diff --git a/include/z64save.h b/include/z64save.h index cdd2d62fc50..ecd1dcd9296 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -572,18 +572,38 @@ typedef enum LinkAge { #define EVENTCHKINF_PAID_BACK_BUNNY_HOOD 0x8F // EVENTCHKINF 0x90-0x93 -// carpenters freed from the gerudo -#define EVENTCHKINF_INDEX_CARPENTERS_FREE 9 -#define EVENTCHKINF_CARPENTERS_FREE_SHIFT(n) (0 + (n)) -#define EVENTCHKINF_CARPENTERS_FREE_MASK(n) (1 << EVENTCHKINF_CARPENTERS_FREE_SHIFT(n)) -#define EVENTCHKINF_CARPENTERS_FREE(n) ((EVENTCHKINF_INDEX_CARPENTERS_FREE << 4) | EVENTCHKINF_CARPENTERS_FREE_SHIFT(n)) -#define EVENTCHKINF_CARPENTERS_FREE_MASK_ALL (\ - EVENTCHKINF_CARPENTERS_FREE_MASK(0) \ - | EVENTCHKINF_CARPENTERS_FREE_MASK(1) \ - | EVENTCHKINF_CARPENTERS_FREE_MASK(2) \ - | EVENTCHKINF_CARPENTERS_FREE_MASK(3) ) -#define GET_EVENTCHKINF_CARPENTERS_FREE_ALL() \ - CHECK_FLAG_ALL(gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_FREE], EVENTCHKINF_CARPENTERS_FREE_MASK_ALL) +// Carpenters rescued from Gerudo Fortress +#define EVENTCHKINF_INDEX_CARPENTERS_RESCUED 0x9 +#define EVENTCHKINF_CARPENTER_0_RESCUED 0x90 +#define EVENTCHKINF_CARPENTER_1_RESCUED 0x91 +#define EVENTCHKINF_CARPENTER_2_RESCUED 0x92 +#define EVENTCHKINF_CARPENTER_3_RESCUED 0x93 + +#define EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK \ + (EVENTCHKINF_MASK(EVENTCHKINF_CARPENTER_0_RESCUED) | EVENTCHKINF_MASK(EVENTCHKINF_CARPENTER_1_RESCUED) | \ + EVENTCHKINF_MASK(EVENTCHKINF_CARPENTER_2_RESCUED) | EVENTCHKINF_MASK(EVENTCHKINF_CARPENTER_3_RESCUED)) + +#define GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED() \ + CHECK_FLAG_ALL(gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_RESCUED], \ + EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK) + +#define GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED2() \ + CHECK_FLAG_ALL(gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_RESCUED] & \ + (EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK | 0xF0), \ + EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK) + +#define ENDAIKU_CARPENTER_RESCUED_MASK(carpenterType) (1 << (carpenterType)) + +#define ENDAIKU_IS_CARPENTER_RESCUED(carpenterType) \ + gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_RESCUED] & \ + ENDAIKU_CARPENTER_RESCUED_MASK(carpenterType) + +#define ENDAIKU_SET_CARPENTER_RESCUED(carpenterType) \ + gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_RESCUED] |= \ + ENDAIKU_CARPENTER_RESCUED_MASK((carpenterType)) + +#define GET_EVENTCHKINF_CARPENTERS_RESCUED_FLAGS() \ + gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_RESCUED] & EVENTCHKINF_CARPENTERS_ALL_RESCUED_MASK #define EVENTCHKINF_94 0x94 #define EVENTCHKINF_95 0x95 diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index 916add81f20..52e88c1f6f6 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -122,11 +122,11 @@ void Map_InitData(PlayState* play, s16 room) { extendedMapIndex = 0x15; } } else if (play->sceneId == SCENE_GERUDO_VALLEY) { - if ((LINK_AGE_IN_YEARS == YEARS_ADULT) && !GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) { + if ((LINK_AGE_IN_YEARS == YEARS_ADULT) && !GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED()) { extendedMapIndex = 0x16; } } else if (play->sceneId == SCENE_GERUDOS_FORTRESS) { - if (GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) { + if (GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED()) { extendedMapIndex = 0x17; } } diff --git a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c index 23bfb153fd5..00ca47644f3 100644 --- a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c @@ -63,7 +63,7 @@ s32 func_808B1AE0(BgSpot09Obj* this, PlayState* play) { return this->dyna.actor.params == 0; } - carpentersRescued = GET_EVENTCHKINF_CARPENTERS_FREE_ALL(); + carpentersRescued = GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED(); if (LINK_AGE_IN_YEARS == YEARS_ADULT) { switch (this->dyna.actor.params) { @@ -138,8 +138,7 @@ void BgSpot09Obj_Init(Actor* thisx, PlayState* play) { BgSpot09Obj* this = (BgSpot09Obj*)thisx; PRINTF("Spot09 Object [arg_data : 0x%04x](大工救出フラグ 0x%x)\n", this->dyna.actor.params, - gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_FREE] & - EVENTCHKINF_CARPENTERS_FREE_MASK_ALL); + GET_EVENTCHKINF_CARPENTERS_RESCUED_FLAGS()); this->dyna.actor.params &= 0xFF; if ((this->dyna.actor.params < 0) || (this->dyna.actor.params >= 5)) { PRINTF("Error : Spot 09 object の arg_data が判別出来ない(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot09_obj.c", diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index f106e270c29..64b3cc10889 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -4,6 +4,8 @@ #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED) +#define ENDAIKU_GET_TYPE(thisx) PARAMS_GET_U((thisx)->params, 0, 2) + typedef struct EnDaikuEscapeSubCamParam { Vec3f eyePosDeltaLocal; s32 maxFramesActive; @@ -150,21 +152,21 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) { EnDaiku* this = (EnDaiku*)thisx; s32 pad; s32 noKill = true; - s32 isFree = false; - - if (PARAMS_GET_U(this->actor.params, 0, 2) == 0 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(0))) { - isFree = true; - } else if (PARAMS_GET_U(this->actor.params, 0, 2) == 1 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(1))) { - isFree = true; - } else if (PARAMS_GET_U(this->actor.params, 0, 2) == 2 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(2))) { - isFree = true; - } else if (PARAMS_GET_U(this->actor.params, 0, 2) == 3 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(3))) { - isFree = true; + s32 isRescued = false; + + if (ENDAIKU_GET_TYPE(&this->actor) == ENDAIKU_TYPE0 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTER_0_RESCUED)) { + isRescued = true; + } else if (ENDAIKU_GET_TYPE(&this->actor) == ENDAIKU_TYPE1 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTER_1_RESCUED)) { + isRescued = true; + } else if (ENDAIKU_GET_TYPE(&this->actor) == ENDAIKU_TYPE2 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTER_2_RESCUED)) { + isRescued = true; + } else if (ENDAIKU_GET_TYPE(&this->actor) == ENDAIKU_TYPE3 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTER_3_RESCUED)) { + isRescued = true; } - if (isFree == true && play->sceneId == SCENE_THIEVES_HIDEOUT) { + if (isRescued == true && play->sceneId == SCENE_THIEVES_HIDEOUT) { noKill = false; - } else if (!isFree && play->sceneId == SCENE_CARPENTERS_TENT) { + } else if (!isRescued && play->sceneId == SCENE_CARPENTERS_TENT) { noKill = false; } @@ -200,7 +202,7 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) { this->stateFlags |= ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2; this->actionFunc = EnDaiku_Jailed; } else { - if (PARAMS_GET_U(this->actor.params, 0, 2) == 1 || PARAMS_GET_U(this->actor.params, 0, 2) == 3) { + if (ENDAIKU_GET_TYPE(&this->actor) == ENDAIKU_TYPE1 || ENDAIKU_GET_TYPE(&this->actor) == ENDAIKU_TYPE3) { EnDaiku_ChangeAnim(this, ENDAIKU_ANIM_SIT, &this->currentAnimIndex); this->stateFlags |= ENDAIKU_STATEFLAG_1; } else { @@ -254,7 +256,7 @@ s32 EnDaiku_UpdateTalking(EnDaiku* this, PlayState* play) { void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) { s32 carpenterType; - s32 freedCount; + s32 rescuedCount; s16 sp2E; s16 sp2C; @@ -268,15 +270,14 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) { Actor_OfferTalk(&this->actor, play, 100.0f) == 1) { if (play->sceneId == SCENE_THIEVES_HIDEOUT) { if (this->stateFlags & ENDAIKU_STATEFLAG_GERUDODEFEATED) { - freedCount = 0; + rescuedCount = 0; for (carpenterType = 0; carpenterType < 4; carpenterType++) { - if (gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_FREE] & - EVENTCHKINF_CARPENTERS_FREE_MASK(carpenterType)) { - freedCount++; + if (ENDAIKU_IS_CARPENTER_RESCUED(carpenterType)) { + rescuedCount++; } } - switch (freedCount) { + switch (rescuedCount) { case 0: this->actor.textId = 0x605B; break; @@ -295,15 +296,15 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) { this->actor.textId = 0x6007; } } else if (play->sceneId == SCENE_CARPENTERS_TENT) { - switch (PARAMS_GET_U(this->actor.params, 0, 2)) { - case 0: + switch (ENDAIKU_GET_TYPE(&this->actor)) { + case ENDAIKU_TYPE0: if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) { this->actor.textId = 0x6060; } else { this->actor.textId = 0x605F; } break; - case 1: + case ENDAIKU_TYPE1: if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) { this->actor.textId = 0x6063; } else { @@ -314,7 +315,7 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) { } } break; - case 2: + case ENDAIKU_TYPE2: if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) { this->actor.textId = 0x6066; } else { @@ -325,7 +326,7 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) { } } break; - case 3: + case ENDAIKU_TYPE3: if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) { this->actor.textId = 0x6068; } else { @@ -385,7 +386,7 @@ void EnDaiku_WaitFreedom(EnDaiku* this, PlayState* play) { } /** - * The carpenter is free, initializes his running away animation + * The carpenter is rescued, initializes his running away animation */ void EnDaiku_InitEscape(EnDaiku* this, PlayState* play) { Path* path; @@ -399,11 +400,10 @@ void EnDaiku_InitEscape(EnDaiku* this, PlayState* play) { EnDaiku_ChangeAnim(this, ENDAIKU_ANIM_RUN, &this->currentAnimIndex); this->stateFlags &= ~(ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2); - gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_FREE] |= - EVENTCHKINF_CARPENTERS_FREE_MASK(PARAMS_GET_U(this->actor.params, 0, 2)); + ENDAIKU_SET_CARPENTER_RESCUED(ENDAIKU_GET_TYPE(&this->actor)); this->actor.gravity = -1.0f; - this->escapeSubCamTimer = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].maxFramesActive; + this->escapeSubCamTimer = sEscapeSubCamParams[ENDAIKU_GET_TYPE(&this->actor)].maxFramesActive; EnDaiku_InitSubCamera(this, play); exitLoop = false; @@ -444,11 +444,11 @@ void EnDaiku_InitSubCamera(EnDaiku* this, PlayState* play) { Vec3f eyePosDeltaWorld; this->subCamActive = true; - this->escapeSubCamTimer = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].maxFramesActive; + this->escapeSubCamTimer = sEscapeSubCamParams[ENDAIKU_GET_TYPE(&this->actor)].maxFramesActive; - eyePosDeltaLocal.x = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].eyePosDeltaLocal.x; - eyePosDeltaLocal.y = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].eyePosDeltaLocal.y; - eyePosDeltaLocal.z = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].eyePosDeltaLocal.z; + eyePosDeltaLocal.x = sEscapeSubCamParams[ENDAIKU_GET_TYPE(&this->actor)].eyePosDeltaLocal.x; + eyePosDeltaLocal.y = sEscapeSubCamParams[ENDAIKU_GET_TYPE(&this->actor)].eyePosDeltaLocal.y; + eyePosDeltaLocal.z = sEscapeSubCamParams[ENDAIKU_GET_TYPE(&this->actor)].eyePosDeltaLocal.z; Matrix_RotateY(BINANG_TO_RAD(this->actor.world.rot.y), MTXMODE_NEW); Matrix_MultVec3f(&eyePosDeltaLocal, &eyePosDeltaWorld); @@ -493,7 +493,7 @@ void EnDaiku_EscapeSuccess(EnDaiku* this, PlayState* play) { Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_ACTIVE); this->subCamActive = false; - if (GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) { + if (GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED()) { Actor* gerudoGuard; Vec3f vec; @@ -594,13 +594,13 @@ void EnDaiku_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - if (PARAMS_GET_U(thisx->params, 0, 2) == 0) { + if (ENDAIKU_GET_TYPE(thisx) == ENDAIKU_TYPE0) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 10, 70, 255); - } else if (PARAMS_GET_U(thisx->params, 0, 2) == 1) { + } else if (ENDAIKU_GET_TYPE(thisx) == ENDAIKU_TYPE1) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 200, 255, 255); - } else if (PARAMS_GET_U(thisx->params, 0, 2) == 2) { + } else if (ENDAIKU_GET_TYPE(thisx) == ENDAIKU_TYPE2) { gDPSetEnvColor(POLY_OPA_DISP++, 0, 230, 70, 255); - } else if (PARAMS_GET_U(thisx->params, 0, 2) == 3) { + } else if (ENDAIKU_GET_TYPE(thisx) == ENDAIKU_TYPE3) { gDPSetEnvColor(POLY_OPA_DISP++, 200, 0, 150, 255); } @@ -637,7 +637,7 @@ void EnDaiku_PostLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3s* rot, vo if (limb == 15) { // head Matrix_MultVec3f(&targetPosHeadLocal, &this->actor.focus.pos); - gSPDisplayList(POLY_OPA_DISP++, hairDLists[PARAMS_GET_U(this->actor.params, 0, 2)]); + gSPDisplayList(POLY_OPA_DISP++, hairDLists[ENDAIKU_GET_TYPE(&this->actor)]); } CLOSE_DISPS(play->state.gfxCtx, "../z_en_daiku.c", 1330); diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h index 82b7a06346a..69136f6a925 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h @@ -8,6 +8,13 @@ struct EnDaiku; typedef void (*EnDaikuActionFunc)(struct EnDaiku*, PlayState*); +typedef enum EnDaikuType { + ENDAIKU_TYPE0, + ENDAIKU_TYPE1, + ENDAIKU_TYPE2, + ENDAIKU_TYPE3 +} EnDaikuType; + typedef struct EnDaiku { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 56ee48b2c60..8082c7d87cd 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -27,7 +27,7 @@ void EnGe1_Destroy(Actor* thisx, PlayState* play); void EnGe1_Update(Actor* thisx, PlayState* play); void EnGe1_Draw(Actor* thisx, PlayState* play); -s32 EnGe1_CheckCarpentersFreed(void); +s32 EnGe1_CheckAllCarpentersRescued(void); void EnGe1_WatchForPlayerFrontOnly(EnGe1* this, PlayState* play); void EnGe1_SetNormalText(EnGe1* this, PlayState* play); void EnGe1_WatchForAndSensePlayer(EnGe1* this, PlayState* play); @@ -114,7 +114,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { case GE1_TYPE_GATE_OPERATOR: this->hairstyle = GE1_HAIR_STRAIGHT; - if (EnGe1_CheckCarpentersFreed()) { + if (EnGe1_CheckAllCarpentersRescued()) { this->actionFunc = EnGe1_CheckGate_GateOp; } else { this->actionFunc = EnGe1_WatchForPlayerFrontOnly; @@ -124,7 +124,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { case GE1_TYPE_NORMAL: this->hairstyle = GE1_HAIR_STRAIGHT; - if (EnGe1_CheckCarpentersFreed()) { + if (EnGe1_CheckAllCarpentersRescued()) { this->actionFunc = EnGe1_SetNormalText; } else { this->actionFunc = EnGe1_WatchForAndSensePlayer; @@ -154,7 +154,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { if (GET_EVENTINF(EVENTINF_HORSES_08)) { this->actionFunc = EnGe1_TalkAfterGame_Archery; - } else if (EnGe1_CheckCarpentersFreed()) { + } else if (EnGe1_CheckAllCarpentersRescued()) { this->actionFunc = EnGe1_Wait_Archery; } else { this->actionFunc = EnGe1_WatchForPlayerFrontOnly; @@ -164,7 +164,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { case GE1_TYPE_TRAINING_GROUNDS_GUARD: this->hairstyle = GE1_HAIR_STRAIGHT; - if (EnGe1_CheckCarpentersFreed()) { + if (EnGe1_CheckAllCarpentersRescued()) { this->actionFunc = EnGe1_CheckForCard_GTGGuard; } else { this->actionFunc = EnGe1_WatchForPlayerFrontOnly; @@ -208,9 +208,9 @@ void EnGe1_SetAnimationIdle(EnGe1* this) { this->animFunc = EnGe1_CueUpAnimation; } -s32 EnGe1_CheckCarpentersFreed(void) { - if (!(GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(0)) && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(1)) && - GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(2)) && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(3)))) { +s32 EnGe1_CheckAllCarpentersRescued(void) { + if (!(GET_EVENTCHKINF(EVENTCHKINF_CARPENTER_0_RESCUED) && GET_EVENTCHKINF(EVENTCHKINF_CARPENTER_1_RESCUED) && + GET_EVENTCHKINF(EVENTCHKINF_CARPENTER_2_RESCUED) && GET_EVENTCHKINF(EVENTCHKINF_CARPENTER_3_RESCUED))) { return false; } return true; diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index ad1b7a1caad..0df133fe4f9 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -39,7 +39,7 @@ void EnGe2_Destroy(Actor* thisx, PlayState* play); void EnGe2_Update(Actor* thisx, PlayState* play); void EnGe2_Draw(Actor* thisx, PlayState* play); -s32 EnGe2_CheckCarpentersFreed(void); +s32 EnGe2_CheckAllCarpentersRescued(void); void EnGe2_CaptureClose(EnGe2* this, PlayState* play); void EnGe2_CaptureCharge(EnGe2* this, PlayState* play); void EnGe2_CaptureTurn(EnGe2* this, PlayState* play); @@ -137,14 +137,14 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { switch (PARAMS_GET_S(thisx->params, 0, 8)) { case GE2_TYPE_PATROLLING: EnGe2_ChangeAction(this, GE2_ACTION_WALK); - if (EnGe2_CheckCarpentersFreed()) { + if (EnGe2_CheckAllCarpentersRescued()) { this->actor.update = EnGe2_UpdateFriendly; this->actor.attentionRangeType = ATTENTION_RANGE_6; } break; case GE2_TYPE_STATIONARY: EnGe2_ChangeAction(this, GE2_ACTION_STAND); - if (EnGe2_CheckCarpentersFreed()) { + if (EnGe2_CheckAllCarpentersRescued()) { this->actor.update = EnGe2_UpdateFriendly; this->actor.attentionRangeType = ATTENTION_RANGE_6; } @@ -224,13 +224,11 @@ s32 Ge2_DetectPlayerInUpdate(PlayState* play, EnGe2* this, Vec3f* pos, s16 yRot, return 1; } -s32 EnGe2_CheckCarpentersFreed(void) { - if (CHECK_FLAG_ALL(gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_FREE] & - (EVENTCHKINF_CARPENTERS_FREE_MASK_ALL | 0xF0), - EVENTCHKINF_CARPENTERS_FREE_MASK_ALL)) { - return 1; +s32 EnGe2_CheckAllCarpentersRescued(void) { + if (GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED2()) { + return true; } - return 0; + return false; } // Actions @@ -594,7 +592,7 @@ void EnGe2_Update(Actor* thisx, PlayState* play) { } EnGe2_MoveAndBlink(this, play); - if (EnGe2_CheckCarpentersFreed() && !(this->stateFlags & GE2_STATE_KO)) { + if (EnGe2_CheckAllCarpentersRescued() && !(this->stateFlags & GE2_STATE_KO)) { this->actor.update = EnGe2_UpdateFriendly; this->actor.attentionRangeType = ATTENTION_RANGE_6; } @@ -620,7 +618,7 @@ void EnGe2_UpdateStunned(Actor* thisx, PlayState* play2) { } CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); - if (EnGe2_CheckCarpentersFreed()) { + if (EnGe2_CheckAllCarpentersRescued()) { this->actor.update = EnGe2_UpdateFriendly; this->actor.attentionRangeType = ATTENTION_RANGE_6; this->actor.colorFilterTimer = 0; diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 3373c941621..075facff4d7 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -457,7 +457,7 @@ s32 EnHorse_BgCheckBridgeJumpPoint(EnHorse* this, PlayState* play) { if (this->actor.speed < 12.8f) { return false; } - if (GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) { + if (GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED()) { return false; } @@ -3595,7 +3595,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) { this->stateFlags &= ~ENHORSE_FLAG_24; } - if (play->sceneId == SCENE_GERUDO_VALLEY && !GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) { + if (play->sceneId == SCENE_GERUDO_VALLEY && !GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED()) { EnHorse_CheckBridgeJumps(this, play); } diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c index 28901f464dd..3082b5c35de 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -100,7 +100,7 @@ void EnMm2_ChangeAnim(EnMm2* this, s32 index, s32* currentIndex) { } void func_80AAEF70(EnMm2* this, PlayState* play) { - if (!GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) { + if (!GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED()) { this->actor.textId = 0x6086; } else if (GET_INFTABLE(INFTABLE_17F)) { if (GET_EVENTINF(EVENTINF_MARATHON_ACTIVE)) { diff --git a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index ab2c9aaf777..5b31c32f84c 100644 --- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -258,7 +258,7 @@ s32 EnToryo_GetTextId(EnToryo* this, PlayState* play) { if (textId == 0) { if (this->stateFlags & 1) { - if (GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) { + if (GET_EVENTCHKINF_CARPENTERS_ALL_RESCUED()) { ret = 0x606C; } else if (GET_INFTABLE(INFTABLE_170)) { ret = 0x606B;