Fixed all possible ice trap scenarios

This commit is contained in:
aMannus 2022-07-19 22:29:52 +02:00
parent 27ac523b14
commit 69de5ac14a
5 changed files with 21 additions and 6 deletions

View File

@ -622,6 +622,7 @@ typedef struct Player {
/* 0x0A86 */ s8 unk_A86;
/* 0x0A87 */ u8 unk_A87;
/* 0x0A88 */ Vec3f unk_A88; // previous body part 0 position
/* 0x0A89 */ u8 iceTrapped;
} Player; // size = 0xA94
#endif

View File

@ -2439,6 +2439,14 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act
return RC_DEKU_TREE_COMPASS_ROOM_SIDE_CHEST;
case 22788:
return RC_DEKU_TREE_BASEMENT_CHEST;
case 8200:
return RC_DEKU_TREE_GS_COMPASS_ROOM;
case 8196:
return RC_DEKU_TREE_GS_BASEMENT_VINES;
case 8194:
return RC_DEKU_TREE_GS_BASEMENT_GATE;
case 8193:
return RC_DEKU_TREE_GS_BASEMENT_BACK_ROOM;
}
break;
case 1:

View File

@ -1981,6 +1981,9 @@ s32 GiveItemWithoutActor(GlobalContext* globalCtx, s32 getItemId) {
player->getItemId = getItemId;
player->interactRangeActor = &player->actor;
player->getItemDirection = player->actor.shape.rot.y;
if (player->stateFlags1 & (PLAYER_STATE1_26)) {
player->iceTrapped = 0;
}
return true;
}
}

View File

@ -99,14 +99,14 @@ void func_80AFB768(EnSi* this, GlobalContext* globalCtx) {
this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER;
if (gSaveContext.n64ddFlag) {
if (getItemId == GI_ICE_TRAP) {
GiveItemWithoutActor(globalCtx, getItemId);
player->getItemId = GI_ICE_TRAP;
player->iceTrapped = 1;
textId = 0xF8;
} else {
textId = sGetItemTable[getItemId - 1].textId;
giveItemId = sGetItemTable[getItemId - 1].itemId;
}
}
if (getItemId != GI_ICE_TRAP) {
} else {
Item_Give(globalCtx, giveItemId);
}
if (CVar_GetS32("gSkulltulaFreeze", 0) != 1 || giveItemId != ITEM_SKULL_TOKEN) {
@ -134,14 +134,13 @@ void func_80AFB89C(EnSi* this, GlobalContext* globalCtx) {
if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_13)) {
if (gSaveContext.n64ddFlag) {
if (getItemId == GI_ICE_TRAP) {
GiveItemWithoutActor(globalCtx, getItemId);
GiveItemWithoutActor(globalCtx, GI_ICE_TRAP);
textId = 0xF8;
} else {
textId = sGetItemTable[getItemId - 1].textId;
giveItemId = sGetItemTable[getItemId - 1].itemId;
}
}
if (getItemId != GI_ICE_TRAP) {
} else {
Item_Give(globalCtx, giveItemId);
}
Message_StartTextbox(globalCtx, textId, NULL);

View File

@ -10977,6 +10977,10 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) {
Collider_ResetQuadAC(globalCtx, &this->shieldQuad.base);
Collider_ResetQuadAT(globalCtx, &this->shieldQuad.base);
if (this->iceTrapped != 0) {
GiveItemWithoutActor(globalCtx, GI_ICE_TRAP);
}
}
static Vec3f D_80854838 = { 0.0f, 0.0f, -30.0f };