diff --git a/include/z64save.h b/include/z64save.h index 71cb6428b1..ca0625ad27 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -603,8 +603,15 @@ typedef enum { #define WEEKEVENTREG_08_10 PACK_WEEKEVENTREG_FLAG(8, 0x10) #define WEEKEVENTREG_RECEIVED_DOGGY_RACETRACK_HEART_PIECE PACK_WEEKEVENTREG_FLAG(8, 0x20) -// Related to final hours -#define WEEKEVENTREG_08_40 PACK_WEEKEVENTREG_FLAG(8, 0x40) +// This is set under three circumstances: +// 1. The player watches the cutscene of the Clock Tower opening. +// 2. The player sees the Clock Tower opening outside of a cutscene. After the first cycle, this +// can be seen in Termina Field or in North, East, or West Clock Town. +// 3. The player enters Termina Field or North, South, East, or West Clock Town any time after +// midnight on the Final Day. +// Thus, it is possible for the player to be in the final six hours and still have this unset; all +// the player needs to do is avoid certain areas. +#define WEEKEVENTREG_CLOCK_TOWER_OPENED PACK_WEEKEVENTREG_FLAG(8, 0x40) #define WEEKEVENTREG_08_80 PACK_WEEKEVENTREG_FLAG(8, 0x80) #define WEEKEVENTREG_09_01 PACK_WEEKEVENTREG_FLAG(9, 0x01) diff --git a/src/code/z_elf_message.c b/src/code/z_elf_message.c index 1b005443db..e2b54a9bf4 100644 --- a/src/code/z_elf_message.c +++ b/src/code/z_elf_message.c @@ -26,7 +26,7 @@ u16 QuestHint_GetTatlTextId(PlayState* play) { } if (CHECK_WEEKEVENTREG(WEEKEVENTREG_79_10)) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_08_40)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLOCK_TOWER_OPENED)) { return 0; } diff --git a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c index b9bf702b2b..afb9796a9c 100644 --- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c +++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c @@ -1173,7 +1173,7 @@ void DmStk_StartTelescopeCutscene(DmStk* this, PlayState* play) { if (gSaveContext.save.day < 3) { csId = dayOneAndTwoCsId; - } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_08_40) || + } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLOCK_TOWER_OPENED) || ((CURRENT_DAY == 3) && (gSaveContext.save.time < CLOCK_TIME(6, 0)))) { csId = finalHoursCsId; } else { diff --git a/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c b/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c index 89fbd9f6b3..7304be4428 100644 --- a/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c +++ b/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c @@ -183,7 +183,7 @@ void ElfMsg6_Init(Actor* thisx, PlayState* play) { return; } - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_08_40)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLOCK_TOWER_OPENED)) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_88_20)) { Actor_Kill(&this->actor); return; @@ -276,7 +276,7 @@ void func_80BA1CF8(ElfMsg6* this, PlayState* play) { return; } - if ((this->actor.textId == 0x224) && CHECK_WEEKEVENTREG(WEEKEVENTREG_08_40)) { + if ((this->actor.textId == 0x224) && CHECK_WEEKEVENTREG(WEEKEVENTREG_CLOCK_TOWER_OPENED)) { this->actor.textId = 0x25B; } else if (func_80BA1C00(this) && (player->actor.speed > 1.0f)) { player->tatlTextId = -this->actor.textId; diff --git a/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c b/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c index dfcd1bad0f..9b569f8032 100644 --- a/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c +++ b/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c @@ -56,7 +56,7 @@ void EnTimeTag_Init(Actor* thisx, PlayState* play) { switch (TIMETAG_GET_TYPE(&this->actor)) { case TIMETAG_KICKOUT_FINAL_HOURS: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_08_40) || (CURRENT_DAY != 3)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLOCK_TOWER_OPENED) || (CURRENT_DAY != 3)) { Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c index 170eb35ceb..73cefa0f20 100644 --- a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c +++ b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c @@ -128,7 +128,7 @@ void ObjTokeidai_ExteriorGear_Init(ObjTokeidai* this, PlayState* play) { this->actionFunc = ObjTokeidai_ExteriorGear_OpenedIdle; this->actor.world.pos.y += this->actor.scale.y * 1900.0f; this->actor.shape.yOffset = 1500.0f; - SET_WEEKEVENTREG(WEEKEVENTREG_08_40); + SET_WEEKEVENTREG(WEEKEVENTREG_CLOCK_TOWER_OPENED); } else { this->actionFunc = ObjTokeidai_ExteriorGear_Idle; } @@ -444,7 +444,7 @@ void ObjTokeidai_TerminaFieldWalls_Idle(ObjTokeidai* this, PlayState* play) { void ObjTokeidai_TowerOpening_EndCutscene(ObjTokeidai* this, PlayState* play) { if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_132) && (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_132)]->id == 5)) { - SET_WEEKEVENTREG(WEEKEVENTREG_08_40); + SET_WEEKEVENTREG(WEEKEVENTREG_CLOCK_TOWER_OPENED); if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 2) && (play->csCtx.scriptIndex == 0)) || ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 2) && (play->csCtx.scriptIndex == 0))) { Audio_SetCutsceneFlag(false); @@ -593,7 +593,7 @@ void ObjTokeidai_TowerOpening_RaiseTower(ObjTokeidai* this, PlayState* play) { void ObjTokeidai_TowerOpening_Start(ObjTokeidai* this, PlayState* play) { if ((Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_132) && (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_132)]->id == 4)) || - CHECK_WEEKEVENTREG(WEEKEVENTREG_08_40)) { + CHECK_WEEKEVENTREG(WEEKEVENTREG_CLOCK_TOWER_OPENED)) { this->actionFunc = ObjTokeidai_TowerOpening_RaiseTower; } } @@ -616,7 +616,7 @@ void ObjTokeidai_DoNothing(ObjTokeidai* this, PlayState* play) { void ObjTokeidai_StaircaseToRooftop_Idle(ObjTokeidai* this, PlayState* play) { if ((((CURRENT_DAY == 3) && (gSaveContext.save.time < CLOCK_TIME(6, 0))) || (CURRENT_DAY >= 4)) || - CHECK_WEEKEVENTREG(WEEKEVENTREG_08_40)) { + CHECK_WEEKEVENTREG(WEEKEVENTREG_CLOCK_TOWER_OPENED)) { this->actor.draw = ObjTokeidai_Draw; } else { this->actor.draw = NULL; @@ -691,7 +691,7 @@ void ObjTokeidai_TowerClock_Idle(ObjTokeidai* this, PlayState* play) { if ((CURRENT_DAY == 3) && (this->clockHour < 6) && (gSaveContext.save.time < CLOCK_TIME(6, 0))) { this->actor.draw = ObjTokeidai_Clock_Draw; ObjTokeidai_SetupTowerOpening(this); - SET_WEEKEVENTREG(WEEKEVENTREG_08_40); + SET_WEEKEVENTREG(WEEKEVENTREG_CLOCK_TOWER_OPENED); return; } diff --git a/tools/weekeventregconvert.py b/tools/weekeventregconvert.py index ceaa72f50a..45faf5f0eb 100755 --- a/tools/weekeventregconvert.py +++ b/tools/weekeventregconvert.py @@ -74,7 +74,7 @@ weekEventReg = { ( 8 << 8) | 0x08: "WEEKEVENTREG_08_08", ( 8 << 8) | 0x10: "WEEKEVENTREG_08_10", ( 8 << 8) | 0x20: "WEEKEVENTREG_RECEIVED_DOGGY_RACETRACK_HEART_PIECE", - ( 8 << 8) | 0x40: "WEEKEVENTREG_08_40", + ( 8 << 8) | 0x40: "WEEKEVENTREG_CLOCK_TOWER_OPENED", ( 8 << 8) | 0x80: "WEEKEVENTREG_08_80", ( 9 << 8) | 0x01: "WEEKEVENTREG_09_01", ( 9 << 8) | 0x02: "WEEKEVENTREG_09_02",