Tweak - Rando freestanding/skulltula ice trap behaviour (#2230)

* Improve skulltula ice traps

* Improve freestanding ice traps

* Merge fix
This commit is contained in:
aMannus 2023-01-21 03:30:49 +01:00 committed by GitHub
parent 261db2c3e1
commit 1b9ab52e35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 25 deletions

View File

@ -106,15 +106,25 @@ void func_80AFB768(EnSi* this, PlayState* play) {
} else {
Item_Give(play, giveItemId);
}
if ((CVarGetInteger("gSkulltulaFreeze", 0) != 1 || giveItemId != ITEM_SKULL_TOKEN) && getItemId != RG_ICE_TRAP) {
if ((!CVarGetInteger("gSkulltulaFreeze", 0) || giveItemId != ITEM_SKULL_TOKEN) &&
getItemId != RG_ICE_TRAP) {
player->actor.freezeTimer = 20;
}
if (getItemId == RG_ICE_TRAP && Message_GetState(&play->msgCtx) != TEXT_STATE_CLOSING) {
player->actor.freezeTimer = 10;
}
Message_StartTextbox(play, textId, NULL);
if (gSaveContext.n64ddFlag && getItemId != RG_ICE_TRAP) {
if (gSaveContext.n64ddFlag) {
if (getItemId != RG_ICE_TRAP) {
Randomizer_GiveSkullReward(this, play);
Audio_PlayFanfare_Rando(getItem);
} else {
gSaveContext.pendingIceTrapCount++;
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
}
} else {
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
}
@ -145,9 +155,14 @@ void func_80AFB89C(EnSi* this, PlayState* play) {
Message_StartTextbox(play, textId, NULL);
if (gSaveContext.n64ddFlag && getItemId != RG_ICE_TRAP) {
if (gSaveContext.n64ddFlag) {
if (getItemId != RG_ICE_TRAP) {
Randomizer_GiveSkullReward(this, play);
Audio_PlayFanfare_Rando(getItem);
} else {
gSaveContext.pendingIceTrapCount++;
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
}
} else {
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
}
@ -161,7 +176,7 @@ void func_80AFB950(EnSi* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (Message_GetState(&play->msgCtx) != TEXT_STATE_CLOSING &&
((CVarGetInteger("gSkulltulaFreeze", 0) != 1 || giveItemId != ITEM_SKULL_TOKEN) && getItemId != RG_ICE_TRAP)) {
(!CVarGetInteger("gSkulltulaFreeze", 0) || getItemId == RG_ICE_TRAP || giveItemId != ITEM_SKULL_TOKEN)) {
player->actor.freezeTimer = 10;
} else {
SET_GS_FLAGS((this->actor.params & 0x1F00) >> 8, this->actor.params & 0xFF);
@ -195,7 +210,6 @@ void EnSi_Draw(Actor* thisx, PlayState* play) {
}
GetItemEntry_Draw(play, getItem);
}
}
}
@ -205,7 +219,6 @@ void Randomizer_UpdateSkullReward(EnSi* this, PlayState* play) {
getItem = Randomizer_GetItemFromActor(this->actor.id, play->sceneNum, this->actor.params, GI_SKULL_TOKEN);
getItemId = getItem.getItemId;
if (getItemId == RG_ICE_TRAP) {
gSaveContext.pendingIceTrapCount++;
textId = 0xF8;
} else {
textId = getItem.textId;

View File

@ -6301,22 +6301,14 @@ s32 func_8083E5A8(Player* this, PlayState* play) {
iREG(67) = false;
if (gSaveContext.n64ddFlag && giEntry.getItemId == RG_ICE_TRAP) {
if (giEntry.getItemFrom == ITEM_FROM_FREESTANDING) {
// RANDOTODO: Abstract this to a function.
this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_11);
this->actor.colChkInfo.damage = 0;
func_80837C0C(play, this, 3, 0.0f, 0.0f, 0, 20);
if (gSaveContext.n64ddFlag && giEntry.getItemId == RG_ICE_TRAP && giEntry.getItemFrom == ITEM_FROM_FREESTANDING) {
this->actor.freezeTimer = 30;
Player_SetPendingFlag(this, play);
Message_StartTextbox(play, 0xF8, NULL);
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
this->getItemId = GI_NONE;
this->getItemEntry = (GetItemEntry) GET_ITEM_NONE;
// Gameplay stats: Increment Ice Trap count
gSaveContext.sohStats.count[COUNT_ICE_TRAPS]++;
gSaveContext.pendingIceTrapCount++;
return 1;
}
}
// Show the cutscene for picking up an item. In vanilla, this happens in bombchu bowling alley (because getting bombchus need to show the cutscene)
// and whenever the player doesn't have the item yet. In rando, we're overruling this because we need to keep showing the cutscene