mirror of
https://github.com/zeldaret/oot.git
synced 2025-05-10 19:13:42 +00:00
Document Timers (#1412)
* Document Timers, First Draft * some progress * more timer docs * cleanup * small cleanup * more cleanup * comments * more cleanup * extra comment * more docs * brackets * PR Suggestions * cleanup, missed some * more suggestions * more PR Suggestions * small change * environmental
This commit is contained in:
parent
cc2409606e
commit
40639e698d
32 changed files with 550 additions and 435 deletions
|
@ -996,9 +996,9 @@ void Inventory_ChangeAmmo(s16 item, s16 ammoChange);
|
||||||
void Magic_Fill(PlayState* play);
|
void Magic_Fill(PlayState* play);
|
||||||
void Magic_Reset(PlayState* play);
|
void Magic_Reset(PlayState* play);
|
||||||
s32 Magic_RequestChange(PlayState* play, s16 amount, s16 type);
|
s32 Magic_RequestChange(PlayState* play, s16 amount, s16 type);
|
||||||
void func_80088AA0(s16 arg0);
|
void Interface_SetSubTimer(s16 seconds);
|
||||||
void func_80088AF0(PlayState* play);
|
void Interface_SetSubTimerToFinalSecond(PlayState* play);
|
||||||
void func_80088B34(s16 arg0);
|
void Interface_SetTimer(s16 seconds);
|
||||||
void Interface_Draw(PlayState* play);
|
void Interface_Draw(PlayState* play);
|
||||||
void Interface_Update(PlayState* play);
|
void Interface_Update(PlayState* play);
|
||||||
Path* Path_GetByIndex(PlayState* play, s16 index, s16 max);
|
Path* Path_GetByIndex(PlayState* play, s16 index, s16 max);
|
||||||
|
@ -1040,7 +1040,7 @@ s32 Player_GetBottleHeld(Player* this);
|
||||||
s32 Player_ActionToExplosive(Player* this, s32 itemAction);
|
s32 Player_ActionToExplosive(Player* this, s32 itemAction);
|
||||||
s32 Player_GetExplosiveHeld(Player* this);
|
s32 Player_GetExplosiveHeld(Player* this);
|
||||||
s32 func_8008F2BC(Player* this, s32 itemAction);
|
s32 func_8008F2BC(Player* this, s32 itemAction);
|
||||||
s32 func_8008F2F8(PlayState* play);
|
s32 Player_GetEnvironmentalHazard(PlayState* play);
|
||||||
void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, s32 tunic,
|
void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, s32 tunic,
|
||||||
s32 boots, s32 face, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw,
|
s32 boots, s32 face, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw,
|
||||||
void* data);
|
void* data);
|
||||||
|
|
|
@ -61,6 +61,14 @@ typedef enum {
|
||||||
/* 0x09 */ PLAYER_MASK_MAX
|
/* 0x09 */ PLAYER_MASK_MAX
|
||||||
} PlayerMask;
|
} PlayerMask;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
/* 0x0 */ PLAYER_ENV_HAZARD_NONE,
|
||||||
|
/* 0x1 */ PLAYER_ENV_HAZARD_HOTROOM,
|
||||||
|
/* 0x2 */ PLAYER_ENV_HAZARD_UNDERWATER_FLOOR,
|
||||||
|
/* 0x3 */ PLAYER_ENV_HAZARD_SWIMMING,
|
||||||
|
/* 0x4 */ PLAYER_ENV_HAZARD_UNDERWATER_FREE
|
||||||
|
} PlayerEnvHazard;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
/* 0x00 */ PLAYER_IA_NONE,
|
/* 0x00 */ PLAYER_IA_NONE,
|
||||||
/* 0x01 */ PLAYER_IA_LAST_USED,
|
/* 0x01 */ PLAYER_IA_LAST_USED,
|
||||||
|
@ -571,7 +579,7 @@ typedef struct Player {
|
||||||
/* 0x0838 */ f32 linearVelocity;
|
/* 0x0838 */ f32 linearVelocity;
|
||||||
/* 0x083C */ s16 currentYaw;
|
/* 0x083C */ s16 currentYaw;
|
||||||
/* 0x083E */ s16 targetYaw;
|
/* 0x083E */ s16 targetYaw;
|
||||||
/* 0x0840 */ u16 unk_840;
|
/* 0x0840 */ u16 underwaterTimer;
|
||||||
/* 0x0842 */ s8 meleeWeaponAnimation;
|
/* 0x0842 */ s8 meleeWeaponAnimation;
|
||||||
/* 0x0843 */ s8 meleeWeaponState;
|
/* 0x0843 */ s8 meleeWeaponState;
|
||||||
/* 0x0844 */ s8 unk_844;
|
/* 0x0844 */ s8 unk_844;
|
||||||
|
|
|
@ -99,6 +99,49 @@ typedef struct {
|
||||||
/* 0x24 */ s32 tempCollectFlags;
|
/* 0x24 */ s32 tempCollectFlags;
|
||||||
} FaroresWindData; // size = 0x28
|
} FaroresWindData; // size = 0x28
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
/* 0x0 */ TIMER_STATE_OFF,
|
||||||
|
/* 0x1 */ TIMER_STATE_ENV_HAZARD_INIT, // Init env timer that counts down, total time based on health, resets on void-out, kills at 0
|
||||||
|
/* 0x2 */ TIMER_STATE_ENV_HAZARD_PREVIEW, // Display initial time, keep it fixed at the screen center
|
||||||
|
/* 0x3 */ TIMER_STATE_ENV_HAZARD_MOVE, // Move to top-left corner
|
||||||
|
/* 0x4 */ TIMER_STATE_ENV_HAZARD_TICK, // Counting down
|
||||||
|
/* 0x5 */ TIMER_STATE_DOWN_INIT, // Init timer that counts down
|
||||||
|
/* 0x6 */ TIMER_STATE_DOWN_PREVIEW, // Display initial time, keep it fixed at the screen center
|
||||||
|
/* 0x7 */ TIMER_STATE_DOWN_MOVE, // Move to top-left corner
|
||||||
|
/* 0x8 */ TIMER_STATE_DOWN_TICK, // Counting down
|
||||||
|
/* 0xA */ TIMER_STATE_STOP = 10,
|
||||||
|
/* 0xB */ TIMER_STATE_UP_INIT, // Init timer that counts up
|
||||||
|
/* 0xC */ TIMER_STATE_UP_PREVIEW, // Display initial time, keep it fixed at the screen center
|
||||||
|
/* 0xD */ TIMER_STATE_UP_MOVE, // Move to top-left corner
|
||||||
|
/* 0xE */ TIMER_STATE_UP_TICK, // Counting up
|
||||||
|
/* 0xF */ TIMER_STATE_UP_FREEZE // Stop counting the timer
|
||||||
|
} TimerState;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
/* 0x0 */ SUBTIMER_STATE_OFF,
|
||||||
|
/* 0x1 */ SUBTIMER_STATE_DOWN_INIT, // Init timer that counts down
|
||||||
|
/* 0x2 */ SUBTIMER_STATE_DOWN_PREVIEW, // Display initial time, keep it fixed at the screen center
|
||||||
|
/* 0x3 */ SUBTIMER_STATE_DOWN_MOVE, // Move to top-left corner
|
||||||
|
/* 0x4 */ SUBTIMER_STATE_DOWN_TICK, // Counting down
|
||||||
|
/* 0x5 */ SUBTIMER_STATE_RESPAWN, // Time is up, trigger a transition, reset button items, spoil trade quest items
|
||||||
|
/* 0x6 */ SUBTIMER_STATE_STOP, // Time is up, stop counting
|
||||||
|
/* 0x7 */ SUBTIMER_STATE_UP_INIT, // Init timer that counts up
|
||||||
|
/* 0x8 */ SUBTIMER_STATE_UP_PREVIEW, // Display initial time, keep it fixed at the screen center
|
||||||
|
/* 0x9 */ SUBTIMER_STATE_UP_MOVE, // Move to top-left corner
|
||||||
|
/* 0xA */ SUBTIMER_STATE_UP_TICK // Counting up
|
||||||
|
} SubTimerState;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
/* 0 */ TIMER_ID_MAIN, // Takes priority in both counting and drawing. See `timerState` and `timerSeconds`
|
||||||
|
/* 1 */ TIMER_ID_SUB, // See `subTimerState` and `subTimerSeconds`
|
||||||
|
/* 2 */ TIMER_ID_MAX
|
||||||
|
} TimerId;
|
||||||
|
|
||||||
|
#define MARATHON_TIME_LIMIT 240 // 4 minutes
|
||||||
|
|
||||||
|
#define ENV_HAZARD_TEXT_TRIGGER_HOTROOM (1 << 0)
|
||||||
|
#define ENV_HAZARD_TEXT_TRIGGER_UNDERWATER (1 << 1)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0x0000 */ s32 entranceIndex; // start of `save` substruct, originally called "memory"
|
/* 0x0000 */ s32 entranceIndex; // start of `save` substruct, originally called "memory"
|
||||||
/* 0x0004 */ s32 linkAge; // 0: Adult; 1: Child (see enum `LinkAge`)
|
/* 0x0004 */ s32 linkAge; // 0: Adult; 1: Child (see enum `LinkAge`)
|
||||||
|
@ -162,17 +205,17 @@ typedef struct {
|
||||||
/* 0x13C2 */ char unk_13C2[0x0001];
|
/* 0x13C2 */ char unk_13C2[0x0001];
|
||||||
/* 0x13C3 */ u8 retainWeatherMode;
|
/* 0x13C3 */ u8 retainWeatherMode;
|
||||||
/* 0x13C4 */ s16 dogParams;
|
/* 0x13C4 */ s16 dogParams;
|
||||||
/* 0x13C6 */ u8 textTriggerFlags;
|
/* 0x13C6 */ u8 envHazardTextTriggerFlags;
|
||||||
/* 0x13C7 */ u8 showTitleCard;
|
/* 0x13C7 */ u8 showTitleCard;
|
||||||
/* 0x13C8 */ s16 nayrusLoveTimer;
|
/* 0x13C8 */ s16 nayrusLoveTimer;
|
||||||
/* 0x13CA */ char unk_13CA[0x0002];
|
/* 0x13CA */ char unk_13CA[0x0002];
|
||||||
/* 0x13CC */ s16 rupeeAccumulator;
|
/* 0x13CC */ s16 rupeeAccumulator;
|
||||||
/* 0x13CE */ s16 timer1State;
|
/* 0x13CE */ s16 timerState; // See `TimerState`
|
||||||
/* 0x13D0 */ s16 timer1Value;
|
/* 0x13D0 */ s16 timerSeconds;
|
||||||
/* 0x13D2 */ s16 timer2State;
|
/* 0x13D2 */ s16 subTimerState; // See `SubTimerState`
|
||||||
/* 0x13D4 */ s16 timer2Value;
|
/* 0x13D4 */ s16 subTimerSeconds;
|
||||||
/* 0x13D6 */ s16 timerX[2];
|
/* 0x13D6 */ s16 timerX[TIMER_ID_MAX];
|
||||||
/* 0x13DA */ s16 timerY[2];
|
/* 0x13DA */ s16 timerY[TIMER_ID_MAX];
|
||||||
/* 0x13DE */ char unk_13DE[0x0002];
|
/* 0x13DE */ char unk_13DE[0x0002];
|
||||||
/* 0x13E0 */ u8 seqId;
|
/* 0x13E0 */ u8 seqId;
|
||||||
/* 0x13E1 */ u8 natureAmbienceId;
|
/* 0x13E1 */ u8 natureAmbienceId;
|
||||||
|
@ -748,7 +791,8 @@ typedef enum {
|
||||||
(gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & ~EVENTINF_HORSES_0F_MASK) | ((v) << EVENTINF_HORSES_0F_SHIFT)
|
(gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & ~EVENTINF_HORSES_0F_MASK) | ((v) << EVENTINF_HORSES_0F_SHIFT)
|
||||||
|
|
||||||
|
|
||||||
#define EVENTINF_10 0x10
|
// Is the running man race active
|
||||||
|
#define EVENTINF_MARATHON_ACTIVE 0x10
|
||||||
|
|
||||||
// 0x20-0x24
|
// 0x20-0x24
|
||||||
#define EVENTINF_20_21_22_23_24_INDEX 2
|
#define EVENTINF_20_21_22_23_24_INDEX 2
|
||||||
|
|
|
@ -8,7 +8,7 @@ void Interface_Init(PlayState* play) {
|
||||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||||
u32 parameterSize;
|
u32 parameterSize;
|
||||||
u16 doActionOffset;
|
u16 doActionOffset;
|
||||||
u8 temp;
|
u8 timerId;
|
||||||
|
|
||||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||||
gSaveContext.unk_13E8 = gSaveContext.unk_13EA = 0;
|
gSaveContext.unk_13E8 = gSaveContext.unk_13EA = 0;
|
||||||
|
@ -109,39 +109,42 @@ void Interface_Init(PlayState* play) {
|
||||||
0x1000, "../z_construct.c", 219);
|
0x1000, "../z_construct.c", 219);
|
||||||
}
|
}
|
||||||
|
|
||||||
osSyncPrintf("EVENT=%d\n", ((void)0, gSaveContext.timer1State));
|
osSyncPrintf("EVENT=%d\n", ((void)0, gSaveContext.timerState));
|
||||||
|
|
||||||
if ((gSaveContext.timer1State == 4) || (gSaveContext.timer1State == 8) || (gSaveContext.timer2State == 4) ||
|
if ((gSaveContext.timerState == TIMER_STATE_ENV_HAZARD_TICK) ||
|
||||||
(gSaveContext.timer2State == 10)) {
|
(gSaveContext.timerState == TIMER_STATE_DOWN_TICK) ||
|
||||||
|
(gSaveContext.subTimerState == SUBTIMER_STATE_DOWN_TICK) ||
|
||||||
|
(gSaveContext.subTimerState == SUBTIMER_STATE_UP_TICK)) {
|
||||||
osSyncPrintf("restart_flag=%d\n", ((void)0, gSaveContext.respawnFlag));
|
osSyncPrintf("restart_flag=%d\n", ((void)0, gSaveContext.respawnFlag));
|
||||||
|
|
||||||
if ((gSaveContext.respawnFlag == -1) || (gSaveContext.respawnFlag == 1)) {
|
if ((gSaveContext.respawnFlag == -1) || (gSaveContext.respawnFlag == 1)) {
|
||||||
if (gSaveContext.timer1State == 4) {
|
if (gSaveContext.timerState == TIMER_STATE_ENV_HAZARD_TICK) {
|
||||||
gSaveContext.timer1State = 1;
|
gSaveContext.timerState = TIMER_STATE_ENV_HAZARD_INIT;
|
||||||
gSaveContext.timerX[0] = 140;
|
gSaveContext.timerX[TIMER_ID_MAIN] = 140;
|
||||||
gSaveContext.timerY[0] = 80;
|
gSaveContext.timerY[TIMER_ID_MAIN] = 80;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gSaveContext.timer1State == 4) || (gSaveContext.timer1State == 8)) {
|
if ((gSaveContext.timerState == TIMER_STATE_ENV_HAZARD_TICK) ||
|
||||||
temp = 0;
|
(gSaveContext.timerState == TIMER_STATE_DOWN_TICK)) {
|
||||||
|
timerId = TIMER_ID_MAIN;
|
||||||
} else {
|
} else {
|
||||||
temp = 1;
|
timerId = TIMER_ID_SUB;
|
||||||
}
|
}
|
||||||
|
|
||||||
gSaveContext.timerX[temp] = 26;
|
gSaveContext.timerX[timerId] = 26;
|
||||||
|
|
||||||
if (gSaveContext.healthCapacity > 0xA0) {
|
if (gSaveContext.healthCapacity > 0xA0) {
|
||||||
gSaveContext.timerY[temp] = 54;
|
gSaveContext.timerY[timerId] = 54; // two rows of hearts
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timerY[temp] = 46;
|
gSaveContext.timerY[timerId] = 46; // one row of hearts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gSaveContext.timer1State >= 11) && (gSaveContext.timer1State < 16)) {
|
if ((gSaveContext.timerState >= TIMER_STATE_UP_INIT) && (gSaveContext.timerState <= TIMER_STATE_UP_FREEZE)) {
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
// "Timer Stop!!!!!!!!!!!!!!!!!!!!!!"
|
// "Timer Stop!!!!!!!!!!!!!!!!!!!!!!"
|
||||||
osSyncPrintf("タイマー停止!!!!!!!!!!!!!!!!!!!!! = %d\n", gSaveContext.timer1State);
|
osSyncPrintf("タイマー停止!!!!!!!!!!!!!!!!!!!!! = %d\n", gSaveContext.timerState);
|
||||||
}
|
}
|
||||||
|
|
||||||
osSyncPrintf("PARAMETER領域=%x\n", parameterSize + 0x5300); // "Parameter Area = %x"
|
osSyncPrintf("PARAMETER領域=%x\n", parameterSize + 0x5300); // "Parameter Area = %x"
|
||||||
|
|
|
@ -28,9 +28,9 @@ void GameOver_Update(PlayState* play) {
|
||||||
case GAMEOVER_DEATH_START:
|
case GAMEOVER_DEATH_START:
|
||||||
Message_CloseTextbox(play);
|
Message_CloseTextbox(play);
|
||||||
|
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
gSaveContext.timer2State = 0;
|
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
|
||||||
CLEAR_EVENTINF(EVENTINF_10);
|
CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE);
|
||||||
|
|
||||||
// search inventory for spoiling items and revert if necessary
|
// search inventory for spoiling items and revert if necessary
|
||||||
for (i = 0; i < ARRAY_COUNT(gSpoilingItems); i++) {
|
for (i = 0; i < ARRAY_COUNT(gSpoilingItems); i++) {
|
||||||
|
|
|
@ -1283,9 +1283,9 @@ void Message_Decode(PlayState* play) {
|
||||||
osSyncPrintf("\nEVENTタイマー = ");
|
osSyncPrintf("\nEVENTタイマー = ");
|
||||||
digits[0] = digits[1] = digits[2] = 0;
|
digits[0] = digits[1] = digits[2] = 0;
|
||||||
if (curChar == MESSAGE_RACE_TIME) {
|
if (curChar == MESSAGE_RACE_TIME) {
|
||||||
digits[3] = gSaveContext.timer1Value;
|
digits[3] = gSaveContext.timerSeconds;
|
||||||
} else {
|
} else {
|
||||||
digits[3] = gSaveContext.timer2Value;
|
digits[3] = gSaveContext.subTimerSeconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (digits[3] >= 60) {
|
while (digits[3] >= 60) {
|
||||||
|
|
|
@ -154,8 +154,8 @@ static s16 sExtraItemBases[] = {
|
||||||
ITEM_DEKU_NUT, // ITEM_DEKU_NUT_UPGRADE_40
|
ITEM_DEKU_NUT, // ITEM_DEKU_NUT_UPGRADE_40
|
||||||
};
|
};
|
||||||
|
|
||||||
static s16 D_80125A58 = 0;
|
static s16 sEnvHazard = PLAYER_ENV_HAZARD_NONE;
|
||||||
static s16 D_80125A5C = false;
|
static s16 sEnvHazardActive = false;
|
||||||
|
|
||||||
static Gfx sSetupDL_80125A60[] = {
|
static Gfx sSetupDL_80125A60[] = {
|
||||||
gsDPPipeSync(),
|
gsDPPipeSync(),
|
||||||
|
@ -722,7 +722,8 @@ void func_80083108(PlayState* play) {
|
||||||
Interface_ChangeAlpha(50);
|
Interface_ChangeAlpha(50);
|
||||||
}
|
}
|
||||||
} else if (msgCtx->msgMode == MSGMODE_NONE) {
|
} else if (msgCtx->msgMode == MSGMODE_NONE) {
|
||||||
if ((func_8008F2F8(play) >= 2) && (func_8008F2F8(play) < 5)) {
|
if ((Player_GetEnvironmentalHazard(play) >= PLAYER_ENV_HAZARD_UNDERWATER_FLOOR) &&
|
||||||
|
(Player_GetEnvironmentalHazard(play) <= PLAYER_ENV_HAZARD_UNDERWATER_FREE)) {
|
||||||
if (gSaveContext.buttonStatus[0] != BTN_DISABLED) {
|
if (gSaveContext.buttonStatus[0] != BTN_DISABLED) {
|
||||||
sp28 = true;
|
sp28 = true;
|
||||||
}
|
}
|
||||||
|
@ -730,7 +731,7 @@ void func_80083108(PlayState* play) {
|
||||||
gSaveContext.buttonStatus[0] = BTN_DISABLED;
|
gSaveContext.buttonStatus[0] = BTN_DISABLED;
|
||||||
|
|
||||||
for (i = 1; i < 4; i++) {
|
for (i = 1; i < 4; i++) {
|
||||||
if (func_8008F2F8(play) == 2) {
|
if (Player_GetEnvironmentalHazard(play) == PLAYER_ENV_HAZARD_UNDERWATER_FLOOR) {
|
||||||
if ((gSaveContext.equips.buttonItems[i] != ITEM_HOOKSHOT) &&
|
if ((gSaveContext.equips.buttonItems[i] != ITEM_HOOKSHOT) &&
|
||||||
(gSaveContext.equips.buttonItems[i] != ITEM_LONGSHOT)) {
|
(gSaveContext.equips.buttonItems[i] != ITEM_LONGSHOT)) {
|
||||||
if (gSaveContext.buttonStatus[i] == BTN_ENABLED) {
|
if (gSaveContext.buttonStatus[i] == BTN_ENABLED) {
|
||||||
|
@ -2523,7 +2524,9 @@ void Magic_Update(PlayState* play) {
|
||||||
if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0) && (msgCtx->msgMode == MSGMODE_NONE) &&
|
if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0) && (msgCtx->msgMode == MSGMODE_NONE) &&
|
||||||
(play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
|
(play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
|
||||||
(play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play)) {
|
(play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play)) {
|
||||||
if ((gSaveContext.magic == 0) || ((func_8008F2F8(play) >= 2) && (func_8008F2F8(play) < 5)) ||
|
if ((gSaveContext.magic == 0) ||
|
||||||
|
((Player_GetEnvironmentalHazard(play) >= PLAYER_ENV_HAZARD_UNDERWATER_FLOOR) &&
|
||||||
|
(Player_GetEnvironmentalHazard(play) <= PLAYER_ENV_HAZARD_UNDERWATER_FREE)) ||
|
||||||
((gSaveContext.equips.buttonItems[1] != ITEM_LENS_OF_TRUTH) &&
|
((gSaveContext.equips.buttonItems[1] != ITEM_LENS_OF_TRUTH) &&
|
||||||
(gSaveContext.equips.buttonItems[2] != ITEM_LENS_OF_TRUTH) &&
|
(gSaveContext.equips.buttonItems[2] != ITEM_LENS_OF_TRUTH) &&
|
||||||
(gSaveContext.equips.buttonItems[3] != ITEM_LENS_OF_TRUTH)) ||
|
(gSaveContext.equips.buttonItems[3] != ITEM_LENS_OF_TRUTH)) ||
|
||||||
|
@ -2672,39 +2675,47 @@ void Magic_DrawMeter(PlayState* play) {
|
||||||
CLOSE_DISPS(play->state.gfxCtx, "../z_parameter.c", 2731);
|
CLOSE_DISPS(play->state.gfxCtx, "../z_parameter.c", 2731);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80088AA0(s16 arg0) {
|
void Interface_SetSubTimer(s16 seconds) {
|
||||||
gSaveContext.timerX[1] = 140;
|
gSaveContext.timerX[TIMER_ID_SUB] = 140;
|
||||||
gSaveContext.timerY[1] = 80;
|
gSaveContext.timerY[TIMER_ID_SUB] = 80;
|
||||||
D_80125A5C = false;
|
sEnvHazardActive = false;
|
||||||
gSaveContext.timer2Value = arg0;
|
gSaveContext.subTimerSeconds = seconds;
|
||||||
|
|
||||||
if (arg0 != 0) {
|
if (seconds != 0) {
|
||||||
gSaveContext.timer2State = 1;
|
// count down
|
||||||
|
gSaveContext.subTimerState = SUBTIMER_STATE_DOWN_INIT;
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timer2State = 7;
|
// count up
|
||||||
|
gSaveContext.subTimerState = SUBTIMER_STATE_UP_INIT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80088AF0(PlayState* play) {
|
/**
|
||||||
if (gSaveContext.timer2State != 0) {
|
* Set the subTimer to 1 second left
|
||||||
if (GET_EVENTINF(EVENTINF_10)) {
|
*/
|
||||||
gSaveContext.timer2Value = 239;
|
void Interface_SetSubTimerToFinalSecond(PlayState* play) {
|
||||||
|
if (gSaveContext.subTimerState != SUBTIMER_STATE_OFF) {
|
||||||
|
if (GET_EVENTINF(EVENTINF_MARATHON_ACTIVE)) {
|
||||||
|
// The running-man race counts up and finished at MARATHON_TIME_LIMIT
|
||||||
|
gSaveContext.subTimerSeconds = MARATHON_TIME_LIMIT - 1;
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timer2Value = 1;
|
gSaveContext.subTimerSeconds = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80088B34(s16 arg0) {
|
void Interface_SetTimer(s16 seconds) {
|
||||||
gSaveContext.timerX[0] = 140;
|
gSaveContext.timerX[TIMER_ID_MAIN] = 140;
|
||||||
gSaveContext.timerY[0] = 80;
|
gSaveContext.timerY[TIMER_ID_MAIN] = 80;
|
||||||
D_80125A5C = false;
|
sEnvHazardActive = false;
|
||||||
gSaveContext.timer1Value = arg0;
|
gSaveContext.timerSeconds = seconds;
|
||||||
|
|
||||||
if (arg0 != 0) {
|
if (seconds != 0) {
|
||||||
gSaveContext.timer1State = 5;
|
// count down
|
||||||
|
gSaveContext.timerState = TIMER_STATE_DOWN_INIT;
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timer1State = 11;
|
// count up
|
||||||
|
gSaveContext.timerState = TIMER_STATE_UP_INIT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2802,7 +2813,8 @@ void Interface_DrawItemButtons(PlayState* play) {
|
||||||
|
|
||||||
if ((gSaveContext.unk_13EA == 1) || (gSaveContext.unk_13EA == 2) || (gSaveContext.unk_13EA == 5)) {
|
if ((gSaveContext.unk_13EA == 1) || (gSaveContext.unk_13EA == 2) || (gSaveContext.unk_13EA == 5)) {
|
||||||
temp = 0;
|
temp = 0;
|
||||||
} else if ((player->stateFlags1 & PLAYER_STATE1_21) || (func_8008F2F8(play) == 4) ||
|
} else if ((player->stateFlags1 & PLAYER_STATE1_21) ||
|
||||||
|
(Player_GetEnvironmentalHazard(play) == PLAYER_ENV_HAZARD_UNDERWATER_FREE) ||
|
||||||
(player->stateFlags2 & PLAYER_STATE2_CRAWLING)) {
|
(player->stateFlags2 & PLAYER_STATE2_CRAWLING)) {
|
||||||
temp = 70;
|
temp = 70;
|
||||||
} else {
|
} else {
|
||||||
|
@ -3062,7 +3074,7 @@ void Interface_Draw(PlayState* play) {
|
||||||
static s16 magicArrowEffectsG[] = { 0, 100, 255 };
|
static s16 magicArrowEffectsG[] = { 0, 100, 255 };
|
||||||
static s16 magicArrowEffectsB[] = { 0, 255, 100 };
|
static s16 magicArrowEffectsB[] = { 0, 255, 100 };
|
||||||
static s16 timerDigitLeftPos[] = { 16, 25, 34, 42, 51 };
|
static s16 timerDigitLeftPos[] = { 16, 25, 34, 42, 51 };
|
||||||
static s16 digitWidth[] = { 9, 9, 8, 9, 9 };
|
static s16 sDigitWidths[] = { 9, 9, 8, 9, 9 };
|
||||||
// unused, most likely colors
|
// unused, most likely colors
|
||||||
static s16 D_80125B1C[][3] = {
|
static s16 D_80125B1C[][3] = {
|
||||||
{ 0, 150, 0 }, { 100, 255, 0 }, { 255, 255, 255 }, { 0, 0, 0 }, { 255, 255, 255 },
|
{ 0, 150, 0 }, { 100, 255, 0 }, { 255, 255, 255 }, { 0, 0, 0 }, { 255, 255, 255 },
|
||||||
|
@ -3072,11 +3084,11 @@ void Interface_Draw(PlayState* play) {
|
||||||
static s16 spoilingItemEntrances[] = { ENTR_SPOT10_2, ENTR_SPOT07_3, ENTR_SPOT07_3 };
|
static s16 spoilingItemEntrances[] = { ENTR_SPOT10_2, ENTR_SPOT07_3, ENTR_SPOT07_3 };
|
||||||
static f32 D_80125B54[] = { -40.0f, -35.0f }; // unused
|
static f32 D_80125B54[] = { -40.0f, -35.0f }; // unused
|
||||||
static s16 D_80125B5C[] = { 91, 91 }; // unused
|
static s16 D_80125B5C[] = { 91, 91 }; // unused
|
||||||
static s16 D_8015FFE0;
|
static s16 sTimerNextSecondTimer;
|
||||||
static s16 D_8015FFE2;
|
static s16 sTimerStateTimer;
|
||||||
static s16 D_8015FFE4;
|
static s16 sSubTimerNextSecondTimer;
|
||||||
static s16 D_8015FFE6;
|
static s16 sSubTimerStateTimer;
|
||||||
static s16 timerDigits[5];
|
static s16 sTimerDigits[5];
|
||||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||||
PauseContext* pauseCtx = &play->pauseCtx;
|
PauseContext* pauseCtx = &play->pauseCtx;
|
||||||
MessageContext* msgCtx = &play->msgCtx;
|
MessageContext* msgCtx = &play->msgCtx;
|
||||||
|
@ -3086,7 +3098,7 @@ void Interface_Draw(PlayState* play) {
|
||||||
s16 svar3;
|
s16 svar3;
|
||||||
s16 svar4;
|
s16 svar4;
|
||||||
s16 svar5;
|
s16 svar5;
|
||||||
s16 svar6;
|
s16 timerId;
|
||||||
|
|
||||||
OPEN_DISPS(play->state.gfxCtx, "../z_parameter.c", 3405);
|
OPEN_DISPS(play->state.gfxCtx, "../z_parameter.c", 3405);
|
||||||
|
|
||||||
|
@ -3417,7 +3429,7 @@ void Interface_Draw(PlayState* play) {
|
||||||
if (sHBAScoreDigits[svar1] != 0 || (svar2 != 0) || (svar1 >= 3)) {
|
if (sHBAScoreDigits[svar1] != 0 || (svar2 != 0) || (svar1 >= 3)) {
|
||||||
OVERLAY_DISP = Gfx_TextureI8(
|
OVERLAY_DISP = Gfx_TextureI8(
|
||||||
OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * sHBAScoreDigits[svar1])), 8, 16, svar5,
|
OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * sHBAScoreDigits[svar1])), 8, 16, svar5,
|
||||||
(ZREG(15) - 2), digitWidth[0], VREG(42), VREG(43) << 1, VREG(43) << 1);
|
(ZREG(15) - 2), sDigitWidths[0], VREG(42), VREG(43) << 1, VREG(43) << 1);
|
||||||
svar5 += 9;
|
svar5 += 9;
|
||||||
svar2++;
|
svar2++;
|
||||||
}
|
}
|
||||||
|
@ -3428,13 +3440,14 @@ void Interface_Draw(PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gSaveContext.timer2State == 5) && (Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT)) {
|
if ((gSaveContext.subTimerState == SUBTIMER_STATE_RESPAWN) &&
|
||||||
|
(Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT)) {
|
||||||
// Trade quest timer reached 0
|
// Trade quest timer reached 0
|
||||||
D_8015FFE6 = 40;
|
sSubTimerStateTimer = 40;
|
||||||
gSaveContext.cutsceneIndex = 0;
|
gSaveContext.cutsceneIndex = 0;
|
||||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||||
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
||||||
gSaveContext.timer2State = 0;
|
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
|
||||||
|
|
||||||
if ((gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) &&
|
if ((gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) &&
|
||||||
(gSaveContext.equips.buttonItems[0] != ITEM_SWORD_MASTER) &&
|
(gSaveContext.equips.buttonItems[0] != ITEM_SWORD_MASTER) &&
|
||||||
|
@ -3472,112 +3485,123 @@ void Interface_Draw(PlayState* play) {
|
||||||
!(player->stateFlags2 & PLAYER_STATE2_24) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
|
!(player->stateFlags2 & PLAYER_STATE2_24) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
|
||||||
(play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play) && (gSaveContext.minigameState != 1) &&
|
(play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play) && (gSaveContext.minigameState != 1) &&
|
||||||
(play->shootingGalleryStatus <= 1) && !((play->sceneId == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38))) {
|
(play->shootingGalleryStatus <= 1) && !((play->sceneId == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38))) {
|
||||||
svar6 = 0;
|
|
||||||
switch (gSaveContext.timer1State) {
|
timerId = TIMER_ID_MAIN;
|
||||||
case 1:
|
|
||||||
D_8015FFE2 = 20;
|
switch (gSaveContext.timerState) {
|
||||||
D_8015FFE0 = 20;
|
case TIMER_STATE_ENV_HAZARD_INIT:
|
||||||
gSaveContext.timer1Value = gSaveContext.health >> 1;
|
sTimerStateTimer = 20;
|
||||||
gSaveContext.timer1State = 2;
|
sTimerNextSecondTimer = 20;
|
||||||
|
gSaveContext.timerSeconds = gSaveContext.health >> 1;
|
||||||
|
gSaveContext.timerState = TIMER_STATE_ENV_HAZARD_PREVIEW;
|
||||||
break;
|
break;
|
||||||
case 2:
|
|
||||||
D_8015FFE2--;
|
case TIMER_STATE_ENV_HAZARD_PREVIEW:
|
||||||
if (D_8015FFE2 == 0) {
|
sTimerStateTimer--;
|
||||||
D_8015FFE2 = 20;
|
if (sTimerStateTimer == 0) {
|
||||||
gSaveContext.timer1State = 3;
|
sTimerStateTimer = 20;
|
||||||
|
gSaveContext.timerState = TIMER_STATE_ENV_HAZARD_MOVE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5:
|
|
||||||
case 11:
|
case TIMER_STATE_DOWN_INIT:
|
||||||
D_8015FFE2 = 20;
|
case TIMER_STATE_UP_INIT:
|
||||||
D_8015FFE0 = 20;
|
sTimerStateTimer = 20;
|
||||||
if (gSaveContext.timer1State == 5) {
|
sTimerNextSecondTimer = 20;
|
||||||
gSaveContext.timer1State = 6;
|
if (gSaveContext.timerState == TIMER_STATE_DOWN_INIT) {
|
||||||
|
gSaveContext.timerState = TIMER_STATE_DOWN_PREVIEW;
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timer1State = 12;
|
gSaveContext.timerState = TIMER_STATE_UP_PREVIEW;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
|
||||||
case 12:
|
case TIMER_STATE_DOWN_PREVIEW:
|
||||||
D_8015FFE2--;
|
case TIMER_STATE_UP_PREVIEW:
|
||||||
if (D_8015FFE2 == 0) {
|
sTimerStateTimer--;
|
||||||
D_8015FFE2 = 20;
|
if (sTimerStateTimer == 0) {
|
||||||
if (gSaveContext.timer1State == 6) {
|
sTimerStateTimer = 20;
|
||||||
gSaveContext.timer1State = 7;
|
if (gSaveContext.timerState == TIMER_STATE_DOWN_PREVIEW) {
|
||||||
|
gSaveContext.timerState = TIMER_STATE_DOWN_MOVE;
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timer1State = 13;
|
gSaveContext.timerState = TIMER_STATE_UP_MOVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
|
||||||
case 7:
|
case TIMER_STATE_ENV_HAZARD_MOVE:
|
||||||
svar1 = (gSaveContext.timerX[0] - 26) / D_8015FFE2;
|
case TIMER_STATE_DOWN_MOVE:
|
||||||
gSaveContext.timerX[0] -= svar1;
|
svar1 = (gSaveContext.timerX[TIMER_ID_MAIN] - 26) / sTimerStateTimer;
|
||||||
|
gSaveContext.timerX[TIMER_ID_MAIN] -= svar1;
|
||||||
|
|
||||||
if (gSaveContext.healthCapacity > 0xA0) {
|
if (gSaveContext.healthCapacity > 0xA0) {
|
||||||
svar1 = (gSaveContext.timerY[0] - 54) / D_8015FFE2;
|
svar1 = (gSaveContext.timerY[TIMER_ID_MAIN] - 54) / sTimerStateTimer; // two rows of hearts
|
||||||
} else {
|
} else {
|
||||||
svar1 = (gSaveContext.timerY[0] - 46) / D_8015FFE2;
|
svar1 = (gSaveContext.timerY[TIMER_ID_MAIN] - 46) / sTimerStateTimer; // one row of hearts
|
||||||
}
|
}
|
||||||
gSaveContext.timerY[0] -= svar1;
|
gSaveContext.timerY[TIMER_ID_MAIN] -= svar1;
|
||||||
|
|
||||||
D_8015FFE2--;
|
sTimerStateTimer--;
|
||||||
if (D_8015FFE2 == 0) {
|
if (sTimerStateTimer == 0) {
|
||||||
D_8015FFE2 = 20;
|
sTimerStateTimer = 20;
|
||||||
gSaveContext.timerX[0] = 26;
|
gSaveContext.timerX[TIMER_ID_MAIN] = 26;
|
||||||
|
|
||||||
if (gSaveContext.healthCapacity > 0xA0) {
|
if (gSaveContext.healthCapacity > 0xA0) {
|
||||||
gSaveContext.timerY[0] = 54;
|
gSaveContext.timerY[TIMER_ID_MAIN] = 54; // two rows of hearts
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timerY[0] = 46;
|
gSaveContext.timerY[TIMER_ID_MAIN] = 46; // one row of hearts
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gSaveContext.timer1State == 3) {
|
if (gSaveContext.timerState == TIMER_STATE_ENV_HAZARD_MOVE) {
|
||||||
gSaveContext.timer1State = 4;
|
gSaveContext.timerState = TIMER_STATE_ENV_HAZARD_TICK;
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timer1State = 8;
|
gSaveContext.timerState = TIMER_STATE_DOWN_TICK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FALLTHROUGH;
|
FALLTHROUGH;
|
||||||
case 4:
|
case TIMER_STATE_ENV_HAZARD_TICK:
|
||||||
case 8:
|
case TIMER_STATE_DOWN_TICK:
|
||||||
if ((gSaveContext.timer1State == 4) || (gSaveContext.timer1State == 8)) {
|
if ((gSaveContext.timerState == TIMER_STATE_ENV_HAZARD_TICK) ||
|
||||||
|
(gSaveContext.timerState == TIMER_STATE_DOWN_TICK)) {
|
||||||
if (gSaveContext.healthCapacity > 0xA0) {
|
if (gSaveContext.healthCapacity > 0xA0) {
|
||||||
gSaveContext.timerY[0] = 54;
|
gSaveContext.timerY[TIMER_ID_MAIN] = 54; // two rows of hearts
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timerY[0] = 46;
|
gSaveContext.timerY[TIMER_ID_MAIN] = 46; // one row of hearts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gSaveContext.timer1State >= 3) && (msgCtx->msgLength == 0)) {
|
if ((gSaveContext.timerState >= TIMER_STATE_ENV_HAZARD_MOVE) && (msgCtx->msgLength == 0)) {
|
||||||
D_8015FFE0--;
|
sTimerNextSecondTimer--;
|
||||||
if (D_8015FFE0 == 0) {
|
if (sTimerNextSecondTimer == 0) {
|
||||||
if (gSaveContext.timer1Value != 0) {
|
if (gSaveContext.timerSeconds != 0) {
|
||||||
gSaveContext.timer1Value--;
|
gSaveContext.timerSeconds--;
|
||||||
}
|
}
|
||||||
|
|
||||||
D_8015FFE0 = 20;
|
sTimerNextSecondTimer = 20;
|
||||||
|
|
||||||
if (gSaveContext.timer1Value == 0) {
|
if (gSaveContext.timerSeconds == 0) {
|
||||||
gSaveContext.timer1State = 10;
|
// Out of time
|
||||||
if (D_80125A5C) {
|
gSaveContext.timerState = TIMER_STATE_STOP;
|
||||||
|
if (sEnvHazardActive) {
|
||||||
gSaveContext.health = 0;
|
gSaveContext.health = 0;
|
||||||
play->damagePlayer(play, -(gSaveContext.health + 2));
|
play->damagePlayer(play, -(gSaveContext.health + 2));
|
||||||
}
|
}
|
||||||
D_80125A5C = false;
|
sEnvHazardActive = false;
|
||||||
} else if (gSaveContext.timer1Value > 60) {
|
} else if (gSaveContext.timerSeconds > 60) {
|
||||||
if (timerDigits[4] == 1) {
|
// Beep at "xx:x1" (every 10 seconds)
|
||||||
|
if (sTimerDigits[4] == 1) {
|
||||||
Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_WOMAN, &gSfxDefaultPos, 4,
|
Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_WOMAN, &gSfxDefaultPos, 4,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultReverb);
|
&gSfxDefaultReverb);
|
||||||
}
|
}
|
||||||
} else if (gSaveContext.timer1Value >= 11) {
|
} else if (gSaveContext.timerSeconds > 10) {
|
||||||
if (timerDigits[4] & 1) {
|
// Beep on alternating seconds
|
||||||
|
if ((sTimerDigits[4] % 2) != 0) {
|
||||||
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4,
|
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultReverb);
|
&gSfxDefaultReverb);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// Beep every second
|
||||||
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_E, &gSfxDefaultPos, 4,
|
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_E, &gSfxDefaultPos, 4,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultReverb);
|
&gSfxDefaultReverb);
|
||||||
|
@ -3585,48 +3609,49 @@ void Interface_Draw(PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 13:
|
|
||||||
svar1 = (gSaveContext.timerX[0] - 26) / D_8015FFE2;
|
case TIMER_STATE_UP_MOVE:
|
||||||
gSaveContext.timerX[0] -= svar1;
|
svar1 = (gSaveContext.timerX[TIMER_ID_MAIN] - 26) / sTimerStateTimer;
|
||||||
|
gSaveContext.timerX[TIMER_ID_MAIN] -= svar1;
|
||||||
|
|
||||||
if (gSaveContext.healthCapacity > 0xA0) {
|
if (gSaveContext.healthCapacity > 0xA0) {
|
||||||
svar1 = (gSaveContext.timerY[0] - 54) / D_8015FFE2;
|
svar1 = (gSaveContext.timerY[TIMER_ID_MAIN] - 54) / sTimerStateTimer; // two rows of hearts
|
||||||
} else {
|
} else {
|
||||||
svar1 = (gSaveContext.timerY[0] - 46) / D_8015FFE2;
|
svar1 = (gSaveContext.timerY[TIMER_ID_MAIN] - 46) / sTimerStateTimer; // one row of hearts
|
||||||
}
|
}
|
||||||
gSaveContext.timerY[0] -= svar1;
|
gSaveContext.timerY[TIMER_ID_MAIN] -= svar1;
|
||||||
|
|
||||||
D_8015FFE2--;
|
sTimerStateTimer--;
|
||||||
if (D_8015FFE2 == 0) {
|
if (sTimerStateTimer == 0) {
|
||||||
D_8015FFE2 = 20;
|
sTimerStateTimer = 20;
|
||||||
gSaveContext.timerX[0] = 26;
|
gSaveContext.timerX[TIMER_ID_MAIN] = 26;
|
||||||
if (gSaveContext.healthCapacity > 0xA0) {
|
if (gSaveContext.healthCapacity > 0xA0) {
|
||||||
gSaveContext.timerY[0] = 54;
|
gSaveContext.timerY[TIMER_ID_MAIN] = 54; // two rows of hearts
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timerY[0] = 46;
|
gSaveContext.timerY[TIMER_ID_MAIN] = 46; // one row of hearts
|
||||||
}
|
}
|
||||||
|
|
||||||
gSaveContext.timer1State = 14;
|
gSaveContext.timerState = TIMER_STATE_UP_TICK;
|
||||||
}
|
}
|
||||||
FALLTHROUGH;
|
FALLTHROUGH;
|
||||||
case 14:
|
case TIMER_STATE_UP_TICK:
|
||||||
if (gSaveContext.timer1State == 14) {
|
if (gSaveContext.timerState == TIMER_STATE_UP_TICK) {
|
||||||
if (gSaveContext.healthCapacity > 0xA0) {
|
if (gSaveContext.healthCapacity > 0xA0) {
|
||||||
gSaveContext.timerY[0] = 54;
|
gSaveContext.timerY[TIMER_ID_MAIN] = 54; // two rows of hearts
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timerY[0] = 46;
|
gSaveContext.timerY[TIMER_ID_MAIN] = 46; // one row of hearts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gSaveContext.timer1State >= 3) {
|
if (gSaveContext.timerState >= TIMER_STATE_ENV_HAZARD_MOVE) {
|
||||||
D_8015FFE0--;
|
sTimerNextSecondTimer--;
|
||||||
if (D_8015FFE0 == 0) {
|
if (sTimerNextSecondTimer == 0) {
|
||||||
gSaveContext.timer1Value++;
|
gSaveContext.timerSeconds++;
|
||||||
D_8015FFE0 = 20;
|
sTimerNextSecondTimer = 20;
|
||||||
|
|
||||||
if (gSaveContext.timer1Value == 3599) {
|
if (gSaveContext.timerSeconds == 3599) { // 59 minutes, 59 seconds
|
||||||
D_8015FFE2 = 40;
|
sTimerStateTimer = 40;
|
||||||
gSaveContext.timer1State = 15;
|
gSaveContext.timerState = TIMER_STATE_UP_FREEZE;
|
||||||
} else {
|
} else {
|
||||||
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4,
|
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||||
|
@ -3635,146 +3660,163 @@ void Interface_Draw(PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 10:
|
|
||||||
if (gSaveContext.timer2State != 0) {
|
|
||||||
D_8015FFE6 = 20;
|
|
||||||
D_8015FFE4 = 20;
|
|
||||||
gSaveContext.timerX[1] = 140;
|
|
||||||
gSaveContext.timerY[1] = 80;
|
|
||||||
|
|
||||||
if (gSaveContext.timer2State < 7) {
|
case TIMER_STATE_STOP:
|
||||||
gSaveContext.timer2State = 2;
|
if (gSaveContext.subTimerState != SUBTIMER_STATE_OFF) {
|
||||||
|
sSubTimerStateTimer = 20;
|
||||||
|
sSubTimerNextSecondTimer = 20;
|
||||||
|
gSaveContext.timerX[TIMER_ID_SUB] = 140;
|
||||||
|
gSaveContext.timerY[TIMER_ID_SUB] = 80;
|
||||||
|
|
||||||
|
if (gSaveContext.subTimerState <= SUBTIMER_STATE_STOP) {
|
||||||
|
gSaveContext.subTimerState = SUBTIMER_STATE_DOWN_PREVIEW;
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timer2State = 8;
|
gSaveContext.subTimerState = SUBTIMER_STATE_UP_PREVIEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
}
|
}
|
||||||
case 15:
|
FALLTHROUGH;
|
||||||
|
case TIMER_STATE_UP_FREEZE:
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
svar6 = 1;
|
default: // TIMER_STATE_OFF
|
||||||
switch (gSaveContext.timer2State) {
|
// Process the subTimer only if the main timer is off
|
||||||
case 1:
|
timerId = TIMER_ID_SUB;
|
||||||
case 7:
|
|
||||||
D_8015FFE6 = 20;
|
switch (gSaveContext.subTimerState) {
|
||||||
D_8015FFE4 = 20;
|
case SUBTIMER_STATE_DOWN_INIT:
|
||||||
gSaveContext.timerX[1] = 140;
|
case SUBTIMER_STATE_UP_INIT:
|
||||||
gSaveContext.timerY[1] = 80;
|
sSubTimerStateTimer = 20;
|
||||||
if (gSaveContext.timer2State == 1) {
|
sSubTimerNextSecondTimer = 20;
|
||||||
gSaveContext.timer2State = 2;
|
gSaveContext.timerX[TIMER_ID_SUB] = 140;
|
||||||
|
gSaveContext.timerY[TIMER_ID_SUB] = 80;
|
||||||
|
if (gSaveContext.subTimerState == SUBTIMER_STATE_DOWN_INIT) {
|
||||||
|
gSaveContext.subTimerState = SUBTIMER_STATE_DOWN_PREVIEW;
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timer2State = 8;
|
gSaveContext.subTimerState = SUBTIMER_STATE_UP_PREVIEW;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
|
||||||
case 8:
|
case SUBTIMER_STATE_DOWN_PREVIEW:
|
||||||
D_8015FFE6--;
|
case SUBTIMER_STATE_UP_PREVIEW:
|
||||||
if (D_8015FFE6 == 0) {
|
sSubTimerStateTimer--;
|
||||||
D_8015FFE6 = 20;
|
if (sSubTimerStateTimer == 0) {
|
||||||
if (gSaveContext.timer2State == 2) {
|
sSubTimerStateTimer = 20;
|
||||||
gSaveContext.timer2State = 3;
|
if (gSaveContext.subTimerState == SUBTIMER_STATE_DOWN_PREVIEW) {
|
||||||
|
gSaveContext.subTimerState = SUBTIMER_STATE_DOWN_MOVE;
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timer2State = 9;
|
gSaveContext.subTimerState = SUBTIMER_STATE_UP_MOVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
|
||||||
case 9:
|
|
||||||
osSyncPrintf("event_xp[1]=%d, event_yp[1]=%d TOTAL_EVENT_TM=%d\n",
|
|
||||||
((void)0, gSaveContext.timerX[1]), ((void)0, gSaveContext.timerY[1]),
|
|
||||||
gSaveContext.timer2Value);
|
|
||||||
svar1 = (gSaveContext.timerX[1] - 26) / D_8015FFE6;
|
|
||||||
gSaveContext.timerX[1] -= svar1;
|
|
||||||
if (gSaveContext.healthCapacity > 0xA0) {
|
|
||||||
svar1 = (gSaveContext.timerY[1] - 54) / D_8015FFE6;
|
|
||||||
} else {
|
|
||||||
svar1 = (gSaveContext.timerY[1] - 46) / D_8015FFE6;
|
|
||||||
}
|
|
||||||
gSaveContext.timerY[1] -= svar1;
|
|
||||||
|
|
||||||
D_8015FFE6--;
|
case SUBTIMER_STATE_DOWN_MOVE:
|
||||||
if (D_8015FFE6 == 0) {
|
case SUBTIMER_STATE_UP_MOVE:
|
||||||
D_8015FFE6 = 20;
|
osSyncPrintf("event_xp[1]=%d, event_yp[1]=%d TOTAL_EVENT_TM=%d\n",
|
||||||
gSaveContext.timerX[1] = 26;
|
((void)0, gSaveContext.timerX[TIMER_ID_SUB]),
|
||||||
|
((void)0, gSaveContext.timerY[TIMER_ID_SUB]), gSaveContext.subTimerSeconds);
|
||||||
|
svar1 = (gSaveContext.timerX[TIMER_ID_SUB] - 26) / sSubTimerStateTimer;
|
||||||
|
gSaveContext.timerX[TIMER_ID_SUB] -= svar1;
|
||||||
|
if (gSaveContext.healthCapacity > 0xA0) {
|
||||||
|
// two rows of hearts
|
||||||
|
svar1 = (gSaveContext.timerY[TIMER_ID_SUB] - 54) / sSubTimerStateTimer;
|
||||||
|
} else {
|
||||||
|
// one row of hearts
|
||||||
|
svar1 = (gSaveContext.timerY[TIMER_ID_SUB] - 46) / sSubTimerStateTimer;
|
||||||
|
}
|
||||||
|
gSaveContext.timerY[TIMER_ID_SUB] -= svar1;
|
||||||
|
|
||||||
|
sSubTimerStateTimer--;
|
||||||
|
if (sSubTimerStateTimer == 0) {
|
||||||
|
sSubTimerStateTimer = 20;
|
||||||
|
gSaveContext.timerX[TIMER_ID_SUB] = 26;
|
||||||
|
|
||||||
if (gSaveContext.healthCapacity > 0xA0) {
|
if (gSaveContext.healthCapacity > 0xA0) {
|
||||||
gSaveContext.timerY[1] = 54;
|
gSaveContext.timerY[TIMER_ID_SUB] = 54; // two rows of hearts
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timerY[1] = 46;
|
gSaveContext.timerY[TIMER_ID_SUB] = 46; // one row of hearts
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gSaveContext.timer2State == 3) {
|
if (gSaveContext.subTimerState == SUBTIMER_STATE_DOWN_MOVE) {
|
||||||
gSaveContext.timer2State = 4;
|
gSaveContext.subTimerState = SUBTIMER_STATE_DOWN_TICK;
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timer2State = 10;
|
gSaveContext.subTimerState = SUBTIMER_STATE_UP_TICK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FALLTHROUGH;
|
FALLTHROUGH;
|
||||||
case 4:
|
case SUBTIMER_STATE_DOWN_TICK:
|
||||||
case 10:
|
case SUBTIMER_STATE_UP_TICK:
|
||||||
if ((gSaveContext.timer2State == 4) || (gSaveContext.timer2State == 10)) {
|
if ((gSaveContext.subTimerState == SUBTIMER_STATE_DOWN_TICK) ||
|
||||||
|
(gSaveContext.subTimerState == SUBTIMER_STATE_UP_TICK)) {
|
||||||
if (gSaveContext.healthCapacity > 0xA0) {
|
if (gSaveContext.healthCapacity > 0xA0) {
|
||||||
gSaveContext.timerY[1] = 54;
|
gSaveContext.timerY[TIMER_ID_SUB] = 54; // two rows of hearts
|
||||||
} else {
|
} else {
|
||||||
gSaveContext.timerY[1] = 46;
|
gSaveContext.timerY[TIMER_ID_SUB] = 46; // one row of hearts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gSaveContext.timer2State >= 3) {
|
if (gSaveContext.subTimerState >= SUBTIMER_STATE_DOWN_MOVE) {
|
||||||
D_8015FFE4--;
|
sSubTimerNextSecondTimer--;
|
||||||
if (D_8015FFE4 == 0) {
|
if (sSubTimerNextSecondTimer == 0) {
|
||||||
D_8015FFE4 = 20;
|
sSubTimerNextSecondTimer = 20;
|
||||||
if (gSaveContext.timer2State == 4) {
|
if (gSaveContext.subTimerState == SUBTIMER_STATE_DOWN_TICK) {
|
||||||
gSaveContext.timer2Value--;
|
gSaveContext.subTimerSeconds--;
|
||||||
osSyncPrintf("TOTAL_EVENT_TM=%d\n", gSaveContext.timer2Value);
|
osSyncPrintf("TOTAL_EVENT_TM=%d\n", gSaveContext.subTimerSeconds);
|
||||||
|
|
||||||
if (gSaveContext.timer2Value <= 0) {
|
if (gSaveContext.subTimerSeconds <= 0) {
|
||||||
|
// Out of time
|
||||||
if (!Flags_GetSwitch(play, 0x37) ||
|
if (!Flags_GetSwitch(play, 0x37) ||
|
||||||
((play->sceneId != SCENE_GANON_DEMO) &&
|
((play->sceneId != SCENE_GANON_DEMO) &&
|
||||||
(play->sceneId != SCENE_GANON_FINAL) &&
|
(play->sceneId != SCENE_GANON_FINAL) &&
|
||||||
(play->sceneId != SCENE_GANON_SONOGO) &&
|
(play->sceneId != SCENE_GANON_SONOGO) &&
|
||||||
(play->sceneId != SCENE_GANONTIKA_SONOGO))) {
|
(play->sceneId != SCENE_GANONTIKA_SONOGO))) {
|
||||||
D_8015FFE6 = 40;
|
sSubTimerStateTimer = 40;
|
||||||
gSaveContext.timer2State = 5;
|
gSaveContext.subTimerState = SUBTIMER_STATE_RESPAWN;
|
||||||
gSaveContext.cutsceneIndex = 0;
|
gSaveContext.cutsceneIndex = 0;
|
||||||
Message_StartTextbox(play, 0x71B0, NULL);
|
Message_StartTextbox(play, 0x71B0, NULL);
|
||||||
func_8002DF54(play, NULL, 8);
|
func_8002DF54(play, NULL, 8);
|
||||||
} else {
|
} else {
|
||||||
D_8015FFE6 = 40;
|
sSubTimerStateTimer = 40;
|
||||||
gSaveContext.timer2State = 6;
|
gSaveContext.subTimerState = SUBTIMER_STATE_STOP;
|
||||||
}
|
}
|
||||||
} else if (gSaveContext.timer2Value > 60) {
|
} else if (gSaveContext.subTimerSeconds > 60) {
|
||||||
if (timerDigits[4] == 1) {
|
// Beep at "xx:x1" (every 10 seconds)
|
||||||
|
if (sTimerDigits[4] == 1) {
|
||||||
Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_WOMAN, &gSfxDefaultPos, 4,
|
Audio_PlaySfxGeneral(NA_SE_SY_MESSAGE_WOMAN, &gSfxDefaultPos, 4,
|
||||||
&gSfxDefaultFreqAndVolScale,
|
&gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
}
|
}
|
||||||
} else if (gSaveContext.timer2Value > 10) {
|
} else if (gSaveContext.subTimerSeconds > 10) {
|
||||||
if (timerDigits[4] & 1) {
|
// Beep on alternating seconds
|
||||||
|
if ((sTimerDigits[4] % 2) != 0) {
|
||||||
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4,
|
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4,
|
||||||
&gSfxDefaultFreqAndVolScale,
|
&gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// Beep every second
|
||||||
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_E, &gSfxDefaultPos, 4,
|
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_E, &gSfxDefaultPos, 4,
|
||||||
&gSfxDefaultFreqAndVolScale,
|
&gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
}
|
}
|
||||||
} else {
|
} else { // SUBTIMER_STATE_UP_TICK
|
||||||
gSaveContext.timer2Value++;
|
gSaveContext.subTimerSeconds++;
|
||||||
if (GET_EVENTINF(EVENTINF_10)) {
|
|
||||||
if (gSaveContext.timer2Value == 240) {
|
// Special case for the running-man race
|
||||||
Message_StartTextbox(play, 0x6083, NULL);
|
if (GET_EVENTINF(EVENTINF_MARATHON_ACTIVE) &&
|
||||||
CLEAR_EVENTINF(EVENTINF_10);
|
(gSaveContext.subTimerSeconds == MARATHON_TIME_LIMIT)) {
|
||||||
gSaveContext.timer2State = 0;
|
// After 4 minutes, cancel the timer
|
||||||
}
|
Message_StartTextbox(play, 0x6083, NULL);
|
||||||
|
CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE);
|
||||||
|
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gSaveContext.timer2Value % 60) == 0) {
|
// Beep at the minute mark
|
||||||
|
if ((gSaveContext.subTimerSeconds % 60) == 0) {
|
||||||
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4,
|
Audio_PlaySfxGeneral(NA_SE_SY_WARNING_COUNT_N, &gSfxDefaultPos, 4,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultReverb);
|
&gSfxDefaultReverb);
|
||||||
|
@ -3782,39 +3824,40 @@ void Interface_Draw(PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
|
||||||
D_8015FFE6--;
|
case SUBTIMER_STATE_STOP:
|
||||||
if (D_8015FFE6 == 0) {
|
sSubTimerStateTimer--;
|
||||||
gSaveContext.timer2State = 0;
|
if (sSubTimerStateTimer == 0) {
|
||||||
|
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((gSaveContext.timer1State != 0) && (gSaveContext.timer1State != 10)) ||
|
if (((gSaveContext.timerState != TIMER_STATE_OFF) && (gSaveContext.timerState != TIMER_STATE_STOP)) ||
|
||||||
(gSaveContext.timer2State != 0)) {
|
(gSaveContext.subTimerState != SUBTIMER_STATE_OFF)) {
|
||||||
timerDigits[0] = timerDigits[1] = timerDigits[3] = 0;
|
sTimerDigits[0] = sTimerDigits[1] = sTimerDigits[3] = 0;
|
||||||
timerDigits[2] = 10; // digit 10 is used as ':' (colon)
|
sTimerDigits[2] = 10; // digit 10 is used as ':' (colon)
|
||||||
|
|
||||||
if (gSaveContext.timer1State != 0) {
|
if (gSaveContext.timerState != TIMER_STATE_OFF) {
|
||||||
timerDigits[4] = gSaveContext.timer1Value;
|
sTimerDigits[4] = gSaveContext.timerSeconds;
|
||||||
} else {
|
} else {
|
||||||
timerDigits[4] = gSaveContext.timer2Value;
|
sTimerDigits[4] = gSaveContext.subTimerSeconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (timerDigits[4] >= 60) {
|
while (sTimerDigits[4] >= 60) {
|
||||||
timerDigits[1]++;
|
sTimerDigits[1]++;
|
||||||
if (timerDigits[1] >= 10) {
|
if (sTimerDigits[1] >= 10) {
|
||||||
timerDigits[0]++;
|
sTimerDigits[0]++;
|
||||||
timerDigits[1] -= 10;
|
sTimerDigits[1] -= 10;
|
||||||
}
|
}
|
||||||
timerDigits[4] -= 60;
|
sTimerDigits[4] -= 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (timerDigits[4] >= 10) {
|
while (sTimerDigits[4] >= 10) {
|
||||||
timerDigits[3]++;
|
sTimerDigits[3]++;
|
||||||
timerDigits[4] -= 10;
|
sTimerDigits[4] -= 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clock Icon
|
// Clock Icon
|
||||||
|
@ -3822,34 +3865,36 @@ void Interface_Draw(PlayState* play) {
|
||||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255);
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255);
|
||||||
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0);
|
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0);
|
||||||
OVERLAY_DISP =
|
OVERLAY_DISP =
|
||||||
Gfx_TextureIA8(OVERLAY_DISP, gClockIconTex, 16, 16, ((void)0, gSaveContext.timerX[svar6]),
|
Gfx_TextureIA8(OVERLAY_DISP, gClockIconTex, 16, 16, ((void)0, gSaveContext.timerX[timerId]),
|
||||||
((void)0, gSaveContext.timerY[svar6]) + 2, 16, 16, 1 << 10, 1 << 10);
|
((void)0, gSaveContext.timerY[timerId]) + 2, 16, 16, 1 << 10, 1 << 10);
|
||||||
|
|
||||||
// Timer Counter
|
// Timer Counter
|
||||||
gDPPipeSync(OVERLAY_DISP++);
|
gDPPipeSync(OVERLAY_DISP++);
|
||||||
gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE,
|
gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE,
|
||||||
TEXEL0, 0, PRIMITIVE, 0);
|
TEXEL0, 0, PRIMITIVE, 0);
|
||||||
|
|
||||||
if (gSaveContext.timer1State != 0) {
|
if (gSaveContext.timerState != TIMER_STATE_OFF) {
|
||||||
if ((gSaveContext.timer1Value < 10) && (gSaveContext.timer1State < 11)) {
|
// TIMER_ID_MAIN
|
||||||
|
if ((gSaveContext.timerSeconds < 10) && (gSaveContext.timerState <= TIMER_STATE_STOP)) {
|
||||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 50, 0, 255);
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 50, 0, 255);
|
||||||
} else {
|
} else {
|
||||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255);
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((gSaveContext.timer2Value < 10) && (gSaveContext.timer2State < 6)) {
|
// TIMER_ID_SUB
|
||||||
|
if ((gSaveContext.subTimerSeconds < 10) && (gSaveContext.subTimerState <= SUBTIMER_STATE_RESPAWN)) {
|
||||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 50, 0, 255);
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 50, 0, 255);
|
||||||
} else {
|
} else {
|
||||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 0, 255);
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 0, 255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (svar1 = 0; svar1 < 5; svar1++) {
|
for (svar1 = 0; svar1 < ARRAY_COUNT(sTimerDigits); svar1++) {
|
||||||
OVERLAY_DISP =
|
OVERLAY_DISP =
|
||||||
Gfx_TextureI8(OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * timerDigits[svar1])), 8, 16,
|
Gfx_TextureI8(OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * sTimerDigits[svar1])), 8, 16,
|
||||||
((void)0, gSaveContext.timerX[svar6]) + timerDigitLeftPos[svar1],
|
((void)0, gSaveContext.timerX[timerId]) + timerDigitLeftPos[svar1],
|
||||||
((void)0, gSaveContext.timerY[svar6]), digitWidth[svar1], VREG(42), VREG(43) << 1,
|
((void)0, gSaveContext.timerY[timerId]), sDigitWidths[svar1], VREG(42),
|
||||||
VREG(43) << 1);
|
VREG(43) << 1, VREG(43) << 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4021,24 +4066,25 @@ void Interface_Update(PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Health_UpdateBeatingHeart(play);
|
Health_UpdateBeatingHeart(play);
|
||||||
D_80125A58 = func_8008F2F8(play);
|
sEnvHazard = Player_GetEnvironmentalHazard(play);
|
||||||
|
|
||||||
if (D_80125A58 == 1) {
|
if (sEnvHazard == PLAYER_ENV_HAZARD_HOTROOM) {
|
||||||
if (CUR_EQUIP_VALUE(EQUIP_TYPE_TUNIC) == EQUIP_VALUE_TUNIC_GORON) {
|
if (CUR_EQUIP_VALUE(EQUIP_TYPE_TUNIC) == EQUIP_VALUE_TUNIC_GORON) {
|
||||||
D_80125A58 = 0;
|
sEnvHazard = PLAYER_ENV_HAZARD_NONE;
|
||||||
}
|
}
|
||||||
} else if ((func_8008F2F8(play) >= 2) && (func_8008F2F8(play) < 5)) {
|
} else if ((Player_GetEnvironmentalHazard(play) >= PLAYER_ENV_HAZARD_UNDERWATER_FLOOR) &&
|
||||||
|
(Player_GetEnvironmentalHazard(play) <= PLAYER_ENV_HAZARD_UNDERWATER_FREE)) {
|
||||||
if (CUR_EQUIP_VALUE(EQUIP_TYPE_TUNIC) == EQUIP_VALUE_TUNIC_ZORA) {
|
if (CUR_EQUIP_VALUE(EQUIP_TYPE_TUNIC) == EQUIP_VALUE_TUNIC_ZORA) {
|
||||||
D_80125A58 = 0;
|
sEnvHazard = PLAYER_ENV_HAZARD_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Health_UpdateMeter(play);
|
Health_UpdateMeter(play);
|
||||||
|
|
||||||
if ((gSaveContext.timer1State >= 3) && (play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0) &&
|
if ((gSaveContext.timerState >= TIMER_STATE_ENV_HAZARD_MOVE) && (play->pauseCtx.state == 0) &&
|
||||||
(msgCtx->msgMode == MSGMODE_NONE) && !(player->stateFlags2 & PLAYER_STATE2_24) &&
|
(play->pauseCtx.debugState == 0) && (msgCtx->msgMode == MSGMODE_NONE) &&
|
||||||
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF) &&
|
!(player->stateFlags2 & PLAYER_STATE2_24) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
|
||||||
!Play_InCsMode(play)) {}
|
(play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play)) {}
|
||||||
|
|
||||||
if (gSaveContext.rupeeAccumulator != 0) {
|
if (gSaveContext.rupeeAccumulator != 0) {
|
||||||
if (gSaveContext.rupeeAccumulator > 0) {
|
if (gSaveContext.rupeeAccumulator > 0) {
|
||||||
|
@ -4140,16 +4186,19 @@ void Interface_Update(PlayState* play) {
|
||||||
Magic_Update(play);
|
Magic_Update(play);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gSaveContext.timer1State == 0) {
|
if (gSaveContext.timerState == TIMER_STATE_OFF) {
|
||||||
if (((D_80125A58 == 1) || (D_80125A58 == 2) || (D_80125A58 == 4)) && ((gSaveContext.health >> 1) != 0)) {
|
if (((sEnvHazard == PLAYER_ENV_HAZARD_HOTROOM) || (sEnvHazard == PLAYER_ENV_HAZARD_UNDERWATER_FLOOR) ||
|
||||||
gSaveContext.timer1State = 1;
|
(sEnvHazard == PLAYER_ENV_HAZARD_UNDERWATER_FREE)) &&
|
||||||
gSaveContext.timerX[0] = 140;
|
((gSaveContext.health >> 1) != 0)) {
|
||||||
gSaveContext.timerY[0] = 80;
|
gSaveContext.timerState = TIMER_STATE_ENV_HAZARD_INIT;
|
||||||
D_80125A5C = true;
|
gSaveContext.timerX[TIMER_ID_MAIN] = 140;
|
||||||
|
gSaveContext.timerY[TIMER_ID_MAIN] = 80;
|
||||||
|
sEnvHazardActive = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (((D_80125A58 == 0) || (D_80125A58 == 3)) && (gSaveContext.timer1State < 5)) {
|
if (((sEnvHazard == PLAYER_ENV_HAZARD_NONE) || (sEnvHazard == PLAYER_ENV_HAZARD_SWIMMING)) &&
|
||||||
gSaveContext.timer1State = 0;
|
(gSaveContext.timerState <= TIMER_STATE_ENV_HAZARD_TICK)) {
|
||||||
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,6 @@
|
||||||
#include "assets/objects/object_link_boy/object_link_boy.h"
|
#include "assets/objects/object_link_boy/object_link_boy.h"
|
||||||
#include "assets/objects/object_link_child/object_link_child.h"
|
#include "assets/objects/object_link_child/object_link_child.h"
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
/* 0x00 */ u8 flag;
|
|
||||||
/* 0x02 */ u16 textId;
|
|
||||||
} TextTriggerEntry; // size = 0x04
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0x00 */ Gfx* dList;
|
/* 0x00 */ Gfx* dList;
|
||||||
/* 0x04 */ Vec3f pos;
|
/* 0x04 */ Vec3f pos;
|
||||||
|
@ -95,11 +90,16 @@ u8 sActionModelGroups[PLAYER_IA_MAX] = {
|
||||||
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_LENS_OF_TRUTH
|
PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_LENS_OF_TRUTH
|
||||||
};
|
};
|
||||||
|
|
||||||
TextTriggerEntry sTextTriggers[] = {
|
typedef struct {
|
||||||
{ 1, 0x3040 },
|
/* 0x0 */ u8 flag;
|
||||||
{ 2, 0x401D },
|
/* 0x2 */ u16 textId;
|
||||||
{ 0, 0x0000 },
|
} EnvHazardTextTriggerEntry; // size = 0x4
|
||||||
{ 2, 0x401D },
|
|
||||||
|
EnvHazardTextTriggerEntry sEnvHazardTextTriggers[] = {
|
||||||
|
{ ENV_HAZARD_TEXT_TRIGGER_HOTROOM, 0x3040 }, // PLAYER_ENV_HAZARD_HOTROOM - 1
|
||||||
|
{ ENV_HAZARD_TEXT_TRIGGER_UNDERWATER, 0x401D }, // PLAYER_ENV_HAZARD_UNDERWATER_FLOOR - 1
|
||||||
|
{ 0, 0x0000 }, // PLAYER_ENV_HAZARD_SWIMMING - 1
|
||||||
|
{ ENV_HAZARD_TEXT_TRIGGER_UNDERWATER, 0x401D }, // PLAYER_ENV_HAZARD_UNDERWATER_FREE - 1
|
||||||
};
|
};
|
||||||
|
|
||||||
// Used to map model groups to model types for [animation, left hand, right hand, sheath, waist]
|
// Used to map model groups to model types for [animation, left hand, right hand, sheath, waist]
|
||||||
|
@ -778,35 +778,37 @@ return_neg:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 func_8008F2F8(PlayState* play) {
|
s32 Player_GetEnvironmentalHazard(PlayState* play) {
|
||||||
Player* this = GET_PLAYER(play);
|
Player* this = GET_PLAYER(play);
|
||||||
TextTriggerEntry* triggerEntry;
|
EnvHazardTextTriggerEntry* triggerEntry;
|
||||||
s32 var;
|
s32 envHazard;
|
||||||
|
|
||||||
if (play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) { // Room is hot
|
if (play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) { // Room is hot
|
||||||
var = 0;
|
envHazard = PLAYER_ENV_HAZARD_HOTROOM - 1;
|
||||||
} else if ((this->unk_840 > 80) &&
|
} else if ((this->underwaterTimer > 80) &&
|
||||||
((this->currentBoots == PLAYER_BOOTS_IRON) || (this->unk_840 >= 300))) { // Deep underwater
|
((this->currentBoots == PLAYER_BOOTS_IRON) || (this->underwaterTimer >= 300))) {
|
||||||
var = ((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) ? 1 : 3;
|
envHazard = ((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND))
|
||||||
|
? (PLAYER_ENV_HAZARD_UNDERWATER_FLOOR - 1)
|
||||||
|
: (PLAYER_ENV_HAZARD_UNDERWATER_FREE - 1);
|
||||||
} else if (this->stateFlags1 & PLAYER_STATE1_27) { // Swimming
|
} else if (this->stateFlags1 & PLAYER_STATE1_27) { // Swimming
|
||||||
var = 2;
|
envHazard = PLAYER_ENV_HAZARD_SWIMMING - 1;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return PLAYER_ENV_HAZARD_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trigger general textboxes under certain conditions, like "It's so hot in here!"
|
triggerEntry = &sEnvHazardTextTriggers[envHazard];
|
||||||
triggerEntry = &sTextTriggers[var];
|
|
||||||
if (!Player_InCsMode(play)) {
|
if (!Player_InCsMode(play)) {
|
||||||
if ((triggerEntry->flag != 0) && !(gSaveContext.textTriggerFlags & triggerEntry->flag) &&
|
if ((triggerEntry->flag != 0) && !(gSaveContext.envHazardTextTriggerFlags & triggerEntry->flag) &&
|
||||||
(((var == 0) && (this->currentTunic != PLAYER_TUNIC_GORON)) ||
|
(((envHazard == (PLAYER_ENV_HAZARD_HOTROOM - 1)) && (this->currentTunic != PLAYER_TUNIC_GORON)) ||
|
||||||
(((var == 1) || (var == 3)) && (this->currentBoots == PLAYER_BOOTS_IRON) &&
|
(((envHazard == (PLAYER_ENV_HAZARD_UNDERWATER_FLOOR - 1)) ||
|
||||||
(this->currentTunic != PLAYER_TUNIC_ZORA)))) {
|
(envHazard == (PLAYER_ENV_HAZARD_UNDERWATER_FREE - 1))) &&
|
||||||
|
(this->currentBoots == PLAYER_BOOTS_IRON) && (this->currentTunic != PLAYER_TUNIC_ZORA)))) {
|
||||||
Message_StartTextbox(play, triggerEntry->textId, NULL);
|
Message_StartTextbox(play, triggerEntry->textId, NULL);
|
||||||
gSaveContext.textTriggerFlags |= triggerEntry->flag;
|
gSaveContext.envHazardTextTriggerFlags |= triggerEntry->flag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return var + 1;
|
return envHazard + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 sEyeMouthIndices[][2] = {
|
u8 sEyeMouthIndices[][2] = {
|
||||||
|
|
|
@ -226,8 +226,8 @@ void BgPoEvent_Destroy(Actor* thisx, PlayState* play) {
|
||||||
Collider_DestroyTris(play, &this->collider);
|
Collider_DestroyTris(play, &this->collider);
|
||||||
} else {
|
} else {
|
||||||
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
|
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
|
||||||
if ((this->type == 1) && (gSaveContext.timer1Value > 0)) {
|
if ((this->type == 1) && (gSaveContext.timerSeconds > 0)) {
|
||||||
gSaveContext.timer1State = 0xA;
|
gSaveContext.timerState = TIMER_STATE_STOP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -316,7 +316,7 @@ void BgPoEvent_BlockFall(BgPoEvent* this, PlayState* play) {
|
||||||
} else {
|
} else {
|
||||||
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
|
Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
|
||||||
Actor_RequestQuakeAndRumble(&this->dyna.actor, play, 5, 5);
|
Actor_RequestQuakeAndRumble(&this->dyna.actor, play, 5, 5);
|
||||||
func_80088B34(this->timer);
|
Interface_SetTimer(this->timer);
|
||||||
if (firstFall == 0) {
|
if (firstFall == 0) {
|
||||||
firstFall = 1;
|
firstFall = 1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -342,10 +342,10 @@ void BgPoEvent_BlockIdle(BgPoEvent* this, PlayState* play) {
|
||||||
OnePointCutscene_Init(play, 3170, 30, amy, CAM_ID_MAIN);
|
OnePointCutscene_Init(play, 3170, 30, amy, CAM_ID_MAIN);
|
||||||
}
|
}
|
||||||
func_80078884(NA_SE_SY_CORRECT_CHIME);
|
func_80078884(NA_SE_SY_CORRECT_CHIME);
|
||||||
gSaveContext.timer1State = 0xA;
|
gSaveContext.timerState = TIMER_STATE_STOP;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((gSaveContext.timer1Value == 0) && (sBlocksAtRest == 5)) {
|
if ((gSaveContext.timerSeconds == 0) && (sBlocksAtRest == 5)) {
|
||||||
player->stateFlags2 &= ~PLAYER_STATE2_4;
|
player->stateFlags2 &= ~PLAYER_STATE2_4;
|
||||||
sPuzzleState = 0x10;
|
sPuzzleState = 0x10;
|
||||||
sBlocksAtRest = 0;
|
sBlocksAtRest = 0;
|
||||||
|
|
|
@ -156,7 +156,7 @@ void func_808A9234(BgRelayObjects* this, PlayState* play) {
|
||||||
Flags_UnsetSwitch(play, this->switchFlag);
|
Flags_UnsetSwitch(play, this->switchFlag);
|
||||||
this->dyna.actor.flags &= ~ACTOR_FLAG_4;
|
this->dyna.actor.flags &= ~ACTOR_FLAG_4;
|
||||||
if (play->roomCtx.curRoom.num == 4) {
|
if (play->roomCtx.curRoom.num == 4) {
|
||||||
gSaveContext.timer1State = 0xF;
|
gSaveContext.timerState = TIMER_STATE_UP_FREEZE;
|
||||||
}
|
}
|
||||||
this->actionFunc = BgRelayObjects_DoNothing;
|
this->actionFunc = BgRelayObjects_DoNothing;
|
||||||
}
|
}
|
||||||
|
|
|
@ -823,7 +823,7 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) {
|
||||||
this->unk_150[i].unk_22++;
|
this->unk_150[i].unk_22++;
|
||||||
}
|
}
|
||||||
} else if (i + 1 == this->sparkleCounter && play->csCtx.state == CS_STATE_IDLE) {
|
} else if (i + 1 == this->sparkleCounter && play->csCtx.state == CS_STATE_IDLE) {
|
||||||
func_80088AF0(play);
|
Interface_SetSubTimerToFinalSecond(play);
|
||||||
Actor_Kill(&this->actor);
|
Actor_Kill(&this->actor);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -103,7 +103,7 @@ void EnDivingGame_Destroy(Actor* thisx, PlayState* play) {
|
||||||
EnDivingGame* this = (EnDivingGame*)thisx;
|
EnDivingGame* this = (EnDivingGame*)thisx;
|
||||||
|
|
||||||
if (this->unk_31F == 0) {
|
if (this->unk_31F == 0) {
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
}
|
}
|
||||||
Collider_DestroyCylinder(play, &this->collider);
|
Collider_DestroyCylinder(play, &this->collider);
|
||||||
}
|
}
|
||||||
|
@ -125,9 +125,9 @@ void EnDivingGame_SpawnRuppy(EnDivingGame* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, PlayState* play) {
|
s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, PlayState* play) {
|
||||||
if (gSaveContext.timer1State == 10 && !Play_InCsMode(play)) {
|
if ((gSaveContext.timerState == TIMER_STATE_STOP) && !Play_InCsMode(play)) {
|
||||||
// Failed.
|
// Failed.
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
func_800F5B58();
|
func_800F5B58();
|
||||||
func_80078884(NA_SE_SY_FOUND);
|
func_80078884(NA_SE_SY_FOUND);
|
||||||
this->actor.textId = 0x71AD;
|
this->actor.textId = 0x71AD;
|
||||||
|
@ -145,7 +145,7 @@ s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
if (this->grabbedRupeesCounter >= rupeesNeeded) {
|
if (this->grabbedRupeesCounter >= rupeesNeeded) {
|
||||||
// Won.
|
// Won.
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
this->allRupeesThrown = this->state = this->phase = this->unk_2A2 = this->grabbedRupeesCounter = 0;
|
this->allRupeesThrown = this->state = this->phase = this->unk_2A2 = this->grabbedRupeesCounter = 0;
|
||||||
if (!GET_EVENTCHKINF(EVENTCHKINF_38)) {
|
if (!GET_EVENTCHKINF(EVENTCHKINF_38)) {
|
||||||
this->actor.textId = 0x4055;
|
this->actor.textId = 0x4055;
|
||||||
|
@ -418,9 +418,9 @@ void func_809EE800(EnDivingGame* this, PlayState* play) {
|
||||||
if (this->unk_292 == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play)) {
|
if (this->unk_292 == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play)) {
|
||||||
Message_CloseTextbox(play);
|
Message_CloseTextbox(play);
|
||||||
if (!GET_EVENTCHKINF(EVENTCHKINF_38)) {
|
if (!GET_EVENTCHKINF(EVENTCHKINF_38)) {
|
||||||
func_80088B34(BREG(2) + 50);
|
Interface_SetTimer(50 + BREG(2));
|
||||||
} else {
|
} else {
|
||||||
func_80088B34(BREG(2) + 50);
|
Interface_SetTimer(50 + BREG(2));
|
||||||
}
|
}
|
||||||
func_800F5ACC(NA_BGM_TIMED_MINI_GAME);
|
func_800F5ACC(NA_BGM_TIMED_MINI_GAME);
|
||||||
func_8002DF54(play, NULL, 7);
|
func_8002DF54(play, NULL, 7);
|
||||||
|
@ -506,9 +506,10 @@ void EnDivingGame_Update(Actor* thisx, PlayState* play2) {
|
||||||
|
|
||||||
if (1) {}
|
if (1) {}
|
||||||
|
|
||||||
if (gSaveContext.timer1Value == 10) {
|
if (gSaveContext.timerSeconds == 10) {
|
||||||
Audio_SetFastTempoForTimedMinigame();
|
Audio_SetFastTempoForTimedMinigame();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->eyeTimer == 0) {
|
if (this->eyeTimer == 0) {
|
||||||
this->eyeTimer = 2;
|
this->eyeTimer = 2;
|
||||||
this->eyeTexIndex++;
|
this->eyeTexIndex++;
|
||||||
|
|
|
@ -88,7 +88,7 @@ void EnDs_GiveOddPotion(EnDs* this, PlayState* play) {
|
||||||
if (Actor_HasParent(&this->actor, play)) {
|
if (Actor_HasParent(&this->actor, play)) {
|
||||||
this->actor.parent = NULL;
|
this->actor.parent = NULL;
|
||||||
this->actionFunc = EnDs_DisplayOddPotionText;
|
this->actionFunc = EnDs_DisplayOddPotionText;
|
||||||
gSaveContext.timer2State = 0;
|
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
|
||||||
} else {
|
} else {
|
||||||
func_8002F434(&this->actor, play, GI_ODD_POTION, 10000.0f, 50.0f);
|
func_8002F434(&this->actor, play, GI_ODD_POTION, 10000.0f, 50.0f);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ void EnEg_Init(Actor* thisx, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_809FFDC8(EnEg* this, PlayState* play) {
|
void func_809FFDC8(EnEg* this, PlayState* play) {
|
||||||
if (!sVoided && (gSaveContext.timer2Value < 1) && Flags_GetSwitch(play, 0x36) && (kREG(0) == 0)) {
|
if (!sVoided && (gSaveContext.subTimerSeconds <= 0) && Flags_GetSwitch(play, 0x36) && (kREG(0) == 0)) {
|
||||||
// Void the player out
|
// Void the player out
|
||||||
Play_TriggerRespawn(play);
|
Play_TriggerRespawn(play);
|
||||||
gSaveContext.respawnFlag = -2;
|
gSaveContext.respawnFlag = -2;
|
||||||
|
|
|
@ -865,7 +865,7 @@ void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) {
|
||||||
this->unk_1E0.unk_00 = 0;
|
this->unk_1E0.unk_00 = 0;
|
||||||
EnGo_SetupAction(this, EnGo_Eyedrops);
|
EnGo_SetupAction(this, EnGo_Eyedrops);
|
||||||
play->msgCtx.msgMode = MSGMODE_PAUSED;
|
play->msgCtx.msgMode = MSGMODE_PAUSED;
|
||||||
gSaveContext.timer2State = 0;
|
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
|
||||||
OnePointCutscene_Init(play, 4190, -99, &this->actor, CAM_ID_MAIN);
|
OnePointCutscene_Init(play, 4190, -99, &this->actor, CAM_ID_MAIN);
|
||||||
} else {
|
} else {
|
||||||
this->unk_1E0.unk_00 = 0;
|
this->unk_1E0.unk_00 = 0;
|
||||||
|
|
|
@ -1062,7 +1062,7 @@ void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) {
|
||||||
this->actor.textId = 0x3058;
|
this->actor.textId = 0x3058;
|
||||||
}
|
}
|
||||||
if (this->actor.textId == 0x3059) {
|
if (this->actor.textId == 0x3059) {
|
||||||
gSaveContext.timer2State = 0;
|
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
|
||||||
}
|
}
|
||||||
player->actor.textId = this->actor.textId;
|
player->actor.textId = this->actor.textId;
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ void EnHorseGameCheck_FinishIngoRace(EnHorseGameCheckIngoRace* this, PlayState*
|
||||||
}
|
}
|
||||||
DREG(25) = 0;
|
DREG(25) = 0;
|
||||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play) {
|
s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play) {
|
||||||
|
@ -140,7 +140,7 @@ s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play)
|
||||||
|
|
||||||
if ((this->startTimer > 50) && !(this->startFlags & INGORACE_SET_TIMER)) {
|
if ((this->startTimer > 50) && !(this->startFlags & INGORACE_SET_TIMER)) {
|
||||||
this->startFlags |= INGORACE_SET_TIMER;
|
this->startFlags |= INGORACE_SET_TIMER;
|
||||||
func_80088B34(0);
|
Interface_SetTimer(0);
|
||||||
} else if ((this->startTimer > 80) && (player->rideActor != NULL) && !(this->startFlags & INGORACE_PLAYER_MOVE)) {
|
} else if ((this->startTimer > 80) && (player->rideActor != NULL) && !(this->startFlags & INGORACE_PLAYER_MOVE)) {
|
||||||
this->startFlags |= INGORACE_PLAYER_MOVE;
|
this->startFlags |= INGORACE_PLAYER_MOVE;
|
||||||
horse = (EnHorse*)player->rideActor;
|
horse = (EnHorse*)player->rideActor;
|
||||||
|
@ -211,7 +211,7 @@ s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play)
|
||||||
this->result = INGORACE_INGO_WIN;
|
this->result = INGORACE_INGO_WIN;
|
||||||
this->finishTimer = 20;
|
this->finishTimer = 20;
|
||||||
}
|
}
|
||||||
if ((gSaveContext.timer1Value >= 180) && (this->startFlags & 2)) {
|
if ((gSaveContext.timerSeconds >= 180) && (this->startFlags & 2)) {
|
||||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_HORSE_GOAL);
|
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_HORSE_GOAL);
|
||||||
this->result = INGORACE_TIME_UP;
|
this->result = INGORACE_TIME_UP;
|
||||||
this->finishTimer = 20;
|
this->finishTimer = 20;
|
||||||
|
@ -298,8 +298,8 @@ void EnHorseGameCheck_FinishMalonRace(EnHorseGameCheckMalonRace* this, PlayState
|
||||||
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
|
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
|
||||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||||
} else if (this->result == MALONRACE_FAILURE) {
|
} else if (this->result == MALONRACE_FAILURE) {
|
||||||
gSaveContext.timer1Value = 240;
|
gSaveContext.timerSeconds = 240;
|
||||||
gSaveContext.timer1State = 0xF;
|
gSaveContext.timerState = TIMER_STATE_UP_FREEZE;
|
||||||
gSaveContext.cutsceneIndex = 0;
|
gSaveContext.cutsceneIndex = 0;
|
||||||
play->nextEntranceIndex = ENTR_SPOT20_7;
|
play->nextEntranceIndex = ENTR_SPOT20_7;
|
||||||
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
|
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
|
||||||
|
@ -328,7 +328,7 @@ s32 EnHorseGameCheck_UpdateMalonRace(EnHorseGameCheckBase* base, PlayState* play
|
||||||
}
|
}
|
||||||
if ((this->startTimer > 50) && !(this->raceFlags & MALONRACE_SET_TIMER)) {
|
if ((this->startTimer > 50) && !(this->raceFlags & MALONRACE_SET_TIMER)) {
|
||||||
this->raceFlags |= MALONRACE_SET_TIMER;
|
this->raceFlags |= MALONRACE_SET_TIMER;
|
||||||
func_80088B34(0);
|
Interface_SetTimer(0);
|
||||||
} else if ((this->startTimer > 80) && (player->rideActor != NULL) && !(this->raceFlags & MALONRACE_PLAYER_MOVE)) {
|
} else if ((this->startTimer > 80) && (player->rideActor != NULL) && !(this->raceFlags & MALONRACE_PLAYER_MOVE)) {
|
||||||
this->raceFlags |= MALONRACE_PLAYER_MOVE;
|
this->raceFlags |= MALONRACE_PLAYER_MOVE;
|
||||||
horse = (EnHorse*)player->rideActor;
|
horse = (EnHorse*)player->rideActor;
|
||||||
|
@ -383,7 +383,7 @@ s32 EnHorseGameCheck_UpdateMalonRace(EnHorseGameCheckBase* base, PlayState* play
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
this->result = MALONRACE_SUCCESS;
|
this->result = MALONRACE_SUCCESS;
|
||||||
this->finishTimer = 70;
|
this->finishTimer = 70;
|
||||||
gSaveContext.timer1State = 0xF;
|
gSaveContext.timerState = TIMER_STATE_UP_FREEZE;
|
||||||
} else if ((this->fenceCheck[7] == 1) && !(this->raceFlags & MALONRACE_SECOND_LAP)) {
|
} else if ((this->fenceCheck[7] == 1) && !(this->raceFlags & MALONRACE_SECOND_LAP)) {
|
||||||
this->lapCount = 1;
|
this->lapCount = 1;
|
||||||
this->raceFlags |= MALONRACE_SECOND_LAP;
|
this->raceFlags |= MALONRACE_SECOND_LAP;
|
||||||
|
@ -400,11 +400,11 @@ s32 EnHorseGameCheck_UpdateMalonRace(EnHorseGameCheckBase* base, PlayState* play
|
||||||
this->finishTimer = 30;
|
this->finishTimer = 30;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((gSaveContext.timer1Value >= 180) && (this->raceFlags & MALONRACE_SET_TIMER)) {
|
if ((gSaveContext.timerSeconds >= 180) && (this->raceFlags & MALONRACE_SET_TIMER)) {
|
||||||
gSaveContext.timer1Value = 240;
|
gSaveContext.timerSeconds = 240;
|
||||||
this->result = MALONRACE_TIME_UP;
|
this->result = MALONRACE_TIME_UP;
|
||||||
this->finishTimer = 30;
|
this->finishTimer = 30;
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this->finishTimer > 0) {
|
if (this->finishTimer > 0) {
|
||||||
|
|
|
@ -89,11 +89,11 @@ typedef struct {
|
||||||
|
|
||||||
// these seem to be valid coords on Hyrule field, along with target speeds
|
// these seem to be valid coords on Hyrule field, along with target speeds
|
||||||
static HorsePosSpeed sHorseFieldPositions[] = {
|
static HorsePosSpeed sHorseFieldPositions[] = {
|
||||||
{ {-1682, -500, 12578}, 7 }, { {-3288, -500, 13013}, 7 }, { {-5142, -417, 11630}, 7 },
|
{ { -1682, -500, 12578 }, 7 }, { { -3288, -500, 13013 }, 7 }, { { -5142, -417, 11630 }, 7 },
|
||||||
{ {-5794, -473, 9573}, 7 }, { {-6765, -500, 8364}, 7 }, { {-6619, -393, 6919}, 7 },
|
{ { -5794, -473, 9573 }, 7 }, { { -6765, -500, 8364 }, 7 }, { { -6619, -393, 6919 }, 7 },
|
||||||
{ {-5193, 124, 5433}, 7 }, { {-2970, 2, 4537}, 7 }, { {-2949, -35, 4527}, 7 },
|
{ { -5193, 124, 5433 }, 7 }, { { -2970, 2, 4537 }, 7 }, { { -2949, -35, 4527 }, 7 },
|
||||||
{ {-1907, -47, 2978}, 7 }, { {2488, 294, 3628}, 7 }, { {3089, 378, 4713}, 7 },
|
{ { -1907, -47, 2978 }, 7 }, { { 2488, 294, 3628 }, 7 }, { { 3089, 378, 4713 }, 7 },
|
||||||
{ {1614, -261, 7596}, 7 }, { {754, -187, 9295}, 7 },
|
{ { 1614, -261, 7596 }, 7 }, { { 754, -187, 9295 }, 7 },
|
||||||
};
|
};
|
||||||
|
|
||||||
static InitChainEntry sInitChain[] = {
|
static InitChainEntry sInitChain[] = {
|
||||||
|
|
|
@ -126,9 +126,9 @@ void func_80A6E5EC(EnHs* this, PlayState* play) {
|
||||||
|
|
||||||
void func_80A6E630(EnHs* this, PlayState* play) {
|
void func_80A6E630(EnHs* this, PlayState* play) {
|
||||||
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) {
|
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) {
|
||||||
func_80088AA0(180);
|
Interface_SetSubTimer(180);
|
||||||
func_80A6E3A0(this, func_80A6E6B0);
|
func_80A6E3A0(this, func_80A6E6B0);
|
||||||
CLEAR_EVENTINF(EVENTINF_10);
|
CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->unk_2A8 |= 1;
|
this->unk_2A8 |= 1;
|
||||||
|
|
|
@ -437,7 +437,7 @@ void func_80A79BAC(EnIn* this, PlayState* play, s32 index, u32 transitionType) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
AREG(6) = 0;
|
AREG(6) = 0;
|
||||||
}
|
}
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80A79C78(EnIn* this, PlayState* play) {
|
void func_80A79C78(EnIn* this, PlayState* play) {
|
||||||
|
@ -580,7 +580,7 @@ void func_80A79FB0(EnIn* this, PlayState* play) {
|
||||||
this->actor.targetMode = 3;
|
this->actor.targetMode = 3;
|
||||||
EnIn_ChangeAnim(this, ENIN_ANIM_2);
|
EnIn_ChangeAnim(this, ENIN_ANIM_2);
|
||||||
this->actionFunc = func_80A7A568;
|
this->actionFunc = func_80A7A568;
|
||||||
func_80088B34(0x3C);
|
Interface_SetTimer(60);
|
||||||
break;
|
break;
|
||||||
case EVENTINF_HORSES_STATE_3:
|
case EVENTINF_HORSES_STATE_3:
|
||||||
EnIn_ChangeAnim(this, ENIN_ANIM_4);
|
EnIn_ChangeAnim(this, ENIN_ANIM_4);
|
||||||
|
@ -657,12 +657,12 @@ void func_80A7A568(EnIn* this, PlayState* play) {
|
||||||
if (!GET_EVENTCHKINF(EVENTCHKINF_1B) && (player->stateFlags1 & PLAYER_STATE1_23)) {
|
if (!GET_EVENTCHKINF(EVENTCHKINF_1B) && (player->stateFlags1 & PLAYER_STATE1_23)) {
|
||||||
SET_INFTABLE(INFTABLE_AB);
|
SET_INFTABLE(INFTABLE_AB);
|
||||||
}
|
}
|
||||||
if (gSaveContext.timer1State == 10) {
|
if (gSaveContext.timerState == TIMER_STATE_STOP) {
|
||||||
Audio_PlaySfxGeneral(NA_SE_SY_FOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
Audio_PlaySfxGeneral(NA_SE_SY_FOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
func_80A79C78(this, play);
|
func_80A79C78(this, play);
|
||||||
this->actionFunc = func_80A7B024;
|
this->actionFunc = func_80A7B024;
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
} else if (this->unk_308.unk_00 == 2) {
|
} else if (this->unk_308.unk_00 == 2) {
|
||||||
if (play->msgCtx.choiceIndex == 0) {
|
if (play->msgCtx.choiceIndex == 0) {
|
||||||
if (gSaveContext.rupees < 50) {
|
if (gSaveContext.rupees < 50) {
|
||||||
|
@ -929,7 +929,8 @@ void EnIn_Update(Actor* thisx, PlayState* play) {
|
||||||
this->actionFunc(this, play);
|
this->actionFunc(this, play);
|
||||||
if (this->actionFunc != func_80A7A304) {
|
if (this->actionFunc != func_80A7A304) {
|
||||||
func_80A79AB4(this, play);
|
func_80A79AB4(this, play);
|
||||||
if (gSaveContext.timer2Value < 6 && gSaveContext.timer2State != 0 && this->unk_308.unk_00 == 0) {
|
if ((gSaveContext.subTimerSeconds < 6) && (gSaveContext.subTimerState != SUBTIMER_STATE_OFF) &&
|
||||||
|
(this->unk_308.unk_00 == 0)) {
|
||||||
if (Actor_ProcessTalkRequest(&this->actor, play)) {}
|
if (Actor_ProcessTalkRequest(&this->actor, play)) {}
|
||||||
} else {
|
} else {
|
||||||
func_800343CC(play, &this->actor, &this->unk_308.unk_00,
|
func_800343CC(play, &this->actor, &this->unk_308.unk_00,
|
||||||
|
|
|
@ -441,8 +441,8 @@ void EnKz_SetupGetItem(EnKz* this, PlayState* play) {
|
||||||
void EnKz_StartTimer(EnKz* this, PlayState* play) {
|
void EnKz_StartTimer(EnKz* this, PlayState* play) {
|
||||||
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) {
|
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) {
|
||||||
if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_EYEBALL_FROG) {
|
if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_EYEBALL_FROG) {
|
||||||
func_80088AA0(180); // start timer2 with 3 minutes
|
Interface_SetSubTimer(180);
|
||||||
CLEAR_EVENTINF(EVENTINF_10);
|
CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE);
|
||||||
}
|
}
|
||||||
this->unk_1E0.unk_00 = 0;
|
this->unk_1E0.unk_00 = 0;
|
||||||
this->actionFunc = EnKz_Wait;
|
this->actionFunc = EnKz_Wait;
|
||||||
|
|
|
@ -73,39 +73,44 @@ static AnimationFrameCountInfo sAnimationInfo[] = {
|
||||||
|
|
||||||
u16 func_80AA2AA0(PlayState* play, Actor* thisx) {
|
u16 func_80AA2AA0(PlayState* play, Actor* thisx) {
|
||||||
Player* player = GET_PLAYER(play);
|
Player* player = GET_PLAYER(play);
|
||||||
s16* timer1ValuePtr; // weirdness with this necessary to match
|
|
||||||
|
|
||||||
if (!GET_INFTABLE(INFTABLE_B8)) {
|
if (!GET_INFTABLE(INFTABLE_B8)) {
|
||||||
return 0x2000;
|
return 0x2000;
|
||||||
}
|
}
|
||||||
timer1ValuePtr = &gSaveContext.timer1Value;
|
|
||||||
if (GET_EVENTINF(EVENTINF_HORSES_0A)) {
|
if (GET_EVENTINF(EVENTINF_HORSES_0A)) {
|
||||||
gSaveContext.timer1Value = gSaveContext.timer1Value;
|
gSaveContext.timerSeconds = gSaveContext.timerSeconds;
|
||||||
thisx->flags |= ACTOR_FLAG_16;
|
thisx->flags |= ACTOR_FLAG_16;
|
||||||
if (gSaveContext.timer1Value >= 0xD3) {
|
|
||||||
|
if (((void)0, gSaveContext.timerSeconds) > 210) {
|
||||||
return 0x208E;
|
return 0x208E;
|
||||||
}
|
}
|
||||||
if ((HIGH_SCORE(HS_HORSE_RACE) == 0) || (HIGH_SCORE(HS_HORSE_RACE) >= 0xB4)) {
|
|
||||||
HIGH_SCORE(HS_HORSE_RACE) = 0xB4;
|
if ((HIGH_SCORE(HS_HORSE_RACE) == 0) || (HIGH_SCORE(HS_HORSE_RACE) >= 180)) {
|
||||||
gSaveContext.timer1Value = *timer1ValuePtr;
|
HIGH_SCORE(HS_HORSE_RACE) = 180;
|
||||||
}
|
}
|
||||||
if (!GET_EVENTCHKINF(EVENTCHKINF_1E) && (gSaveContext.timer1Value < 0x32)) {
|
|
||||||
|
if (!GET_EVENTCHKINF(EVENTCHKINF_1E) && (((void)0, gSaveContext.timerSeconds) < 50)) {
|
||||||
return 0x208F;
|
return 0x208F;
|
||||||
} else if (gSaveContext.timer1Value < HIGH_SCORE(HS_HORSE_RACE)) {
|
|
||||||
return 0x2012;
|
|
||||||
} else {
|
|
||||||
return 0x2004;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (HIGH_SCORE(HS_HORSE_RACE) > ((void)0, gSaveContext.timerSeconds)) {
|
||||||
|
return 0x2012;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0x2004;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(player->stateFlags1 & PLAYER_STATE1_23) &&
|
if (!(player->stateFlags1 & PLAYER_STATE1_23) &&
|
||||||
(Actor_FindNearby(play, thisx, ACTOR_EN_HORSE, 1, 1200.0f) == NULL)) {
|
(Actor_FindNearby(play, thisx, ACTOR_EN_HORSE, 1, 1200.0f) == NULL)) {
|
||||||
return 0x2001;
|
return 0x2001;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GET_INFTABLE(INFTABLE_B9)) {
|
if (!GET_INFTABLE(INFTABLE_B9)) {
|
||||||
return 0x2002;
|
return 0x2002;
|
||||||
} else {
|
|
||||||
return 0x2003;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0x2003;
|
||||||
}
|
}
|
||||||
|
|
||||||
s16 func_80AA2BD4(PlayState* play, Actor* thisx) {
|
s16 func_80AA2BD4(PlayState* play, Actor* thisx) {
|
||||||
|
@ -119,7 +124,7 @@ s16 func_80AA2BD4(PlayState* play, Actor* thisx) {
|
||||||
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
|
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
|
||||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||||
SET_EVENTINF(EVENTINF_HORSES_0A);
|
SET_EVENTINF(EVENTINF_HORSES_0A);
|
||||||
gSaveContext.timer1State = 0xF;
|
gSaveContext.timerState = TIMER_STATE_UP_FREEZE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TEXT_STATE_CHOICE:
|
case TEXT_STATE_CHOICE:
|
||||||
|
@ -147,15 +152,15 @@ s16 func_80AA2BD4(PlayState* play, Actor* thisx) {
|
||||||
FALLTHROUGH;
|
FALLTHROUGH;
|
||||||
case 0x2004:
|
case 0x2004:
|
||||||
case 0x2012:
|
case 0x2012:
|
||||||
if (HIGH_SCORE(HS_HORSE_RACE) > gSaveContext.timer1Value) {
|
if (HIGH_SCORE(HS_HORSE_RACE) > gSaveContext.timerSeconds) {
|
||||||
HIGH_SCORE(HS_HORSE_RACE) = gSaveContext.timer1Value;
|
HIGH_SCORE(HS_HORSE_RACE) = gSaveContext.timerSeconds;
|
||||||
}
|
}
|
||||||
FALLTHROUGH;
|
FALLTHROUGH;
|
||||||
case 0x208E:
|
case 0x208E:
|
||||||
CLEAR_EVENTINF(EVENTINF_HORSES_0A);
|
CLEAR_EVENTINF(EVENTINF_HORSES_0A);
|
||||||
thisx->flags &= ~ACTOR_FLAG_16;
|
thisx->flags &= ~ACTOR_FLAG_16;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
gSaveContext.timer1State = 0xA;
|
gSaveContext.timerState = TIMER_STATE_STOP;
|
||||||
break;
|
break;
|
||||||
case 0x2002:
|
case 0x2002:
|
||||||
SET_INFTABLE(INFTABLE_B9);
|
SET_INFTABLE(INFTABLE_B9);
|
||||||
|
|
|
@ -92,8 +92,8 @@ void func_80AACA94(EnMk* this, PlayState* play) {
|
||||||
if (Actor_HasParent(&this->actor, play) != 0) {
|
if (Actor_HasParent(&this->actor, play) != 0) {
|
||||||
this->actor.parent = NULL;
|
this->actor.parent = NULL;
|
||||||
this->actionFunc = func_80AACA40;
|
this->actionFunc = func_80AACA40;
|
||||||
func_80088AA0(240);
|
Interface_SetSubTimer(240);
|
||||||
CLEAR_EVENTINF(EVENTINF_10);
|
CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE);
|
||||||
} else {
|
} else {
|
||||||
func_8002F434(&this->actor, play, GI_EYE_DROPS, 10000.0f, 50.0f);
|
func_8002F434(&this->actor, play, GI_EYE_DROPS, 10000.0f, 50.0f);
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,7 @@ void EnMk_Wait(EnMk* this, PlayState* play) {
|
||||||
Animation_Change(&this->skelAnime, &object_mk_Anim_000368, 1.0f, 0.0f,
|
Animation_Change(&this->skelAnime, &object_mk_Anim_000368, 1.0f, 0.0f,
|
||||||
Animation_GetLastFrame(&object_mk_Anim_000368), ANIMMODE_ONCE, -4.0f);
|
Animation_GetLastFrame(&object_mk_Anim_000368), ANIMMODE_ONCE, -4.0f);
|
||||||
this->flags &= ~2;
|
this->flags &= ~2;
|
||||||
gSaveContext.timer2State = 0;
|
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
|
||||||
func_80078884(NA_SE_SY_TRE_BOX_APPEAR);
|
func_80078884(NA_SE_SY_TRE_BOX_APPEAR);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -103,20 +103,20 @@ void func_80AAEF70(EnMm2* this, PlayState* play) {
|
||||||
if (!GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) {
|
if (!GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) {
|
||||||
this->actor.textId = 0x6086;
|
this->actor.textId = 0x6086;
|
||||||
} else if (GET_INFTABLE(INFTABLE_17F)) {
|
} else if (GET_INFTABLE(INFTABLE_17F)) {
|
||||||
if (GET_EVENTINF(EVENTINF_10)) {
|
if (GET_EVENTINF(EVENTINF_MARATHON_ACTIVE)) {
|
||||||
this->actor.textId = 0x6082;
|
this->actor.textId = 0x6082;
|
||||||
} else if (gSaveContext.timer2State != 0) {
|
} else if (gSaveContext.subTimerState != SUBTIMER_STATE_OFF) {
|
||||||
this->actor.textId = 0x6076;
|
this->actor.textId = 0x6076;
|
||||||
} else if (HIGH_SCORE(HS_MARATHON) == 158) {
|
} else if (HIGH_SCORE(HS_MARATHON) == 158) {
|
||||||
this->actor.textId = 0x607E;
|
this->actor.textId = 0x607E;
|
||||||
} else {
|
} else {
|
||||||
this->actor.textId = 0x6081;
|
this->actor.textId = 0x6081;
|
||||||
}
|
}
|
||||||
} else if (gSaveContext.timer2State) {
|
} else if (gSaveContext.subTimerState != SUBTIMER_STATE_OFF) {
|
||||||
this->actor.textId = 0x6076;
|
this->actor.textId = 0x6076;
|
||||||
} else {
|
} else {
|
||||||
this->actor.textId = 0x607D;
|
this->actor.textId = 0x607D;
|
||||||
CLEAR_EVENTINF(EVENTINF_10);
|
CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE);
|
||||||
HIGH_SCORE(HS_MARATHON) = 158;
|
HIGH_SCORE(HS_MARATHON) = 158;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ void EnMm2_Init(Actor* thisx, PlayState* play2) {
|
||||||
Actor_Kill(&this->actor);
|
Actor_Kill(&this->actor);
|
||||||
}
|
}
|
||||||
if (this->actor.params == 1) {
|
if (this->actor.params == 1) {
|
||||||
if (!GET_INFTABLE(INFTABLE_17F) || !GET_EVENTINF(EVENTINF_10)) {
|
if (!GET_INFTABLE(INFTABLE_17F) || !GET_EVENTINF(EVENTINF_MARATHON_ACTIVE)) {
|
||||||
osSyncPrintf(VT_FGCOL(CYAN) " マラソン 開始されていない \n" VT_RST "\n");
|
osSyncPrintf(VT_FGCOL(CYAN) " マラソン 開始されていない \n" VT_RST "\n");
|
||||||
Actor_Kill(&this->actor);
|
Actor_Kill(&this->actor);
|
||||||
}
|
}
|
||||||
|
@ -193,8 +193,8 @@ void func_80AAF330(EnMm2* this, PlayState* play) {
|
||||||
if (!(this->unk_1F4 & 2)) {
|
if (!(this->unk_1F4 & 2)) {
|
||||||
Message_CloseTextbox(play);
|
Message_CloseTextbox(play);
|
||||||
}
|
}
|
||||||
gSaveContext.timer2State = 0;
|
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
|
||||||
CLEAR_EVENTINF(EVENTINF_10);
|
CLEAR_EVENTINF(EVENTINF_MARATHON_ACTIVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ void func_80AAF3C0(EnMm2* this, PlayState* play) {
|
||||||
case 0:
|
case 0:
|
||||||
Message_ContinueTextbox(play, 0x607F);
|
Message_ContinueTextbox(play, 0x607F);
|
||||||
this->actor.textId = 0x607F;
|
this->actor.textId = 0x607F;
|
||||||
SET_EVENTINF(EVENTINF_10);
|
SET_EVENTINF(EVENTINF_MARATHON_ACTIVE);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
Message_ContinueTextbox(play, 0x6080);
|
Message_ContinueTextbox(play, 0x6080);
|
||||||
|
@ -219,14 +219,14 @@ void func_80AAF3C0(EnMm2* this, PlayState* play) {
|
||||||
if (this->unk_1F4 & 4) {
|
if (this->unk_1F4 & 4) {
|
||||||
if (1) {}
|
if (1) {}
|
||||||
this->unk_1F4 &= ~4;
|
this->unk_1F4 &= ~4;
|
||||||
HIGH_SCORE(HS_MARATHON) += 1;
|
HIGH_SCORE(HS_MARATHON)++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case 0x6081:
|
case 0x6081:
|
||||||
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
|
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
|
||||||
this->unk_1F4 |= 4;
|
this->unk_1F4 |= 4;
|
||||||
HIGH_SCORE(HS_MARATHON) -= 1;
|
HIGH_SCORE(HS_MARATHON)--;
|
||||||
Message_ContinueTextbox(play, 0x607E);
|
Message_ContinueTextbox(play, 0x607E);
|
||||||
this->actor.textId = 0x607E;
|
this->actor.textId = 0x607E;
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ void func_80AAF3C0(EnMm2* this, PlayState* play) {
|
||||||
|
|
||||||
if (Actor_TextboxIsClosing(&this->actor, play)) {
|
if (Actor_TextboxIsClosing(&this->actor, play)) {
|
||||||
if (this->actor.textId == 0x607F) {
|
if (this->actor.textId == 0x607F) {
|
||||||
func_80088AA0(0);
|
Interface_SetSubTimer(0);
|
||||||
this->actionFunc = func_80AAF57C;
|
this->actionFunc = func_80AAF57C;
|
||||||
} else {
|
} else {
|
||||||
this->actionFunc = func_80AAF57C;
|
this->actionFunc = func_80AAF57C;
|
||||||
|
@ -266,19 +266,20 @@ void func_80AAF668(EnMm2* this, PlayState* play) {
|
||||||
this->actor.world.rot.y = -0x3E80;
|
this->actor.world.rot.y = -0x3E80;
|
||||||
this->actor.shape.rot.y = this->actor.world.rot.y;
|
this->actor.shape.rot.y = this->actor.world.rot.y;
|
||||||
SkelAnime_Update(&this->skelAnime);
|
SkelAnime_Update(&this->skelAnime);
|
||||||
if (((void)0, gSaveContext.timer2Value) < HIGH_SCORE(HS_MARATHON)) {
|
if (((void)0, gSaveContext.subTimerSeconds) < HIGH_SCORE(HS_MARATHON)) {
|
||||||
this->actor.textId = 0x6085;
|
this->actor.textId = 0x6085;
|
||||||
} else {
|
} else {
|
||||||
this->actor.textId = 0x6084;
|
this->actor.textId = 0x6084;
|
||||||
}
|
}
|
||||||
if (func_80AAF224(this, play, func_80AAF5EC)) {
|
if (func_80AAF224(this, play, func_80AAF5EC)) {
|
||||||
this->unk_1F6 = 0;
|
this->unk_1F6 = 0;
|
||||||
if (((void)0, gSaveContext.timer2Value) < HIGH_SCORE(HS_MARATHON)) {
|
if (((void)0, gSaveContext.subTimerSeconds) < HIGH_SCORE(HS_MARATHON)) {
|
||||||
HIGH_SCORE(HS_MARATHON) = gSaveContext.timer2Value;
|
HIGH_SCORE(HS_MARATHON) = gSaveContext.subTimerSeconds;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG_HEX("((z_common_data.event_inf[1]) & (0x0001))", GET_EVENTINF(EVENTINF_10), "../z_en_mm2.c", 541);
|
LOG_HEX("((z_common_data.event_inf[1]) & (0x0001))", GET_EVENTINF(EVENTINF_MARATHON_ACTIVE), "../z_en_mm2.c",
|
||||||
if (!GET_EVENTINF(EVENTINF_10)) {
|
541);
|
||||||
|
if (!GET_EVENTINF(EVENTINF_MARATHON_ACTIVE)) {
|
||||||
this->unk_1F4 |= 2;
|
this->unk_1F4 |= 2;
|
||||||
this->unk_1F4 &= ~1;
|
this->unk_1F4 &= ~1;
|
||||||
EnMm2_ChangeAnim(this, RM2_ANIM_STAND, &this->previousAnimation);
|
EnMm2_ChangeAnim(this, RM2_ANIM_STAND, &this->previousAnimation);
|
||||||
|
|
|
@ -137,7 +137,7 @@ void EnPoRelay_SetupRace(EnPoRelay* this) {
|
||||||
|
|
||||||
EnPoRelay_Vec3sToVec3f(&vec, &D_80AD8C30[this->pathIndex]);
|
EnPoRelay_Vec3sToVec3f(&vec, &D_80AD8C30[this->pathIndex]);
|
||||||
this->actionTimer = ((s16)(this->actor.shape.rot.y - this->actor.world.rot.y - 0x8000) >> 0xB) % 32U;
|
this->actionTimer = ((s16)(this->actor.shape.rot.y - this->actor.world.rot.y - 0x8000) >> 0xB) % 32U;
|
||||||
func_80088B34(0);
|
Interface_SetTimer(0);
|
||||||
this->hookshotSlotFull = INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE;
|
this->hookshotSlotFull = INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE;
|
||||||
this->unk_19A = Actor_WorldYawTowardPoint(&this->actor, &vec);
|
this->unk_19A = Actor_WorldYawTowardPoint(&this->actor, &vec);
|
||||||
this->actor.flags |= ACTOR_FLAG_27;
|
this->actor.flags |= ACTOR_FLAG_27;
|
||||||
|
@ -258,7 +258,7 @@ void EnPoRelay_EndRace(EnPoRelay* this, PlayState* play) {
|
||||||
this->actionFunc = EnPoRelay_Talk2;
|
this->actionFunc = EnPoRelay_Talk2;
|
||||||
} else if (play->roomCtx.curRoom.num == 5) {
|
} else if (play->roomCtx.curRoom.num == 5) {
|
||||||
Actor_Kill(&this->actor);
|
Actor_Kill(&this->actor);
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
} else if (Actor_IsFacingAndNearPlayer(&this->actor, 150.0f, 0x3000)) {
|
} else if (Actor_IsFacingAndNearPlayer(&this->actor, 150.0f, 0x3000)) {
|
||||||
this->actor.textId = this->textId;
|
this->actor.textId = this->textId;
|
||||||
func_8002F2CC(&this->actor, play, 250.0f);
|
func_8002F2CC(&this->actor, play, 250.0f);
|
||||||
|
@ -279,7 +279,7 @@ void EnPoRelay_Talk2(EnPoRelay* this, PlayState* play) {
|
||||||
Message_ContinueTextbox(play, this->actor.textId);
|
Message_ContinueTextbox(play, this->actor.textId);
|
||||||
}
|
}
|
||||||
} else if (Actor_TextboxIsClosing(&this->actor, play)) {
|
} else if (Actor_TextboxIsClosing(&this->actor, play)) {
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
this->actionTimer = 0;
|
this->actionTimer = 0;
|
||||||
this->actionFunc = EnPoRelay_DisappearAndReward;
|
this->actionFunc = EnPoRelay_DisappearAndReward;
|
||||||
}
|
}
|
||||||
|
@ -326,17 +326,17 @@ void EnPoRelay_DisappearAndReward(EnPoRelay* this, PlayState* play) {
|
||||||
sp60.x = this->actor.world.pos.x;
|
sp60.x = this->actor.world.pos.x;
|
||||||
sp60.y = this->actor.floorHeight;
|
sp60.y = this->actor.floorHeight;
|
||||||
sp60.z = this->actor.world.pos.z;
|
sp60.z = this->actor.world.pos.z;
|
||||||
if (gSaveContext.timer1Value < HIGH_SCORE(HS_DAMPE_RACE)) {
|
if (gSaveContext.timerSeconds < HIGH_SCORE(HS_DAMPE_RACE)) {
|
||||||
HIGH_SCORE(HS_DAMPE_RACE) = gSaveContext.timer1Value;
|
HIGH_SCORE(HS_DAMPE_RACE) = gSaveContext.timerSeconds;
|
||||||
}
|
}
|
||||||
if (Flags_GetCollectible(play, this->actor.params) == 0 && gSaveContext.timer1Value <= 60) {
|
if (!Flags_GetCollectible(play, this->actor.params) && (gSaveContext.timerSeconds <= 60)) {
|
||||||
Item_DropCollectible2(play, &sp60, (this->actor.params << 8) + (0x4000 | ITEM00_HEART_PIECE));
|
Item_DropCollectible2(play, &sp60, (this->actor.params << 8) + (0x4000 | ITEM00_HEART_PIECE));
|
||||||
} else {
|
} else {
|
||||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ITEM00, sp60.x, sp60.y, sp60.z, 0, 0, 0, 2);
|
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ITEM00, sp60.x, sp60.y, sp60.z, 0, 0, 0, 2);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Flags_SetTempClear(play, 4);
|
Flags_SetTempClear(play, 4);
|
||||||
HIGH_SCORE(HS_DAMPE_RACE) = gSaveContext.timer1Value;
|
HIGH_SCORE(HS_DAMPE_RACE) = gSaveContext.timerSeconds;
|
||||||
}
|
}
|
||||||
Actor_Kill(&this->actor);
|
Actor_Kill(&this->actor);
|
||||||
}
|
}
|
||||||
|
|
|
@ -489,7 +489,7 @@ void func_80B12460(EnSyatekiNiw* this, PlayState* play) {
|
||||||
|
|
||||||
void func_80B128D8(EnSyatekiNiw* this, PlayState* play) {
|
void func_80B128D8(EnSyatekiNiw* this, PlayState* play) {
|
||||||
if (this->unk_25E == 1) {
|
if (this->unk_25E == 1) {
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -278,7 +278,7 @@ void EnTa_Destroy(Actor* thisx, PlayState* play) {
|
||||||
|
|
||||||
if (this->actor.params != ENTA_IN_KAKARIKO && this->actor.params != ENTA_RETURNED_FROM_KAKARIKO &&
|
if (this->actor.params != ENTA_IN_KAKARIKO && this->actor.params != ENTA_RETURNED_FROM_KAKARIKO &&
|
||||||
play->sceneId == SCENE_SOUKO) {
|
play->sceneId == SCENE_SOUKO) {
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->stateFlags & TALON_STATE_FLAG_RESTORE_BGM_ON_DESTROY) {
|
if (this->stateFlags & TALON_STATE_FLAG_RESTORE_BGM_ON_DESTROY) {
|
||||||
|
@ -756,7 +756,7 @@ void EnTa_RunCuccoGame(EnTa* this, PlayState* play) {
|
||||||
switch (EnTa_GetSuperCuccosCount(this, play)) {
|
switch (EnTa_GetSuperCuccosCount(this, play)) {
|
||||||
case 1:
|
case 1:
|
||||||
// Last cucco found, end the game
|
// Last cucco found, end the game
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
func_8002DF54(play, &this->actor, 1);
|
func_8002DF54(play, &this->actor, 1);
|
||||||
|
|
||||||
Message_StartTextbox(play, 0x2084, &this->actor);
|
Message_StartTextbox(play, 0x2084, &this->actor);
|
||||||
|
@ -796,15 +796,15 @@ void EnTa_RunCuccoGame(EnTa* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gSaveContext.timer1Value == 10) {
|
if (gSaveContext.timerSeconds == 10) {
|
||||||
Audio_SetFastTempoForTimedMinigame();
|
Audio_SetFastTempoForTimedMinigame();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gSaveContext.timer1Value == 0 && !Play_InCsMode(play)) {
|
if ((gSaveContext.timerSeconds == 0) && !Play_InCsMode(play)) {
|
||||||
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0);
|
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0);
|
||||||
this->stateFlags &= ~TALON_STATE_FLAG_RESTORE_BGM_ON_DESTROY;
|
this->stateFlags &= ~TALON_STATE_FLAG_RESTORE_BGM_ON_DESTROY;
|
||||||
func_80078884(NA_SE_SY_FOUND);
|
func_80078884(NA_SE_SY_FOUND);
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
func_8002DF54(play, &this->actor, 1);
|
func_8002DF54(play, &this->actor, 1);
|
||||||
|
|
||||||
// Time's up text
|
// Time's up text
|
||||||
|
@ -881,7 +881,7 @@ void EnTa_StartingCuccoGame3(EnTa* this, PlayState* play) {
|
||||||
Animation_GetLastFrame(&gTalonSitHandsUpAnim), ANIMMODE_ONCE, 0.0f);
|
Animation_GetLastFrame(&gTalonSitHandsUpAnim), ANIMMODE_ONCE, 0.0f);
|
||||||
this->timer = 50;
|
this->timer = 50;
|
||||||
|
|
||||||
func_80088B34(30);
|
Interface_SetTimer(30);
|
||||||
func_800F5ACC(NA_BGM_TIMED_MINI_GAME);
|
func_800F5ACC(NA_BGM_TIMED_MINI_GAME);
|
||||||
this->stateFlags |= TALON_STATE_FLAG_RESTORE_BGM_ON_DESTROY;
|
this->stateFlags |= TALON_STATE_FLAG_RESTORE_BGM_ON_DESTROY;
|
||||||
Message_CloseTextbox(play);
|
Message_CloseTextbox(play);
|
||||||
|
|
|
@ -1607,7 +1607,7 @@ void EnZl2_Init(Actor* thisx, PlayState* play) {
|
||||||
Audio_SetSfxBanksMute(0x6F);
|
Audio_SetSfxBanksMute(0x6F);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
gSaveContext.timer2State = 0;
|
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2482,7 +2482,7 @@ s32 func_80B59698(EnZl3* this, PlayState* play) {
|
||||||
u8 spawn = play->spawn;
|
u8 spawn = play->spawn;
|
||||||
|
|
||||||
if ((func_80B54DB4(this) == 0x20) && (spawn == 0) &&
|
if ((func_80B54DB4(this) == 0x20) && (spawn == 0) &&
|
||||||
((gSaveContext.timer2Value <= 0) || (gSaveContext.timer2State == 0))) {
|
((gSaveContext.subTimerSeconds <= 0) || (gSaveContext.subTimerState == SUBTIMER_STATE_OFF))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2497,7 +2497,7 @@ s32 func_80B59768(EnZl3* this, PlayState* play) {
|
||||||
if (cond) {
|
if (cond) {
|
||||||
u8 spawn = play->spawn;
|
u8 spawn = play->spawn;
|
||||||
|
|
||||||
if ((func_80B54DB4(this) == 0x20) && (spawn == 0) && (gSaveContext.timer2Value <= 0)) {
|
if ((func_80B54DB4(this) == 0x20) && (spawn == 0) && (gSaveContext.subTimerSeconds <= 0)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2524,7 +2524,7 @@ void func_80B59828(EnZl3* this, PlayState* play) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (func_80B59698(this, play) != 0) {
|
if (func_80B59698(this, play) != 0) {
|
||||||
func_80088AA0(180);
|
Interface_SetSubTimer(180);
|
||||||
func_80B53468();
|
func_80B53468();
|
||||||
gSaveContext.healthAccumulator = 320;
|
gSaveContext.healthAccumulator = 320;
|
||||||
Magic_Fill(play);
|
Magic_Fill(play);
|
||||||
|
@ -2569,7 +2569,7 @@ void func_80B59AD0(EnZl3* this, PlayState* play) {
|
||||||
Actor* thisx = &this->actor; // unused, necessary to use 'this' first to fix regalloc
|
Actor* thisx = &this->actor; // unused, necessary to use 'this' first to fix regalloc
|
||||||
|
|
||||||
Flags_SetSwitch(play, 0x36);
|
Flags_SetSwitch(play, 0x36);
|
||||||
func_80088AA0(180);
|
Interface_SetSubTimer(180);
|
||||||
func_80B54EA4(this, play);
|
func_80B54EA4(this, play);
|
||||||
func_80B53614(this, play);
|
func_80B53614(this, play);
|
||||||
CLEAR_EVENTCHKINF(EVENTCHKINF_C7);
|
CLEAR_EVENTCHKINF(EVENTCHKINF_C7);
|
||||||
|
@ -2657,7 +2657,7 @@ void EnZl3_Init(Actor* thisx, PlayState* play) {
|
||||||
|
|
||||||
switch (func_80B54DD4(this)) {
|
switch (func_80B54DD4(this)) {
|
||||||
case 1:
|
case 1:
|
||||||
gSaveContext.timer2State = 0;
|
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
func_80B59A80(this, play);
|
func_80B59A80(this, play);
|
||||||
|
|
|
@ -49,14 +49,14 @@ void ObjRoomtimer_Init(Actor* thisx, PlayState* play) {
|
||||||
void ObjRoomtimer_Destroy(Actor* thisx, PlayState* play) {
|
void ObjRoomtimer_Destroy(Actor* thisx, PlayState* play) {
|
||||||
ObjRoomtimer* this = (ObjRoomtimer*)thisx;
|
ObjRoomtimer* this = (ObjRoomtimer*)thisx;
|
||||||
|
|
||||||
if ((this->actor.params != 0x3FF) && (gSaveContext.timer1Value > 0)) {
|
if ((this->actor.params != 0x3FF) && (gSaveContext.timerSeconds > 0)) {
|
||||||
gSaveContext.timer1State = 10;
|
gSaveContext.timerState = TIMER_STATE_STOP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80B9D054(ObjRoomtimer* this, PlayState* play) {
|
void func_80B9D054(ObjRoomtimer* this, PlayState* play) {
|
||||||
if (this->actor.params != 0x3FF) {
|
if (this->actor.params != 0x3FF) {
|
||||||
func_80088B34(this->actor.params);
|
Interface_SetTimer(this->actor.params);
|
||||||
}
|
}
|
||||||
|
|
||||||
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
|
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
|
||||||
|
@ -66,19 +66,20 @@ void func_80B9D054(ObjRoomtimer* this, PlayState* play) {
|
||||||
void func_80B9D0B0(ObjRoomtimer* this, PlayState* play) {
|
void func_80B9D0B0(ObjRoomtimer* this, PlayState* play) {
|
||||||
if (Flags_GetTempClear(play, this->actor.room)) {
|
if (Flags_GetTempClear(play, this->actor.room)) {
|
||||||
if (this->actor.params != 0x3FF) {
|
if (this->actor.params != 0x3FF) {
|
||||||
gSaveContext.timer1State = 10;
|
gSaveContext.timerState = TIMER_STATE_STOP;
|
||||||
}
|
}
|
||||||
Flags_SetClear(play, this->actor.room);
|
Flags_SetClear(play, this->actor.room);
|
||||||
Flags_SetSwitch(play, this->switchFlag);
|
Flags_SetSwitch(play, this->switchFlag);
|
||||||
func_80078884(NA_SE_SY_CORRECT_CHIME);
|
func_80078884(NA_SE_SY_CORRECT_CHIME);
|
||||||
Actor_Kill(&this->actor);
|
Actor_Kill(&this->actor);
|
||||||
} else {
|
return;
|
||||||
if ((this->actor.params != 0x3FF) && (gSaveContext.timer1Value == 0)) {
|
}
|
||||||
Audio_PlaySfxGeneral(NA_SE_OC_ABYSS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
if ((this->actor.params != 0x3FF) && (gSaveContext.timerSeconds == 0)) {
|
||||||
Play_TriggerVoidOut(play);
|
Audio_PlaySfxGeneral(NA_SE_OC_ABYSS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||||
Actor_Kill(&this->actor);
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
}
|
Play_TriggerVoidOut(play);
|
||||||
|
Actor_Kill(&this->actor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2411,7 +2411,7 @@ void func_80834298(Player* this, PlayState* play) {
|
||||||
((this->heldItemAction == this->itemAction) || (this->stateFlags1 & PLAYER_STATE1_22)) &&
|
((this->heldItemAction == this->itemAction) || (this->stateFlags1 & PLAYER_STATE1_22)) &&
|
||||||
(gSaveContext.health != 0) && (play->csCtx.state == CS_STATE_IDLE) && (this->csMode == 0) &&
|
(gSaveContext.health != 0) && (play->csCtx.state == CS_STATE_IDLE) && (this->csMode == 0) &&
|
||||||
(play->shootingGalleryStatus == 0) && (play->activeCamId == CAM_ID_MAIN) &&
|
(play->shootingGalleryStatus == 0) && (play->activeCamId == CAM_ID_MAIN) &&
|
||||||
(play->transitionTrigger != TRANS_TRIGGER_START) && (gSaveContext.timer1State != 10)) {
|
(play->transitionTrigger != TRANS_TRIGGER_START) && (gSaveContext.timerState != TIMER_STATE_STOP)) {
|
||||||
func_80833DF8(this, play);
|
func_80833DF8(this, play);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6056,11 +6056,11 @@ void func_8083D36C(PlayState* play, Player* this) {
|
||||||
void func_8083D53C(PlayState* play, Player* this) {
|
void func_8083D53C(PlayState* play, Player* this) {
|
||||||
if (this->actor.yDistToWater < this->ageProperties->unk_2C) {
|
if (this->actor.yDistToWater < this->ageProperties->unk_2C) {
|
||||||
Audio_SetBaseFilter(0);
|
Audio_SetBaseFilter(0);
|
||||||
this->unk_840 = 0;
|
this->underwaterTimer = 0;
|
||||||
} else {
|
} else {
|
||||||
Audio_SetBaseFilter(0x20);
|
Audio_SetBaseFilter(0x20);
|
||||||
if (this->unk_840 < 300) {
|
if (this->underwaterTimer < 300) {
|
||||||
this->unk_840++;
|
this->underwaterTimer++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13394,7 +13394,7 @@ void func_8085063C(Player* this, PlayState* play) {
|
||||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||||
play->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_TOP].entranceIndex;
|
play->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_TOP].entranceIndex;
|
||||||
play->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
|
play->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
|
||||||
func_80088AF0(play);
|
Interface_SetSubTimerToFinalSecond(play);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1463,8 +1463,8 @@ void FileSelect_LoadGame(GameState* thisx) {
|
||||||
gSaveContext.natureAmbienceId = 0xFF;
|
gSaveContext.natureAmbienceId = 0xFF;
|
||||||
gSaveContext.showTitleCard = true;
|
gSaveContext.showTitleCard = true;
|
||||||
gSaveContext.dogParams = 0;
|
gSaveContext.dogParams = 0;
|
||||||
gSaveContext.timer1State = 0;
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||||
gSaveContext.timer2State = 0;
|
gSaveContext.subTimerState = SUBTIMER_STATE_OFF;
|
||||||
gSaveContext.eventInf[0] = 0;
|
gSaveContext.eventInf[0] = 0;
|
||||||
gSaveContext.eventInf[1] = 0;
|
gSaveContext.eventInf[1] = 0;
|
||||||
gSaveContext.eventInf[2] = 0;
|
gSaveContext.eventInf[2] = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue