Decomp import: rename timer-related functions and variables (#5896)

This commit is contained in:
Jordan Longstaff
2026-01-08 13:56:01 -05:00
committed by GitHub
parent feb1429471
commit 9ca5ce0b53
33 changed files with 349 additions and 288 deletions

View File

@@ -932,28 +932,32 @@ return_neg:
s32 Player_GetEnvironmentalHazard(PlayState* play) {
Player* this = GET_PLAYER(play);
TextTriggerEntry* triggerEntry;
s32 var;
s32 envHazard;
if (play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) { // Room is hot
var = 0;
envHazard = PLAYER_ENV_HAZARD_HOTROOM - 1;
} else if ((this->underwaterTimer > 80) &&
((this->currentBoots == PLAYER_BOOTS_IRON) || (this->underwaterTimer >= 300))) { // Deep underwater
var = ((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & 1)) ? 1 : 3;
envHazard = ((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & 1))
? (PLAYER_ENV_HAZARD_UNDERWATER_FLOOR - 1)
: (PLAYER_ENV_HAZARD_UNDERWATER_FREE - 1);
} else if (this->stateFlags1 & PLAYER_STATE1_IN_WATER) { // Swimming
var = 2;
envHazard = PLAYER_ENV_HAZARD_SWIMMING - 1;
} else {
return 0;
return PLAYER_ENV_HAZARD_NONE;
}
// Trigger general textboxes under certain conditions, like "It's so hot in here!"
if (!Player_InCsMode(play)) {
triggerEntry = &sTextTriggers[var];
triggerEntry = &sTextTriggers[envHazard];
if ((triggerEntry->flag != 0) && !(gSaveContext.textTriggerFlags & triggerEntry->flag) &&
(((var == 0) &&
(((envHazard == (PLAYER_ENV_HAZARD_HOTROOM - 1)) &&
(this->currentTunic != PLAYER_TUNIC_GORON && CVarGetInteger(CVAR_CHEAT("SuperTunic"), 0) == 0 &&
CVarGetInteger(CVAR_ENHANCEMENT("DisableTunicWarningText"), 0) == 0)) ||
(((var == 1) || (var == 3)) && (this->currentBoots == PLAYER_BOOTS_IRON) &&
(((envHazard == (PLAYER_ENV_HAZARD_UNDERWATER_FLOOR - 1)) ||
(envHazard == (PLAYER_ENV_HAZARD_UNDERWATER_FREE - 1))) &&
(this->currentBoots == PLAYER_BOOTS_IRON) &&
(this->currentTunic != PLAYER_TUNIC_ZORA && CVarGetInteger(CVAR_CHEAT("SuperTunic"), 0) == 0 &&
CVarGetInteger(CVAR_ENHANCEMENT("DisableTunicWarningText"), 0) == 0)))) {
Message_StartTextbox(play, triggerEntry->textId, NULL);
@@ -961,7 +965,7 @@ s32 Player_GetEnvironmentalHazard(PlayState* play) {
}
}
return var + 1;
return envHazard + 1;
}
u8 sEyeMouthIndexes[][2] = {