diff --git a/include/z64player.h b/include/z64player.h index b762961bb3..aa5463161f 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -202,6 +202,81 @@ typedef struct { /* 0x10 */ Vec3f base; } WeaponInfo; // size = 0x1C +#define PLAYER_STATE1_0 (1 << 0) +#define PLAYER_STATE1_1 (1 << 1) +#define PLAYER_STATE1_2 (1 << 2) +#define PLAYER_STATE1_3 (1 << 3) +#define PLAYER_STATE1_4 (1 << 4) +#define PLAYER_STATE1_5 (1 << 5) +#define PLAYER_STATE1_6 (1 << 6) +#define PLAYER_STATE1_7 (1 << 7) +#define PLAYER_STATE1_8 (1 << 8) +#define PLAYER_STATE1_9 (1 << 9) +#define PLAYER_STATE1_10 (1 << 10) +#define PLAYER_STATE1_11 (1 << 11) +#define PLAYER_STATE1_12 (1 << 12) +#define PLAYER_STATE1_13 (1 << 13) +#define PLAYER_STATE1_14 (1 << 14) +#define PLAYER_STATE1_15 (1 << 15) +#define PLAYER_STATE1_16 (1 << 16) +#define PLAYER_STATE1_17 (1 << 17) +#define PLAYER_STATE1_18 (1 << 18) +#define PLAYER_STATE1_19 (1 << 19) +#define PLAYER_STATE1_20 (1 << 20) +#define PLAYER_STATE1_21 (1 << 21) +#define PLAYER_STATE1_22 (1 << 22) +#define PLAYER_STATE1_23 (1 << 23) +#define PLAYER_STATE1_24 (1 << 24) +#define PLAYER_STATE1_25 (1 << 25) +#define PLAYER_STATE1_26 (1 << 26) +#define PLAYER_STATE1_27 (1 << 27) +#define PLAYER_STATE1_28 (1 << 28) +#define PLAYER_STATE1_29 (1 << 29) +#define PLAYER_STATE1_30 (1 << 30) +#define PLAYER_STATE1_31 (1 << 31) + +#define PLAYER_STATE2_0 (1 << 0) +#define PLAYER_STATE2_1 (1 << 1) +#define PLAYER_STATE2_2 (1 << 2) +#define PLAYER_STATE2_3 (1 << 3) +#define PLAYER_STATE2_4 (1 << 4) +#define PLAYER_STATE2_5 (1 << 5) +#define PLAYER_STATE2_6 (1 << 6) +#define PLAYER_STATE2_7 (1 << 7) +#define PLAYER_STATE2_8 (1 << 8) +#define PLAYER_STATE2_9 (1 << 9) +#define PLAYER_STATE2_10 (1 << 10) +#define PLAYER_STATE2_11 (1 << 11) +#define PLAYER_STATE2_12 (1 << 12) +#define PLAYER_STATE2_13 (1 << 13) +#define PLAYER_STATE2_14 (1 << 14) +#define PLAYER_STATE2_15 (1 << 15) +#define PLAYER_STATE2_16 (1 << 16) +#define PLAYER_STATE2_17 (1 << 17) +#define PLAYER_STATE2_18 (1 << 18) +#define PLAYER_STATE2_19 (1 << 19) +#define PLAYER_STATE2_20 (1 << 20) +#define PLAYER_STATE2_21 (1 << 21) +#define PLAYER_STATE2_22 (1 << 22) +#define PLAYER_STATE2_23 (1 << 23) +#define PLAYER_STATE2_24 (1 << 24) +#define PLAYER_STATE2_25 (1 << 25) +#define PLAYER_STATE2_26 (1 << 26) +#define PLAYER_STATE2_27 (1 << 27) +#define PLAYER_STATE2_28 (1 << 28) +#define PLAYER_STATE2_29 (1 << 29) +#define PLAYER_STATE2_30 (1 << 30) +#define PLAYER_STATE2_31 (1 << 31) + +#define PLAYER_STATE3_0 (1 << 0) +#define PLAYER_STATE3_1 (1 << 1) +#define PLAYER_STATE3_2 (1 << 2) +#define PLAYER_STATE3_3 (1 << 3) +#define PLAYER_STATE3_4 (1 << 4) +#define PLAYER_STATE3_5 (1 << 5) +#define PLAYER_STATE3_6 (1 << 6) +#define PLAYER_STATE3_7 (1 << 7) + typedef void (*PlayerFunc674)(struct Player*, struct GlobalContext*); typedef s32 (*PlayerFunc82C)(struct Player*, struct GlobalContext*); typedef void (*PlayerFuncA74)(struct GlobalContext*, struct Player*); diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 2d1e06c308..235702d206 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -351,7 +351,7 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { func_8002BE64(targetCtx, targetCtx->unk_4C, spBC.x, spBC.y, spBC.z); - if ((!(player->stateFlags1 & 0x40)) || (actor != player->unk_664)) { + if ((!(player->stateFlags1 & PLAYER_STATE1_6)) || (actor != player->unk_664)) { OVERLAY_DISP = Gfx_CallSetupDL(OVERLAY_DISP, 0x39); for (spB0 = 0, spAC = targetCtx->unk_4C; spB0 < spB8; spB0++, spAC = (spAC + 1) % 3) { @@ -948,7 +948,7 @@ f32 Actor_HeightDiff(Actor* actorA, Actor* actorB) { } f32 Player_GetHeight(Player* player) { - f32 offset = (player->stateFlags1 & 0x800000) ? 32.0f : 0.0f; + f32 offset = (player->stateFlags1 & PLAYER_STATE1_23) ? 32.0f : 0.0f; if (LINK_IS_ADULT) { return offset + 68.0f; @@ -958,9 +958,9 @@ f32 Player_GetHeight(Player* player) { } f32 func_8002DCE4(Player* player) { - if (player->stateFlags1 & 0x800000) { + if (player->stateFlags1 & PLAYER_STATE1_23) { return 8.0f; - } else if (player->stateFlags1 & 0x8000000) { + } else if (player->stateFlags1 & PLAYER_STATE1_27) { return (R_RUN_SPEED_LIMIT / 100.0f) * 0.6f; } else { return R_RUN_SPEED_LIMIT / 100.0f; @@ -968,7 +968,7 @@ f32 func_8002DCE4(Player* player) { } s32 func_8002DD6C(Player* player) { - return player->stateFlags1 & 0x8; + return player->stateFlags1 & PLAYER_STATE1_3; } s32 func_8002DD78(Player* player) { @@ -978,19 +978,19 @@ s32 func_8002DD78(Player* player) { s32 func_8002DDA8(GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - return (player->stateFlags1 & 0x800) || func_8002DD78(player); + return (player->stateFlags1 & PLAYER_STATE1_11) || func_8002DD78(player); } s32 func_8002DDE4(GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - return player->stateFlags2 & 0x8; + return player->stateFlags2 & PLAYER_STATE2_3; } s32 func_8002DDF4(GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - return player->stateFlags2 & 0x1000; + return player->stateFlags2 & PLAYER_STATE2_12; } void func_8002DE04(GlobalContext* globalCtx, Actor* actorA, Actor* actorB) { @@ -1012,12 +1012,12 @@ void func_8002DE74(GlobalContext* globalCtx, Player* player) { void Actor_MountHorse(GlobalContext* globalCtx, Player* player, Actor* horse) { player->rideActor = horse; - player->stateFlags1 |= 0x800000; + player->stateFlags1 |= PLAYER_STATE1_23; horse->child = &player->actor; } s32 func_8002DEEC(Player* player) { - return (player->stateFlags1 & 0x20000080) || (player->csMode != 0); + return (player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_29)) || (player->csMode != 0); } void func_8002DF18(GlobalContext* globalCtx, Player* player) { @@ -1568,10 +1568,12 @@ u32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx) { s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange) { Player* player = GET_PLAYER(globalCtx); - if (!(player->stateFlags1 & 0x3C7080) && Player_GetExplosiveHeld(player) < 0) { + if (!(player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_12 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | + PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_20 | PLAYER_STATE1_21)) && + Player_GetExplosiveHeld(player) < 0) { if ((((player->heldActor != NULL) || (actor == player->targetActor)) && (getItemId > GI_NONE) && (getItemId < GI_MAX)) || - (!(player->stateFlags1 & 0x20000800))) { + (!(player->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_29)))) { if ((actor->xzDistToPlayer < xzRange) && (fabsf(actor->yDistToPlayer) < yRange)) { s16 yawDiff = actor->yawTowardsPlayer - player->actor.shape.rot.y; s32 absYawDiff = ABS(yawDiff); @@ -1639,7 +1641,9 @@ s32 Actor_IsMounted(GlobalContext* globalCtx, Actor* horse) { u32 Actor_SetRideActor(GlobalContext* globalCtx, Actor* horse, s32 mountSide) { Player* player = GET_PLAYER(globalCtx); - if (!(player->stateFlags1 & 0x003C7880)) { + if (!(player->stateFlags1 & + (PLAYER_STATE1_7 | PLAYER_STATE1_11 | PLAYER_STATE1_12 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | + PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_20 | PLAYER_STATE1_21))) { player->rideActor = horse; player->mountSide = mountSide; return true; @@ -1983,8 +1987,18 @@ void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry* } u32 D_80116068[ACTORCAT_MAX] = { - 0x100000C0, 0x100000C0, 0x00000000, 0x100004C0, 0x00000080, 0x300000C0, - 0x10000080, 0x00000000, 0x300000C0, 0x100004C0, 0x00000000, 0x100000C0, + PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28, + PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28, + 0, + PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_10 | PLAYER_STATE1_28, + PLAYER_STATE1_7, + PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29, + PLAYER_STATE1_7 | PLAYER_STATE1_28, + 0, + PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29, + PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_10 | PLAYER_STATE1_28, + 0, + PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28, }; void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) { @@ -2029,11 +2043,11 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) { sp80 = &D_80116068[0]; - if (player->stateFlags2 & 0x8000000) { + if (player->stateFlags2 & PLAYER_STATE2_27) { unkFlag = ACTOR_FLAG_25; } - if ((player->stateFlags1 & 0x40) && ((player->actor.textId & 0xFF00) != 0x600)) { + if ((player->stateFlags1 & PLAYER_STATE1_6) && ((player->actor.textId & 0xFF00) != 0x600)) { sp74 = player->targetActor; } @@ -3389,7 +3403,7 @@ s16 Actor_TestFloorInDirection(Actor* actor, GlobalContext* globalCtx, f32 dista s32 Actor_IsTargeted(GlobalContext* globalCtx, Actor* actor) { Player* player = GET_PLAYER(globalCtx); - if ((player->stateFlags1 & 0x10) && actor->isTargeted) { + if ((player->stateFlags1 & PLAYER_STATE1_4) && actor->isTargeted) { return true; } else { return false; @@ -3402,7 +3416,7 @@ s32 Actor_IsTargeted(GlobalContext* globalCtx, Actor* actor) { s32 Actor_OtherIsTargeted(GlobalContext* globalCtx, Actor* actor) { Player* player = GET_PLAYER(globalCtx); - if ((player->stateFlags1 & 0x10) && !actor->isTargeted) { + if ((player->stateFlags1 & PLAYER_STATE1_4) && !actor->isTargeted) { return true; } else { return false; diff --git a/src/code/z_camera.c b/src/code/z_camera.c index dfbf8a0493..f5e9287c7b 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -511,7 +511,7 @@ s32 Camera_GetWaterBoxDataIdx(Camera* camera, f32* waterY) { return -1; } - if (!(camera->player->stateFlags1 & 0x8000000)) { + if (!(camera->player->stateFlags1 & PLAYER_STATE1_27)) { // player is not swimming *waterY = BGCHECK_Y_MIN; return -1; @@ -1021,7 +1021,7 @@ s32 Camera_CalcAtForParallel(Camera* camera, VecSph* arg1, f32 yOffset, f32* arg } if (camera->playerGroundY == camera->playerPosRot.pos.y || camera->player->actor.gravity > -0.1f || - camera->player->stateFlags1 & 0x200000) { + camera->player->stateFlags1 & PLAYER_STATE1_21) { *arg3 = Camera_LERPCeilF(playerPosRot->pos.y, *arg3, PCT(OREG(43)), 0.1f); phi_f20 = playerPosRot->pos.y - *arg3; posOffsetTarget.y -= phi_f20; @@ -1124,7 +1124,7 @@ s32 Camera_CalcAtForLockOn(Camera* camera, VecSph* eyeAtDir, Vec3f* targetPos, f tmpPos0.z = tmpPos0.z + lookFromOffset.z; if (camera->playerGroundY == camera->playerPosRot.pos.y || camera->player->actor.gravity > -0.1f || - camera->player->stateFlags1 & 0x200000) { + camera->player->stateFlags1 & PLAYER_STATE1_21) { *yPosOffset = Camera_LERPCeilF(playerPosRot->pos.y, *yPosOffset, PCT(OREG(43)), 0.1f); yPosDelta = playerPosRot->pos.y - *yPosOffset; tmpPos0.y -= yPosDelta; @@ -2059,7 +2059,7 @@ s32 Camera_Parallel1(Camera* camera) { } if (camera->playerGroundY == camera->playerPosRot.pos.y || camera->player->actor.gravity > -0.1f || - camera->player->stateFlags1 & 0x200000) { + camera->player->stateFlags1 & PLAYER_STATE1_21) { anim->yTarget = playerPosRot->pos.y; sp6A = 0; } else { @@ -2748,7 +2748,7 @@ s32 Camera_Battle1(Camera* camera) { sp78 = batt1->swingPitchFinal; fov = batt1->fov; - if (camera->player->stateFlags1 & 0x1000) { + if (camera->player->stateFlags1 & PLAYER_STATE1_12) { // charging sword. anim->unk_10 = Camera_LERPCeilF(PCT(OREG(12)) * 0.5f, anim->unk_10, PCT(OREG(25)), 0.1f); camera->xzOffsetUpdateRate = Camera_LERPCeilF(0.2f, camera->xzOffsetUpdateRate, PCT(OREG(25)), 0.1f); @@ -2819,7 +2819,7 @@ s32 Camera_Battle1(Camera* camera) { } if (camera->playerGroundY == camera->playerPosRot.pos.y || camera->player->actor.gravity > -0.1f || - camera->player->stateFlags1 & 0x200000) { + camera->player->stateFlags1 & PLAYER_STATE1_21) { isOffGround = false; anim->yPosOffset = playerPosRot->pos.y; } else { @@ -3139,7 +3139,7 @@ s32 Camera_KeepOn1(Camera* camera) { anim->unk_0C = NULL; cont: if (camera->playerGroundY == camera->playerPosRot.pos.y || camera->player->actor.gravity > -0.1f || - camera->player->stateFlags1 & 0x200000) { + camera->player->stateFlags1 & PLAYER_STATE1_21) { anim->unk_08 = playerPosRot->pos.y; sp80 = 0; } else { @@ -3560,7 +3560,7 @@ s32 Camera_KeepOn4(Camera* camera) { keep4->unk_04 = playerHeight * 1.6f * yNormal; keep4->unk_08 = -2.0f; keep4->unk_0C = 120.0f; - keep4->unk_10 = player->stateFlags1 & 0x8000000 ? 0.0f : 20.0f; + keep4->unk_10 = player->stateFlags1 & PLAYER_STATE1_27 ? 0.0f : 20.0f; keep4->unk_1C = 0x3212; keep4->unk_1E = 0x1E; keep4->unk_18 = 50.0f; @@ -4813,7 +4813,7 @@ s32 Camera_Unique0(Camera* camera) { camera->animState++; } - if (player->stateFlags1 & 0x20000000) { + if (player->stateFlags1 & PLAYER_STATE1_29) { anim->initalPos = playerPosRot->pos; } @@ -4821,7 +4821,7 @@ s32 Camera_Unique0(Camera* camera) { if (anim->animTimer > 0) { anim->animTimer--; anim->initalPos = playerPosRot->pos; - } else if ((!(player->stateFlags1 & 0x20000000)) && + } else if ((!(player->stateFlags1 & PLAYER_STATE1_29)) && ((OLib_Vec3fDistXZ(&playerPosRot->pos, &anim->initalPos) >= 10.0f) || CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_A) || CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_B) || @@ -4849,7 +4849,7 @@ s32 Camera_Unique0(Camera* camera) { anim->initalPos = playerPosRot->pos; } - if ((!(player->stateFlags1 & 0x20000000)) && + if ((!(player->stateFlags1 & PLAYER_STATE1_29)) && ((0.001f < camera->xzSpeed) || CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_A) || CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_B) || CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_CLEFT) || @@ -5066,7 +5066,8 @@ s32 Camera_Unique9(Camera* camera) { D_8011D3AC = anim->curKeyFrame->unk_01 & 0xF; } else if ((anim->curKeyFrame->unk_01 & 0xF0) == 0xC0) { Camera_UpdateInterface(0xF000 | ((anim->curKeyFrame->unk_01 & 0xF) << 8)); - } else if (camera->player->stateFlags1 & 0x8000000 && player->currentBoots != PLAYER_BOOTS_IRON) { + } else if (camera->player->stateFlags1 & PLAYER_STATE1_27 && + player->currentBoots != PLAYER_BOOTS_IRON) { func_8002DF38(camera->globalCtx, camera->target, 8); osSyncPrintf("camera: demo: player demo set WAIT\n"); } else { @@ -5442,7 +5443,7 @@ s32 Camera_Unique9(Camera* camera) { // Set the player's position camera->player->actor.world.pos.x = anim->playerPos.x; camera->player->actor.world.pos.z = anim->playerPos.z; - if (camera->player->stateFlags1 & 0x8000000 && player->currentBoots != PLAYER_BOOTS_IRON) { + if (camera->player->stateFlags1 & PLAYER_STATE1_27 && player->currentBoots != PLAYER_BOOTS_IRON) { camera->player->actor.world.pos.y = anim->playerPos.y; } } else { @@ -6003,16 +6004,16 @@ s32 Camera_Demo5(Camera* camera) { sDemo5PrevSfxFrame = camera->globalCtx->state.frames; - if (camera->player->stateFlags1 & 0x8000000 && (player->currentBoots != PLAYER_BOOTS_IRON)) { + if (camera->player->stateFlags1 & PLAYER_STATE1_27 && (player->currentBoots != PLAYER_BOOTS_IRON)) { // swimming, and not iron boots - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_29; // env frozen player->actor.freezeTimer = camera->timer; } else { sp4A = playerhead.rot.y - playerTargetGeo.yaw; if (camera->target->category == ACTORCAT_PLAYER) { pad = camera->globalCtx->state.frames - sDemo5PrevAction12Frame; - if (player->stateFlags1 & 0x800) { + if (player->stateFlags1 & PLAYER_STATE1_11) { // holding object over head. func_8002DF54(camera->globalCtx, camera->target, 8); } else if (ABS(pad) > 3000) { @@ -7072,7 +7073,7 @@ s32 Camera_CheckWater(Camera* camera) { } if (camera->unk_14C & 0x200) { - if (player->stateFlags2 & 0x800) { + if (player->stateFlags2 & PLAYER_STATE2_11) { Camera_ChangeSettingFlags(camera, CAM_SET_PIVOT_WATER_SURFACE, 6); camera->unk_14C |= (s16)0x8000; } else if (camera->unk_14C & (s16)0x8000) { @@ -7556,7 +7557,7 @@ void Camera_Finish(Camera* camera) { if ((camera->parentCamIdx == MAIN_CAM) && (camera->csId != 0)) { player->actor.freezeTimer = 0; - player->stateFlags1 &= ~0x20000000; + player->stateFlags1 &= ~PLAYER_STATE1_29; if (player->csMode != 0) { func_8002DF54(camera->globalCtx, &player->actor, 7); diff --git a/src/code/z_onepointdemo.c b/src/code/z_onepointdemo.c index 96ef33c18b..4a8f9e738f 100644 --- a/src/code/z_onepointdemo.c +++ b/src/code/z_onepointdemo.c @@ -769,7 +769,7 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 camIdx, s16 csId, Act func_8002DF54(globalCtx, NULL, 8); func_800C0808(globalCtx, camIdx, player, CAM_SET_CS_C); - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_29; player->actor.freezeTimer = 90; i = Quake_Add(csCam, 1); @@ -966,7 +966,7 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 camIdx, s16 csId, Act if (func_800C0CB8(globalCtx)) { D_801231B4[0].eyeTargetInit.z = D_801231B4[1].eyeTargetInit.z = !LINK_IS_ADULT ? 100.0f : 120.0f; - if (player->stateFlags1 & 0x08000000) { + if (player->stateFlags1 & PLAYER_STATE1_27) { D_801231B4[2].atTargetInit.z = 0.0f; } Actor_GetWorldPosShapeRot(&spA0, &player->actor); diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 45983cc03f..fdee59c956 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -612,7 +612,7 @@ void func_80083108(GlobalContext* globalCtx) { ((globalCtx->sceneNum == SCENE_SPOT20) && (gSaveContext.cutsceneIndex == 0xFFF0))) { gSaveContext.unk_13E7 = 0; - if ((player->stateFlags1 & 0x00800000) || (globalCtx->shootingGalleryStatus > 1) || + if ((player->stateFlags1 & PLAYER_STATE1_23) || (globalCtx->shootingGalleryStatus > 1) || ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) { if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { gSaveContext.unk_13E7 = 1; @@ -661,11 +661,11 @@ void func_80083108(GlobalContext* globalCtx) { Interface_ChangeAlpha(8); } else if ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38)) { Interface_ChangeAlpha(8); - } else if (player->stateFlags1 & 0x00800000) { + } else if (player->stateFlags1 & PLAYER_STATE1_23) { Interface_ChangeAlpha(12); } } else { - if (player->stateFlags1 & 0x00800000) { + if (player->stateFlags1 & PLAYER_STATE1_23) { Interface_ChangeAlpha(12); } } @@ -743,7 +743,7 @@ void func_80083108(GlobalContext* globalCtx) { } Interface_ChangeAlpha(50); - } else if ((player->stateFlags1 & 0x00200000) || (player->stateFlags2 & 0x00040000)) { + } else if ((player->stateFlags1 & PLAYER_STATE1_21) || (player->stateFlags2 & PLAYER_STATE2_18)) { if (gSaveContext.buttonStatus[0] != BTN_DISABLED) { gSaveContext.buttonStatus[0] = BTN_DISABLED; gSaveContext.buttonStatus[1] = BTN_DISABLED; @@ -753,7 +753,7 @@ void func_80083108(GlobalContext* globalCtx) { Interface_ChangeAlpha(50); } } else if ((gSaveContext.eventInf[0] & 0xF) == 1) { - if (player->stateFlags1 & 0x00800000) { + if (player->stateFlags1 & PLAYER_STATE1_23) { if ((gSaveContext.equips.buttonItems[0] != ITEM_NONE) && (gSaveContext.equips.buttonItems[0] != ITEM_BOW)) { if (gSaveContext.inventory.items[SLOT_BOW] == ITEM_NONE) { @@ -2730,8 +2730,8 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { if ((gSaveContext.unk_13EA == 1) || (gSaveContext.unk_13EA == 2) || (gSaveContext.unk_13EA == 5)) { temp = 0; - } else if ((player->stateFlags1 & 0x00200000) || (func_8008F2F8(globalCtx) == 4) || - (player->stateFlags2 & 0x00040000)) { + } else if ((player->stateFlags1 & PLAYER_STATE1_21) || (func_8008F2F8(globalCtx) == 4) || + (player->stateFlags2 & PLAYER_STATE2_18)) { temp = 70; } else { temp = interfaceCtx->healthAlpha; @@ -3157,7 +3157,7 @@ void Interface_Draw(GlobalContext* globalCtx) { if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { Interface_DrawItemIconTexture(globalCtx, interfaceCtx->iconItemSegment, 0); - if ((player->stateFlags1 & 0x00800000) || (globalCtx->shootingGalleryStatus > 1) || + if ((player->stateFlags1 & PLAYER_STATE1_23) || (globalCtx->shootingGalleryStatus > 1) || ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) { gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, @@ -3403,7 +3403,7 @@ void Interface_Draw(GlobalContext* globalCtx) { if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) && (globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) && (msgCtx->msgMode == MSGMODE_NONE) && - !(player->stateFlags2 & 0x01000000) && (globalCtx->sceneLoadFlag == 0) && + !(player->stateFlags2 & PLAYER_STATE2_24) && (globalCtx->sceneLoadFlag == 0) && (globalCtx->transitionMode == 0) && !Gameplay_InCsMode(globalCtx) && (gSaveContext.minigameState != 1) && (globalCtx->shootingGalleryStatus <= 1) && !((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) { @@ -3962,8 +3962,8 @@ void Interface_Update(GlobalContext* globalCtx) { HealthMeter_Update(globalCtx); if ((gSaveContext.timer1State >= 3) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) && - (msgCtx->msgMode == MSGMODE_NONE) && !(player->stateFlags2 & 0x01000000) && (globalCtx->sceneLoadFlag == 0) && - (globalCtx->transitionMode == 0) && !Gameplay_InCsMode(globalCtx)) {} + (msgCtx->msgMode == MSGMODE_NONE) && !(player->stateFlags2 & PLAYER_STATE2_24) && + (globalCtx->sceneLoadFlag == 0) && (globalCtx->transitionMode == 0) && !Gameplay_InCsMode(globalCtx)) {} if (gSaveContext.rupeeAccumulator != 0) { if (gSaveContext.rupeeAccumulator > 0) { diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index b1707a5651..71b14e2524 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -293,7 +293,7 @@ void Player_SetBootData(GlobalContext* globalCtx, Player* this) { currentBoots = PLAYER_BOOTS_NORMAL_CHILD; } } else if (currentBoots == PLAYER_BOOTS_IRON) { - if (this->stateFlags1 & 0x8000000) { + if (this->stateFlags1 & PLAYER_STATE1_27) { currentBoots = PLAYER_BOOTS_IRON_UNDERWATER; } REG(27) = 500; @@ -325,8 +325,9 @@ void Player_SetBootData(GlobalContext* globalCtx, Player* this) { } s32 Player_InBlockingCsMode(GlobalContext* globalCtx, Player* this) { - return (this->stateFlags1 & 0x20000080) || (this->csMode != 0) || (globalCtx->sceneLoadFlag == 0x14) || - (this->stateFlags1 & 1) || (this->stateFlags3 & 0x80) || + return (this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_29)) || (this->csMode != 0) || + (globalCtx->sceneLoadFlag == 0x14) || (this->stateFlags1 & PLAYER_STATE1_0) || + (this->stateFlags3 & PLAYER_STATE3_7) || ((gSaveContext.unk_13F0 != 0) && (Player_ActionToMagicSpell(this, this->itemActionParam) >= 0)); } @@ -337,7 +338,7 @@ s32 Player_InCsMode(GlobalContext* globalCtx) { } s32 func_8008E9C4(Player* this) { - return (this->stateFlags1 & 0x10); + return (this->stateFlags1 & PLAYER_STATE1_4); } s32 Player_IsChildWithHylianShield(Player* this) { @@ -355,7 +356,7 @@ s32 Player_ActionToModelGroup(Player* this, s32 actionParam) { } void Player_SetModelsForHoldingShield(Player* this) { - if ((this->stateFlags1 & 0x400000) && + if ((this->stateFlags1 & PLAYER_STATE1_22) && ((this->itemActionParam < 0) || (this->itemActionParam == this->heldItemActionParam))) { if (!Player_HoldsTwoHandedWeapon(this) && !Player_IsChildWithHylianShield(this)) { this->rightHandType = 10; @@ -431,15 +432,18 @@ void Player_UpdateBottleHeld(GlobalContext* globalCtx, Player* this, s32 item, s void func_8008EDF0(Player* this) { this->unk_664 = NULL; - this->stateFlags2 &= ~0x2000; + this->stateFlags2 &= ~PLAYER_STATE2_13; } void func_8008EE08(Player* this) { - if ((this->actor.bgCheckFlags & 1) || (this->stateFlags1 & 0x8A00000) || - (!(this->stateFlags1 & 0xC0000) && ((this->actor.world.pos.y - this->actor.floorHeight) < 100.0f))) { - this->stateFlags1 &= ~0x400F8000; - } else if (!(this->stateFlags1 & 0x2C0000)) { - this->stateFlags1 |= 0x80000; + if ((this->actor.bgCheckFlags & 1) || + (this->stateFlags1 & (PLAYER_STATE1_21 | PLAYER_STATE1_23 | PLAYER_STATE1_27)) || + (!(this->stateFlags1 & (PLAYER_STATE1_18 | PLAYER_STATE1_19)) && + ((this->actor.world.pos.y - this->actor.floorHeight) < 100.0f))) { + this->stateFlags1 &= ~(PLAYER_STATE1_15 | PLAYER_STATE1_16 | PLAYER_STATE1_17 | PLAYER_STATE1_18 | + PLAYER_STATE1_19 | PLAYER_STATE1_30); + } else if (!(this->stateFlags1 & (PLAYER_STATE1_18 | PLAYER_STATE1_19 | PLAYER_STATE1_21))) { + this->stateFlags1 |= PLAYER_STATE1_19; } func_8008EDF0(this); @@ -451,7 +455,7 @@ void func_8008EEAC(GlobalContext* globalCtx, Actor* actor) { func_8008EE08(this); this->unk_664 = actor; this->unk_684 = actor; - this->stateFlags1 |= 0x10000; + this->stateFlags1 |= PLAYER_STATE1_16; Camera_SetParam(Gameplay_GetCamera(globalCtx, 0), 8, actor); Camera_ChangeMode(Gameplay_GetCamera(globalCtx, 0), 2); } @@ -459,7 +463,7 @@ void func_8008EEAC(GlobalContext* globalCtx, Actor* actor) { s32 func_8008EF30(GlobalContext* globalCtx) { Player* this = GET_PLAYER(globalCtx); - return (this->stateFlags1 & 0x800000); + return (this->stateFlags1 & PLAYER_STATE1_23); } s32 func_8008EF44(GlobalContext* globalCtx, s32 ammo) { @@ -616,7 +620,7 @@ s32 func_8008F2F8(GlobalContext* globalCtx) { } else if ((this->unk_840 > 80) && ((this->currentBoots == PLAYER_BOOTS_IRON) || (this->unk_840 >= 300))) { // Deep underwater var = ((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & 1)) ? 1 : 3; - } else if (this->stateFlags1 & 0x8000000) { // Swimming + } else if (this->stateFlags1 & PLAYER_STATE1_27) { // Swimming var = 2; } else { return 0; @@ -779,7 +783,7 @@ void func_8008F87C(GlobalContext* globalCtx, Player* this, SkelAnime* skelAnime, s16 temp2; s32 temp3; - if ((this->actor.scale.y >= 0.0f) && !(this->stateFlags1 & 0x80) && + if ((this->actor.scale.y >= 0.0f) && !(this->stateFlags1 & PLAYER_STATE1_7) && (Player_ActionToMagicSpell(this, this->itemActionParam) < 0)) { s32 pad; @@ -923,10 +927,11 @@ s32 func_80090014(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p if ((D_80160014 == 4) && (gSaveContext.swordHealth <= 0.0f)) { dLists += 4; - } else if ((D_80160014 == 6) && (this->stateFlags1 & 0x2000000)) { + } else if ((D_80160014 == 6) && (this->stateFlags1 & PLAYER_STATE1_25)) { dLists = &D_80125E08[gSaveContext.linkAge]; D_80160014 = 0; - } else if ((this->leftHandType == 0) && (this->actor.speedXZ > 2.0f) && !(this->stateFlags1 & 0x8000000)) { + } else if ((this->leftHandType == 0) && (this->actor.speedXZ > 2.0f) && + !(this->stateFlags1 & PLAYER_STATE1_27)) { dLists = &D_80125E18[gSaveContext.linkAge]; D_80160014 = 1; } @@ -937,7 +942,8 @@ s32 func_80090014(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p if (D_80160018 == 10) { dLists += this->currentShield * 4; - } else if ((this->rightHandType == 8) && (this->actor.speedXZ > 2.0f) && !(this->stateFlags1 & 0x8000000)) { + } else if ((this->rightHandType == 8) && (this->actor.speedXZ > 2.0f) && + !(this->stateFlags1 & PLAYER_STATE1_27)) { dLists = &D_80125E58[gSaveContext.linkAge]; D_80160018 = 9; } @@ -1036,7 +1042,7 @@ void func_80090604(GlobalContext* globalCtx, Player* this, ColliderQuad* collide COLTYPE_METAL, }; - if (this->stateFlags1 & 0x400000) { + if (this->stateFlags1 & PLAYER_STATE1_22) { Vec3f quadDest[4]; this->shieldQuad.base.colType = shieldColTypes[this->currentShield]; @@ -1070,12 +1076,12 @@ void func_800906D4(GlobalContext* globalCtx, Player* this, Vec3f* newTipPos) { Matrix_MultVec3f(&D_801260A4[2], &newBasePos[2]); if (func_80090480(globalCtx, NULL, &this->swordInfo[0], &newTipPos[0], &newBasePos[0]) && - !(this->stateFlags1 & 0x400000)) { + !(this->stateFlags1 & PLAYER_STATE1_22)) { EffectBlure_AddVertex(Effect_GetByIndex(this->swordEffectIndex), &this->swordInfo[0].tip, &this->swordInfo[0].base); } - if ((this->swordState > 0) && ((this->swordAnimation < 0x18) || (this->stateFlags2 & 0x20000))) { + if ((this->swordState > 0) && ((this->swordAnimation < 0x18) || (this->stateFlags2 & PLAYER_STATE2_17))) { func_80090480(globalCtx, &this->swordQuads[0], &this->swordInfo[1], &newTipPos[1], &newBasePos[1]); func_80090480(globalCtx, &this->swordQuads[1], &this->swordInfo[2], &newTipPos[2], &newBasePos[2]); } @@ -1272,13 +1278,13 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* if (this->actor.scale.y >= 0.0f) { if (!Player_HoldsHookshot(this) && ((hookedActor = this->heldActor) != NULL)) { - if (this->stateFlags1 & 0x200) { + if (this->stateFlags1 & PLAYER_STATE1_9) { Matrix_MultVec3f(&D_80126128, &hookedActor->world.pos); Matrix_RotateZYX(0x69E8, -0x5708, 0x458E, MTXMODE_APPLY); Matrix_Get(&sp14C); Matrix_MtxFToYXZRotS(&sp14C, &hookedActor->world.rot, 0); hookedActor->shape.rot = hookedActor->world.rot; - } else if (this->stateFlags1 & 0x800) { + } else if (this->stateFlags1 & PLAYER_STATE1_11) { Vec3s spB8; Matrix_Get(&sp14C); @@ -1308,7 +1314,7 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* Matrix_Push(); Matrix_Translate(stringData->pos.x, stringData->pos.y, stringData->pos.z, MTXMODE_APPLY); - if ((this->stateFlags1 & 0x200) && (this->unk_860 >= 0) && (this->unk_834 <= 10)) { + if ((this->stateFlags1 & PLAYER_STATE1_9) && (this->unk_860 >= 0) && (this->unk_834 <= 10)) { Vec3f sp90; f32 distXYZ; @@ -1370,7 +1376,8 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* } if ((this->unk_862 != 0) || ((func_8002DD6C(this) == 0) && (heldActor != NULL))) { - if (!(this->stateFlags1 & 0x400) && (this->unk_862 != 0) && (this->exchangeItemId != EXCH_ITEM_NONE)) { + if (!(this->stateFlags1 & PLAYER_STATE1_10) && (this->unk_862 != 0) && + (this->exchangeItemId != EXCH_ITEM_NONE)) { Math_Vec3f_Copy(&sGetItemRefPos, &this->leftHandPos); } else { sGetItemRefPos.x = (this->bodyPartsPos[15].x + this->leftHandPos.x) * 0.5f; diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index bb85a9416e..bc0f1c77fe 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -121,7 +121,7 @@ s32 ArmsHook_CheckForCancel(ArmsHook* this) { if (Player_HoldsHookshot(player)) { if ((player->itemActionParam != player->heldItemActionParam) || (player->actor.flags & ACTOR_FLAG_8) || - ((player->stateFlags1 & 0x4000080))) { + ((player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_26)))) { this->timer = 0; ArmsHook_DetachHookFromActor(this); Math_Vec3f_Copy(&this->actor.world.pos, &player->unk_3C8); diff --git a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c index 8b6933cf90..41618506be 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c @@ -235,7 +235,7 @@ void BgGndIceblock_Idle(BgGndIceblock* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); if (this->dyna.unk_150 != 0.0f) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; if (this->dyna.unk_150 > 0.0f) { BgGndIceblock_SetNextPosition(this); if (Actor_WorldDistXZToPoint(&this->dyna.actor, &this->targetPos) > 1.0f) { @@ -252,7 +252,7 @@ void BgGndIceblock_Reset(BgGndIceblock* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; if (this->dyna.unk_150 != 0.0f) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; } if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y, 1.0f)) { diff --git a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c index 508d77e0d5..af83709785 100644 --- a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c +++ b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c @@ -60,7 +60,7 @@ void func_8087B758(BgHaka* this, Player* player) { func_8002DBD0(&this->dyna.actor, &sp1C, &player->actor.world.pos); if (fabsf(sp1C.x) < 34.6f && sp1C.z > -112.8f && sp1C.z < -36.0f) { - player->stateFlags2 |= 0x200; + player->stateFlags2 |= PLAYER_STATE2_9; } } @@ -70,7 +70,7 @@ void func_8087B7E8(BgHaka* this, GlobalContext* globalCtx) { if (this->dyna.unk_150 != 0.0f) { if (globalCtx->sceneNum == SCENE_SPOT02 && !LINK_IS_ADULT && IS_DAY) { this->dyna.unk_150 = 0.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; if (!Gameplay_InCsMode(globalCtx)) { Message_StartTextbox(globalCtx, 0x5073, NULL); this->dyna.actor.params = 100; @@ -79,7 +79,7 @@ void func_8087B7E8(BgHaka* this, GlobalContext* globalCtx) { } else if (0.0f < this->dyna.unk_150 || (globalCtx->sceneNum == SCENE_SPOT06 && !LINK_IS_ADULT && !Flags_GetSwitch(globalCtx, 0x23))) { this->dyna.unk_150 = 0.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; } else { this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y + 0x8000; this->actionFunc = func_8087B938; @@ -101,7 +101,7 @@ void func_8087B938(BgHaka* this, GlobalContext* globalCtx) { Math_CosS(this->dyna.actor.world.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.home.pos.z; if (sp38 != 0) { this->dyna.unk_150 = 0.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; if (this->dyna.actor.params == 1) { func_80078884(NA_SE_SY_CORRECT_CHIME); } else if (!IS_DAY && globalCtx->sceneNum == SCENE_SPOT02) { @@ -119,7 +119,7 @@ void func_8087BAAC(BgHaka* this, GlobalContext* globalCtx) { if (this->dyna.unk_150 != 0.0f) { this->dyna.unk_150 = 0.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; } } @@ -132,7 +132,7 @@ void func_8087BAE4(BgHaka* this, GlobalContext* globalCtx) { } if (this->dyna.unk_150 != 0.0f) { this->dyna.unk_150 = 0.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; } if (this->dyna.actor.params == 0) { this->actionFunc = func_8087B7E8; diff --git a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c index c6005072f7..0f1751a973 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c +++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c @@ -151,7 +151,7 @@ void BgHakaGate_StatueInactive(BgHakaGate* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); if (this->dyna.unk_150 != 0.0f) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; } } @@ -170,7 +170,7 @@ void BgHakaGate_StatueIdle(BgHakaGate* this, GlobalContext* globalCtx) { this->vTurnDirection = linkDirection * forceDirection; this->actionFunc = BgHakaGate_StatueTurn; } else { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; if (this->vTimer != 0) { this->vTimer--; @@ -195,7 +195,7 @@ void BgHakaGate_StatueTurn(BgHakaGate* this, GlobalContext* globalCtx) { turnFinished = Math_StepToS(&this->vTurnAngleDeg10, 600, this->vTurnRateDeg10); turnAngle = this->vTurnAngleDeg10 * this->vTurnDirection; this->dyna.actor.shape.rot.y = (this->vRotYDeg10 + turnAngle) * 0.1f * (0x10000 / 360.0f); - if ((player->stateFlags2 & 0x10) && (sStatueDistToPlayer > 0.0f)) { + if ((player->stateFlags2 & PLAYER_STATE2_4) && (sStatueDistToPlayer > 0.0f)) { player->actor.world.pos.x = this->dyna.actor.home.pos.x + (Math_SinS(this->dyna.actor.shape.rot.y - this->vInitTurnAngle) * sStatueDistToPlayer); @@ -207,7 +207,7 @@ void BgHakaGate_StatueTurn(BgHakaGate* this, GlobalContext* globalCtx) { } sStatueRotY = this->dyna.actor.shape.rot.y; if (turnFinished) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->vRotYDeg10 = (this->vRotYDeg10 + turnAngle) % 3600; this->vTurnRateDeg10 = 0; this->vTurnAngleDeg10 = 0; diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c index 3e9a97f852..d946b3cbb5 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c @@ -289,7 +289,8 @@ void BgHakaSgami_Update(Actor* thisx, GlobalContext* globalCtx) { BgHakaSgami* this = (BgHakaSgami*)thisx; Player* player = GET_PLAYER(globalCtx); - if (!(player->stateFlags1 & 0x300000C0) || (this->actionFunc == BgHakaSgami_SetupSpin)) { + if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29)) || + (this->actionFunc == BgHakaSgami_SetupSpin)) { this->actionFunc(this, globalCtx); } } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index c5d9d15e99..0f79340d1b 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -148,7 +148,7 @@ void func_8088B268(BgHidanRock* this, GlobalContext* globalCtx) { this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.unk_158) * D_8088BFC0) + this->dyna.actor.home.pos.z; if (temp_v1) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x; this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; @@ -159,7 +159,7 @@ void func_8088B268(BgHidanRock* this, GlobalContext* globalCtx) { func_8002F974(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); } else { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; if (this->timer != 0) { this->timer--; @@ -177,7 +177,7 @@ void func_8088B268(BgHidanRock* this, GlobalContext* globalCtx) { this->dyna.actor.world.pos.z = D_8088BF60.z; this->dyna.actor.speedXZ = 0.0f; D_8088BFC0 = 0.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->actionFunc = func_8088B79C; } @@ -297,7 +297,7 @@ void func_8088B990(BgHidanRock* this, GlobalContext* globalCtx) { this->timer++; if (this->dyna.unk_150 != 0.0f) { this->dyna.actor.speedXZ = 0.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; } if ((this->type == 0 && (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 1820.0f, diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c index 4154c1d82d..38fde9541f 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c @@ -117,7 +117,7 @@ void func_8088E518(BgHidanSima* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 3.4f); - if (func_8004356C(&this->dyna) && !(player->stateFlags1 & 0x6000)) { + if (func_8004356C(&this->dyna) && !(player->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14))) { this->timer = 20; this->dyna.actor.world.rot.y = Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x4000; if (this->dyna.actor.home.pos.y <= this->dyna.actor.world.pos.y) { diff --git a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c index 5d40632021..884e0537d2 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c +++ b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c @@ -137,7 +137,7 @@ void BgIceObjects_Idle(BgIceObjects* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; if (this->dyna.unk_150 != 0.0f) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; if ((this->dyna.unk_150 > 0.0f) && !Player_InCsMode(globalCtx)) { BgIceObjects_SetNextTarget(this, globalCtx); if (Actor_WorldDistXZToPoint(thisx, &this->targetPos) > 1.0f) { @@ -202,7 +202,7 @@ void BgIceObjects_Reset(BgIceObjects* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; if (this->dyna.unk_150 != 0.0f) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; } if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y, 1.0f)) { @@ -217,7 +217,7 @@ void BgIceObjects_Stuck(BgIceObjects* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); if (this->dyna.unk_150 != 0.0f) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; } } diff --git a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c index e3625ad0de..5638409fab 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c +++ b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c @@ -58,7 +58,7 @@ void BgJyaBlock_Update(Actor* thisx, GlobalContext* globalCtx) { BgJyaBlock* this = (BgJyaBlock*)thisx; Player* player = GET_PLAYER(globalCtx); - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; } diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index f4103ba574..f13ef94e64 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -449,7 +449,7 @@ void func_80896950(BgJyaCobra* this, GlobalContext* globalCtx) { if (fabsf(this->dyna.unk_150) > 0.001f) { this->dyna.unk_150 = 0.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; } } @@ -490,7 +490,7 @@ void func_80896ABC(BgJyaCobra* this, GlobalContext* globalCtx) { if (Math_ScaledStepToS(&this->unk_170, this->unk_16A * 0x2000, this->unk_16E)) { this->unk_16C = (this->unk_16C + this->unk_16A) & 7; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; func_80896918(this, globalCtx); } else { @@ -498,7 +498,7 @@ void func_80896ABC(BgJyaCobra* this, GlobalContext* globalCtx) { (this->unk_16C * 0x2000) + this->dyna.actor.home.rot.y + this->unk_170; } - if (player->stateFlags2 & 0x10) { + if (player->stateFlags2 & PLAYER_STATE2_4) { if (this->unk_172) { func_80895BEC(this, globalCtx); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c index 543cb56121..b5ee4e84f1 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c @@ -200,7 +200,7 @@ void BgJyaGoroiwa_Update(Actor* thisx, GlobalContext* globalCtx) { s32 bgId; Vec3f pos; - if (!(player->stateFlags1 & 0x300000C0)) { + if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29))) { this->actionFunc(this, globalCtx); BgJyaGoroiwa_UpdateRotation(this); pos.x = this->actor.world.pos.x; diff --git a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c index 4b75c560f1..686fd95c4a 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c +++ b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c @@ -77,7 +77,7 @@ void BgJyaZurerukabe_InitDynaPoly(BgJyaZurerukabe* this, GlobalContext* globalCt void func_8089B4C8(BgJyaZurerukabe* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if ((player->stateFlags1 == 0x200000) && (player->actor.wallPoly != NULL)) { + if ((player->stateFlags1 == PLAYER_STATE1_21) && (player->actor.wallPoly != NULL)) { s32 i; for (i = 0; i < ARRAY_COUNT(D_8089BA18); i++) { diff --git a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c index f00eb06ec8..fd748ff2c5 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c +++ b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c @@ -111,7 +111,7 @@ void BgMoriKaitenkabe_Wait(BgMoriKaitenkabe* this, GlobalContext* globalCtx) { } if (fabsf(this->dyna.unk_150) > 0.001f) { this->dyna.unk_150 = 0.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; } } @@ -144,7 +144,7 @@ void BgMoriKaitenkabe_Rotate(BgMoriKaitenkabe* this, GlobalContext* globalCtx) { } if (fabsf(this->dyna.unk_150) > 0.001f) { this->dyna.unk_150 = 0.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; } Math_Vec3f_Copy(&player->actor.world.pos, &this->lockedPlayerPos); } diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index c932a2e0bd..db2dd57771 100644 --- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -347,7 +347,7 @@ void BgPoEvent_BlockIdle(BgPoEvent* this, GlobalContext* globalCtx) { } } else { if ((gSaveContext.timer1Value == 0) && (sBlocksAtRest == 5)) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; sPuzzleState = 0x10; sBlocksAtRest = 0; } @@ -366,11 +366,11 @@ void BgPoEvent_BlockIdle(BgPoEvent* this, GlobalContext* globalCtx) { this->direction = (this->dyna.unk_150 >= 0.0f) ? 1.0f : -1.0f; this->actionFunc = BgPoEvent_BlockPush; } else { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; } } else { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; DECR(this->direction); } @@ -393,7 +393,7 @@ void BgPoEvent_BlockPush(BgPoEvent* this, GlobalContext* globalCtx) { this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.x; this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.z; if (blockStop) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; if ((this->dyna.unk_150 > 0.0f) && (func_800435D8(globalCtx, &this->dyna, 0x1E, 0x32, -0x14) == 0)) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } @@ -418,7 +418,7 @@ void BgPoEvent_BlockReset(BgPoEvent* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); if (this->dyna.unk_150 != 0.0f) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; } if (Math_StepToF(&this->dyna.actor.world.pos.y, 493.0f, 1.0f) && @@ -438,7 +438,7 @@ void BgPoEvent_BlockSolved(BgPoEvent* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); if (this->dyna.unk_150 != 0.0f) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; } if (Math_StepToF(&this->dyna.actor.world.pos.y, 369.0f, 2.0f)) { sPuzzleState = 0x20; diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index 604d7ceea0..be3dff4020 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -238,11 +238,11 @@ void func_808B40AC(BgSpot15Rrbox* this, GlobalContext* globalCtx) { this->unk_17C = this->dyna.unk_150; func_808B4178(this, globalCtx); } else { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; } } else { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; } } @@ -274,7 +274,7 @@ void func_808B4194(BgSpot15Rrbox* this, GlobalContext* globalCtx) { if (!func_808B3F58(this, globalCtx)) { actor->home.pos.x = actor->world.pos.x; actor->home.pos.z = actor->world.pos.z; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; this->unk_178 = 0.0f; this->unk_174 = 0.0f; @@ -289,7 +289,7 @@ void func_808B4194(BgSpot15Rrbox* this, GlobalContext* globalCtx) { } actor->home.pos.x = actor->world.pos.x; actor->home.pos.z = actor->world.pos.z; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; this->unk_178 = 0.0f; this->unk_174 = 0.0f; @@ -315,7 +315,7 @@ void func_808B43D0(BgSpot15Rrbox* this, GlobalContext* globalCtx) { if (fabsf(this->dyna.unk_150) > 0.001f) { this->dyna.unk_150 = 0.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; } Actor_MoveForward(actor); @@ -346,7 +346,7 @@ void func_808B44B8(BgSpot15Rrbox* this, GlobalContext* globalCtx) { void func_808B44CC(BgSpot15Rrbox* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; } diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index ec2a2c4db2..e517070259 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -413,7 +413,7 @@ void func_808B57E0(BgSpot16Bombstone* this, GlobalContext* globalCtx) { OnePointCutscene_Init(globalCtx, 4180, sTimer, NULL, MAIN_CAM); } } - } else if (player->stateFlags1 & 0x800) { + } else if (player->stateFlags1 & PLAYER_STATE1_11) { playerHeldActor = player->heldActor; if (playerHeldActor != NULL && playerHeldActor->category == ACTORCAT_EXPLOSIVE && playerHeldActor->id == ACTOR_EN_BOMBF) { diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c index 22ea4d2c9b..8a500d1086 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c @@ -212,7 +212,7 @@ void func_808B8E20(BgSpot18Obj* this, GlobalContext* globalCtx) { if (fabsf(this->dyna.unk_150) > 0.001f) { this->dyna.unk_150 = 0.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; } } @@ -255,7 +255,7 @@ void func_808B8F08(BgSpot18Obj* this, GlobalContext* globalCtx) { this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.x; this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.z; this->dyna.unk_150 = 0.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F); func_80078884(NA_SE_SY_CORRECT_CHIME); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); diff --git a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c index 715f7cc196..c2da1387ac 100644 --- a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c +++ b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c @@ -80,7 +80,7 @@ void BgSstFloor_Update(BgSstFloor* thisx, GlobalContext* globalCtx) { this->dyna.actor.params = BONGOFLOOR_REST; this->drumPhase = 28; - if (func_8004356C(&this->dyna) && !(player->stateFlags1 & 0x6000)) { + if (func_8004356C(&this->dyna) && !(player->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14))) { distFromRim = 600.0f - this->dyna.actor.xzDistToPlayer; if (distFromRim > 0.0f) { if (distFromRim > 350.0f) { diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index af5ddc928e..63d06f58fd 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -2203,10 +2203,10 @@ void BossGanon_Wait(BossGanon* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if ((this->unk_1C2 == 0) && !(player->actor.world.pos.y < 0.0f)) { - if (!(player->stateFlags1 & 0x2000) && (fabsf(player->actor.world.pos.x) < 110.0f) && + if (!(player->stateFlags1 & PLAYER_STATE1_13) && (fabsf(player->actor.world.pos.x) < 110.0f) && (fabsf(player->actor.world.pos.z) < 110.0f)) { BossGanon_SetupPoundFloor(this, globalCtx); - } else if ((this->timers[0] == 0) && !(player->stateFlags1 & 0x2000)) { + } else if ((this->timers[0] == 0) && !(player->stateFlags1 & PLAYER_STATE1_13)) { this->timers[0] = (s16)Rand_ZeroFloat(30.0f) + 30; if ((s8)this->actor.colChkInfo.health >= 20) { @@ -3927,7 +3927,7 @@ void BossGanon_LightBall_Update(Actor* thisx, GlobalContext* globalCtx2) { switch (this->unk_1C2) { case 0: - if ((player->stateFlags1 & 2) && + if ((player->stateFlags1 & PLAYER_STATE1_1) && (ABS((s16)(player->actor.shape.rot.y - (s16)(ganondorf->actor.yawTowardsPlayer + 0x8000))) < 0x2000) && (sqrtf(SQ(xDistFromLink) + SQ(yDistFromLink) + SQ(zDistFromLink)) <= 25.0f)) { diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 328d65f1b0..2dc10d7311 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -370,7 +370,7 @@ void BossSst_HeadSetupIntro(BossSst* this, GlobalContext* globalCtx) { player->targetYaw = -0x8000; player->currentYaw = -0x8000; player->fallStartHeight = 0; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_5; func_80064520(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 8); @@ -404,7 +404,7 @@ void BossSst_HeadIntro(BossSst* this, GlobalContext* globalCtx) { if (this->timer == 0) { sHands[RIGHT]->actor.flags |= ACTOR_FLAG_0; sHands[LEFT]->actor.flags |= ACTOR_FLAG_0; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_5; func_80064534(globalCtx, &globalCtx->csCtx); func_8002DF54(globalCtx, &this->actor, 7); sCameraAt.y += 30.0f; @@ -650,7 +650,8 @@ void BossSst_HeadNeutral(BossSst* this, GlobalContext* globalCtx) { } if (this->timer == 0) { - if ((GET_PLAYER(globalCtx)->actor.world.pos.y > -50.0f) && !(GET_PLAYER(globalCtx)->stateFlags1 & 0x6080)) { + if ((GET_PLAYER(globalCtx)->actor.world.pos.y > -50.0f) && + !(GET_PLAYER(globalCtx)->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14))) { sHands[Rand_ZeroOne() <= 0.5f]->ready = true; BossSst_HeadSetupWait(this); } else { @@ -1234,7 +1235,8 @@ void BossSst_HandWait(BossSst* this, GlobalContext* globalCtx) { this->timer--; } - if ((this->timer == 0) && (player->actor.world.pos.y > -50.0f) && !(player->stateFlags1 & 0x6080)) { + if ((this->timer == 0) && (player->actor.world.pos.y > -50.0f) && + !(player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14))) { BossSst_HandSelectAttack(this); } } else if (sHead->actionFunc == BossSst_HeadNeutral) { @@ -1717,7 +1719,7 @@ void BossSst_HandClap(BossSst* this, GlobalContext* globalCtx) { if (this->ready) { this->timer = 30; this->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT); - if (!(player->stateFlags2 & 0x80)) { + if (!(player->stateFlags2 & PLAYER_STATE2_7)) { dropFlag = true; } } else { @@ -1806,7 +1808,7 @@ void BossSst_HandGrab(BossSst* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { this->colliderJntSph.base.atFlags &= ~(AT_ON | AT_HIT); this->actor.speedXZ = 0.0f; - if (player->stateFlags2 & 0x80) { + if (player->stateFlags2 & PLAYER_STATE2_7) { if (Rand_ZeroOne() < 0.5f) { BossSst_HandSetupCrush(this); } else { @@ -1833,7 +1835,7 @@ void BossSst_HandGrab(BossSst* this, GlobalContext* globalCtx) { this->actor.world.pos.x += this->actor.speedXZ * Math_SinS(this->actor.world.rot.y); this->actor.world.pos.z += this->actor.speedXZ * Math_CosS(this->actor.world.rot.y); - if (player->stateFlags2 & 0x80) { + if (player->stateFlags2 & PLAYER_STATE2_7) { player->unk_850 = 0; player->actor.world.pos = this->actor.world.pos; player->actor.shape.rot.y = this->actor.shape.rot.y; @@ -1854,7 +1856,7 @@ void BossSst_HandCrush(BossSst* this, GlobalContext* globalCtx) { this->timer--; } - if (!(player->stateFlags2 & 0x80)) { + if (!(player->stateFlags2 & PLAYER_STATE2_7)) { BossSst_HandReleasePlayer(this, globalCtx, true); BossSst_HandSetupEndCrush(this); } else { @@ -1927,7 +1929,7 @@ void BossSst_HandSwing(BossSst* this, GlobalContext* globalCtx) { Math_ScaledStepToS(&this->actor.shape.rot.z, 0, 0x800); } - if (player->stateFlags2 & 0x80) { + if (player->stateFlags2 & PLAYER_STATE2_7) { player->unk_850 = 0; Math_Vec3f_Copy(&player->actor.world.pos, &this->actor.world.pos); player->actor.shape.rot.x = this->actor.shape.rot.x; @@ -1940,7 +1942,7 @@ void BossSst_HandSwing(BossSst* this, GlobalContext* globalCtx) { } if ((this->timer == 4) && (this->amplitude == 0) && SkelAnime_Update(&this->skelAnime) && - (player->stateFlags2 & 0x80)) { + (player->stateFlags2 & PLAYER_STATE2_7)) { BossSst_HandReleasePlayer(this, globalCtx, false); player->actor.world.pos.x += 70.0f * Math_SinS(this->actor.shape.rot.y); player->actor.world.pos.z += 70.0f * Math_CosS(this->actor.shape.rot.y); diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 3d499f9e02..407c1ed772 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -836,7 +836,7 @@ s32 BossTw_CheckBeamReflection(BossTw* this, GlobalContext* globalCtx) { Vec3f vec; Player* player = GET_PLAYER(globalCtx); - if (player->stateFlags1 & 0x400000 && + if (player->stateFlags1 & PLAYER_STATE1_22 && (s16)(player->actor.shape.rot.y - this->actor.shape.rot.y + 0x8000) < 0x2000 && (s16)(player->actor.shape.rot.y - this->actor.shape.rot.y + 0x8000) > -0x2000) { // player is shielding and facing angles are less than 45 degrees in either direction @@ -978,7 +978,7 @@ void BossTw_ShootBeam(BossTw* this, GlobalContext* globalCtx) { if (this->timers[1] != 0) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, this->rotateSpeed); - if ((player->stateFlags1 & 0x400000) && + if ((player->stateFlags1 & PLAYER_STATE1_22) && ((s16)((player->actor.shape.rot.y - this->actor.shape.rot.y) + 0x8000) < 0x2000) && ((s16)((player->actor.shape.rot.y - this->actor.shape.rot.y) + 0x8000) > -0x2000)) { Math_ApproachF(&this->targetPos.x, player->bodyPartsPos[15].x, 1.0f, 400.0f); @@ -4804,7 +4804,7 @@ void BossTw_UpdateEffects(GlobalContext* globalCtx) { if (eff->workf[EFF_SCALE] == 0.0f) { eff->type = TWEFF_NONE; if (eff->target == NULL) { - player->stateFlags2 &= ~0x8000; + player->stateFlags2 &= ~PLAYER_STATE2_15; sFreezeState = 0; } } @@ -4820,9 +4820,9 @@ void BossTw_UpdateEffects(GlobalContext* globalCtx) { if (eff->workf[EFF_ROLL] >= 0.8f) { eff->workf[EFF_ROLL] -= 0.8f; - player->stateFlags2 |= 0x8000; + player->stateFlags2 |= PLAYER_STATE2_15; } else { - player->stateFlags2 &= ~0x8000; + player->stateFlags2 &= ~PLAYER_STATE2_15; } if ((sKotakePtr->workf[UNK_F11] > 10.0f) && (sKotakePtr->workf[UNK_F11] < 200.0f)) { diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index 8435da950b..221d5ae915 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -1426,14 +1426,14 @@ void BossVa_BodyPhase4(BossVa* this, GlobalContext* globalCtx) { } else { Math_SmoothStepToS(&this->vaBodySpinRate, 0, 1, 0x96, 0); if (this->timer > 0) { - if ((player->stateFlags1 & 0x4000000) && (this->timer > 35)) { + if ((player->stateFlags1 & PLAYER_STATE1_26) && (this->timer > 35)) { this->timer = 35; } Math_SmoothStepToF(&this->actor.shape.yOffset, -480.0f, 1.0f, 30.0f, 0.0f); this->colliderBody.info.bumper.dmgFlags = 0xFC00712; this->timer--; } else { - if ((player->stateFlags1 & 0x4000000) && (this->timer < -60)) { + if ((player->stateFlags1 & PLAYER_STATE1_26) && (this->timer < -60)) { this->timer = -59; } if ((globalCtx->gameplayFrames % 4) == 0) { @@ -2002,7 +2002,7 @@ void BossVa_ZapperAttack(BossVa* this, GlobalContext* globalCtx) { sp98 = Math_Vec3f_Yaw(&sp7C, &this->armTip); tmp17 = sp98 - this->actor.shape.rot.y; - if ((sp8E >= ABS(tmp17) || this->burst) && !(sBodyState & 0x80) && !(player->stateFlags1 & 0x04000000)) { + if ((sp8E >= ABS(tmp17) || this->burst) && !(sBodyState & 0x80) && !(player->stateFlags1 & PLAYER_STATE1_26)) { if (!this->burst) { sp94 = sp98 - this->actor.shape.rot.y; @@ -2064,7 +2064,7 @@ void BossVa_ZapperAttack(BossVa* this, GlobalContext* globalCtx) { this->timer2 = 0; } - if ((this->timer2 < 0) && (player->stateFlags1 & 0x4000000)) { + if ((this->timer2 < 0) && (player->stateFlags1 & PLAYER_STATE1_26)) { BossVa_Spark(globalCtx, this, 1, 30, 0.0f, 0.0f, SPARK_LINK, 0.0f, true); } } @@ -2265,7 +2265,7 @@ void BossVa_ZapperEnraged(BossVa* this, GlobalContext* globalCtx) { sp6C = Math_Vec3f_Yaw(&sp54, &this->armTip); tmp16 = sp6C - this->actor.shape.rot.y; - if ((ABS(tmp16) <= 0x4650 || this->burst) && !(sBodyState & 0x80) && !(player->stateFlags1 & 0x04000000)) { + if ((ABS(tmp16) <= 0x4650 || this->burst) && !(sBodyState & 0x80) && !(player->stateFlags1 & PLAYER_STATE1_26)) { if (!this->burst) { sp68 = sp6C - this->actor.shape.rot.y; @@ -2322,7 +2322,7 @@ void BossVa_ZapperEnraged(BossVa* this, GlobalContext* globalCtx) { this->timer2 = 0; } - if ((this->timer2 < 0) && (player->stateFlags1 & 0x4000000)) { + if ((this->timer2 < 0) && (player->stateFlags1 & PLAYER_STATE1_26)) { BossVa_Spark(globalCtx, this, 1, 30, 0.0f, 0, SPARK_LINK, 0.0f, true); } } diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index ed9f84cf4e..6b61cf1656 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -127,8 +127,8 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) { player = GET_PLAYER(globalCtx); if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f)) { - if ((this->actor.targetMode != 0) && (globalCtx->sceneLoadFlag == 0) && (player->stateFlags1 & 0x80000000) && - (player->unk_84F == 0)) { + if ((this->actor.targetMode != 0) && (globalCtx->sceneLoadFlag == 0) && + (player->stateFlags1 & PLAYER_STATE1_31) && (player->unk_84F == 0)) { destinationIdx = ((this->actor.params >> 0xC) & 7) - 1; Gameplay_SetupRespawnPoint(globalCtx, RESPAWN_MODE_RETURN, 0x4FF); gSaveContext.respawn[RESPAWN_MODE_RETURN].pos.y = this->actor.world.pos.y; @@ -140,10 +140,10 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) { globalCtx->nextEntranceIndex = entrances[destinationIdx]; DoorAna_SetupAction(this, DoorAna_GrabPlayer); } else { - if (!Player_InCsMode(globalCtx) && !(player->stateFlags1 & 0x8800000) && + if (!Player_InCsMode(globalCtx) && !(player->stateFlags1 & (PLAYER_STATE1_23 | PLAYER_STATE1_27)) && this->actor.xzDistToPlayer <= 15.0f && -50.0f <= this->actor.yDistToPlayer && this->actor.yDistToPlayer <= 15.0f) { - player->stateFlags1 |= 0x80000000; + player->stateFlags1 |= PLAYER_STATE1_31; this->actor.targetMode = 1; } else { this->actor.targetMode = 0; diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 0670830eca..13a72e9db9 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -552,7 +552,7 @@ void func_80997220(DoorShutter* this, GlobalContext* globalCtx) { } this->unk_164 = 0; this->dyna.actor.velocity.y = 0.0f; - if (DoorShutter_SetupDoor(this, globalCtx) && !(player->stateFlags1 & 0x800)) { + if (DoorShutter_SetupDoor(this, globalCtx) && !(player->stateFlags1 & PLAYER_STATE1_11)) { DoorShutter_SetupAction(this, func_80997568); func_8002DF54(globalCtx, NULL, 2); } @@ -636,7 +636,8 @@ void DoorShutter_Update(Actor* thisx, GlobalContext* globalCtx) { DoorShutter* this = (DoorShutter*)thisx; Player* player = GET_PLAYER(globalCtx); - if (!(player->stateFlags1 & 0x100004C0) || (this->actionFunc == DoorShutter_SetupType)) { + if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_10 | PLAYER_STATE1_28)) || + (this->actionFunc == DoorShutter_SetupType)) { this->actionFunc(this, globalCtx); } } diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c index b5ab3185d6..dad65b14b5 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c @@ -178,7 +178,7 @@ void EffDust_UpdateFunc_8099DFC0(EffDust* this, GlobalContext* globalCtx) { s32 i; s32 j; - if (parent == NULL || parent->update == NULL || !(player->stateFlags1 & 0x1000)) { + if (parent == NULL || parent->update == NULL || !(player->stateFlags1 & PLAYER_STATE1_12)) { if (this->life != 0) { this->life -= 1; } else { diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index 0ce123dcd3..6e6708e8fc 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -689,7 +689,7 @@ void EnAm_Statue(EnAm* this, GlobalContext* globalCtx) { ((this->hurtCollider.base.ocFlags1 & OC1_HIT) && (ABS(moveDir) <= 0x2000))) { this->unk_258 = 0; - player->stateFlags2 &= ~0x151; + player->stateFlags2 &= ~(PLAYER_STATE2_0 | PLAYER_STATE2_4 | PLAYER_STATE2_6 | PLAYER_STATE2_8); player->actor.speedXZ = 0.0f; this->dyna.unk_150 = this->dyna.unk_154 = 0.0f; } diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c index 290e27e32b..00bdafe232 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -184,7 +184,7 @@ void EnBa_Idle(EnBa* this, GlobalContext* globalCtx) { } this->unk2A8[13].x = this->unk2A8[12].x; this->unk2A8[13].y = this->unk2A8[12].y; - if (!(player->stateFlags1 & 0x4000000) && (this->actor.xzDistToPlayer <= 175.0f) && + if (!(player->stateFlags1 & PLAYER_STATE1_26) && (this->actor.xzDistToPlayer <= 175.0f) && (this->actor.world.pos.y == this->actor.home.pos.y + 100.0f)) { EnBa_SetupSwingAtPlayer(this); } @@ -290,7 +290,7 @@ void EnBa_SwingAtPlayer(EnBa* this, GlobalContext* globalCtx) { Matrix_MultVec3f(&D_809B8080, &this->unk158[i + 1]); } this->unk31A--; - } else if ((this->actor.xzDistToPlayer > 175.0f) || (player->stateFlags1 & 0x4000000)) { + } else if ((this->actor.xzDistToPlayer > 175.0f) || (player->stateFlags1 & PLAYER_STATE1_26)) { EnBa_SetupIdle(this); } else { EnBa_SetupSwingAtPlayer(this); @@ -309,7 +309,7 @@ void EnBa_SwingAtPlayer(EnBa* this, GlobalContext* globalCtx) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); return; } - if ((this->actor.xzDistToPlayer > 175.0f) || (player->stateFlags1 & 0x4000000)) { + if ((this->actor.xzDistToPlayer > 175.0f) || (player->stateFlags1 & PLAYER_STATE1_26)) { EnBa_SetupIdle(this); } else { EnBa_SetupSwingAtPlayer(this); diff --git a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c index 3941aaa0c8..965b78c000 100644 --- a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c +++ b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c @@ -83,7 +83,7 @@ void EnBlkobj_Wait(EnBlkobj* this, GlobalContext* globalCtx) { if (this->dyna.actor.xzDistToPlayer < 120.0f) { EnBlkobj_SetupAction(this, EnBlkobj_SpawnDarkLink); } - player->stateFlags2 |= 0x04000000; + player->stateFlags2 |= PLAYER_STATE2_26; } void EnBlkobj_SpawnDarkLink(EnBlkobj* this, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c index c6116736d0..f7df3a48bb 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -206,11 +206,11 @@ void EnBom_Explode(EnBom* this, GlobalContext* globalCtx) { if (this->timer == 0) { player = GET_PLAYER(globalCtx); - if ((player->stateFlags1 & 0x800) && (player->heldActor == &this->actor)) { + if ((player->stateFlags1 & PLAYER_STATE1_11) && (player->heldActor == &this->actor)) { player->actor.child = NULL; player->heldActor = NULL; player->interactRangeActor = NULL; - player->stateFlags1 &= ~0x800; + player->stateFlags1 &= ~PLAYER_STATE1_11; } Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c index 5326acc8c7..c3f191b02f 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c @@ -181,10 +181,10 @@ void EnBomBowlPit_GivePrize(EnBomBowlPit* this, GlobalContext* globalCtx) { this->getItemId = GI_BOMB_BAG_40; } - player->stateFlags1 &= ~0x20000000; + player->stateFlags1 &= ~PLAYER_STATE1_29; this->actor.parent = NULL; func_8002F434(&this->actor, globalCtx, this->getItemId, 2000.0f, 1000.0f); - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_29; this->actionFunc = EnBomBowlPit_WaitTillPrizeGiven; } diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index 5d99928e6c..2d098dbcee 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -163,7 +163,7 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) { player->heldActor = NULL; player->interactRangeActor = NULL; this->actor.parent = NULL; - player->stateFlags1 &= ~0x800; + player->stateFlags1 &= ~PLAYER_STATE1_11; } } else if (this->bombCollider.base.acFlags & AC_HIT) { this->bombCollider.base.acFlags &= ~AC_HIT; @@ -199,7 +199,7 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) { player->heldActor = NULL; player->interactRangeActor = NULL; this->actor.parent = NULL; - player->stateFlags1 &= ~0x800; + player->stateFlags1 &= ~PLAYER_STATE1_11; this->actor.world.pos = this->actor.home.pos; } } @@ -217,7 +217,7 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) { player->heldActor = NULL; player->interactRangeActor = NULL; this->actor.parent = NULL; - player->stateFlags1 &= ~0x800; + player->stateFlags1 &= ~PLAYER_STATE1_11; this->actor.world.pos = this->actor.home.pos; } } @@ -301,11 +301,11 @@ void EnBombf_Explode(EnBombf* this, GlobalContext* globalCtx) { if (this->timer == 0) { player = GET_PLAYER(globalCtx); - if ((player->stateFlags1 & 0x800) && (player->heldActor == &this->actor)) { + if ((player->stateFlags1 & PLAYER_STATE1_11) && (player->heldActor == &this->actor)) { player->actor.child = NULL; player->heldActor = NULL; player->interactRangeActor = NULL; - player->stateFlags1 &= ~0x800; + player->stateFlags1 &= ~PLAYER_STATE1_11; } Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index a62aa11949..6b324696c1 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -186,7 +186,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { } } // Set player flags and kill the boomerang beacause Link caught it. - player->stateFlags1 &= ~0x02000000; + player->stateFlags1 &= ~PLAYER_STATE1_25; Actor_Kill(&this->actor); } } else { @@ -240,7 +240,7 @@ void EnBoom_Update(Actor* thisx, GlobalContext* globalCtx) { EnBoom* this = (EnBoom*)thisx; Player* player = GET_PLAYER(globalCtx); - if (!(player->stateFlags1 & 0x20000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_29)) { this->actionFunc(this, globalCtx); Actor_SetFocus(&this->actor, 0.0f); this->activeTimer = this->activeTimer + 1; diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index 2331432ced..3314e82335 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -293,8 +293,8 @@ void func_809C9700(EnBox* this, GlobalContext* globalCtx) { this->unk_1FB = ENBOX_STATE_0; } else { if (this->unk_1FB == ENBOX_STATE_0) { - if (!(player->stateFlags2 & 0x1000000)) { - player->stateFlags2 |= 0x800000; + if (!(player->stateFlags2 & PLAYER_STATE2_24)) { + player->stateFlags2 |= PLAYER_STATE2_23; return; } this->unk_1FB = ENBOX_STATE_1; diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index f48b3420b5..b59f444cbb 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -354,7 +354,8 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_236 + this->unk_238, 1, this->actor.speedXZ * 1000.0f, 0); } - if ((this->unk_224 == 0) || (ABS(this->actor.yDistToPlayer) > 60.0f) || (player2->stateFlags1 & 0x6000)) { + if ((this->unk_224 == 0) || (ABS(this->actor.yDistToPlayer) > 60.0f) || + (player2->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14))) { this->unk_221 = 3; this->unk_224 = 150; this->unk_250 = 0.0f; diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index 03e27aeda4..250a4752a5 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -276,7 +276,7 @@ void EnCrow_FlyIdle(EnCrow* this, GlobalContext* globalCtx) { if (this->timer != 0) { this->timer--; } - if ((this->timer == 0) && (this->actor.xzDistToPlayer < 300.0f) && !(player->stateFlags1 & 0x00800000) && + if ((this->timer == 0) && (this->actor.xzDistToPlayer < 300.0f) && !(player->stateFlags1 & PLAYER_STATE1_23) && (this->actor.yDistToWater < -40.0f) && (Player_GetMask(globalCtx) != PLAYER_MASK_SKULL)) { EnCrow_SetupDiveAttack(this); } @@ -314,7 +314,7 @@ void EnCrow_DiveAttack(EnCrow* this, GlobalContext* globalCtx) { if ((this->timer == 0) || (Player_GetMask(globalCtx) == PLAYER_MASK_SKULL) || (this->collider.base.atFlags & AT_HIT) || (this->actor.bgCheckFlags & 9) || - (player->stateFlags1 & 0x00800000) || (this->actor.yDistToWater > -40.0f)) { + (player->stateFlags1 & PLAYER_STATE1_23) || (this->actor.yDistToWater > -40.0f)) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; Audio_PlayActorSound2(&this->actor, NA_SE_EN_KAICHO_ATTACK); diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.c b/src/overlays/actors/ovl_En_Dha/z_en_dha.c index a81f215aa7..99ffa3e496 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -227,7 +227,7 @@ void EnDha_Wait(EnDha* this, GlobalContext* globalCtx) { this->timer += 0x1194; this->limbAngleY = Math_SinS(this->timer) * 1820.0f; - if (!(player->stateFlags2 & 0x80)) { + if (!(player->stateFlags2 & PLAYER_STATE2_7)) { this->unk_1CC = 0; EnDha_SetupTakeDamage(this); return; @@ -242,8 +242,8 @@ void EnDha_Wait(EnDha* this, GlobalContext* globalCtx) { this->handAngle.y -= this->actor.shape.rot.y + this->limbAngleY; this->handAngle.x -= this->actor.shape.rot.x + this->limbAngleX[0] + this->limbAngleX[1]; } else { - if ((player->stateFlags2 & 0x80) && (&this->actor == player->actor.parent)) { - player->stateFlags2 &= ~0x80; + if ((player->stateFlags2 & PLAYER_STATE2_7) && (&this->actor == player->actor.parent)) { + player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->unk_850 = 200; } @@ -282,8 +282,8 @@ void EnDha_Wait(EnDha* this, GlobalContext* globalCtx) { this->limbAngleX[1] *= -2; } } else { - if ((player->stateFlags2 & 0x80) && (&this->actor == player->actor.parent)) { - player->stateFlags2 &= ~0x80; + if ((player->stateFlags2 & PLAYER_STATE2_7) && (&this->actor == player->actor.parent)) { + player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->unk_850 = 200; } @@ -303,8 +303,8 @@ void EnDha_SetupTakeDamage(EnDha* this) { void EnDha_TakeDamage(EnDha* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if ((player->stateFlags2 & 0x80) && (&this->actor == player->actor.parent)) { - player->stateFlags2 &= ~0x80; + if ((player->stateFlags2 & PLAYER_STATE2_7) && (&this->actor == player->actor.parent)) { + player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->unk_850 = 200; } @@ -341,8 +341,8 @@ void EnDha_Die(EnDha* this, GlobalContext* globalCtx) { Vec3f vec; Player* player = GET_PLAYER(globalCtx); - if ((player->stateFlags2 & 0x80) && (&this->actor == player->actor.parent)) { - player->stateFlags2 &= ~0x80; + if ((player->stateFlags2 & PLAYER_STATE2_7) && (&this->actor == player->actor.parent)) { + player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->unk_850 = 200; } diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 55a81009bd..4c4dd8b4ed 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -405,7 +405,7 @@ void func_809EFF50(EnDns* this, GlobalContext* globalCtx) { void func_809EFF98(EnDns* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (player->stateFlags1 & 0x400) { + if (player->stateFlags1 & PLAYER_STATE1_10) { if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) { this->dnsItemEntry->setRupeesAndFlags(this); this->dropCollectible = 1; diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index 1789cc9950..eb1c9b1d7a 100644 --- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -117,7 +117,7 @@ void EnDntJiji_Wait(EnDntJiji* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if ((this->timer == 1) && (this->actor.xzDistToPlayer < 150.0f) && !Gameplay_InCsMode(globalCtx) && - !(player->stateFlags1 & 0x800)) { + !(player->stateFlags1 & PLAYER_STATE1_11)) { OnePointCutscene_Init(globalCtx, 2230, -99, &this->actor, MAIN_CAM); this->timer = 0; func_8002DF54(globalCtx, NULL, 8); diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index 0d1d4c3a72..3582cf93ad 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -192,7 +192,7 @@ void EnDoor_Idle(EnDoor* this, GlobalContext* globalCtx) { if (this->playerIsOpening != 0) { this->actionFunc = EnDoor_Open; Animation_PlayOnceSetSpeed(&this->skelAnime, D_809FCECC[this->animStyle], - (player->stateFlags1 & 0x8000000) ? 0.75f : 1.5f); + (player->stateFlags1 & PLAYER_STATE1_27) ? 0.75f : 1.5f); if (this->lockTimer != 0) { gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]--; Flags_SetSwitch(globalCtx, this->actor.params & 0x3F); diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.c b/src/overlays/actors/ovl_En_Du/z_en_du.c index 2ca7b37b33..27bd5df27c 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -320,9 +320,9 @@ void func_809FE3B4(EnDu* this, GlobalContext* globalCtx) { void func_809FE3C0(EnDu* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (player->stateFlags2 & 0x1000000) { + if (player->stateFlags2 & PLAYER_STATE2_24) { func_8010BD88(globalCtx, OCARINA_ACTION_CHECK_SARIA); - player->stateFlags2 |= 0x2000000; + player->stateFlags2 |= PLAYER_STATE2_25; player->unk_6A8 = &this->actor; EnDu_SetupAction(this, func_809FE4A4); return; @@ -332,7 +332,7 @@ void func_809FE3C0(EnDu* this, GlobalContext* globalCtx) { this->unk_1F4.unk_00 = 0; } if (this->actor.xzDistToPlayer < 116.0f + this->collider.dim.radius) { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } @@ -356,14 +356,14 @@ void func_809FE4A4(EnDu* this, GlobalContext* globalCtx) { EnDu_SetupAction(this, func_809FE890); globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04; } else { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } void func_809FE638(EnDu* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (!(player->stateFlags1 & 0x20000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_29)) { OnePointCutscene_Init(globalCtx, 3330, -99, &this->actor, MAIN_CAM); player->actor.shape.rot.y = player->actor.world.rot.y = this->actor.world.rot.y + 0x7FFF; Audio_PlayFanfare(NA_BGM_APPEAR); diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index 18bc3bee0e..e9918f71fb 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -1081,13 +1081,13 @@ void func_80A0461C(EnElf* this, GlobalContext* globalCtx) { } else { arrowPointedActor = globalCtx->actorCtx.targetCtx.arrowPointedActor; - if ((player->stateFlags1 & 0x400) || ((YREG(15) & 0x10) && func_800BC56C(globalCtx, 2))) { + if ((player->stateFlags1 & PLAYER_STATE1_10) || ((YREG(15) & 0x10) && func_800BC56C(globalCtx, 2))) { temp = 12; this->unk_2C0 = 100; } else if (arrowPointedActor == NULL || arrowPointedActor->category == ACTORCAT_NPC) { if (arrowPointedActor != NULL) { this->unk_2C0 = 100; - player->stateFlags2 |= 0x100000; + player->stateFlags2 |= PLAYER_STATE2_20; temp = 0; } else { switch (this->unk_2A8) { @@ -1108,7 +1108,7 @@ void func_80A0461C(EnElf* this, GlobalContext* globalCtx) { this->unk_2AE--; temp = 7; } else { - player->stateFlags2 |= 0x100000; + player->stateFlags2 |= PLAYER_STATE2_20; temp = 0; } } else { @@ -1138,7 +1138,7 @@ void func_80A0461C(EnElf* this, GlobalContext* globalCtx) { switch (temp) { case 0: - if (!(player->stateFlags2 & 0x100000)) { + if (!(player->stateFlags2 & PLAYER_STATE2_20)) { temp = 7; if (this->unk_2C7 == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EV_NAVY_VANISH); @@ -1146,7 +1146,7 @@ void func_80A0461C(EnElf* this, GlobalContext* globalCtx) { } break; case 8: - if (player->stateFlags2 & 0x100000) { + if (player->stateFlags2 & PLAYER_STATE2_20) { func_80A0299C(this, 0x32); this->unk_2C0 = 42; temp = 11; @@ -1156,10 +1156,10 @@ void func_80A0461C(EnElf* this, GlobalContext* globalCtx) { } break; case 7: - player->stateFlags2 &= ~0x100000; + player->stateFlags2 &= ~PLAYER_STATE2_20; break; default: - player->stateFlags2 |= 0x100000; + player->stateFlags2 |= PLAYER_STATE2_20; break; } } @@ -1498,7 +1498,7 @@ void EnElf_Draw(Actor* thisx, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); if ((this->unk_2A8 != 8) && !(this->fairyFlags & 8)) { - if (!(player->stateFlags1 & 0x100000) || (kREG(90) < this->actor.projectedPos.z)) { + if (!(player->stateFlags1 & PLAYER_STATE1_20) || (kREG(90) < this->actor.projectedPos.z)) { dListHead = Graph_Alloc(globalCtx->state.gfxCtx, sizeof(Gfx) * 4); OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_elf.c", 2730); diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index 2552320116..b5b2a056e3 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -242,7 +242,7 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, GlobalContext* globalCt while ((this->curNumSpawn < this->maxCurSpawns) && (this->totalNumSpawn < this->maxTotalSpawns)) { if (globalCtx->sceneNum == SCENE_SPOT00) { if ((player->unk_89E == 0) || (player->actor.floorBgId != BGCHECK_SCENE) || - !(player->actor.bgCheckFlags & 1) || (player->stateFlags1 & 0x08000000)) { + !(player->actor.bgCheckFlags & 1) || (player->stateFlags1 & PLAYER_STATE1_27)) { this->fieldSpawnTimer = 60; break; diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c index 53e7c6e981..5f7894d73a 100644 --- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c +++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c @@ -469,7 +469,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, GlobalContext* globalCtx) { switch (this->work[FHGFIRE_FIRE_MODE]) { case FHGFIRE_LIGHT_GREEN: canBottleReflect1 = - ((player->stateFlags1 & 2) && + ((player->stateFlags1 & PLAYER_STATE1_1) && (ABS((s16)(player->actor.shape.rot.y - (s16)(bossGnd->actor.yawTowardsPlayer + 0x8000))) < 0x2000) && (sqrtf(SQ(dxL) + SQ(dyL) + SQ(dzL)) <= 25.0f)) diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c index ef4fc33422..60a21b266b 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c @@ -361,7 +361,7 @@ void EnFireRock_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->collider.base.atFlags & 2) { this->collider.base.atFlags &= ~2; if (this->collider.base.at == playerActor) { - if (!(player->stateFlags1 & 0x04000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_26)) { func_8002F758(globalCtx, thisx, 2.0f, -player->actor.world.rot.y, 3.0f, 4); } return; diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 238a82ec76..fbc515f18a 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -791,7 +791,7 @@ void EnFloormas_GrabLink(EnFloormas* this, GlobalContext* globalCtx) { this->actor.world.pos.z = Math_CosS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.world.pos.z; // let go - if (!(player->stateFlags2 & 0x80) || (player->invincibilityTimer < 0)) { + if (!(player->stateFlags2 & PLAYER_STATE2_7) || (player->invincibilityTimer < 0)) { parent = (EnFloormas*)this->actor.parent; child = (EnFloormas*)this->actor.child; diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 91254406cc..60da9551a8 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -597,7 +597,7 @@ s32 EnFr_SetupJumpingUp(EnFr* this, s32 frogIndex) { void EnFr_Idle(EnFr* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (player->stateFlags2 & 0x2000000) { + if (player->stateFlags2 & PLAYER_STATE2_25) { if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_04) { globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_00; } diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index a5709ab38b..0cccddd5e0 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -178,17 +178,17 @@ void func_80A1DBD4(EnFu* this, GlobalContext* globalCtx) { globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_00; gSaveContext.eventChkInf[6] |= 0x20; } else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_02) { - player->stateFlags2 &= ~0x1000000; + player->stateFlags2 &= ~PLAYER_STATE2_24; this->actionFunc = EnFu_WaitAdult; } else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_01) { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } void EnFu_WaitForPlayback(EnFu* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; // if dialog state is 7, player has played back the song if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_SONG_DEMO_DONE) { func_8010BD58(globalCtx, OCARINA_ACTION_PLAYBACK_STORMS); @@ -199,7 +199,7 @@ void EnFu_WaitForPlayback(EnFu* this, GlobalContext* globalCtx) { void EnFu_TeachSong(EnFu* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; // if dialog state is 2, start song demonstration if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CLOSING) { this->behaviorFlags &= ~FU_WAIT; @@ -216,7 +216,7 @@ void EnFu_WaitAdult(EnFu* this, GlobalContext* globalCtx) { yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if ((gSaveContext.eventChkInf[5] & 0x800)) { func_80A1D94C(this, globalCtx, 0x508E, func_80A1DBA0); - } else if (player->stateFlags2 & 0x1000000) { + } else if (player->stateFlags2 & PLAYER_STATE2_24) { this->actor.textId = 0x5035; Message_StartTextbox(globalCtx, this->actor.textId, NULL); this->actionFunc = EnFu_TeachSong; @@ -227,7 +227,7 @@ void EnFu_WaitAdult(EnFu* this, GlobalContext* globalCtx) { if (this->actor.xzDistToPlayer < 100.0f) { this->actor.textId = 0x5034; func_8002F2CC(&this->actor, globalCtx, 100.0f); - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } } 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 76ac5c9691..2cbd20bce1 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -587,7 +587,7 @@ void EnGe1_BeginGame_Archery(EnGe1* this, GlobalContext* globalCtx) { gSaveContext.eventInf[0] |= 0x100; gSaveContext.eventChkInf[6] |= 0x100; - if (!(player->stateFlags1 & 0x800000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_23)) { func_8002DF54(globalCtx, &this->actor, 1); } else { horse = Actor_FindNearby(globalCtx, &player->actor, ACTOR_EN_HORSE, ACTORCAT_BG, 1200.0f); @@ -667,7 +667,7 @@ void EnGe1_Wait_Archery(EnGe1* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); u16 textId; - if (!(player->stateFlags1 & 0x800000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_23)) { EnGe1_SetTalkAction(this, globalCtx, 0x603F, 100.0f, EnGe1_TalkNoHorse_Archery); } else { if (gSaveContext.eventChkInf[6] & 0x100) { diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 5e9e1a6ea0..a41a5e98fe 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -725,7 +725,7 @@ void EnGoroiwa_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; s32 sp30; - if (!(player->stateFlags1 & 0x300000C0)) { + if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29))) { if (this->collisionDisabledTimer > 0) { this->collisionDisabledTimer--; } diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 456c90bf3a..1572f6c8e0 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -143,8 +143,8 @@ void func_80A4E470(EnGs* this, GlobalContext* globalCtx) { if (this->actor.xzDistToPlayer <= 100.0f) { bREG(15) = 1; if (this->unk_19D == 0) { - player->stateFlags2 |= 0x800000; - if (player->stateFlags2 & 0x1000000) { + player->stateFlags2 |= PLAYER_STATE2_23; + if (player->stateFlags2 & PLAYER_STATE2_24) { func_8010BD58(globalCtx, OCARINA_ACTION_FREE_PLAY); this->unk_19D |= 1; } @@ -167,7 +167,7 @@ void func_80A4E470(EnGs* this, GlobalContext* globalCtx) { this->unk_19D = 0; Flags_SetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F); } else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_01) { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } } 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 cfabfd8284..30406892b5 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -722,9 +722,9 @@ void EnHorse_ResetRace(EnHorse* this, GlobalContext* globalCtx) { s32 EnHorse_PlayerCanMove(EnHorse* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if ((player->stateFlags1 & 1) || func_8002DD78(GET_PLAYER(globalCtx)) == 1 || (player->stateFlags1 & 0x100000) || - ((this->stateFlags & ENHORSE_FLAG_19) && !this->inRace) || this->action == ENHORSE_ACT_HBA || - player->actor.flags & ACTOR_FLAG_8 || globalCtx->csCtx.state != 0) { + if ((player->stateFlags1 & PLAYER_STATE1_0) || func_8002DD78(GET_PLAYER(globalCtx)) == 1 || + (player->stateFlags1 & PLAYER_STATE1_20) || ((this->stateFlags & ENHORSE_FLAG_19) && !this->inRace) || + this->action == ENHORSE_ACT_HBA || player->actor.flags & ACTOR_FLAG_8 || globalCtx->csCtx.state != 0) { return false; } return true; @@ -3531,7 +3531,7 @@ void EnHorse_Update(Actor* thisx, GlobalContext* globalCtx2) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->cyl1.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->cyl1.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->cyl2.base); - if ((player->stateFlags1 & 1) && player->rideActor != NULL) { + if ((player->stateFlags1 & PLAYER_STATE1_0) && player->rideActor != NULL) { if (globalCtx->sceneNum != SCENE_SPOT20 || (globalCtx->sceneNum == SCENE_SPOT20 && (thisx->world.pos.z < -2400.0f))) { EnHorse_UpdateConveyors(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index 484b809a05..ff4b0dbc92 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -143,7 +143,7 @@ u16 func_80A79010(GlobalContext* globalCtx) { } switch (gSaveContext.eventInf[0] & 0xF) { case 1: - if (!(player->stateFlags1 & 0x800000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_23)) { return 0x2036; } else if (gSaveContext.eventChkInf[1] & 0x800) { if (gSaveContext.infTable[10] & 4) { @@ -653,7 +653,7 @@ void func_80A7A568(EnIn* this, GlobalContext* globalCtx) { s32 phi_a2; s32 phi_a3; - if (!(gSaveContext.eventChkInf[1] & 0x800) && (player->stateFlags1 & 0x800000)) { + if (!(gSaveContext.eventChkInf[1] & 0x800) && (player->stateFlags1 & PLAYER_STATE1_23)) { gSaveContext.infTable[10] |= 0x800; } if (gSaveContext.timer1State == 10) { diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index 0aa8b45d9a..d78e5306a6 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -212,18 +212,18 @@ void func_80A8F75C(EnKakasi* this, GlobalContext* globalCtx) { if (absyawTowardsPlayer < 0x4300) { if (!this->unk_194) { - if (player->stateFlags2 & 0x1000000) { + if (player->stateFlags2 & PLAYER_STATE2_24) { this->camId = OnePointCutscene_Init(globalCtx, 2260, -99, &this->actor, MAIN_CAM); func_8010BD58(globalCtx, OCARINA_ACTION_SCARECROW_LONG_RECORDING); this->unk_19A = 0; this->unk_1B8 = 0.0; - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; this->actionFunc = func_80A8F8D0; return; } if (this->actor.xzDistToPlayer < 80.0f) { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } func_8002F2CC(&this->actor, globalCtx, 100.0f); @@ -252,7 +252,7 @@ void func_80A8F8D0(EnKakasi* this, GlobalContext* globalCtx) { } } else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_01) { func_80A8F320(this, globalCtx, 0); - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } diff --git a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c index dfb3c389a0..5d468f594f 100644 --- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c +++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c @@ -231,33 +231,33 @@ void func_80A91348(EnKakasi3* this, GlobalContext* globalCtx) { if (absAngleTowardsLink < 0x4300) { if (!this->unk_194) { - if (player->stateFlags2 & 0x1000000) { + if (player->stateFlags2 & PLAYER_STATE2_24) { this->camId = OnePointCutscene_Init(globalCtx, 2260, -99, &this->actor, MAIN_CAM); globalCtx->msgCtx.msgMode = MSGMODE_PAUSED; this->dialogState = TEXT_STATE_EVENT; this->unk_1B8 = 0.0f; Message_StartTextbox(globalCtx, 0x40A4, NULL); - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; this->actionFunc = func_80A915B8; return; } if (this->actor.xzDistToPlayer < 80.0f) { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } else if (gSaveContext.scarecrowSpawnSongSet && !this->unk_195) { - if (player->stateFlags2 & 0x1000000) { + if (player->stateFlags2 & PLAYER_STATE2_24) { this->camId = OnePointCutscene_Init(globalCtx, 2260, -99, &this->actor, MAIN_CAM); globalCtx->msgCtx.msgMode = MSGMODE_PAUSED; this->dialogState = TEXT_STATE_EVENT; this->unk_1B8 = 0.0f; Message_StartTextbox(globalCtx, 0x40A8, NULL); - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; this->actionFunc = func_80A9187C; return; } if (this->actor.xzDistToPlayer < 80.0f) { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } func_8002F2CC(&this->actor, globalCtx, 100.0f); @@ -302,7 +302,7 @@ void func_80A91620(EnKakasi3* this, GlobalContext* globalCtx) { if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_01) { func_80A90EBC(this, globalCtx, 0); - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } @@ -376,7 +376,7 @@ void func_80A918E4(EnKakasi3* this, GlobalContext* globalCtx) { if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_01) { func_80A90EBC(this, globalCtx, 0); - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index 87c9880211..a8a1e588e4 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -83,7 +83,7 @@ void EnMThunder_Init(Actor* thisx, GlobalContext* globalCtx2) { Actor_SetScale(&this->actor, 0.1f); this->unk_1CA = 0; - if (player->stateFlags2 & 0x20000) { + if (player->stateFlags2 & PLAYER_STATE2_17) { if (!gSaveContext.magicAcquired || gSaveContext.unk_13F0 || (((this->actor.params & 0xFF00) >> 8) && !(func_80087708(globalCtx, (this->actor.params & 0xFF00) >> 8, 0)))) { @@ -95,7 +95,7 @@ void EnMThunder_Init(Actor* thisx, GlobalContext* globalCtx2) { return; } - player->stateFlags2 &= ~0x20000; + player->stateFlags2 &= ~PLAYER_STATE2_17; this->unk_1CA = 1; this->collider.info.toucher.dmgFlags = D_80AA044C[this->unk_1C7]; this->unk_1C6 = 1; @@ -130,7 +130,7 @@ void func_80A9F314(GlobalContext* globalCtx, f32 arg1) { void func_80A9F350(EnMThunder* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (player->stateFlags2 & 0x20000) { + if (player->stateFlags2 & PLAYER_STATE2_17) { if (player->swordAnimation >= 0x18) { Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); @@ -142,7 +142,7 @@ void func_80A9F350(EnMThunder* this, GlobalContext* globalCtx) { return; } - if (!(player->stateFlags1 & 0x1000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_12)) { Actor_Kill(&this->actor); } } @@ -175,7 +175,7 @@ void func_80A9F408(EnMThunder* this, GlobalContext* globalCtx) { func_800AA000(0.0f, (s32)(player->unk_858 * 150.0f) & 0xFF, 2, (s32)(player->unk_858 * 150.0f) & 0xFF); } - if (player->stateFlags2 & 0x20000) { + if (player->stateFlags2 & PLAYER_STATE2_17) { if ((child != NULL) && (child->update != NULL)) { child->parent = NULL; } @@ -190,7 +190,7 @@ void func_80A9F408(EnMThunder* this, GlobalContext* globalCtx) { Actor_Kill(&this->actor); return; } else { - player->stateFlags2 &= ~0x20000; + player->stateFlags2 &= ~PLAYER_STATE2_17; if ((this->actor.params & 0xFF00) >> 8) { gSaveContext.unk_13F0 = 1; } @@ -213,7 +213,7 @@ void func_80A9F408(EnMThunder* this, GlobalContext* globalCtx) { } } - if (!(player->stateFlags1 & 0x1000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_12)) { if (this->actor.child != NULL) { this->actor.child->parent = NULL; } diff --git a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index 19eafdc9e9..9a472f0ab6 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -350,8 +350,8 @@ void func_80AA0F44(EnMa1* this, GlobalContext* globalCtx) { } if (gSaveContext.eventChkInf[1] & 0x40) { - if (player->stateFlags2 & 0x1000000) { - player->stateFlags2 |= 0x2000000; + if (player->stateFlags2 & PLAYER_STATE2_24) { + player->stateFlags2 |= PLAYER_STATE2_25; player->unk_6A8 = &this->actor; this->actor.textId = 0x2061; Message_StartTextbox(globalCtx, this->actor.textId, NULL); @@ -359,13 +359,13 @@ void func_80AA0F44(EnMa1* this, GlobalContext* globalCtx) { this->actor.flags |= ACTOR_FLAG_16; this->actionFunc = func_80AA106C; } else if (this->actor.xzDistToPlayer < 30.0f + (f32)this->collider.dim.radius) { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } } void func_80AA106C(EnMa1* this, GlobalContext* globalCtx) { - GET_PLAYER(globalCtx)->stateFlags2 |= 0x800000; + GET_PLAYER(globalCtx)->stateFlags2 |= PLAYER_STATE2_23; if (this->unk_1E8.unk_00 == 2) { Audio_OcaSetInstrument(2); func_8010BD58(globalCtx, OCARINA_ACTION_TEACH_EPONA); @@ -375,7 +375,7 @@ void func_80AA106C(EnMa1* this, GlobalContext* globalCtx) { } void func_80AA10EC(EnMa1* this, GlobalContext* globalCtx) { - GET_PLAYER(globalCtx)->stateFlags2 |= 0x800000; + GET_PLAYER(globalCtx)->stateFlags2 |= PLAYER_STATE2_23; if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_SONG_DEMO_DONE) { func_8010BD58(globalCtx, OCARINA_ACTION_PLAYBACK_EPONA); this->actionFunc = func_80AA1150; @@ -383,7 +383,7 @@ void func_80AA10EC(EnMa1* this, GlobalContext* globalCtx) { } void func_80AA1150(EnMa1* this, GlobalContext* globalCtx) { - GET_PLAYER(globalCtx)->stateFlags2 |= 0x800000; + GET_PLAYER(globalCtx)->stateFlags2 |= PLAYER_STATE2_23; if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_03) { globalCtx->nextEntranceIndex = 0x157; gSaveContext.nextCutsceneIndex = 0xFFF1; diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c index 8c28ac4ecc..dc457c78d5 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -264,13 +264,13 @@ void func_80AA2018(EnMa2* this, GlobalContext* globalCtx) { void func_80AA204C(EnMa2* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (player->stateFlags2 & 0x1000000) { + if (player->stateFlags2 & PLAYER_STATE2_24) { player->unk_6A8 = &this->actor; - player->stateFlags2 |= 0x2000000; + player->stateFlags2 |= PLAYER_STATE2_25; func_8010BD58(globalCtx, OCARINA_ACTION_CHECK_EPONA); this->actionFunc = func_80AA20E4; } else if (this->actor.xzDistToPlayer < 30.0f + (f32)this->collider.dim.radius) { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } @@ -287,7 +287,7 @@ void func_80AA20E4(EnMa2* this, GlobalContext* globalCtx) { this->actionFunc = func_80AA21C8; globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04; } else { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } @@ -295,7 +295,7 @@ void func_80AA21C8(EnMa2* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); if (DECR(this->unk_208)) { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } else { if (this->unk_1E0.unk_00 == 0) { this->actor.flags |= ACTOR_FLAG_16; diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c index 2973f31d24..f81cbab4ce 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c @@ -97,7 +97,7 @@ u16 func_80AA2AA0(GlobalContext* globalCtx, Actor* thisx) { return 0x2004; } } - if ((!(player->stateFlags1 & 0x800000)) && + if ((!(player->stateFlags1 & PLAYER_STATE1_23)) && (Actor_FindNearby(globalCtx, thisx, ACTOR_EN_HORSE, 1, 1200.0f) == NULL)) { return 0x2001; } diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 028f48e21e..25d7e49800 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -601,8 +601,8 @@ void EnMb_SetupStunned(EnMb* this) { void EnMb_Stunned(EnMb* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if ((player->stateFlags2 & 0x80) && player->actor.parent == &this->actor) { - player->stateFlags2 &= ~0x80; + if ((player->stateFlags2 & PLAYER_STATE2_7) && player->actor.parent == &this->actor) { + player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->unk_850 = 200; func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); @@ -718,8 +718,8 @@ void EnMb_SpearPatrolEndCharge(EnMb* this, GlobalContext* globalCtx) { s16 relYawFromPlayer; s16 yawPlayerToWaypoint; - if ((player->stateFlags2 & 0x80) && player->actor.parent == &this->actor) { - player->stateFlags2 &= ~0x80; + if ((player->stateFlags2 & PLAYER_STATE2_7) && player->actor.parent == &this->actor) { + player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->unk_850 = 200; func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); @@ -908,7 +908,7 @@ void EnMb_SpearPatrolPrepareAndCharge(EnMb* this, GlobalContext* globalCtx) { if (this->attackCollider.base.atFlags & AT_HIT) { if (this->attackCollider.base.at == &player->actor) { - if (!endCharge && !(player->stateFlags2 & 0x80)) { + if (!endCharge && !(player->stateFlags2 & PLAYER_STATE2_7)) { if (player->invincibilityTimer < 0) { if (player->invincibilityTimer < -39) { player->invincibilityTimer = 0; @@ -930,7 +930,7 @@ void EnMb_SpearPatrolPrepareAndCharge(EnMb* this, GlobalContext* globalCtx) { } } - if ((player->stateFlags2 & 0x80) && player->actor.parent == &this->actor) { + if ((player->stateFlags2 & PLAYER_STATE2_7) && player->actor.parent == &this->actor) { player->actor.world.pos.x = this->actor.world.pos.x + Math_CosS(this->actor.shape.rot.y) * 10.0f + Math_SinS(this->actor.shape.rot.y) * 89.0f; hasHitPlayer = true; @@ -942,10 +942,10 @@ void EnMb_SpearPatrolPrepareAndCharge(EnMb* this, GlobalContext* globalCtx) { } if (endCharge) { - if (hasHitPlayer || (player->stateFlags2 & 0x80)) { + if (hasHitPlayer || (player->stateFlags2 & PLAYER_STATE2_7)) { this->attackCollider.base.atFlags &= ~AT_HIT; - if (player->stateFlags2 & 0x80) { - player->stateFlags2 &= ~0x80; + if (player->stateFlags2 & PLAYER_STATE2_7) { + player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->unk_850 = 200; func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); @@ -977,7 +977,7 @@ void EnMb_SpearPatrolImmediateCharge(EnMb* this, GlobalContext* globalCtx) { if (this->attackCollider.base.atFlags & AT_HIT) { if (this->attackCollider.base.at == &player->actor) { - if (!endCharge && !(player->stateFlags2 & 0x80)) { + if (!endCharge && !(player->stateFlags2 & PLAYER_STATE2_7)) { if (player->invincibilityTimer < 0) { if (player->invincibilityTimer <= -40) { player->invincibilityTimer = 0; @@ -999,7 +999,7 @@ void EnMb_SpearPatrolImmediateCharge(EnMb* this, GlobalContext* globalCtx) { } } - if ((player->stateFlags2 & 0x80) && player->actor.parent == &this->actor) { + if ((player->stateFlags2 & PLAYER_STATE2_7) && player->actor.parent == &this->actor) { player->actor.world.pos.x = this->actor.world.pos.x + Math_CosS(this->actor.shape.rot.y) * 10.0f + Math_SinS(this->actor.shape.rot.y) * 89.0f; hasHitPlayer = true; @@ -1011,10 +1011,10 @@ void EnMb_SpearPatrolImmediateCharge(EnMb* this, GlobalContext* globalCtx) { } if (endCharge) { - if (hasHitPlayer || (player->stateFlags2 & 0x80)) { + if (hasHitPlayer || (player->stateFlags2 & PLAYER_STATE2_7)) { this->attackCollider.base.atFlags &= ~AT_HIT; - if (player->stateFlags2 & 0x80) { - player->stateFlags2 &= ~0x80; + if (player->stateFlags2 & PLAYER_STATE2_7) { + player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->unk_850 = 200; func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); @@ -1236,7 +1236,7 @@ void EnMb_ClubWaitPlayerNear(EnMb* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < this->playerDetectionRange && - !(player->stateFlags1 & 0x4000000) && ABS(relYawFromPlayer) < 0x3E80) { + !(player->stateFlags1 & PLAYER_STATE1_26) && ABS(relYawFromPlayer) < 0x3E80) { EnMb_SetupClubAttack(this); } } @@ -1295,8 +1295,8 @@ void EnMb_SpearDead(EnMb* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); - if ((player->stateFlags2 & 0x80) && player->actor.parent == &this->actor) { - player->stateFlags2 &= ~0x80; + if ((player->stateFlags2 & PLAYER_STATE2_7) && player->actor.parent == &this->actor) { + player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->unk_850 = 200; func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); @@ -1378,8 +1378,8 @@ void EnMb_CheckColliding(EnMb* this, GlobalContext* globalCtx) { this->hitbox.base.acFlags &= ~AC_HIT; if (this->actor.colChkInfo.damageEffect != ENMB_DMGEFF_IGNORE && this->actor.colChkInfo.damageEffect != ENMB_DMGEFF_FREEZE) { - if ((player->stateFlags2 & 0x80) && player->actor.parent == &this->actor) { - player->stateFlags2 &= ~0x80; + if ((player->stateFlags2 & PLAYER_STATE2_7) && player->actor.parent == &this->actor) { + player->stateFlags2 &= ~PLAYER_STATE2_7; player->actor.parent = NULL; player->unk_850 = 200; func_8002F71C(globalCtx, &this->actor, 6.0f, this->actor.world.rot.y, 6.0f); diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index 5ec129cd56..b47dc19cbc 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -735,8 +735,8 @@ void func_80AAB948(EnMd* this, GlobalContext* globalCtx) { } if ((this->unk_1E0.unk_00 == 0) && (globalCtx->sceneNum == SCENE_SPOT10)) { - if (player->stateFlags2 & 0x1000000) { - player->stateFlags2 |= 0x2000000; + if (player->stateFlags2 & PLAYER_STATE2_24) { + player->stateFlags2 |= PLAYER_STATE2_25; player->unk_6A8 = &this->actor; func_8010BD58(globalCtx, OCARINA_ACTION_CHECK_SARIA); this->actionFunc = func_80AABC10; @@ -744,7 +744,7 @@ void func_80AAB948(EnMd* this, GlobalContext* globalCtx) { } if (this->actor.xzDistToPlayer < (30.0f + this->collider.dim.radius)) { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } } @@ -763,7 +763,7 @@ void func_80AABC10(EnMd* this, GlobalContext* globalCtx) { this->actionFunc = func_80AAB948; globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04; } else { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/src/overlays/actors/ovl_En_Mk/z_en_mk.c index 9c66898b73..959509fbb5 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -307,13 +307,13 @@ void EnMk_Update(Actor* thisx, GlobalContext* globalCtx) { player = GET_PLAYER(globalCtx); if (this->flags & 8) { - if (!(player->stateFlags2 & 0x400)) { + if (!(player->stateFlags2 & PLAYER_STATE2_10)) { this->flags &= ~8; } } else { if (player->currentBoots == PLAYER_BOOTS_IRON) { this->flags |= 8; - } else if (player->stateFlags2 & 0x400) { + } else if (player->stateFlags2 & PLAYER_STATE2_10) { swimFlag = player->actor.yDistToWater; if (swimFlag > 0) { diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index b97b765a01..5151bb6c1d 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -146,7 +146,8 @@ void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); s32 pad; - if (!(player->stateFlags1 & 0x300000C0) || (this->actionFunc == func_80ABBB34)) { + if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29)) || + (this->actionFunc == func_80ABBB34)) { this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index 818a80478c..6b6f8b0fba 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -114,18 +114,18 @@ void func_80ABEF2C(EnOkarinaTag* this, GlobalContext* globalCtx) { this->actor.flags &= ~ACTOR_FLAG_0; } else { if ((this->ocarinaSong != 6) || (gSaveContext.scarecrowSpawnSongSet)) { - if (player->stateFlags2 & 0x1000000) { + if (player->stateFlags2 & PLAYER_STATE2_24) { // "North! ! ! ! !" osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 北!!!!! ☆☆☆☆☆ %f\n" VT_RST, this->actor.xzDistToPlayer); } if ((this->actor.xzDistToPlayer < (90.0f + this->interactRange)) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 80.0f)) { - if (player->stateFlags2 & 0x2000000) { + if (player->stateFlags2 & PLAYER_STATE2_25) { ocarinaSong = this->ocarinaSong; if (ocarinaSong == 6) { ocarinaSong = 0xA; } - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; func_8010BD58(globalCtx, ocarinaSong + OCARINA_ACTION_CHECK_SARIA); this->actionFunc = func_80ABF0CC; } else if ((this->actor.xzDistToPlayer < (50.0f + this->interactRange) && @@ -179,7 +179,7 @@ void func_80ABF0CC(EnOkarinaTag* this, GlobalContext* globalCtx) { globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04; this->actionFunc = func_80ABEF2C; } else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_01) { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } } @@ -195,7 +195,7 @@ void func_80ABF28C(EnOkarinaTag* this, GlobalContext* globalCtx) { ((this->type != 6) || !(gSaveContext.eventChkInf[1] & 0x2000)) && (this->actor.xzDistToPlayer < (90.0f + this->interactRange)) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 80.0f)) { - if (player->stateFlags2 & 0x1000000) { + if (player->stateFlags2 & PLAYER_STATE2_24) { switch (this->type) { case 1: func_8010BD58(globalCtx, OCARINA_ACTION_CHECK_LULLABY); @@ -216,12 +216,12 @@ void func_80ABF28C(EnOkarinaTag* this, GlobalContext* globalCtx) { Actor_Kill(&this->actor); break; } - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; this->actionFunc = func_80ABF4C8; } else if ((this->actor.xzDistToPlayer < (50.0f + this->interactRange)) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 40.0f)) { this->unk_15A = 0; - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } } @@ -272,7 +272,7 @@ void func_80ABF4C8(EnOkarinaTag* this, GlobalContext* globalCtx) { } } if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_01) { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } } diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 0e6633e887..ecb9abdc4f 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -578,7 +578,7 @@ void EnOkuta_Update(Actor* thisx, GlobalContext* globalCtx2) { Vec3f sp38; s32 sp34; - if (!(player->stateFlags1 & 0x300000C0)) { + if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29))) { if (this->actor.params == 0) { EnOkuta_ColliderCheck(this, globalCtx); if (!WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index fbd2d70195..d6d0137cb8 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -653,7 +653,7 @@ void EnOssan_EndInteraction(GlobalContext* globalCtx, EnOssan* this) { Actor_ProcessTalkRequest(&this->actor, globalCtx); globalCtx->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; globalCtx->msgCtx.stateTimer = 4; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_29; func_800BC490(globalCtx, 1); Interface_ChangeAlpha(50); this->drawCursor = 0; @@ -737,7 +737,7 @@ void EnOssan_State_Idle(EnOssan* this, GlobalContext* globalCtx, Player* player) if (Actor_ProcessTalkRequest(&this->actor, globalCtx)) { // "Start conversation!!" osSyncPrintf(VT_FGCOL(YELLOW) "★★★ 会話開始!! ★★★" VT_RST "\n"); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_29; func_800BC590(globalCtx); EnOssan_SetStateStartShopping(globalCtx, this, false); } else if (this->actor.xzDistToPlayer < 100.0f) { @@ -1323,7 +1323,7 @@ void EnOssan_GiveItemWithFanfare(GlobalContext* globalCtx, EnOssan* this) { func_8002F434(&this->actor, globalCtx, this->shelfSlots[this->cursorIndex]->getItemId, 120.0f, 120.0f); globalCtx->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; globalCtx->msgCtx.stateTimer = 4; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_29; func_800BC490(globalCtx, 1); Interface_ChangeAlpha(50); this->drawCursor = 0; @@ -1698,7 +1698,7 @@ void EnOssan_State_ContinueShoppingPrompt(EnOssan* this, GlobalContext* globalCt case 0: osSyncPrintf(VT_FGCOL(YELLOW) "★★★ 続けるよ!! ★★★" VT_RST "\n"); player->actor.shape.rot.y += 0x8000; - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_29; func_800BC490(globalCtx, 2); Message_StartTextbox(globalCtx, this->actor.textId, &this->actor); EnOssan_SetStateStartShopping(globalCtx, this, true); @@ -1717,7 +1717,7 @@ void EnOssan_State_ContinueShoppingPrompt(EnOssan* this, GlobalContext* globalCt selectedItem = this->shelfSlots[this->cursorIndex]; selectedItem->updateStockedItemFunc(globalCtx, selectedItem); player->actor.shape.rot.y += 0x8000; - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_29; func_800BC490(globalCtx, 2); Message_StartTextbox(globalCtx, this->actor.textId, &this->actor); EnOssan_SetStateStartShopping(globalCtx, this, true); diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index ff11ccedc1..0bc1bdf085 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -379,7 +379,8 @@ void EnPoField_CorrectYPos(EnPoField* this, GlobalContext* globalCtx) { f32 EnPoField_SetFleeSpeed(EnPoField* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - f32 speed = ((player->stateFlags1 & 0x800000) && player->rideActor != NULL) ? player->rideActor->speedXZ : 12.0f; + f32 speed = + ((player->stateFlags1 & PLAYER_STATE1_23) && player->rideActor != NULL) ? player->rideActor->speedXZ : 12.0f; if (this->actor.xzDistToPlayer < 300.0f) { this->actor.speedXZ = speed * 1.5f + 2.0f; @@ -407,13 +408,13 @@ void EnPoField_WaitForSpawn(EnPoField* this, GlobalContext* globalCtx) { if (fabsf(sSpawnPositions[i].x - player->actor.world.pos.x) < 150.0f && fabsf(sSpawnPositions[i].z - player->actor.world.pos.z) < 150.0f) { if (Flags_GetSwitch(globalCtx, sSpawnSwitchFlags[i])) { - if (player->stateFlags1 & 0x800000) { // Player riding Epona + if (player->stateFlags1 & PLAYER_STATE1_23) { // Player riding Epona return; } else { this->actor.params = EN_PO_FIELD_SMALL; spawnDist = 300.0f; } - } else if (player->stateFlags1 & 0x800000 || Rand_ZeroOne() < 0.4f) { + } else if (player->stateFlags1 & PLAYER_STATE1_23 || Rand_ZeroOne() < 0.4f) { this->actor.params = EN_PO_FIELD_BIG; this->spawnFlagIndex = i; spawnDist = 480.0f; diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index f02bd3edd9..d5df0648be 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -322,7 +322,9 @@ void func_80AE2C1C(EnRd* this, GlobalContext* globalCtx) { } if ((ABS(sp32) < 0x1554) && (Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 150.0f)) { - if (!(player->stateFlags1 & 0x2C6080) && !(player->stateFlags2 & 0x80)) { + if (!(player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_18 | + PLAYER_STATE1_19 | PLAYER_STATE1_21)) && + !(player->stateFlags2 & PLAYER_STATE2_7)) { if (this->unk_306 == 0) { if (!(this->unk_312 & 0x80)) { player->actor.freezeTimer = 40; @@ -394,7 +396,9 @@ void func_80AE2FD0(EnRd* this, GlobalContext* globalCtx) { this->actor.world.rot.y = this->actor.shape.rot.y; SkelAnime_Update(&this->skelAnime); - if (!(player->stateFlags1 & 0x2C6080) && !(player->stateFlags2 & 0x80) && + if (!(player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_18 | + PLAYER_STATE1_19 | PLAYER_STATE1_21)) && + !(player->stateFlags2 & PLAYER_STATE2_7) && (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) < 150.0f)) { this->actor.targetMode = 0; func_80AE2B90(this, globalCtx); @@ -487,7 +491,7 @@ void func_80AE3454(EnRd* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x5DC, 0); Math_SmoothStepToS(&this->unk_310, 0, 1, 0x5DC, 0); case 2: - if (!(player->stateFlags2 & 0x80)) { + if (!(player->stateFlags2 & PLAYER_STATE2_7)) { Animation_Change(&this->skelAnime, &object_rd_Anim_0046F8, 0.5f, 0.0f, Animation_GetLastFrame(&object_rd_Anim_0046F8), ANIMMODE_ONCE_INTERP, 0.0f); this->unk_304++; diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index 794c71c9ed..a45fb099f0 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -495,7 +495,7 @@ void EnRr_CollisionCheck(EnRr* this, GlobalContext* globalCtx) { } } if ((this->ocTimer == 0) && (this->actor.colorFilterTimer == 0) && (player->invincibilityTimer == 0) && - !(player->stateFlags2 & 0x80) && + !(player->stateFlags2 & PLAYER_STATE2_7) && ((this->collider1.base.ocFlags1 & OC1_HIT) || (this->collider2.base.ocFlags1 & OC1_HIT))) { this->collider1.base.ocFlags1 &= ~OC1_HIT; this->collider2.base.ocFlags1 &= ~OC1_HIT; @@ -623,7 +623,7 @@ void EnRr_GrabPlayer(EnRr* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIKE_EAT); } this->ocTimer = 8; - if ((this->grabTimer == 0) || !(player->stateFlags2 & 0x80)) { + if ((this->grabTimer == 0) || !(player->stateFlags2 & PLAYER_STATE2_7)) { EnRr_SetupReleasePlayer(this, globalCtx); } else { Math_ApproachF(&player->actor.world.pos.x, this->mouthPos.x, 1.0f, 30.0f); diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 30b0965ca1..bd5d419f09 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -855,7 +855,8 @@ void func_80AEC780(EnRu1* this, GlobalContext* globalCtx) { s32 pad; Player* player = GET_PLAYER(globalCtx); - if ((func_80AEC5FC(this, globalCtx)) && (!Gameplay_InCsMode(globalCtx)) && (!(player->stateFlags1 & 0x206000)) && + if ((func_80AEC5FC(this, globalCtx)) && (!Gameplay_InCsMode(globalCtx)) && + (!(player->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_21))) && (player->actor.bgCheckFlags & 1)) { globalCtx->csCtx.segment = &D_80AF0880; @@ -1641,7 +1642,7 @@ void func_80AEE7C4(EnRu1* this, GlobalContext* globalCtx) { } player = GET_PLAYER(globalCtx); - if (player->stateFlags2 & 0x10000000) { + if (player->stateFlags2 & PLAYER_STATE2_28) { this->unk_370 += 1.0f; if (this->action != 32) { if (*unk_370 > 30.0f) { diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c index 8788fadc02..e1597b737f 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -718,7 +718,7 @@ void EnSkj_SariasSongKidIdle(EnSkj* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); if (EnSkj_RangeCheck(player, sSmallStumpSkullKid.skullkid)) { EnSkj_SetupWaitInRange(this); - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; player->unk_6A8 = &sSmallStumpSkullKid.skullkid->actor; } } @@ -902,8 +902,8 @@ void EnSkj_WaitInRange(EnSkj* this, GlobalContext* globalCtx) { // When link pulls out the Ocarina center him on the stump // Link was probably supposed to be pointed towards skull kid as well - if (player->stateFlags2 & 0x1000000) { - player->stateFlags2 |= 0x2000000; + if (player->stateFlags2 & PLAYER_STATE2_24) { + player->stateFlags2 |= PLAYER_STATE2_25; player->unk_6A8 = &sSmallStumpSkullKid.skullkid->actor; player->actor.world.pos.x = sSmallStumpSkullKid.skullkid->actor.world.pos.x; player->actor.world.pos.y = sSmallStumpSkullKid.skullkid->actor.world.pos.y; @@ -924,7 +924,7 @@ void EnSkj_WaitInRange(EnSkj* this, GlobalContext* globalCtx) { } else if (!EnSkj_RangeCheck(player, sSmallStumpSkullKid.skullkid)) { EnSkj_SetupResetFight(this); } else { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; if (gSaveContext.itemGetInf[1] & 0x40) { if (gSaveContext.itemGetInf[3] & 0x200) { this->textId = Text_GetFaceReaction(globalCtx, 0x15); @@ -985,10 +985,10 @@ void EnSkj_WaitForSong(EnSkj* this, GlobalContext* globalCtx) { globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_05; } } else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_02) { - player->stateFlags2 &= ~0x1000000; + player->stateFlags2 &= ~PLAYER_STATE2_24; Actor_Kill(&this->actor); } else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_01) { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } else { if (globalCtx->msgCtx.ocarinaMode >= OCARINA_MODE_05) { gSaveContext.sunsSongState = 0; @@ -1201,7 +1201,7 @@ void EnSkj_SariasSongWaitForTextClear(EnSkj* this, GlobalContext* globalCtx) { if (state == TEXT_STATE_DONE && Message_ShouldAdvance(globalCtx)) { EnSkj_SetupWaitInRange(this); - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; player->unk_6A8 = (Actor*)sSmallStumpSkullKid.skullkid; } } @@ -1364,8 +1364,8 @@ void EnSkj_SetupWaitForOcarina(EnSkj* this, GlobalContext* globalCtx) { sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid->playerInRange = true; sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid->playerInRange = true; - if (player->stateFlags2 & 0x1000000) { - player->stateFlags2 |= 0x2000000; + if (player->stateFlags2 & PLAYER_STATE2_24) { + player->stateFlags2 |= PLAYER_STATE2_25; func_800F5BF0(NATURE_ID_KOKIRI_REGION); EnSkj_TurnPlayer(this, player); player->unk_6A8 = &this->actor; @@ -1380,15 +1380,15 @@ void EnSkj_SetupWaitForOcarina(EnSkj* this, GlobalContext* globalCtx) { void EnSkj_WaitForOcarina(EnSkj* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (player->stateFlags2 & 0x1000000) { - player->stateFlags2 |= 0x2000000; + if (player->stateFlags2 & PLAYER_STATE2_24) { + player->stateFlags2 |= PLAYER_STATE2_25; func_800F5BF0(NATURE_ID_KOKIRI_REGION); EnSkj_TurnPlayer(this, player); player->unk_6A8 = &this->actor; Message_StartTextbox(globalCtx, 0x10BE, &this->actor); this->actionFunc = EnSkj_StartOcarinaMinigame; } else if (EnSkj_RangeCheck(player, this)) { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } @@ -1507,7 +1507,7 @@ void EnSkj_WaitForOfferResponse(EnSkj* this, GlobalContext* globalCtx) { switch (globalCtx->msgCtx.choiceIndex) { case 0: // yes player = GET_PLAYER(globalCtx); - player->stateFlags3 |= 0x20; // makes player take ocarina out right away after closing box + player->stateFlags3 |= PLAYER_STATE3_5; // makes player take ocarina out right away after closing box this->actionFunc = EnSkj_SetupWaitForOcarina; break; case 1: // no diff --git a/src/overlays/actors/ovl_En_Stream/z_en_stream.c b/src/overlays/actors/ovl_En_Stream/z_en_stream.c index 71a5a9e437..7315e0c38d 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.c +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.c @@ -102,7 +102,7 @@ void EnStream_SuckPlayer(EnStream* this, GlobalContext* globalCtx) { if (yDistWithOffset > 0.0f) { Math_SmoothStepToF(&player->actor.velocity.y, -3.0f, 0.7f, yDistWithOffset, 0.0f); if (posDifference.y < -70.0f) { - player->stateFlags2 |= 0x80000000; + player->stateFlags2 |= PLAYER_STATE2_31; } } } else { diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index b48eebdb12..82871ec9e7 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -692,7 +692,7 @@ s32 func_80B0DEA8(EnSw* this, GlobalContext* globalCtx, s32 arg2) { s32 sp54; Vec3f sp48; - if (!(player->stateFlags1 & 0x200000) && arg2) { + if (!(player->stateFlags1 & PLAYER_STATE1_21) && arg2) { return false; } else if (func_8002DDF4(globalCtx) && arg2) { return false; diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/src/overlays/actors/ovl_En_Ta/z_en_ta.c index ee7a4791f1..9a915eece8 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -573,7 +573,7 @@ s32 func_80B150AC(EnTa* this, GlobalContext* globalCtx, s32 idx) { Player* player = GET_PLAYER(globalCtx); Actor* interactRangeActor; - if (player->stateFlags1 & 0x800) { + if (player->stateFlags1 & PLAYER_STATE1_11) { interactRangeActor = player->interactRangeActor; if (interactRangeActor != NULL && interactRangeActor->id == ACTOR_EN_NIW && interactRangeActor == &this->superCuccos[idx]->actor) { @@ -607,7 +607,7 @@ void func_80B15100(EnTa* this, GlobalContext* globalCtx) { if (player->heldActor == &this->superCuccos[unk_2CA]->actor) { player->heldActor = NULL; } - player->stateFlags1 &= ~0x800; + player->stateFlags1 &= ~PLAYER_STATE1_11; this->superCuccos[unk_2CA] = NULL; } this->unk_2E0 |= 1; diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index 12519b247e..bcca638a05 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -402,7 +402,7 @@ void EnTest_ChooseAction(EnTest* this, GlobalContext* globalCtx) { } else { if (this->actor.xzDistToPlayer < 110.0f) { if (Rand_ZeroOne() > 0.2f) { - if (player->stateFlags1 & 0x10) { + if (player->stateFlags1 & PLAYER_STATE1_4) { if (this->actor.isTargeted) { EnTest_SetupSlashDown(this); } else { @@ -688,7 +688,7 @@ void EnTest_WalkAndBlock(EnTest* this, GlobalContext* globalCtx) { if (this->actor.xzDistToPlayer < 110.0f) { if (Rand_ZeroOne() > 0.2f) { - if (player->stateFlags1 & 0x10) { + if (player->stateFlags1 & PLAYER_STATE1_4) { if (this->actor.isTargeted) { EnTest_SetupSlashDown(this); } else { @@ -973,7 +973,7 @@ void EnTest_SlashDownEnd(EnTest* this, GlobalContext* globalCtx) { if ((ABS(yawDiff) > 0x3E80) && (this->actor.params != STALFOS_TYPE_CEILING)) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnTest_SetupJumpBack(this); - } else if (player->stateFlags1 & 0x10) { + } else if (player->stateFlags1 & PLAYER_STATE1_4) { if (this->actor.isTargeted) { EnTest_SetupSlashDown(this); } else if ((globalCtx->gameplayFrames % 2) != 0) { diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 75ca816442..8a32db6226 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -344,7 +344,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { } else if (sSwordJumpState != 0) { sStickTilt = 0.0f; - player->stateFlags3 |= 4; + player->stateFlags3 |= PLAYER_STATE3_2; Math_SmoothStepToF(&this->actor.world.pos.x, (Math_SinS(player->actor.shape.rot.y - 0x3E8) * 45.0f) + player->actor.world.pos.x, @@ -357,7 +357,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { if (((u32)sSwordJumpTimer == 0) || ((player->invincibilityTimer > 0) && (this->swordState == 0))) { this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; input->cur.button = BTN_A; - player->stateFlags3 &= ~4; + player->stateFlags3 &= ~PLAYER_STATE3_2; sStickTilt = 127.0f; player->skelAnime.curFrame = 3.0f; sStickAngle = this->actor.yawTowardsPlayer + 0x8000; @@ -392,7 +392,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { sStickTilt = 0.0f; sSwordJumpState = 1; - player->stateFlags3 |= 4; + player->stateFlags3 |= PLAYER_STATE3_2; this->actor.flags &= ~ACTOR_FLAG_0; sSwordJumpTimer = 27; player->swordState = 0; @@ -440,7 +440,8 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { sStickAngle = thisx->yawTowardsPlayer; sp50 = 0.0f; if ((90.0f >= this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 70.0f) && - (ABS(sp5A) >= 0x7800) && (this->actor.isTargeted || !(player->stateFlags1 & 0x00400000))) { + (ABS(sp5A) >= 0x7800) && + (this->actor.isTargeted || !(player->stateFlags1 & PLAYER_STATE1_22))) { EnTorch2_SwingSword(globalCtx, input, this); } else if (((this->actor.xzDistToPlayer <= 70.0f) || ((this->actor.xzDistToPlayer <= 80.0f + sp50) && (player->swordState != 0))) && @@ -511,7 +512,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { this->swordState = 0; input->cur.stick_x = input->cur.stick_y = 0; if ((this->invincibilityTimer > 0) && (this->actor.world.pos.y < (this->actor.floorHeight - 160.0f))) { - this->stateFlags3 &= ~1; + this->stateFlags3 &= ~PLAYER_STATE3_0; this->actor.flags |= ACTOR_FLAG_0; this->invincibilityTimer = 0; this->actor.velocity.y = 0.0f; @@ -591,7 +592,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { sDeathFlag = false; } if ((this->invincibilityTimer == 0) && (this->actor.colChkInfo.health != 0) && - (this->cylinder.base.acFlags & AC_HIT) && !(this->stateFlags1 & 0x04000000) && + (this->cylinder.base.acFlags & AC_HIT) && !(this->stateFlags1 & PLAYER_STATE1_26) && !(this->swordQuads[0].base.atFlags & AT_HIT) && !(this->swordQuads[1].base.atFlags & AT_HIT)) { if (!Actor_ApplyDamage(&this->actor)) { @@ -606,7 +607,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { sActionState = ENTORCH2_DEATH; Enemy_StartFinishingBlow(globalCtx, &this->actor); Item_DropCollectibleRandom(globalCtx, &this->actor, &thisx->world.pos, 0xC0); - this->stateFlags3 &= ~4; + this->stateFlags3 &= ~PLAYER_STATE3_2; } else { func_800F5ACC(NA_BGM_MINI_BOSS); if (this->actor.colChkInfo.damageEffect == 1) { @@ -623,8 +624,8 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { this->unk_8A4 = 8.0f; this->unk_8A2 = this->actor.yawTowardsPlayer + 0x8000; Actor_SetDropFlag(&this->actor, &this->cylinder.info, 1); - this->stateFlags3 &= ~4; - this->stateFlags3 |= 1; + this->stateFlags3 &= ~PLAYER_STATE3_2; + this->stateFlags3 |= PLAYER_STATE3_0; sActionState = ENTORCH2_DAMAGE; if (sAlpha == 255) { Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 0xC); @@ -640,10 +641,10 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { // Handles being frozen by a deku nut if ((this->actor.colorFilterTimer == 0) || (this->actor.colorFilterParams & 0x4000)) { - this->stateFlags3 &= ~4; + this->stateFlags3 &= ~PLAYER_STATE3_2; } else { - this->stateFlags3 |= 4; - this->stateFlags1 &= ~0x04000000; + this->stateFlags3 |= PLAYER_STATE3_2; + this->stateFlags1 &= ~PLAYER_STATE1_26; this->invincibilityTimer = 0; input->press.stick_x = input->press.stick_y = 0; /*! @bug diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/src/overlays/actors/ovl_En_Tp/z_en_tp.c index 0877589844..3522684c49 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -654,7 +654,7 @@ void EnTp_Update(Actor* thisx, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); s16 yawToWall; - if (player->stateFlags1 & 0x4000000) { // Shielding + if (player->stateFlags1 & PLAYER_STATE1_26) { // Shielding this->damageEffect = TAILPASARAN_DMGEFF_NONE; } diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index f38106497d..9432a42921 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -303,7 +303,8 @@ void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx) { this->timer--; } - if ((player->stateFlags1 & 0x100000) || (player->stateFlags1 & 0x8000000) || !(player->actor.bgCheckFlags & 1) || + if ((player->stateFlags1 & PLAYER_STATE1_20) || (player->stateFlags1 & PLAYER_STATE1_27) || + !(player->actor.bgCheckFlags & 1) || ((this->actor.params == 1) && (320.0f < Math_Vec3f_DistXZ(&this->actor.home.pos, playerPos)))) { Audio_StopSfxById(NA_SE_EN_FALL_AIM); this->timer = 0x82; @@ -321,7 +322,7 @@ void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_Drop(EnWallmas* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (!Player_InCsMode(globalCtx) && !(player->stateFlags2 & 0x10) && (player->invincibilityTimer >= 0) && + if (!Player_InCsMode(globalCtx) && !(player->stateFlags2 & PLAYER_STATE2_4) && (player->invincibilityTimer >= 0) && (this->actor.xzDistToPlayer < 30.0f) && (this->actor.yDistToPlayer < -5.0f) && (-(f32)(player->cylinder.dim.height + 10) < this->actor.yDistToPlayer)) { EnWallmas_SetupTakePlayer(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c index c4eb189c17..59351098b1 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -347,8 +347,8 @@ s32 EnXc_SerenadeCS(EnXc* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); s32 stateFlags = player->stateFlags1; - if (CHECK_OWNED_EQUIP(EQUIP_BOOTS, 1) && !(gSaveContext.eventChkInf[5] & 4) && !(stateFlags & 0x20000000) && - !Gameplay_InCsMode(globalCtx)) { + if (CHECK_OWNED_EQUIP(EQUIP_BOOTS, 1) && !(gSaveContext.eventChkInf[5] & 4) && + !(stateFlags & PLAYER_STATE1_29) && !Gameplay_InCsMode(globalCtx)) { Cutscene_SetSegment(globalCtx, &gIceCavernSerenadeCs); gSaveContext.cutsceneTrigger = 1; gSaveContext.eventChkInf[5] |= 4; // Learned Serenade of Water Flag diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index 39fd149178..a8d90a4a80 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -526,8 +526,8 @@ s32 EnZf_CanAttack(GlobalContext* globalCtx, EnZf* this) { Actor* targetedActor; Player* player = GET_PLAYER(globalCtx); - if (this->actor.params >= ENZF_TYPE_LIZALFOS_MINIBOSS_A) { // miniboss - if (player->stateFlags1 & 0x6000) { // Hanging or climbing + if (this->actor.params >= ENZF_TYPE_LIZALFOS_MINIBOSS_A) { // miniboss + if (player->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14)) { // Hanging or climbing return false; } else { return true; @@ -1203,7 +1203,7 @@ void EnZf_Slash(EnZf* this, GlobalContext* globalCtx) { if (yawDiff > 16000) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; func_80B483E4(this, globalCtx); - } else if (player->stateFlags1 & 0x6010) { + } else if (player->stateFlags1 & (PLAYER_STATE1_4 | PLAYER_STATE1_13 | PLAYER_STATE1_14)) { if (this->actor.isTargeted) { EnZf_SetupSlash(this); } else { diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index 9c59c813b8..aa0493a8d4 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -2196,7 +2196,7 @@ void Fishing_UpdateLure(Fishing* this, GlobalContext* globalCtx) { Math_ApproachF(&D_80B7E144, 195.0f, 1.0f, 1.0f); - if (player->stateFlags1 & 0x8000000) { + if (player->stateFlags1 & PLAYER_STATE1_27) { D_80B7E0B4 = 0; player->unk_860 = 0; } diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index eafbe9e3af..8377723718 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -475,11 +475,11 @@ void ObjOshihiki_OnScene(ObjOshihiki* this, GlobalContext* globalCtx) { this->direction = this->dyna.unk_150; ObjOshihiki_SetupPush(this, globalCtx); } else { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; } } else { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; } } @@ -516,11 +516,11 @@ void ObjOshihiki_OnActor(ObjOshihiki* this, GlobalContext* globalCtx) { this->direction = this->dyna.unk_150; ObjOshihiki_SetupPush(this, globalCtx); } else { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; } } else { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; } } else { @@ -568,7 +568,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx) { if (!ObjOshihiki_CheckFloor(this, globalCtx)) { thisx->home.pos.x = thisx->world.pos.x; thisx->home.pos.z = thisx->world.pos.z; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; this->pushDist = 0.0f; this->pushSpeed = 0.0f; @@ -581,7 +581,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx) { thisx->home.pos.x = thisx->world.pos.x; thisx->home.pos.z = thisx->world.pos.z; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; this->pushDist = 0.0f; this->pushSpeed = 0.0f; @@ -609,7 +609,7 @@ void ObjOshihiki_Fall(ObjOshihiki* this, GlobalContext* globalCtx) { this->stateFlags |= PUSHBLOCK_FALL; if (fabsf(this->dyna.unk_150) > 0.001f) { this->dyna.unk_150 = 0.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_4; } Actor_MoveForward(&this->dyna.actor); if (ObjOshihiki_CheckGround(this, globalCtx)) { diff --git a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c index 1a484099db..978856f81f 100644 --- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c +++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c @@ -170,11 +170,11 @@ s32 ObjTimeblock_WaitForOcarina(ObjTimeblock* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); if (ObjTimeblock_PlayerIsInRange(this, globalCtx)) { - if (player->stateFlags2 & 0x1000000) { + if (player->stateFlags2 & PLAYER_STATE2_24) { func_8010BD58(globalCtx, OCARINA_ACTION_FREE_PLAY); this->songObserverFunc = ObjTimeblock_WaitForSong; } else { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } return false; diff --git a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c index 182987c2bd..d6d979dfb3 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c @@ -158,11 +158,11 @@ s32 func_80BA2218(ObjWarp2block* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); if (func_80BA1ECC(this, globalCtx)) { - if (player->stateFlags2 & 0x1000000) { + if (player->stateFlags2 & PLAYER_STATE2_24) { func_8010BD58(globalCtx, OCARINA_ACTION_FREE_PLAY); this->func_168 = func_80BA228C; } else { - player->stateFlags2 |= 0x800000; + player->stateFlags2 |= PLAYER_STATE2_23; } } diff --git a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c index 2e631ce6d8..810838fb50 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c @@ -71,7 +71,7 @@ void OceffSpot_Destroy(Actor* thisx, GlobalContext* globalCtx) { LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->lightNode2); func_800876C8(globalCtx); if ((gSaveContext.nayrusLoveTimer != 0) && (globalCtx->actorCtx.actorLists[ACTORCAT_PLAYER].length != 0)) { - player->stateFlags3 |= 0x40; + player->stateFlags3 |= PLAYER_STATE3_6; } } diff --git a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c index 13395a0dfe..ad0aebf89b 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c @@ -61,7 +61,7 @@ void OceffStorm_Destroy(Actor* thisx, GlobalContext* globalCtx) { func_800876C8(globalCtx); if (gSaveContext.nayrusLoveTimer != 0) { - player->stateFlags3 |= 0x40; + player->stateFlags3 |= PLAYER_STATE3_6; } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index 9662c5e7ca..a39b5206a9 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -41,7 +41,7 @@ void OceffWipe_Destroy(Actor* thisx, GlobalContext* globalCtx) { func_800876C8(globalCtx); if (gSaveContext.nayrusLoveTimer != 0) { - player->stateFlags3 |= 0x40; + player->stateFlags3 |= PLAYER_STATE3_6; } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c index edeb6f6882..66637178bc 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -41,7 +41,7 @@ void OceffWipe2_Destroy(Actor* thisx, GlobalContext* globalCtx) { func_800876C8(globalCtx); if (gSaveContext.nayrusLoveTimer != 0) { - player->stateFlags3 |= 0x40; + player->stateFlags3 |= PLAYER_STATE3_6; } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c index 43fa8793db..0b7ca33c3d 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -44,7 +44,7 @@ void OceffWipe3_Destroy(Actor* thisx, GlobalContext* globalCtx) { func_800876C8(globalCtx); if (gSaveContext.nayrusLoveTimer != 0) { - player->stateFlags3 |= 0x40; + player->stateFlags3 |= PLAYER_STATE3_6; } } diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index 250df0f2bf..27fa236345 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -127,8 +127,8 @@ void func_80BADF0C(ShotSun* this, GlobalContext* globalCtx) { this->unk_1A4 = 0; } else { if (this->unk_1A4 == 0) { - if (!(player->stateFlags2 & 0x1000000)) { - player->stateFlags2 |= 0x800000; + if (!(player->stateFlags2 & PLAYER_STATE2_24)) { + player->stateFlags2 |= PLAYER_STATE2_23; return; } else { this->unk_1A4 = 1; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index ea73761427..1f8b465d25 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -1176,7 +1176,7 @@ void func_808322FC(Player* this) { } void func_80832318(Player* this) { - this->stateFlags2 &= ~0x20000; + this->stateFlags2 &= ~PLAYER_STATE2_17; this->swordState = 0; this->swordInfo[0].active = this->swordInfo[1].active = this->swordInfo[2].active = 0; } @@ -1192,7 +1192,7 @@ void func_80832340(GlobalContext* globalCtx, Player* this) { } } - this->stateFlags2 &= ~0xC00; + this->stateFlags2 &= ~(PLAYER_STATE2_10 | PLAYER_STATE2_11); } void func_808323B4(GlobalContext* globalCtx, Player* this) { @@ -1203,7 +1203,7 @@ void func_808323B4(GlobalContext* globalCtx, Player* this) { this->heldActor = NULL; this->interactRangeActor = NULL; heldActor->parent = NULL; - this->stateFlags1 &= ~0x800; + this->stateFlags1 &= ~PLAYER_STATE1_11; } if (Player_GetExplosiveHeld(this) >= 0) { @@ -1213,14 +1213,14 @@ void func_808323B4(GlobalContext* globalCtx, Player* this) { } void func_80832440(GlobalContext* globalCtx, Player* this) { - if ((this->stateFlags1 & 0x800) && (this->heldActor == NULL)) { + if ((this->stateFlags1 & PLAYER_STATE1_11) && (this->heldActor == NULL)) { if (this->interactRangeActor != NULL) { if (this->getItemId == GI_NONE) { - this->stateFlags1 &= ~0x800; + this->stateFlags1 &= ~PLAYER_STATE1_11; this->interactRangeActor = NULL; } } else { - this->stateFlags1 &= ~0x800; + this->stateFlags1 &= ~PLAYER_STATE1_11; } } @@ -1230,8 +1230,8 @@ void func_80832440(GlobalContext* globalCtx, Player* this) { func_80832340(globalCtx, this); func_8005B1A4(Gameplay_GetCamera(globalCtx, 0)); - this->stateFlags1 &= ~0x306000; - this->stateFlags2 &= ~0x40090; + this->stateFlags1 &= ~(PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_20 | PLAYER_STATE1_21); + this->stateFlags2 &= ~(PLAYER_STATE2_4 | PLAYER_STATE2_7 | PLAYER_STATE2_18); this->actor.shape.rot.x = 0; this->actor.shape.yOffset = 0.0f; @@ -1349,7 +1349,7 @@ void func_808328A0(Player* this) { void func_808328EC(Player* this, u16 sfxId) { func_8002F7DC(&this->actor, sfxId); - this->stateFlags2 |= 8; + this->stateFlags2 |= PLAYER_STATE2_3; } void func_80832924(Player* this, struct_80832924* entry) { @@ -1556,11 +1556,11 @@ void func_8083328C(GlobalContext* globalCtx, Player* this, LinkAnimationHeader* } s32 func_808332B8(Player* this) { - return (this->stateFlags1 & 0x8000000) && (this->currentBoots != PLAYER_BOOTS_IRON); + return (this->stateFlags1 & PLAYER_STATE1_27) && (this->currentBoots != PLAYER_BOOTS_IRON); } s32 func_808332E4(Player* this) { - return (this->stateFlags1 & 0x1000000); + return (this->stateFlags1 & PLAYER_STATE1_24); } void func_808332F4(Player* this, GlobalContext* globalCtx) { @@ -1598,7 +1598,8 @@ void func_808333FC(Player* this, s32 arg1) { LinkAnimationHeader* func_80833438(Player* this) { if (this->unk_890 != 0) { return D_8085395C[this->modelAnimType]; - } else if (!(this->stateFlags1 & 0x28000000) && (this->currentBoots == PLAYER_BOOTS_IRON)) { + } else if (!(this->stateFlags1 & (PLAYER_STATE1_27 | PLAYER_STATE1_29)) && + (this->currentBoots == PLAYER_BOOTS_IRON)) { return D_80853974[this->modelAnimType]; } else { return D_80853944[this->modelAnimType]; @@ -1661,7 +1662,7 @@ void func_80833664(GlobalContext* globalCtx, Player* this, s8 actionParam) { LinkAnimationHeader** iter = &D_80853914[this->modelAnimType]; u32 i; - this->stateFlags1 &= ~0x1000008; + this->stateFlags1 &= ~(PLAYER_STATE1_3 | PLAYER_STATE1_24); for (i = 0; i < 45; i++) { if (current == *iter) { @@ -1700,7 +1701,7 @@ void func_80833790(GlobalContext* globalCtx, Player* this) { } void func_8083379C(GlobalContext* globalCtx, Player* this) { - this->stateFlags1 |= 8; + this->stateFlags1 |= PLAYER_STATE1_3; if (this->heldItemActionParam != PLAYER_AP_SLINGSHOT) { this->unk_860 = -1; @@ -1714,7 +1715,7 @@ void func_808337D4(GlobalContext* globalCtx, Player* this) { ExplosiveInfo* explosiveInfo; Actor* spawnedActor; - if (this->stateFlags1 & 0x800) { + if (this->stateFlags1 & PLAYER_STATE1_11) { func_80832528(globalCtx, this); return; } @@ -1739,12 +1740,12 @@ void func_808337D4(GlobalContext* globalCtx, Player* this) { this->heldActor = spawnedActor; this->getItemId = GI_NONE; this->unk_3BC.y = spawnedActor->shape.rot.y - this->actor.shape.rot.y; - this->stateFlags1 |= 0x800; + this->stateFlags1 |= PLAYER_STATE1_11; } } void func_80833910(GlobalContext* globalCtx, Player* this) { - this->stateFlags1 |= 8; + this->stateFlags1 |= PLAYER_STATE1_3; this->unk_860 = -3; this->heldActor = @@ -1753,7 +1754,7 @@ void func_80833910(GlobalContext* globalCtx, Player* this) { } void func_80833984(GlobalContext* globalCtx, Player* this) { - this->stateFlags1 |= 0x1000000; + this->stateFlags1 |= PLAYER_STATE1_24; } void func_8083399C(GlobalContext* globalCtx, Player* this, s8 actionParam) { @@ -1764,7 +1765,7 @@ void func_8083399C(GlobalContext* globalCtx, Player* this, s8 actionParam) { this->heldItemActionParam = this->itemActionParam = actionParam; this->modelGroup = this->nextModelGroup; - this->stateFlags1 &= ~0x1000008; + this->stateFlags1 &= ~(PLAYER_STATE1_3 | PLAYER_STATE1_24); D_80853FE8[actionParam](globalCtx, this); @@ -1806,7 +1807,7 @@ void func_80833A20(Player* this, s32 newSwordState) { } s32 func_80833B2C(Player* this) { - if (this->stateFlags1 & 0x40030000) { + if (this->stateFlags1 & (PLAYER_STATE1_16 | PLAYER_STATE1_17 | PLAYER_STATE1_30)) { return 1; } else { return 0; @@ -1815,12 +1816,12 @@ s32 func_80833B2C(Player* this) { s32 func_80833B54(Player* this) { if ((this->unk_664 != NULL) && CHECK_FLAG_ALL(this->unk_664->flags, ACTOR_FLAG_0 | ACTOR_FLAG_2)) { - this->stateFlags1 |= 0x10; + this->stateFlags1 |= PLAYER_STATE1_4; return 1; } - if (this->stateFlags1 & 0x10) { - this->stateFlags1 &= ~0x10; + if (this->stateFlags1 & PLAYER_STATE1_4) { + this->stateFlags1 &= ~PLAYER_STATE1_4; if (this->linearVelocity == 0.0f) { this->currentYaw = this->actor.shape.rot.y; } @@ -1886,7 +1887,7 @@ void func_80833DF8(Player* this, GlobalContext* globalCtx) { } } - if (!(this->stateFlags1 & 0x20000800) && !func_8008F128(this)) { + if (!(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_29)) && !func_8008F128(this)) { if (this->itemActionParam >= PLAYER_AP_FISHING_POLE) { if (!func_80833C50(this, B_BTN_ITEM) && !func_80833C50(this, C_BTN_ITEM(0)) && !func_80833C50(this, C_BTN_ITEM(1)) && !func_80833C50(this, C_BTN_ITEM(2))) { @@ -1966,19 +1967,19 @@ void func_808340DC(Player* this, GlobalContext* globalCtx) { LinkAnimation_Change(globalCtx, &this->skelAnime2, anim, phi_f0, phi_f12, phi_f14, ANIMMODE_ONCE, 0.0f); - this->stateFlags1 &= ~0x100; + this->stateFlags1 &= ~PLAYER_STATE1_8; } void func_80834298(Player* this, GlobalContext* globalCtx) { - if ((this->actor.category == ACTORCAT_PLAYER) && !(this->stateFlags1 & 0x100) && - ((this->heldItemActionParam == this->itemActionParam) || (this->stateFlags1 & 0x400000)) && + if ((this->actor.category == ACTORCAT_PLAYER) && !(this->stateFlags1 & PLAYER_STATE1_8) && + ((this->heldItemActionParam == this->itemActionParam) || (this->stateFlags1 & PLAYER_STATE1_22)) && (gSaveContext.health != 0) && (globalCtx->csCtx.state == CS_STATE_IDLE) && (this->csMode == 0) && (globalCtx->shootingGalleryStatus == 0) && (globalCtx->activeCamera == MAIN_CAM) && (globalCtx->sceneLoadFlag != 0x14) && (gSaveContext.timer1State != 10)) { func_80833DF8(this, globalCtx); } - if (this->stateFlags1 & 0x100) { + if (this->stateFlags1 & PLAYER_STATE1_8) { func_808340DC(this, globalCtx); } } @@ -1986,7 +1987,7 @@ void func_80834298(Player* this, GlobalContext* globalCtx) { s32 func_80834380(GlobalContext* globalCtx, Player* this, s32* itemPtr, s32* typePtr) { if (LINK_IS_ADULT) { *itemPtr = ITEM_BOW; - if (this->stateFlags1 & 0x800000) { + if (this->stateFlags1 & PLAYER_STATE1_23) { *typePtr = ARROW_NORMAL_HORSE; } else { *typePtr = this->heldItemActionParam - 6; @@ -2016,7 +2017,7 @@ s32 func_8083442C(Player* this, GlobalContext* globalCtx) { } else { func_80833638(this, func_808351D4); - this->stateFlags1 |= 0x200; + this->stateFlags1 |= PLAYER_STATE1_9; this->unk_834 = 14; if (this->unk_860 >= 0) { @@ -2071,7 +2072,7 @@ void func_80834644(GlobalContext* globalCtx, Player* this) { this->unk_834 = 0; this->unk_6AC = 0; func_808323B4(globalCtx, this); - this->stateFlags1 &= ~0x100; + this->stateFlags1 &= ~PLAYER_STATE1_8; } LinkAnimationHeader* func_808346C4(GlobalContext* globalCtx, Player* this) { @@ -2089,9 +2090,9 @@ s32 func_80834758(GlobalContext* globalCtx, Player* this) { LinkAnimationHeader* anim; f32 frame; - if (!(this->stateFlags1 & 0x20C00000) && (globalCtx->shootingGalleryStatus == 0) && - (this->heldItemActionParam == this->itemActionParam) && (this->currentShield != PLAYER_SHIELD_NONE) && - !Player_IsChildWithHylianShield(this) && func_80833BCC(this) && + if (!(this->stateFlags1 & (PLAYER_STATE1_22 | PLAYER_STATE1_23 | PLAYER_STATE1_29)) && + (globalCtx->shootingGalleryStatus == 0) && (this->heldItemActionParam == this->itemActionParam) && + (this->currentShield != PLAYER_SHIELD_NONE) && !Player_IsChildWithHylianShield(this) && func_80833BCC(this) && CHECK_BTN_ALL(sControlInput->cur.button, BTN_R)) { anim = func_808346C4(globalCtx, this); @@ -2139,7 +2140,7 @@ void func_808348EC(GlobalContext* globalCtx, Player* this) { } s32 func_8083499C(Player* this, GlobalContext* globalCtx) { - if (this->stateFlags1 & 0x100) { + if (this->stateFlags1 & PLAYER_STATE1_8) { func_808340DC(this, globalCtx); } else { return 0; @@ -2185,7 +2186,7 @@ s32 func_80834B5C(Player* this, GlobalContext* globalCtx) { func_80834894(this); return 1; } else { - this->stateFlags1 |= 0x400000; + this->stateFlags1 |= PLAYER_STATE1_22; Player_SetModelsForHoldingShield(this); return 1; } @@ -2201,7 +2202,7 @@ s32 func_80834BD4(Player* this, GlobalContext* globalCtx) { LinkAnimation_Change(globalCtx, &this->skelAnime2, anim, 1.0f, frame, frame, ANIMMODE_ONCE, 0.0f); } - this->stateFlags1 |= 0x400000; + this->stateFlags1 |= PLAYER_STATE1_22; Player_SetModelsForHoldingShield(this); return 1; @@ -2241,7 +2242,7 @@ s32 func_80834D2C(Player* this, GlobalContext* globalCtx) { LinkAnimation_PlayOnce(globalCtx, &this->skelAnime2, &gPlayerAnim_002628); } - if (this->stateFlags1 & 0x800000) { + if (this->stateFlags1 & PLAYER_STATE1_23) { func_80832284(globalCtx, this, &gPlayerAnim_003380); } else if ((this->actor.bgCheckFlags & 1) && !func_80833B54(this)) { func_80832284(globalCtx, this, D_80853914[this->modelAnimType]); @@ -2272,7 +2273,7 @@ s32 func_80834EB8(Player* this, GlobalContext* globalCtx) { } s32 func_80834F2C(Player* this, GlobalContext* globalCtx) { - if ((this->doorType == PLAYER_DOORTYPE_NONE) && !(this->stateFlags1 & 0x2000000)) { + if ((this->doorType == PLAYER_DOORTYPE_NONE) && !(this->stateFlags1 & PLAYER_STATE1_25)) { if (D_80853614 || func_80834E44(globalCtx)) { if (func_80834D2C(this, globalCtx)) { return func_80834EB8(this, globalCtx); @@ -2390,7 +2391,7 @@ s32 func_808351D4(Player* this, GlobalContext* globalCtx) { this->unk_834 = 10; func_80832210(this); } else { - this->stateFlags1 |= 0x200; + this->stateFlags1 |= PLAYER_STATE1_9; } return 1; @@ -2419,7 +2420,7 @@ s32 func_808353D8(Player* this, GlobalContext* globalCtx) { this->unk_834--; } - if (func_80833BCC(this) || (this->unk_6AD != 0) || (this->stateFlags1 & 0x100000)) { + if (func_80833BCC(this) || (this->unk_6AD != 0) || (this->stateFlags1 & PLAYER_STATE1_20)) { if (this->unk_834 == 0) { this->unk_834++; } @@ -2448,7 +2449,7 @@ s32 func_80835588(Player* this, GlobalContext* globalCtx) { } void func_808355DC(Player* this) { - this->stateFlags1 |= 0x20000; + this->stateFlags1 |= PLAYER_STATE1_17; if (!(this->skelAnime.moveFlags & 0x80) && (this->actor.bgCheckFlags & 0x200) && (D_80853608 < 0x2000)) { this->currentYaw = this->actor.shape.rot.y = this->actor.wallYaw + 0x8000; @@ -2485,7 +2486,7 @@ s32 func_808356E8(Player* this, GlobalContext* globalCtx) { return 1; } - if (this->stateFlags1 & 0x800) { + if (this->stateFlags1 & PLAYER_STATE1_11) { if (LinkAnimation_Update(globalCtx, &this->skelAnime2)) { LinkAnimation_PlayLoop(globalCtx, &this->skelAnime2, &gPlayerAnim_002E10); } @@ -2511,7 +2512,7 @@ s32 func_80835800(Player* this, GlobalContext* globalCtx) { return 1; } - if (this->stateFlags1 & 0x2000000) { + if (this->stateFlags1 & PLAYER_STATE1_25) { func_80833638(this, func_80835B60); } else if (func_80834F2C(this, globalCtx)) { return 1; @@ -2569,7 +2570,7 @@ s32 func_808359FC(Player* this, GlobalContext* globalCtx) { if (boomerang != NULL) { boomerang->moveTo = this->unk_664; boomerang->returnTimer = 20; - this->stateFlags1 |= 0x2000000; + this->stateFlags1 |= PLAYER_STATE1_25; if (!func_8008E9C4(this)) { func_808355DC(this); } @@ -2587,7 +2588,7 @@ s32 func_80835B60(Player* this, GlobalContext* globalCtx) { return 1; } - if (!(this->stateFlags1 & 0x2000000)) { + if (!(this->stateFlags1 & PLAYER_STATE1_25)) { func_80833638(this, func_80835C08); LinkAnimation_PlayOnce(globalCtx, &this->skelAnime2, &gPlayerAnim_0025F8); func_808357E8(this, D_80125EF8); @@ -2614,26 +2615,28 @@ s32 func_80835C58(GlobalContext* globalCtx, Player* this, PlayerFunc674 func, s3 if (func_8084E3C4 == this->func_674) { Audio_OcaSetInstrument(0); - this->stateFlags2 &= ~0x3000000; + this->stateFlags2 &= ~(PLAYER_STATE2_24 | PLAYER_STATE2_25); } else if (func_808507F4 == this->func_674) { func_80832340(globalCtx, this); } this->func_674 = func; - if ((this->itemActionParam != this->heldItemActionParam) && (!(flags & 1) || !(this->stateFlags1 & 0x400000))) { + if ((this->itemActionParam != this->heldItemActionParam) && + (!(flags & 1) || !(this->stateFlags1 & PLAYER_STATE1_22))) { func_8008EC70(this); } - if (!(flags & 1) && (!(this->stateFlags1 & 0x800))) { + if (!(flags & 1) && (!(this->stateFlags1 & PLAYER_STATE1_11))) { func_80834644(globalCtx, this); - this->stateFlags1 &= ~0x400000; + this->stateFlags1 &= ~PLAYER_STATE1_22; } func_80832DBC(this); - this->stateFlags1 &= ~0xB4000044; - this->stateFlags2 &= ~0x18080000; - this->stateFlags3 &= ~0x8A; + this->stateFlags1 &= ~(PLAYER_STATE1_2 | PLAYER_STATE1_6 | PLAYER_STATE1_26 | PLAYER_STATE1_28 | PLAYER_STATE1_29 | + PLAYER_STATE1_31); + this->stateFlags2 &= ~(PLAYER_STATE2_19 | PLAYER_STATE2_27 | PLAYER_STATE2_28); + this->stateFlags3 &= ~(PLAYER_STATE3_1 | PLAYER_STATE3_3 | PLAYER_STATE3_7); this->unk_84F = 0; this->unk_850 = 0; this->unk_6AC = 0; @@ -2698,12 +2701,12 @@ void func_80835F44(GlobalContext* globalCtx, Player* this, s32 item) { actionParam = Player_ItemToActionParam(item); if (((this->heldItemActionParam == this->itemActionParam) && - (!(this->stateFlags1 & 0x400000) || (Player_ActionToSword(actionParam) != 0) || + (!(this->stateFlags1 & PLAYER_STATE1_22) || (Player_ActionToSword(actionParam) != 0) || (actionParam == PLAYER_AP_NONE))) || ((this->itemActionParam < 0) && ((Player_ActionToSword(actionParam) != 0) || (actionParam == PLAYER_AP_NONE)))) { - if ((actionParam == PLAYER_AP_NONE) || !(this->stateFlags1 & 0x8000000) || + if ((actionParam == PLAYER_AP_NONE) || !(this->stateFlags1 & PLAYER_STATE1_27) || ((this->actor.bgCheckFlags & 1) && ((actionParam == PLAYER_AP_HOOKSHOT) || (actionParam == PLAYER_AP_LONGSHOT)))) { @@ -2781,7 +2784,7 @@ void func_80835F44(GlobalContext* globalCtx, Player* this, s32 item) { if ((this->heldItemActionParam >= 0) && (Player_ActionToMagicSpell(this, actionParam) < 0) && (item != this->heldItemId) && (D_80854164[gPlayerModelTypes[this->modelGroup][0]][nextType] != 0)) { this->heldItemId = item; - this->stateFlags1 |= 0x100; + this->stateFlags1 |= PLAYER_STATE1_8; } else { func_80835EFC(this); func_808323B4(globalCtx, this); @@ -2802,7 +2805,7 @@ void func_80836448(GlobalContext* globalCtx, Player* this, LinkAnimationHeader* func_80835C58(globalCtx, this, cond ? func_8084E368 : func_80843CEC, 0); - this->stateFlags1 |= 0x80; + this->stateFlags1 |= PLAYER_STATE1_7; func_80832264(globalCtx, this, anim); if (anim == &gPlayerAnim_002878) { @@ -2833,16 +2836,16 @@ void func_80836448(GlobalContext* globalCtx, Player* this, LinkAnimationHeader* s32 func_808365C8(Player* this) { return (!(func_808458D0 == this->func_674) || - ((this->stateFlags1 & 0x100) && + ((this->stateFlags1 & PLAYER_STATE1_8) && ((this->heldItemId == ITEM_LAST_USED) || (this->heldItemId == ITEM_NONE)))) && (!(func_80834A2C == this->func_82C) || (Player_ItemToActionParam(this->heldItemId) == this->heldItemActionParam)); } s32 func_80836670(Player* this, GlobalContext* globalCtx) { - if (!(this->stateFlags1 & 0x800000) && (this->actor.parent != NULL) && Player_HoldsHookshot(this)) { + if (!(this->stateFlags1 & PLAYER_STATE1_23) && (this->actor.parent != NULL) && Player_HoldsHookshot(this)) { func_80835C58(globalCtx, this, func_80850AEC, 1); - this->stateFlags3 |= 0x80; + this->stateFlags3 |= PLAYER_STATE3_7; func_80832264(globalCtx, this, &gPlayerAnim_002C90); func_80832F54(globalCtx, this, 0x9B); func_80832224(this); @@ -2887,22 +2890,23 @@ s32 func_80836670(Player* this, GlobalContext* globalCtx) { s32 func_80836898(GlobalContext* globalCtx, Player* this, PlayerFuncA74 func) { this->func_A74 = func; func_80835C58(globalCtx, this, func_808458D0, 0); - this->stateFlags2 |= 0x40; + this->stateFlags2 |= PLAYER_STATE2_6; return func_80832528(globalCtx, this); } void func_808368EC(Player* this, GlobalContext* globalCtx) { s16 previousYaw = this->actor.shape.rot.y; - if (!(this->stateFlags2 & 0x60)) { + if (!(this->stateFlags2 & (PLAYER_STATE2_5 | PLAYER_STATE2_6))) { if ((this->unk_664 != NULL) && ((globalCtx->actorCtx.targetCtx.unk_4B != 0) || (this->actor.category != ACTORCAT_PLAYER))) { Math_ScaledStepToS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_664->focus.pos), 4000); - } else if ((this->stateFlags1 & 0x20000) && !(this->stateFlags2 & 0x60)) { + } else if ((this->stateFlags1 & PLAYER_STATE1_17) && + !(this->stateFlags2 & (PLAYER_STATE2_5 | PLAYER_STATE2_6))) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->targetYaw, 4000); } - } else if (!(this->stateFlags2 & 0x40)) { + } else if (!(this->stateFlags2 & PLAYER_STATE2_6)) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->currentYaw, 2000); } @@ -2962,19 +2966,19 @@ void func_80836BEC(Player* this, GlobalContext* globalCtx) { s32 cond; if (!zTrigPressed) { - this->stateFlags1 &= ~0x40000000; + this->stateFlags1 &= ~PLAYER_STATE1_30; } - if ((globalCtx->csCtx.state != CS_STATE_IDLE) || (this->csMode != 0) || (this->stateFlags1 & 0x20000080) || - (this->stateFlags3 & 0x80)) { + if ((globalCtx->csCtx.state != CS_STATE_IDLE) || (this->csMode != 0) || + (this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_29)) || (this->stateFlags3 & PLAYER_STATE3_7)) { this->unk_66C = 0; - } else if (zTrigPressed || (this->stateFlags2 & 0x2000) || (this->unk_684 != NULL)) { + } else if (zTrigPressed || (this->stateFlags2 & PLAYER_STATE2_13) || (this->unk_684 != NULL)) { if (this->unk_66C <= 5) { this->unk_66C = 5; } else { this->unk_66C--; } - } else if (this->stateFlags1 & 0x20000) { + } else if (this->stateFlags1 & PLAYER_STATE1_17) { this->unk_66C = 0; } else if (this->unk_66C != 0) { this->unk_66C--; @@ -2985,9 +2989,9 @@ void func_80836BEC(Player* this, GlobalContext* globalCtx) { } cond = func_8083224C(globalCtx); - if (cond || (this->unk_66C != 0) || (this->stateFlags1 & 0x2001000)) { + if (cond || (this->unk_66C != 0) || (this->stateFlags1 & (PLAYER_STATE1_12 | PLAYER_STATE1_25))) { if (!cond) { - if (!(this->stateFlags1 & 0x2000000) && + if (!(this->stateFlags1 & PLAYER_STATE1_25) && ((this->heldItemActionParam != PLAYER_AP_FISHING_POLE) || (this->unk_860 == 0)) && CHECK_BTN_ALL(sControlInput->press.button, BTN_Z)) { @@ -2998,7 +3002,7 @@ void func_80836BEC(Player* this, GlobalContext* globalCtx) { } holdTarget = (gSaveContext.zTargetSetting != 0) || (this->actor.category != ACTORCAT_PLAYER); - this->stateFlags1 |= 0x8000; + this->stateFlags1 |= PLAYER_STATE1_15; if ((actorToTarget != NULL) && !(actorToTarget->flags & ACTOR_FLAG_27)) { if ((actorToTarget == this->unk_664) && (this->actor.category == ACTORCAT_PLAYER)) { @@ -3007,20 +3011,20 @@ void func_80836BEC(Player* this, GlobalContext* globalCtx) { if (actorToTarget != this->unk_664) { if (!holdTarget) { - this->stateFlags2 |= 0x2000; + this->stateFlags2 |= PLAYER_STATE2_13; } this->unk_664 = actorToTarget; this->unk_66C = 15; - this->stateFlags2 &= ~0x200002; + this->stateFlags2 &= ~(PLAYER_STATE2_1 | PLAYER_STATE2_21); } else { if (!holdTarget) { func_8008EDF0(this); } } - this->stateFlags1 &= ~0x40000000; + this->stateFlags1 &= ~PLAYER_STATE1_30; } else { - if (!(this->stateFlags1 & 0x40020000)) { + if (!(this->stateFlags1 & (PLAYER_STATE1_17 | PLAYER_STATE1_30))) { func_808355DC(this); } } @@ -3030,7 +3034,7 @@ void func_80836BEC(Player* this, GlobalContext* globalCtx) { if ((this->actor.category == ACTORCAT_PLAYER) && (this->unk_664 != this->unk_684) && func_8002F0C8(this->unk_664, this, sp1C)) { func_8008EDF0(this); - this->stateFlags1 |= 0x40000000; + this->stateFlags1 |= PLAYER_STATE1_30; } else if (this->unk_664 != NULL) { this->unk_664->targetPriority = 40; } @@ -3040,13 +3044,14 @@ void func_80836BEC(Player* this, GlobalContext* globalCtx) { } if (this->unk_664 != NULL) { - this->stateFlags1 &= ~0x30000; - if ((this->stateFlags1 & 0x800) || !CHECK_FLAG_ALL(this->unk_664->flags, ACTOR_FLAG_0 | ACTOR_FLAG_2)) { - this->stateFlags1 |= 0x10000; + this->stateFlags1 &= ~(PLAYER_STATE1_16 | PLAYER_STATE1_17); + if ((this->stateFlags1 & PLAYER_STATE1_11) || + !CHECK_FLAG_ALL(this->unk_664->flags, ACTOR_FLAG_0 | ACTOR_FLAG_2)) { + this->stateFlags1 |= PLAYER_STATE1_16; } } else { - if (this->stateFlags1 & 0x20000) { - this->stateFlags2 &= ~0x2000; + if (this->stateFlags1 & PLAYER_STATE1_17) { + this->stateFlags2 &= ~PLAYER_STATE2_13; } else { func_8008EE08(this); } @@ -3062,7 +3067,7 @@ s32 func_80836FAC(GlobalContext* globalCtx, Player* this, f32* arg2, s16* arg3, f32 temp_f14; f32 temp_f12; - if ((this->unk_6AD != 0) || (globalCtx->sceneLoadFlag == 0x14) || (this->stateFlags1 & 1)) { + if ((this->unk_6AD != 0) || (globalCtx->sceneLoadFlag == 0x14) || (this->stateFlags1 & PLAYER_STATE1_0)) { *arg2 = 0.0f; *arg3 = this->actor.shape.rot.y; } else { @@ -3112,7 +3117,7 @@ s32 func_80837268(Player* this, f32* arg1, s16* arg2, f32 arg3, GlobalContext* g *arg2 = this->actor.shape.rot.y; if (this->unk_664 != NULL) { - if ((globalCtx->actorCtx.targetCtx.unk_4B != 0) && !(this->stateFlags2 & 0x40)) { + if ((globalCtx->actorCtx.targetCtx.unk_4B != 0) && !(this->stateFlags2 & PLAYER_STATE2_6)) { *arg2 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_664->focus.pos); return 0; } @@ -3147,7 +3152,7 @@ static s32 (*D_80854448[])(Player* this, GlobalContext* globalCtx) = { s32 func_80837348(GlobalContext* globalCtx, Player* this, s8* arg2, s32 arg3) { s32 i; - if (!(this->stateFlags1 & 0x20000081)) { + if (!(this->stateFlags1 & (PLAYER_STATE1_0 | PLAYER_STATE1_7 | PLAYER_STATE1_29))) { if (arg3 != 0) { D_808535E0 = func_80836670(this, globalCtx); if (func_8084E604 == this->func_674) { @@ -3160,7 +3165,7 @@ s32 func_80837348(GlobalContext* globalCtx, Player* this, s8* arg2, s32 arg3) { return 1; } - if (!(this->stateFlags1 & 0x100) && (func_80834A2C != this->func_82C)) { + if (!(this->stateFlags1 & PLAYER_STATE1_8) && (func_80834A2C != this->func_82C)) { while (*arg2 >= 0) { if (D_80854448[*arg2](this, globalCtx)) { return 1; @@ -3201,7 +3206,7 @@ void func_80837530(GlobalContext* globalCtx, Player* this, s32 arg2) { this->unk_858 = 0.5f; } - this->stateFlags1 |= 0x1000; + this->stateFlags1 |= PLAYER_STATE1_12; if (this->actor.category == ACTORCAT_PLAYER) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_M_THUNDER, this->bodyPartsPos[0].x, @@ -3292,7 +3297,7 @@ s32 func_80837818(Player* this) { } else { sp18 = D_80854480[sp1C]; if (sp18 == 12) { - this->stateFlags2 |= 0x40000000; + this->stateFlags2 |= PLAYER_STATE2_30; if (!func_80833BCC(this)) { sp18 = 0; } @@ -3415,7 +3420,7 @@ void func_80837C0C(GlobalContext* globalCtx, Player* this, s32 arg2, f32 arg3, f LinkAnimationHeader* sp2C = NULL; LinkAnimationHeader** sp28; - if (this->stateFlags1 & 0x2000) { + if (this->stateFlags1 & PLAYER_STATE1_13) { func_80837B60(this); } @@ -3424,8 +3429,8 @@ void func_80837C0C(GlobalContext* globalCtx, Player* this, s32 arg2, f32 arg3, f func_8002F7DC(&this->actor, NA_SE_PL_DAMAGE); if (!func_80837B18(globalCtx, this, 0 - this->actor.colChkInfo.damage)) { - this->stateFlags2 &= ~0x80; - if (!(this->actor.bgCheckFlags & 1) && !(this->stateFlags1 & 0x8000000)) { + this->stateFlags2 &= ~PLAYER_STATE2_7; + if (!(this->actor.bgCheckFlags & 1) && !(this->stateFlags1 & PLAYER_STATE1_27)) { func_80837B9C(this, globalCtx); } return; @@ -3454,7 +3459,7 @@ void func_80837C0C(GlobalContext* globalCtx, Player* this, s32 arg2, f32 arg3, f this->unk_850 = 20; } else { arg5 -= this->actor.shape.rot.y; - if (this->stateFlags1 & 0x8000000) { + if (this->stateFlags1 & PLAYER_STATE1_27) { func_80835C58(globalCtx, this, func_8084E30C, 0); func_8083264C(this, 180, 20, 50, 0); @@ -3464,10 +3469,11 @@ void func_80837C0C(GlobalContext* globalCtx, Player* this, s32 arg2, f32 arg3, f sp2C = &gPlayerAnim_003320; func_80832698(this, NA_SE_VO_LI_DAMAGE_S); - } else if ((arg2 == 1) || (arg2 == 2) || !(this->actor.bgCheckFlags & 1) || (this->stateFlags1 & 0x206000)) { + } else if ((arg2 == 1) || (arg2 == 2) || !(this->actor.bgCheckFlags & 1) || + (this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_21))) { func_80835C58(globalCtx, this, func_8084377C, 0); - this->stateFlags3 |= 2; + this->stateFlags3 |= PLAYER_STATE3_1; func_8083264C(this, 255, 20, 150, 0); func_80832224(this); @@ -3545,7 +3551,7 @@ void func_80837C0C(GlobalContext* globalCtx, Player* this, s32 arg2, f32 arg3, f func_80832564(globalCtx, this); - this->stateFlags1 |= 0x4000000; + this->stateFlags1 |= PLAYER_STATE1_26; if (sp2C != NULL) { func_808322D0(globalCtx, this, sp2C); @@ -3611,7 +3617,7 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { } else { sp68 = ((Player_GetHeight(this) - 8.0f) < (this->unk_6C4 * this->actor.scale.y)); - if (sp68 || (this->actor.bgCheckFlags & 0x100) || (D_808535E4 == 9) || (this->stateFlags2 & 0x80000000)) { + if (sp68 || (this->actor.bgCheckFlags & 0x100) || (D_808535E4 == 9) || (this->stateFlags2 & PLAYER_STATE2_31)) { func_80832698(this, NA_SE_VO_LI_DAMAGE_S); if (sp68) { @@ -3689,7 +3695,7 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { } } - if (!(this->stateFlags1 & 0x206000)) { + if (!(this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_21))) { this->linearVelocity = -18.0f; this->currentYaw = this->actor.shape.rot.y; } @@ -3702,7 +3708,7 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { return 0; } - if ((this->unk_A87 != 0) || (this->invincibilityTimer > 0) || (this->stateFlags1 & 0x4000000) || + if ((this->unk_A87 != 0) || (this->invincibilityTimer > 0) || (this->stateFlags1 & PLAYER_STATE1_26) || (this->csMode != 0) || (this->swordQuads[0].base.atFlags & AT_HIT) || (this->swordQuads[1].base.atFlags & AT_HIT)) { return 0; @@ -3716,7 +3722,7 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { func_8002F7DC(&this->actor, NA_SE_PL_BODY_HIT); } - if (this->stateFlags1 & 0x8000000) { + if (this->stateFlags1 & PLAYER_STATE1_27) { sp4C = 0; } else if (this->actor.colChkInfo.acHitEffect == 2) { sp4C = 3; @@ -3770,7 +3776,7 @@ void func_80838940(Player* this, LinkAnimationHeader* anim, f32 arg2, GlobalCont func_80832854(this); func_80832698(this, sfxId); - this->stateFlags1 |= 0x40000; + this->stateFlags1 |= PLAYER_STATE1_18; } void func_808389E8(Player* this, LinkAnimationHeader* anim, f32 arg2, GlobalContext* globalCtx) { @@ -3786,8 +3792,8 @@ s32 func_80838A14(Player* this, GlobalContext* globalCtx) { f32 sp28; f32 sp24; - if (!(this->stateFlags1 & 0x800) && (this->unk_88C >= 2) && - (!(this->stateFlags1 & 0x8000000) || (this->ageProperties->unk_14 > this->wallHeight))) { + if (!(this->stateFlags1 & PLAYER_STATE1_11) && (this->unk_88C >= 2) && + (!(this->stateFlags1 & PLAYER_STATE1_27) || (this->ageProperties->unk_14 > this->wallHeight))) { sp3C = 0; if (func_808332B8(this)) { @@ -3799,13 +3805,13 @@ s32 func_80838A14(Player* this, GlobalContext* globalCtx) { return 0; } } else if (!(this->actor.bgCheckFlags & 1) || - ((this->ageProperties->unk_14 <= this->wallHeight) && (this->stateFlags1 & 0x8000000))) { + ((this->ageProperties->unk_14 <= this->wallHeight) && (this->stateFlags1 & PLAYER_STATE1_27))) { return 0; } if ((this->actor.wallBgId != BGCHECK_SCENE) && (D_808535F0 & 0x40)) { if (this->unk_88D >= 6) { - this->stateFlags2 |= 4; + this->stateFlags2 |= PLAYER_STATE2_2; if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A)) { sp3C = 1; } @@ -3817,7 +3823,7 @@ s32 func_80838A14(Player* this, GlobalContext* globalCtx) { if (sp3C != 0) { func_80835C58(globalCtx, this, func_80845668, 0); - this->stateFlags1 |= 0x40000; + this->stateFlags1 |= PLAYER_STATE1_18; sp34 = this->wallHeight; @@ -3829,12 +3835,12 @@ s32 func_80838A14(Player* this, GlobalContext* globalCtx) { sp28 = COLPOLY_GET_NORMAL(this->actor.wallPoly->normal.z); sp24 = this->wallDistance + 0.5f; - this->stateFlags1 |= 0x4000; + this->stateFlags1 |= PLAYER_STATE1_14; if (func_808332B8(this)) { sp38 = &gPlayerAnim_0032E8; sp34 -= (60.0f * this->ageProperties->unk_08); - this->stateFlags1 &= ~0x8000000; + this->stateFlags1 &= ~PLAYER_STATE1_27; } else if (this->ageProperties->unk_18 <= sp34) { sp38 = &gPlayerAnim_002D40; sp34 -= (59.0f * this->ageProperties->unk_08); @@ -3893,13 +3899,13 @@ void func_80838F18(GlobalContext* globalCtx, Player* this) { void func_80838F5C(GlobalContext* globalCtx, Player* this) { func_80835C58(globalCtx, this, func_8084F88C, 0); - this->stateFlags1 |= 0xA0000000; + this->stateFlags1 |= PLAYER_STATE1_29 | PLAYER_STATE1_31; Camera_ChangeSetting(Gameplay_GetCamera(globalCtx, 0), CAM_SET_FREE0); } s32 func_80838FB8(GlobalContext* globalCtx, Player* this) { - if ((globalCtx->sceneLoadFlag == 0) && (this->stateFlags1 & 0x80000000)) { + if ((globalCtx->sceneLoadFlag == 0) && (this->stateFlags1 & PLAYER_STATE1_31)) { func_80838F5C(globalCtx, this); func_80832284(globalCtx, this, &gPlayerAnim_003040); func_80832698(this, NA_SE_VO_LI_FALL_S); @@ -3939,15 +3945,15 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, u if (this->actor.category == ACTORCAT_PLAYER) { sp3C = 0; - if (!(this->stateFlags1 & 0x80) && (globalCtx->sceneLoadFlag == 0) && (this->csMode == 0) && - !(this->stateFlags1 & 1) && + if (!(this->stateFlags1 & PLAYER_STATE1_7) && (globalCtx->sceneLoadFlag == 0) && (this->csMode == 0) && + !(this->stateFlags1 & PLAYER_STATE1_0) && (((poly != NULL) && (sp3C = SurfaceType_GetSceneExitIndex(&globalCtx->colCtx, poly, bgId), sp3C != 0)) || (func_8083816C(D_808535E4) && (this->unk_A7A == 12)))) { sp34 = this->unk_A84 - (s32)this->actor.world.pos.y; - if (!(this->stateFlags1 & 0x28800000) && !(this->actor.bgCheckFlags & 1) && (sp34 < 100) && - (D_80853600 > 100.0f)) { + if (!(this->stateFlags1 & (PLAYER_STATE1_23 | PLAYER_STATE1_27 | PLAYER_STATE1_29)) && + !(this->actor.bgCheckFlags & 1) && (sp34 < 100) && (D_80853600 > 100.0f)) { return 0; } @@ -3977,7 +3983,8 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, u globalCtx->sceneLoadFlag = 0x14; } - if (!(this->stateFlags1 & 0x20800000) && !(this->stateFlags2 & 0x40000) && !func_808332B8(this) && + if (!(this->stateFlags1 & (PLAYER_STATE1_23 | PLAYER_STATE1_29)) && + !(this->stateFlags2 & PLAYER_STATE2_18) && !func_808332B8(this) && (temp = func_80041D4C(&globalCtx->colCtx, poly, bgId), (temp != 10)) && ((sp34 < 100) || (this->actor.bgCheckFlags & 1))) { @@ -4013,7 +4020,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, u } } - this->stateFlags1 |= 0x20000001; + this->stateFlags1 |= PLAYER_STATE1_0 | PLAYER_STATE1_29; func_80835E44(globalCtx, 0x2F); @@ -4113,7 +4120,8 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { Vec3f sp4C; if ((this->doorType != PLAYER_DOORTYPE_NONE) && - (!(this->stateFlags1 & 0x800) || ((this->heldActor != NULL) && (this->heldActor->id == ACTOR_EN_RU1)))) { + (!(this->stateFlags1 & PLAYER_STATE1_11) || + ((this->heldActor != NULL) && (this->heldActor->id == ACTOR_EN_RU1)))) { if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) || (func_8084F9A0 == this->func_674)) { doorActor = this->doorActor; @@ -4144,7 +4152,7 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { this->unk_84F = 0; this->unk_447 = this->doorType; - this->stateFlags1 |= 0x20000000; + this->stateFlags1 |= PLAYER_STATE1_29; this->unk_450.x = this->actor.world.pos.x + ((doorDirection * 20.0f) * sp74); this->unk_450.z = this->actor.world.pos.z + ((doorDirection * 20.0f) * sp78); @@ -4219,7 +4227,7 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { door->playerIsOpening = 1; if (this->doorType != PLAYER_DOORTYPE_FAKE) { - this->stateFlags1 |= 0x20000000; + this->stateFlags1 |= PLAYER_STATE1_29; func_800304B0(globalCtx); if (((doorActor->params >> 7) & 7) == 3) { @@ -4338,13 +4346,13 @@ void func_8083A0F4(GlobalContext* globalCtx, Player* this) { if (interactActorId == ACTOR_BG_TOKI_SWD) { this->interactRangeActor->parent = &this->actor; func_80835C58(globalCtx, this, func_8084F608, 0); - this->stateFlags1 |= 0x20000000; + this->stateFlags1 |= PLAYER_STATE1_29; } else { LinkAnimationHeader* anim; if (interactActorId == ACTOR_BG_HEAVY_BLOCK) { func_80835C58(globalCtx, this, func_80846120, 0); - this->stateFlags1 |= 0x20000000; + this->stateFlags1 |= PLAYER_STATE1_29; anim = &gPlayerAnim_002F98; } else if ((interactActorId == ACTOR_EN_ISHI) && ((interactRangeActor->params & 0xF) == 1)) { func_80835C58(globalCtx, this, func_80846260, 0); @@ -4367,14 +4375,14 @@ void func_8083A0F4(GlobalContext* globalCtx, Player* this) { } } else { func_80839F90(this, globalCtx); - this->stateFlags1 &= ~0x800; + this->stateFlags1 &= ~PLAYER_STATE1_11; } } void func_8083A2F8(GlobalContext* globalCtx, Player* this) { func_80835DAC(globalCtx, this, func_8084B530, 0); - this->stateFlags1 |= 0x20000040; + this->stateFlags1 |= PLAYER_STATE1_6 | PLAYER_STATE1_29; if (this->actor.textId != 0) { Message_StartTextbox(globalCtx, this->actor.textId, this->targetActor); @@ -4408,7 +4416,7 @@ void func_8083A40C(GlobalContext* globalCtx, Player* this) { void func_8083A434(GlobalContext* globalCtx, Player* this) { func_80835DAC(globalCtx, this, func_8084E6D4, 0); - this->stateFlags1 |= 0x20000400; + this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_29; if (this->getItemId == GI_HEART_CONTAINER_2) { this->unk_850 = 20; @@ -4506,14 +4514,14 @@ s32 func_8083A6AC(Player* this, GlobalContext* globalCtx) { this->currentYaw += 0x8000; this->actor.shape.rot.y = this->currentYaw; - this->stateFlags1 |= 0x200000; + this->stateFlags1 |= PLAYER_STATE1_21; func_80832F54(globalCtx, this, 0x9F); this->unk_850 = -1; this->unk_84F = sp50; } else { - this->stateFlags1 |= 0x2000; - this->stateFlags1 &= ~0x20000; + this->stateFlags1 |= PLAYER_STATE1_13; + this->stateFlags1 &= ~PLAYER_STATE1_17; } func_8002F7DC(&this->actor, NA_SE_PL_SLIPDOWN); @@ -4543,7 +4551,7 @@ void func_8083AA10(Player* this, GlobalContext* globalCtx) { this->fallDistance = this->fallStartHeight - (s32)this->actor.world.pos.y; - if (!(this->stateFlags1 & 0x28000000) && !(this->actor.bgCheckFlags & 1)) { + if (!(this->stateFlags1 & (PLAYER_STATE1_27 | PLAYER_STATE1_29)) && !(this->actor.bgCheckFlags & 1)) { if (!func_80838FB8(globalCtx, this)) { if (D_80853604 == 8) { this->actor.world.pos.x = this->actor.prevPos.x; @@ -4551,8 +4559,8 @@ void func_8083AA10(Player* this, GlobalContext* globalCtx) { return; } - if (!(this->stateFlags3 & 2) && !(this->skelAnime.moveFlags & 0x80) && (func_8084411C != this->func_674) && - (func_80844A44 != this->func_674)) { + if (!(this->stateFlags3 & PLAYER_STATE3_1) && !(this->skelAnime.moveFlags & 0x80) && + (func_8084411C != this->func_674) && (func_80844A44 != this->func_674)) { if ((D_80853604 == 7) || (this->swordState != 0)) { Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos); @@ -4573,11 +4581,11 @@ void func_8083AA10(Player* this, GlobalContext* globalCtx) { this->unk_89E = this->unk_A82; - if ((this->actor.bgCheckFlags & 4) && !(this->stateFlags1 & 0x8000000) && (D_80853604 != 6) && + if ((this->actor.bgCheckFlags & 4) && !(this->stateFlags1 & PLAYER_STATE1_27) && (D_80853604 != 6) && (D_80853604 != 9) && (D_80853600 > 20.0f) && (this->swordState == 0) && (ABS(sp5C) < 0x2000) && (this->linearVelocity > 3.0f)) { - if ((D_80853604 == 11) && !(this->stateFlags1 & 0x800)) { + if ((D_80853604 == 11) && !(this->stateFlags1 & PLAYER_STATE1_11)) { sp40 = func_808396F4(globalCtx, this, &D_8085451C, &sp44, &sp58, &sp54); sp3C = this->actor.world.pos.y; @@ -4630,7 +4638,7 @@ s32 func_8083ADD4(GlobalContext* globalCtx, Player* this) { if (this->unk_6AD == 3) { func_80835C58(globalCtx, this, func_80852E14, 0); if (this->unk_46A != 0) { - this->stateFlags1 |= 0x20000000; + this->stateFlags1 |= PLAYER_STATE1_29; } func_80832318(this); return 1; @@ -4700,7 +4708,7 @@ s32 func_8083B040(Player* this, GlobalContext* globalCtx) { Actor* targetActor; if ((this->unk_6AD != 0) && - (func_808332B8(this) || (this->actor.bgCheckFlags & 1) || (this->stateFlags1 & 0x800000))) { + (func_808332B8(this) || (this->actor.bgCheckFlags & 1) || (this->stateFlags1 & PLAYER_STATE1_23))) { if (!func_8083ADD4(globalCtx, this)) { if (this->unk_6AD == 4) { @@ -4710,7 +4718,7 @@ s32 func_8083B040(Player* this, GlobalContext* globalCtx) { func_8083AF44(globalCtx, this, sp2C); } else { func_80835C58(globalCtx, this, func_8085063C, 1); - this->stateFlags1 |= 0x30000000; + this->stateFlags1 |= PLAYER_STATE1_28 | PLAYER_STATE1_29; func_80832264(globalCtx, this, func_80833338(this)); func_80835EA4(globalCtx, 4); } @@ -4736,7 +4744,7 @@ s32 func_8083B040(Player* this, GlobalContext* globalCtx) { func_8083AE40(this, giEntry->objectId); } - this->stateFlags1 |= 0x30000040; + this->stateFlags1 |= PLAYER_STATE1_6 | PLAYER_STATE1_28 | PLAYER_STATE1_29; if (sp2C >= 0) { sp2C = sp2C + 1; @@ -4756,7 +4764,7 @@ s32 func_8083B040(Player* this, GlobalContext* globalCtx) { if (this->exchangeItemId == EXCH_ITEM_BEAN) { Inventory_ChangeAmmo(ITEM_BEAN, -1); func_80835DE4(globalCtx, this, func_8084279C, 0); - this->stateFlags1 |= 0x20000000; + this->stateFlags1 |= PLAYER_STATE1_29; this->unk_850 = 0x50; this->unk_84F = -1; } @@ -4804,20 +4812,20 @@ s32 func_8083B040(Player* this, GlobalContext* globalCtx) { } else { func_80835DE4(globalCtx, this, func_8084E3C4, 0); func_808322D0(globalCtx, this, &gPlayerAnim_0030A0); - this->stateFlags2 |= 0x8000000; + this->stateFlags2 |= PLAYER_STATE2_27; func_80835EA4(globalCtx, (this->unk_6A8 != NULL) ? 0x5B : 0x5A); if (this->unk_6A8 != NULL) { - this->stateFlags2 |= 0x2000000; + this->stateFlags2 |= PLAYER_STATE2_25; Camera_SetParam(Gameplay_GetCamera(globalCtx, 0), 8, this->unk_6A8); } } } else if (func_8083AD4C(globalCtx, this)) { - if (!(this->stateFlags1 & 0x800000)) { + if (!(this->stateFlags1 & PLAYER_STATE1_23)) { func_80835C58(globalCtx, this, func_8084B1D8, 1); this->unk_850 = 13; func_8083B010(this); } - this->stateFlags1 |= 0x100000; + this->stateFlags1 |= PLAYER_STATE1_20; func_80078884(NA_SE_SY_CAMERA_ZOOM_UP); func_80832210(this); return 1; @@ -4827,7 +4835,7 @@ s32 func_8083B040(Player* this, GlobalContext* globalCtx) { return 0; } - this->stateFlags1 |= 0x30000000; + this->stateFlags1 |= PLAYER_STATE1_28 | PLAYER_STATE1_29; } func_80832224(this); @@ -4861,14 +4869,14 @@ s32 func_8083B644(Player* this, GlobalContext* globalCtx) { if ((sp34 != NULL) || (sp2C != NULL)) { if ((sp30 == NULL) || (sp30 == sp34) || (sp30 == sp2C)) { - if (!(this->stateFlags1 & 0x800) || + if (!(this->stateFlags1 & PLAYER_STATE1_11) || ((this->heldActor != NULL) && (sp28 || (sp34 == this->heldActor) || (sp2C == this->heldActor) || ((sp34 != NULL) && (sp34->flags & ACTOR_FLAG_16))))) { - if ((this->actor.bgCheckFlags & 1) || (this->stateFlags1 & 0x800000) || - (func_808332B8(this) && !(this->stateFlags2 & 0x400))) { + if ((this->actor.bgCheckFlags & 1) || (this->stateFlags1 & PLAYER_STATE1_23) || + (func_808332B8(this) && !(this->stateFlags2 & PLAYER_STATE2_10))) { if (sp34 != NULL) { - this->stateFlags2 |= 2; + this->stateFlags2 |= PLAYER_STATE2_1; if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) || (sp34->flags & ACTOR_FLAG_16)) { sp2C = NULL; } else if (sp2C == NULL) { @@ -4878,7 +4886,7 @@ s32 func_8083B644(Player* this, GlobalContext* globalCtx) { if (sp2C != NULL) { if (!sp28) { - this->stateFlags2 |= 0x200000; + this->stateFlags2 |= PLAYER_STATE2_21; } if (!CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) && !sp28) { @@ -4913,7 +4921,8 @@ s32 func_8083B644(Player* this, GlobalContext* globalCtx) { } s32 func_8083B8F4(Player* this, GlobalContext* globalCtx) { - if (!(this->stateFlags1 & 0x800800) && Camera_CheckValidMode(Gameplay_GetCamera(globalCtx, 0), 6)) { + if (!(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_23)) && + Camera_CheckValidMode(Gameplay_GetCamera(globalCtx, 0), 6)) { if ((this->actor.bgCheckFlags & 1) || (func_808332B8(this) && (this->actor.yDistToWater < this->ageProperties->unk_2C))) { this->unk_6AD = 1; @@ -4932,7 +4941,7 @@ s32 func_8083B998(Player* this, GlobalContext* globalCtx) { if ((this->unk_664 != NULL) && (CHECK_FLAG_ALL(this->unk_664->flags, ACTOR_FLAG_0 | ACTOR_FLAG_18) || (this->unk_664->naviEnemyId != 0xFF))) { - this->stateFlags2 |= 0x200000; + this->stateFlags2 |= PLAYER_STATE2_21; } else if ((this->naviTextId == 0) && !func_8008E9C4(this) && CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) && (YREG(15) != 0x10) && (YREG(15) != 0x20) && !func_8083B8F4(this, globalCtx)) { func_80078884(NA_SE_SY_ERROR); @@ -4945,7 +4954,7 @@ void func_8083BA90(GlobalContext* globalCtx, Player* this, s32 arg2, f32 xzVeloc func_80837948(globalCtx, this, arg2); func_80835C58(globalCtx, this, func_80844AF4, 0); - this->stateFlags3 |= 2; + this->stateFlags3 |= PLAYER_STATE3_1; this->currentYaw = this->actor.shape.rot.y; this->linearVelocity = xzVelocity; @@ -4959,7 +4968,7 @@ void func_8083BA90(GlobalContext* globalCtx, Player* this, s32 arg2, f32 xzVeloc } s32 func_8083BB20(Player* this) { - if (!(this->stateFlags1 & 0x400000) && (Player_GetSwordHeld(this) != 0)) { + if (!(this->stateFlags1 & PLAYER_STATE1_22) && (Player_GetSwordHeld(this) != 0)) { if (D_80853614 || ((this->actor.category != ACTORCAT_PLAYER) && CHECK_BTN_ALL(sControlInput->press.button, BTN_B))) { return 1; @@ -5003,7 +5012,7 @@ void func_8083BCD0(Player* this, GlobalContext* globalCtx, s32 arg2) { this->currentYaw = this->actor.shape.rot.y + (arg2 << 0xE); this->linearVelocity = !(arg2 & 1) ? 6.0f : 8.5f; - this->stateFlags2 |= 0x80000; + this->stateFlags2 |= PLAYER_STATE2_19; func_8002F7DC(&this->actor, ((arg2 << 0xE) == 0x8000) ? NA_SE_PL_ROLL : NA_SE_PL_SKIP); } @@ -5084,9 +5093,9 @@ void func_8083C0E8(Player* this, GlobalContext* globalCtx) { } void func_8083C148(Player* this, GlobalContext* globalCtx) { - if (!(this->stateFlags3 & 0x80)) { + if (!(this->stateFlags3 & PLAYER_STATE3_7)) { func_8083B010(this); - if (this->stateFlags1 & 0x8000000) { + if (this->stateFlags1 & PLAYER_STATE1_27) { func_80838F18(globalCtx, this); } else { func_80839F90(this, globalCtx); @@ -5096,11 +5105,11 @@ void func_8083C148(Player* this, GlobalContext* globalCtx) { } } - this->stateFlags1 &= ~0x106000; + this->stateFlags1 &= ~(PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_20); } s32 func_8083C1DC(Player* this, GlobalContext* globalCtx) { - if (!func_80833B54(this) && (D_808535E0 == 0) && !(this->stateFlags1 & 0x800000) && + if (!func_80833B54(this) && (D_808535E0 == 0) && !(this->stateFlags1 & PLAYER_STATE1_23) && CHECK_BTN_ALL(sControlInput->press.button, BTN_A)) { if (func_8083BC7C(this, globalCtx)) { return 1; @@ -5108,7 +5117,7 @@ s32 func_8083C1DC(Player* this, GlobalContext* globalCtx) { if ((this->unk_837 == 0) && (this->heldItemActionParam >= PLAYER_AP_SWORD_MASTER)) { func_80835F44(globalCtx, this, ITEM_NONE); } else { - this->stateFlags2 ^= 0x100000; + this->stateFlags2 ^= PLAYER_STATE2_20; } } @@ -5127,7 +5136,7 @@ s32 func_8083C2B0(Player* this, GlobalContext* globalCtx) { func_808323B4(globalCtx, this); if (func_80835C58(globalCtx, this, func_80843188, 0)) { - this->stateFlags1 |= 0x400000; + this->stateFlags1 |= PLAYER_STATE1_22; if (!Player_IsChildWithHylianShield(this)) { Player_SetModelsForHoldingShield(this); @@ -5185,7 +5194,7 @@ void func_8083C50C(Player* this) { s32 func_8083C544(Player* this, GlobalContext* globalCtx) { if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) { - if (!(this->stateFlags1 & 0x400000) && (Player_GetSwordHeld(this) != 0) && (this->unk_844 == 1) && + if (!(this->stateFlags1 & PLAYER_STATE1_22) && (Player_GetSwordHeld(this) != 0) && (this->unk_844 == 1) && (this->heldItemActionParam != PLAYER_AP_STICK)) { if ((this->heldItemActionParam != PLAYER_AP_SWORD_BGS) || (gSaveContext.swordHealth > 0.0f)) { func_808377DC(globalCtx, this); @@ -5288,7 +5297,7 @@ s32 func_8083C910(GlobalContext* globalCtx, Player* this, f32 arg2) { if (this->ageProperties->unk_24 <= sp28) { func_80835C58(globalCtx, this, func_8084D7C4, 0); func_80832C6C(globalCtx, this, &gPlayerAnim_0032F0); - this->stateFlags1 |= 0x28000000; + this->stateFlags1 |= PLAYER_STATE1_27 | PLAYER_STATE1_29; this->unk_850 = 20; this->linearVelocity = 2.0f; Player_SetBootData(globalCtx, this); @@ -5297,7 +5306,7 @@ s32 func_8083C910(GlobalContext* globalCtx, Player* this, f32 arg2) { } func_80838E70(globalCtx, this, arg2, this->actor.shape.rot.y); - this->stateFlags1 |= 0x20000000; + this->stateFlags1 |= PLAYER_STATE1_29; return 1; } @@ -5432,8 +5441,8 @@ s32 func_8083CFA8(GlobalContext* globalCtx, Player* this, f32 arg2, s32 splashSc } void func_8083D0A8(GlobalContext* globalCtx, Player* this, f32 arg2) { - this->stateFlags1 |= 0x40000; - this->stateFlags1 &= ~0x8000000; + this->stateFlags1 |= PLAYER_STATE1_18; + this->stateFlags1 &= ~PLAYER_STATE1_27; func_80832340(globalCtx, this); if (func_8083CFA8(globalCtx, this, arg2, 500)) { @@ -5444,7 +5453,7 @@ void func_8083D0A8(GlobalContext* globalCtx, Player* this, f32 arg2) { } s32 func_8083D12C(GlobalContext* globalCtx, Player* this, Input* arg2) { - if (!(this->stateFlags1 & 0x400) && !(this->stateFlags2 & 0x400)) { + if (!(this->stateFlags1 & PLAYER_STATE1_10) && !(this->stateFlags2 & PLAYER_STATE2_10)) { if ((arg2 == NULL) || (CHECK_BTN_ALL(arg2->press.button, BTN_A) && (ABS(this->unk_6C2) < 12000) && (this->currentBoots != PLAYER_BOOTS_IRON))) { @@ -5452,11 +5461,11 @@ s32 func_8083D12C(GlobalContext* globalCtx, Player* this, Input* arg2) { func_80832264(globalCtx, this, &gPlayerAnim_003308); this->unk_6C2 = 0; - this->stateFlags2 |= 0x400; + this->stateFlags2 |= PLAYER_STATE2_10; this->actor.velocity.y = 0.0f; if (arg2 != NULL) { - this->stateFlags2 |= 0x800; + this->stateFlags2 |= PLAYER_STATE2_11; func_8002F7DC(&this->actor, NA_SE_PL_DIVE_BUBBLE); } @@ -5464,24 +5473,25 @@ s32 func_8083D12C(GlobalContext* globalCtx, Player* this, Input* arg2) { } } - if ((this->stateFlags1 & 0x400) || (this->stateFlags2 & 0x400)) { + if ((this->stateFlags1 & PLAYER_STATE1_10) || (this->stateFlags2 & PLAYER_STATE2_10)) { if (this->actor.velocity.y > 0.0f) { if (this->actor.yDistToWater < this->ageProperties->unk_30) { - this->stateFlags2 &= ~0x400; + this->stateFlags2 &= ~PLAYER_STATE2_10; if (arg2 != NULL) { func_80835C58(globalCtx, this, func_8084E1EC, 1); - if (this->stateFlags1 & 0x400) { - this->stateFlags1 |= 0x20000C00; + if (this->stateFlags1 & PLAYER_STATE1_10) { + this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_11 | PLAYER_STATE1_29; } this->unk_850 = 2; } func_80832340(globalCtx, this); - func_80832B0C(globalCtx, this, (this->stateFlags1 & 0x800) ? &gPlayerAnim_003318 : &gPlayerAnim_003300); + func_80832B0C(globalCtx, this, + (this->stateFlags1 & PLAYER_STATE1_11) ? &gPlayerAnim_003318 : &gPlayerAnim_003300); if (func_8083CFA8(globalCtx, this, this->actor.velocity.y, 500)) { func_8002F7DC(&this->actor, NA_SE_PL_FACE_UP); @@ -5505,8 +5515,8 @@ void func_8083D36C(GlobalContext* globalCtx, Player* this) { if ((this->currentBoots != PLAYER_BOOTS_IRON) || !(this->actor.bgCheckFlags & 1)) { func_80832564(globalCtx, this); - if ((this->currentBoots != PLAYER_BOOTS_IRON) && (this->stateFlags2 & 0x400)) { - this->stateFlags2 &= ~0x400; + if ((this->currentBoots != PLAYER_BOOTS_IRON) && (this->stateFlags2 & PLAYER_STATE2_10)) { + this->stateFlags2 &= ~PLAYER_STATE2_10; func_8083D12C(globalCtx, this, 0); this->unk_84F = 1; } else if (func_80844A44 == this->func_674) { @@ -5518,7 +5528,7 @@ void func_8083D36C(GlobalContext* globalCtx, Player* this) { } } - if (!(this->stateFlags1 & 0x8000000) || (this->actor.yDistToWater < this->ageProperties->unk_2C)) { + if (!(this->stateFlags1 & PLAYER_STATE1_27) || (this->actor.yDistToWater < this->ageProperties->unk_2C)) { if (func_8083CFA8(globalCtx, this, this->actor.velocity.y, 500)) { func_8002F7DC(&this->actor, NA_SE_EV_DIVE_INTO_WATER); @@ -5528,9 +5538,9 @@ void func_8083D36C(GlobalContext* globalCtx, Player* this) { } } - this->stateFlags1 |= 0x8000000; - this->stateFlags2 |= 0x400; - this->stateFlags1 &= ~0xC0000; + this->stateFlags1 |= PLAYER_STATE1_27; + this->stateFlags2 |= PLAYER_STATE2_10; + this->stateFlags1 &= ~(PLAYER_STATE1_18 | PLAYER_STATE1_19); this->unk_854 = 0.0f; Player_SetBootData(globalCtx, this); @@ -5549,7 +5559,7 @@ void func_8083D53C(GlobalContext* globalCtx, Player* this) { if ((func_80845668 != this->func_674) && (func_8084BDFC != this->func_674)) { if (this->ageProperties->unk_2C < this->actor.yDistToWater) { - if (!(this->stateFlags1 & 0x8000000) || + if (!(this->stateFlags1 & PLAYER_STATE1_27) || (!((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & 1)) && (func_8084E30C != this->func_674) && (func_8084E368 != this->func_674) && (func_8084D610 != this->func_674) && (func_8084D84C != this->func_674) && @@ -5558,7 +5568,7 @@ void func_8083D53C(GlobalContext* globalCtx, Player* this) { func_8083D36C(globalCtx, this); return; } - } else if ((this->stateFlags1 & 0x8000000) && (this->actor.yDistToWater < this->ageProperties->unk_24)) { + } else if ((this->stateFlags1 & PLAYER_STATE1_27) && (this->actor.yDistToWater < this->ageProperties->unk_24)) { if ((this->skelAnime.moveFlags == 0) && (this->currentBoots != PLAYER_BOOTS_IRON)) { func_8083CD54(globalCtx, this, this->actor.shape.rot.y); } @@ -5772,7 +5782,7 @@ s32 func_8083E0FC(Player* this, GlobalContext* globalCtx) { func_80836898(globalCtx, this, func_8083A360); - this->stateFlags1 |= 0x800000; + this->stateFlags1 |= PLAYER_STATE1_23; this->actor.bgCheckFlags &= ~0x20; if (this->mountSide < 0) { @@ -5899,13 +5909,13 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) { func_808323B4(globalCtx, this); func_8083AE40(this, giEntry->objectId); - if (!(this->stateFlags2 & 0x400) || (this->currentBoots == PLAYER_BOOTS_IRON)) { + if (!(this->stateFlags2 & PLAYER_STATE2_10) || (this->currentBoots == PLAYER_BOOTS_IRON)) { func_80836898(globalCtx, this, func_8083A434); func_808322D0(globalCtx, this, &gPlayerAnim_002788); func_80835EA4(globalCtx, 9); } - this->stateFlags1 |= 0x20000C00; + this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_11 | PLAYER_STATE1_29; func_80832224(this); return 1; } @@ -5913,8 +5923,8 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) { func_8083E4C4(globalCtx, this, giEntry); this->getItemId = GI_NONE; } - } else if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && !(this->stateFlags1 & 0x800) && - !(this->stateFlags2 & 0x400)) { + } else if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && !(this->stateFlags1 & PLAYER_STATE1_11) && + !(this->stateFlags2 & PLAYER_STATE2_10)) { if (this->getItemId != GI_NONE) { GetItemEntry* giEntry = &sGetItemTable[-this->getItemId - 1]; EnBox* chest = (EnBox*)interactedActor; @@ -5928,7 +5938,7 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) { } func_80836898(globalCtx, this, func_8083A434); - this->stateFlags1 |= 0x20000C00; + this->stateFlags1 |= PLAYER_STATE1_10 | PLAYER_STATE1_11 | PLAYER_STATE1_29; func_8083AE40(this, giEntry->objectId); this->actor.world.pos.x = chest->dyna.actor.world.pos.x - (Math_SinS(chest->dyna.actor.shape.rot.y) * 29.4343f); @@ -5978,7 +5988,7 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) { } func_80832224(this); - this->stateFlags1 |= 0x800; + this->stateFlags1 |= PLAYER_STATE1_11; return 1; } } @@ -6002,7 +6012,7 @@ s32 func_8083EAF0(Player* this, Actor* actor) { } s32 func_8083EB44(Player* this, GlobalContext* globalCtx) { - if ((this->stateFlags1 & 0x800) && (this->heldActor != NULL) && + if ((this->stateFlags1 & PLAYER_STATE1_11) && (this->heldActor != NULL) && CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) { if (!func_80835644(globalCtx, this, this->heldActor)) { if (!func_8083EAF0(this, this->heldActor)) { @@ -6020,7 +6030,7 @@ s32 func_8083EB44(Player* this, GlobalContext* globalCtx) { s32 func_8083EC18(Player* this, GlobalContext* globalCtx, u32 arg2) { if (this->wallHeight >= 79.0f) { - if (!(this->stateFlags1 & 0x8000000) || (this->currentBoots == PLAYER_BOOTS_IRON) || + if (!(this->stateFlags1 & PLAYER_STATE1_27) || (this->currentBoots == PLAYER_BOOTS_IRON) || (this->actor.yDistToWater < this->ageProperties->unk_2C)) { s32 sp8C = (arg2 & 8) ? 2 : 0; @@ -6087,8 +6097,8 @@ s32 func_8083EC18(Player* this, GlobalContext* globalCtx, u32 arg2) { LinkAnimationHeader* sp30; func_80836898(globalCtx, this, func_8083A3B0); - this->stateFlags1 |= 0x200000; - this->stateFlags1 &= ~0x8000000; + this->stateFlags1 |= PLAYER_STATE1_21; + this->stateFlags1 &= ~PLAYER_STATE1_27; if ((sp8C != 0) || (arg2 & 2)) { if ((this->unk_84F = sp8C) != 0) { @@ -6141,7 +6151,7 @@ s32 func_8083F0C8(Player* this, GlobalContext* globalCtx, u32 arg2) { f32 phi_f12; s32 i; - if (!LINK_IS_ADULT && !(this->stateFlags1 & 0x8000000) && (arg2 & 0x30)) { + if (!LINK_IS_ADULT && !(this->stateFlags1 & PLAYER_STATE1_27) && (arg2 & 0x30)) { wallPoly = this->actor.wallPoly; CollisionPoly_GetVerticesByBgId(wallPoly, this->actor.wallBgId, &globalCtx->colCtx, sp50); @@ -6168,7 +6178,7 @@ s32 func_8083F0C8(Player* this, GlobalContext* globalCtx, u32 arg2) { ((this->actor.world.pos.z - sp44) * COLPOLY_GET_NORMAL(wallPoly->normal.x)); if (fabsf(phi_f2) < 8.0f) { - this->stateFlags2 |= 0x10000; + this->stateFlags2 |= PLAYER_STATE2_16; if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A)) { f32 sp38 = COLPOLY_GET_NORMAL(wallPoly->normal.x); @@ -6176,7 +6186,7 @@ s32 func_8083F0C8(Player* this, GlobalContext* globalCtx, u32 arg2) { f32 sp30 = this->wallDistance; func_80836898(globalCtx, this, func_8083A40C); - this->stateFlags2 |= 0x40000; + this->stateFlags2 |= PLAYER_STATE2_18; this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw + 0x8000; this->actor.world.pos.x = sp4C + (sp30 * sp38); this->actor.world.pos.z = sp44 + (sp30 * sp34); @@ -6294,17 +6304,17 @@ void func_8083F72C(Player* this, LinkAnimationHeader* anim, GlobalContext* globa s32 func_8083F7BC(Player* this, GlobalContext* globalCtx) { DynaPolyActor* wallPolyActor; - if (!(this->stateFlags1 & 0x800) && (this->actor.bgCheckFlags & 0x200) && (D_80853608 < 0x3000)) { + if (!(this->stateFlags1 & PLAYER_STATE1_11) && (this->actor.bgCheckFlags & 0x200) && (D_80853608 < 0x3000)) { if (((this->linearVelocity > 0.0f) && func_8083EC18(this, globalCtx, D_808535F0)) || func_8083F0C8(this, globalCtx, D_808535F0)) { return 1; } - if (!func_808332B8(this) && ((this->linearVelocity == 0.0f) || !(this->stateFlags2 & 4)) && + if (!func_808332B8(this) && ((this->linearVelocity == 0.0f) || !(this->stateFlags2 & PLAYER_STATE2_2)) && (D_808535F0 & 0x40) && (this->actor.bgCheckFlags & 1) && (this->wallHeight >= 39.0f)) { - this->stateFlags2 |= 1; + this->stateFlags2 |= PLAYER_STATE2_0; if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A)) { @@ -6317,7 +6327,7 @@ s32 func_8083F7BC(Player* this, GlobalContext* globalCtx) { } func_80836898(globalCtx, this, func_8083A0F4); - this->stateFlags1 |= 0x800; + this->stateFlags1 |= PLAYER_STATE1_11; this->interactRangeActor = &wallPolyActor->actor; this->getItemId = GI_NONE; this->currentYaw = this->actor.wallYaw + 0x8000; @@ -6343,7 +6353,7 @@ s32 func_8083F7BC(Player* this, GlobalContext* globalCtx) { s32 func_8083F9D0(GlobalContext* globalCtx, Player* this) { if ((this->actor.bgCheckFlags & 0x200) && - ((this->stateFlags2 & 0x10) || CHECK_BTN_ALL(sControlInput->cur.button, BTN_A))) { + ((this->stateFlags2 & PLAYER_STATE2_4) || CHECK_BTN_ALL(sControlInput->cur.button, BTN_A))) { DynaPolyActor* wallPolyActor = NULL; if (this->actor.wallBgId != BGCHECK_SCENE) { @@ -6351,7 +6361,7 @@ s32 func_8083F9D0(GlobalContext* globalCtx, Player* this) { } if (&wallPolyActor->actor == this->unk_3C4) { - if (this->stateFlags2 & 0x10) { + if (this->stateFlags2 & PLAYER_STATE2_4) { return 1; } else { return 0; @@ -6361,24 +6371,24 @@ s32 func_8083F9D0(GlobalContext* globalCtx, Player* this) { func_80839FFC(this, globalCtx); func_80832264(globalCtx, this, &gPlayerAnim_003100); - this->stateFlags2 &= ~0x10; + this->stateFlags2 &= ~PLAYER_STATE2_4; return 1; } void func_8083FAB8(Player* this, GlobalContext* globalCtx) { func_80835C58(globalCtx, this, func_8084B898, 0); - this->stateFlags2 |= 0x10; + this->stateFlags2 |= PLAYER_STATE2_4; func_80832264(globalCtx, this, &gPlayerAnim_0030F0); } void func_8083FB14(Player* this, GlobalContext* globalCtx) { func_80835C58(globalCtx, this, func_8084B9E4, 0); - this->stateFlags2 |= 0x10; + this->stateFlags2 |= PLAYER_STATE2_4; func_80832264(globalCtx, this, D_80853C5C[this->modelAnimType]); } void func_8083FB7C(Player* this, GlobalContext* globalCtx) { - this->stateFlags1 &= ~0x8200000; + this->stateFlags1 &= ~(PLAYER_STATE1_21 | PLAYER_STATE1_27); func_80837B9C(this, globalCtx); this->linearVelocity = -0.4f; } @@ -6536,7 +6546,7 @@ void func_8084029C(Player* this, f32 arg1) { } else if (func_8084021C(this->unk_868, arg1, 29.0f, 10.0f) || func_8084021C(this->unk_868, arg1, 29.0f, 24.0f)) { func_808327F8(this, this->linearVelocity); if (this->linearVelocity > 4.0f) { - this->stateFlags2 |= 8; + this->stateFlags2 |= PLAYER_STATE2_3; } } @@ -6557,11 +6567,11 @@ void func_80840450(Player* this, GlobalContext* globalCtx) { s16 temp3; s32 temp4; - if (this->stateFlags3 & 8) { + if (this->stateFlags3 & PLAYER_STATE3_3) { if (Player_GetSwordHeld(this)) { - this->stateFlags2 |= 0x60; + this->stateFlags2 |= PLAYER_STATE2_5 | PLAYER_STATE2_6; } else { - this->stateFlags3 &= ~8; + this->stateFlags3 &= ~PLAYER_STATE3_3; } } @@ -6570,7 +6580,7 @@ void func_80840450(Player* this, GlobalContext* globalCtx) { func_80832DBC(this); func_80832284(globalCtx, this, func_808334E4(this)); this->unk_850 = 0; - this->stateFlags3 &= ~8; + this->stateFlags3 &= ~PLAYER_STATE3_3; } func_80833C3C(this); } else { @@ -6625,7 +6635,7 @@ void func_80840450(Player* this, GlobalContext* globalCtx) { Math_AsymStepToF(&this->linearVelocity, sp44 * 0.3f, 2.0f, 1.5f); - if (!(this->stateFlags3 & 8)) { + if (!(this->stateFlags3 & PLAYER_STATE3_3)) { Math_ScaledStepToS(&this->currentYaw, sp42, temp4 * 0.1f); } } @@ -6704,11 +6714,11 @@ void func_808409CC(GlobalContext* globalCtx, Player* this) { if ((this->unk_664 != NULL) || (!(heathIsCritical = HealthMeter_IsCritical()) && ((this->unk_6AC = (this->unk_6AC + 1) & 1) != 0))) { - this->stateFlags2 &= ~0x10000000; + this->stateFlags2 &= ~PLAYER_STATE2_28; anim = func_80833338(this); } else { - this->stateFlags2 |= 0x10000000; - if (this->stateFlags1 & 0x800) { + this->stateFlags2 |= PLAYER_STATE2_28; + if (this->stateFlags1 & PLAYER_STATE1_11) { anim = func_80833338(this); } else { sp38 = globalCtx->roomCtx.curRoom.unk_02; @@ -7239,7 +7249,7 @@ void func_80842180(Player* this, GlobalContext* globalCtx) { f32 sp2C; s16 sp2A; - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; func_80841EE4(this, globalCtx); if (!func_80837348(globalCtx, this, D_80854424, 1)) { @@ -7265,7 +7275,7 @@ void func_8084227C(Player* this, GlobalContext* globalCtx) { f32 sp2C; s16 sp2A; - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; func_80841EE4(this, globalCtx); if (!func_80837348(globalCtx, this, D_80854430, 1)) { @@ -7608,9 +7618,9 @@ void func_80843188(Player* this, GlobalContext* globalCtx) { } if (!Player_IsChildWithHylianShield(this)) { - this->stateFlags1 |= 0x400000; + this->stateFlags1 |= PLAYER_STATE1_22; func_80836670(this, globalCtx); - this->stateFlags1 &= ~0x400000; + this->stateFlags1 &= ~PLAYER_STATE1_22; } func_8083721C(this); @@ -7656,7 +7666,7 @@ void func_80843188(Player* this, GlobalContext* globalCtx) { if (func_8083C2B0(this, globalCtx)) { func_808428D8(this, globalCtx); } else { - this->stateFlags1 &= ~0x400000; + this->stateFlags1 &= ~PLAYER_STATE1_22; func_80832318(this); if (Player_IsChildWithHylianShield(this)) { @@ -7679,7 +7689,7 @@ void func_80843188(Player* this, GlobalContext* globalCtx) { } } - this->stateFlags1 |= 0x400000; + this->stateFlags1 |= PLAYER_STATE1_22; Player_SetModelsForHoldingShield(this); this->unk_6AE |= 0xC1; @@ -7701,7 +7711,7 @@ void func_808435C4(Player* this, GlobalContext* globalCtx) { temp = func_808374A0(globalCtx, this, &this->skelAnime, 4.0f); if ((temp != 0) && ((temp > 0) || LinkAnimation_Update(globalCtx, &this->skelAnime))) { func_80835C58(globalCtx, this, func_80843188, 1); - this->stateFlags1 |= 0x400000; + this->stateFlags1 |= PLAYER_STATE1_22; Player_SetModelsForHoldingShield(this); anim = D_80853AF4[this->modelAnimType]; frames = Animation_GetLastFrame(anim); @@ -7722,11 +7732,11 @@ void func_8084370C(Player* this, GlobalContext* globalCtx) { } void func_8084377C(Player* this, GlobalContext* globalCtx) { - this->stateFlags2 |= 0x60; + this->stateFlags2 |= PLAYER_STATE2_5 | PLAYER_STATE2_6; func_808382BC(this); - if (!(this->stateFlags1 & 0x20000000) && (this->unk_850 == 0) && (this->unk_8A1 != 0)) { + if (!(this->stateFlags1 & PLAYER_STATE1_29) && (this->unk_850 == 0) && (this->unk_8A1 != 0)) { s16 temp = this->actor.shape.rot.y - this->unk_8A2; this->currentYaw = this->actor.shape.rot.y = this->unk_8A2; @@ -7748,13 +7758,13 @@ void func_8084377C(Player* this, GlobalContext* globalCtx) { if (this->unk_850 == 0) { func_80853080(this, globalCtx); } - } else if ((this->stateFlags1 & 0x20000000) || + } else if ((this->stateFlags1 & PLAYER_STATE1_29) || (!(this->cylinder.base.acFlags & AC_HIT) && (this->unk_8A1 == 0))) { - if (this->stateFlags1 & 0x20000000) { + if (this->stateFlags1 & PLAYER_STATE1_29) { this->unk_850++; } else { func_80835C58(globalCtx, this, func_80843954, 0); - this->stateFlags1 |= 0x4000000; + this->stateFlags1 |= PLAYER_STATE1_26; } func_80832264(globalCtx, this, @@ -7769,17 +7779,17 @@ void func_8084377C(Player* this, GlobalContext* globalCtx) { } void func_80843954(Player* this, GlobalContext* globalCtx) { - this->stateFlags2 |= 0x60; + this->stateFlags2 |= PLAYER_STATE2_5 | PLAYER_STATE2_6; func_808382BC(this); func_8083721C(this); if (LinkAnimation_Update(globalCtx, &this->skelAnime) && (this->linearVelocity == 0.0f)) { - if (this->stateFlags1 & 0x20000000) { + if (this->stateFlags1 & PLAYER_STATE1_29) { this->unk_850++; } else { func_80835C58(globalCtx, this, func_80843A38, 0); - this->stateFlags1 |= 0x4000000; + this->stateFlags1 |= PLAYER_STATE1_26; } func_808322D0(globalCtx, this, @@ -7796,10 +7806,10 @@ static struct_80832924 D_808545DC[] = { void func_80843A38(Player* this, GlobalContext* globalCtx) { s32 sp24; - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; func_808382BC(this); - if (this->stateFlags1 & 0x20000000) { + if (this->stateFlags1 & PLAYER_STATE1_29) { LinkAnimation_Update(globalCtx, &this->skelAnime); } else { sp24 = func_808374A0(globalCtx, this, &this->skelAnime, 16.0f); @@ -7818,7 +7828,7 @@ void func_80843AE8(GlobalContext* globalCtx, Player* this) { if (this->unk_850 > 0) { this->unk_850--; if (this->unk_850 == 0) { - if (this->stateFlags1 & 0x8000000) { + if (this->stateFlags1 & PLAYER_STATE1_27) { LinkAnimation_Change(globalCtx, &this->skelAnime, &gPlayerAnim_003328, 1.0f, 0.0f, Animation_GetLastFrame(&gPlayerAnim_003328), ANIMMODE_ONCE, -16.0f); } else { @@ -7829,8 +7839,8 @@ void func_80843AE8(GlobalContext* globalCtx, Player* this) { this->unk_850 = -1; } } else if (gSaveContext.healthAccumulator == 0) { - this->stateFlags1 &= ~0x80; - if (this->stateFlags1 & 0x8000000) { + this->stateFlags1 &= ~PLAYER_STATE1_7; + if (this->stateFlags1 & PLAYER_STATE1_27) { func_80838F18(globalCtx, this); } else { func_80853080(this, globalCtx); @@ -7907,7 +7917,7 @@ s32 func_80843E64(GlobalContext* globalCtx, Player* this) { Math_StepToF(&this->linearVelocity, 0.0f, 1.0f); - this->stateFlags1 &= ~0xC0000; + this->stateFlags1 &= ~(PLAYER_STATE1_18 | PLAYER_STATE1_19); if (sp34 >= 400) { s32 impactIndex; @@ -7979,7 +7989,7 @@ void func_8084411C(Player* this, GlobalContext* globalCtx) { func_80837268(this, &sp4C, &sp4A, 0.0f, globalCtx); if (!(this->actor.bgCheckFlags & 1)) { - if (this->stateFlags1 & 0x800) { + if (this->stateFlags1 & PLAYER_STATE1_11) { Actor* heldActor = this->heldActor; if (!func_80835644(globalCtx, this, heldActor) && (heldActor->id == ACTOR_EN_NIW) && @@ -7990,19 +8000,19 @@ void func_8084411C(Player* this, GlobalContext* globalCtx) { LinkAnimation_Update(globalCtx, &this->skelAnime); - if (!(this->stateFlags2 & 0x80000)) { + if (!(this->stateFlags2 & PLAYER_STATE2_19)) { func_8083DFE0(this, &sp4C, &sp4A); } func_80836670(this, globalCtx); - if (((this->stateFlags2 & 0x80000) && (this->unk_84F == 2)) || !func_8083BBA0(this, globalCtx)) { + if (((this->stateFlags2 & PLAYER_STATE2_19) && (this->unk_84F == 2)) || !func_8083BBA0(this, globalCtx)) { if (this->actor.velocity.y < 0.0f) { if (this->unk_850 >= 0) { if ((this->actor.bgCheckFlags & 8) || (this->unk_850 == 0) || (this->fallDistance > 0)) { - if ((D_80853600 > 800.0f) || (this->stateFlags1 & 4)) { + if ((D_80853600 > 800.0f) || (this->stateFlags1 & PLAYER_STATE1_2)) { func_80843E14(this, NA_SE_VO_LI_FALL_S); - this->stateFlags1 &= ~4; + this->stateFlags1 &= ~PLAYER_STATE1_2; } LinkAnimation_Change(globalCtx, &this->skelAnime, &gPlayerAnim_003020, 1.0f, 0.0f, 0.0f, @@ -8015,15 +8025,15 @@ void func_8084411C(Player* this, GlobalContext* globalCtx) { func_80843E14(this, NA_SE_VO_LI_FALL_L); } - if ((this->actor.bgCheckFlags & 0x200) && !(this->stateFlags2 & 0x80000) && - !(this->stateFlags1 & 0x8000800) && (this->linearVelocity > 0.0f)) { + if ((this->actor.bgCheckFlags & 0x200) && !(this->stateFlags2 & PLAYER_STATE2_19) && + !(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_27)) && (this->linearVelocity > 0.0f)) { if ((this->wallHeight >= 150.0f) && (this->unk_84B[this->unk_846] == 0)) { func_8083EC18(this, globalCtx, D_808535F0); } else if ((this->unk_88C >= 2) && (this->wallHeight < 150.0f) && (((this->actor.world.pos.y - this->actor.floorHeight) + this->wallHeight) > (70.0f * this->ageProperties->unk_08))) { AnimationContext_DisableQueue(globalCtx); - if (this->stateFlags1 & 4) { + if (this->stateFlags1 & PLAYER_STATE1_2) { func_80832698(this, NA_SE_VO_LI_HOOKSHOT_HANG); } else { func_80832698(this, NA_SE_VO_LI_HANG); @@ -8032,7 +8042,7 @@ void func_8084411C(Player* this, GlobalContext* globalCtx) { func_8083A5C4(globalCtx, this, this->actor.wallPoly, this->wallDistance, D_80853CBC[this->modelAnimType]); this->actor.shape.rot.y = this->currentYaw += 0x8000; - this->stateFlags1 |= 0x2000; + this->stateFlags1 |= PLAYER_STATE1_13; } } } @@ -8042,7 +8052,7 @@ void func_8084411C(Player* this, GlobalContext* globalCtx) { LinkAnimationHeader* anim = D_80853A64[this->modelAnimType]; s32 sp3C; - if (this->stateFlags2 & 0x80000) { + if (this->stateFlags2 & PLAYER_STATE2_19) { if (func_8008E9C4(this)) { anim = D_80853D4C[this->unk_84F][2]; } else { @@ -8055,7 +8065,8 @@ void func_8084411C(Player* this, GlobalContext* globalCtx) { func_80833C3C(this); } else if (this->fallDistance <= 80) { anim = D_80853A7C[this->modelAnimType]; - } else if ((this->fallDistance < 800) && (this->unk_84B[this->unk_846] == 0) && !(this->stateFlags1 & 0x800)) { + } else if ((this->fallDistance < 800) && (this->unk_84B[this->unk_846] == 0) && + !(this->stateFlags1 & PLAYER_STATE1_11)) { func_8083BC04(this, globalCtx); return; } @@ -8092,7 +8103,7 @@ void func_80844708(Player* this, GlobalContext* globalCtx) { f32 sp38; s16 sp36; - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; cylinderOc = NULL; sp44 = LinkAnimation_Update(globalCtx, &this->skelAnime); @@ -8163,7 +8174,7 @@ void func_80844708(Player* this, GlobalContext* globalCtx) { } void func_80844A44(Player* this, GlobalContext* globalCtx) { - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { func_80832284(globalCtx, this, &gPlayerAnim_003160); @@ -8181,7 +8192,7 @@ void func_80844AF4(Player* this, GlobalContext* globalCtx) { f32 sp2C; s16 sp2A; - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; this->actor.gravity = -1.2f; LinkAnimation_Update(globalCtx, &this->skelAnime); @@ -8208,7 +8219,7 @@ s32 func_80844BE4(Player* this, GlobalContext* globalCtx) { s32 temp; if (func_8083ADD4(globalCtx, this)) { - this->stateFlags2 |= 0x20000; + this->stateFlags2 |= PLAYER_STATE2_17; } else { if (!CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) { if ((this->unk_858 >= 0.85f) || func_808375D8(this)) { @@ -8220,9 +8231,9 @@ s32 func_80844BE4(Player* this, GlobalContext* globalCtx) { func_80837948(globalCtx, this, temp); func_80837AFC(this, -8); - this->stateFlags2 |= 0x20000; + this->stateFlags2 |= PLAYER_STATE2_17; if (this->unk_84B[this->unk_846] == 0) { - this->stateFlags2 |= 0x40000000; + this->stateFlags2 |= PLAYER_STATE2_30; } } else { return 0; @@ -8263,12 +8274,12 @@ void func_80844E68(Player* this, GlobalContext* globalCtx) { s16 sp32; s32 temp; - this->stateFlags1 |= 0x1000; + this->stateFlags1 |= PLAYER_STATE1_12; if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { func_80832DBC(this); func_808355DC(this); - this->stateFlags1 &= ~0x20000; + this->stateFlags1 &= ~PLAYER_STATE1_17; func_80832284(globalCtx, this, D_80854360[Player_HoldsTwoHandedWeapon(this)]); this->unk_850 = -1; } @@ -8315,7 +8326,7 @@ void func_80845000(Player* this, GlobalContext* globalCtx) { sp5C = fabsf(this->linearVelocity); sp58 = sp5C * 1.5f; - this->stateFlags1 |= 0x1000; + this->stateFlags1 |= PLAYER_STATE1_12; if (sp58 < 1.5f) { sp58 = 1.5f; @@ -8377,7 +8388,7 @@ void func_80845308(Player* this, GlobalContext* globalCtx) { sp5C = fabsf(this->linearVelocity); - this->stateFlags1 |= 0x1000; + this->stateFlags1 |= PLAYER_STATE1_12; if (sp5C == 0.0f) { sp5C = ABS(this->unk_87C) * 0.0015f; @@ -8440,7 +8451,7 @@ void func_80845668(Player* this, GlobalContext* globalCtx) { s32 temp2; f32 temp3; - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; sp3C = LinkAnimation_Update(globalCtx, &this->skelAnime); if (this->skelAnime.animation == &gPlayerAnim_002D48) { @@ -8453,7 +8464,7 @@ void func_80845668(Player* this, GlobalContext* globalCtx) { temp1 = this->ageProperties->unk_0C; } - if (this->stateFlags1 & 0x8000000) { + if (this->stateFlags1 & PLAYER_STATE1_27) { temp1 *= 0.085f; } else { temp1 *= 0.072f; @@ -8471,13 +8482,13 @@ void func_80845668(Player* this, GlobalContext* globalCtx) { temp2 = func_808374A0(globalCtx, this, &this->skelAnime, 4.0f); if (temp2 == 0) { - this->stateFlags1 &= ~0x44000; + this->stateFlags1 &= ~(PLAYER_STATE1_14 | PLAYER_STATE1_18); return; } if ((sp3C != 0) || (temp2 > 0)) { func_8083C0E8(this, globalCtx); - this->stateFlags1 &= ~0x44000; + this->stateFlags1 &= ~(PLAYER_STATE1_14 | PLAYER_STATE1_18); return; } @@ -8510,10 +8521,10 @@ void func_80845668(Player* this, GlobalContext* globalCtx) { } void func_808458D0(Player* this, GlobalContext* globalCtx) { - this->stateFlags2 |= 0x60; + this->stateFlags2 |= PLAYER_STATE2_5 | PLAYER_STATE2_6; LinkAnimation_Update(globalCtx, &this->skelAnime); - if (((this->stateFlags1 & 0x800) && (this->heldActor != NULL) && (this->getItemId == GI_NONE)) || + if (((this->stateFlags1 & PLAYER_STATE1_11) && (this->heldActor != NULL) && (this->getItemId == GI_NONE)) || !func_80836670(this, globalCtx)) { this->func_A74(globalCtx, this); } @@ -8549,7 +8560,7 @@ s32 func_80845964(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2 } } - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; func_80841EE4(this, globalCtx); func_8083DF68(this, arg3, arg4); @@ -8606,7 +8617,7 @@ void func_80845CA4(Player* this, GlobalContext* globalCtx) { if (func_80845BA0(globalCtx, this, &sp3C, -1) < 30) { this->unk_84F = 1; - this->stateFlags1 |= 0x20000000; + this->stateFlags1 |= PLAYER_STATE1_29; this->unk_450.x = this->unk_45C.x; this->unk_450.z = this->unk_45C.z; @@ -8615,7 +8626,7 @@ void func_80845CA4(Player* this, GlobalContext* globalCtx) { sp34 = 5.0f; sp30 = 20; - if (this->stateFlags1 & 1) { + if (this->stateFlags1 & PLAYER_STATE1_0) { sp34 = gSaveContext.entranceSpeed; if (D_808535F4 != 0) { @@ -8644,7 +8655,7 @@ void func_80845CA4(Player* this, GlobalContext* globalCtx) { } } - if (this->stateFlags1 & 0x800) { + if (this->stateFlags1 & PLAYER_STATE1_11) { func_80836670(this, globalCtx); } } @@ -8652,7 +8663,7 @@ void func_80845CA4(Player* this, GlobalContext* globalCtx) { void func_80845EF8(Player* this, GlobalContext* globalCtx) { s32 sp2C; - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; sp2C = LinkAnimation_Update(globalCtx, &this->skelAnime); func_80836670(this, globalCtx); @@ -8674,7 +8685,7 @@ void func_80845EF8(Player* this, GlobalContext* globalCtx) { return; } - if (!(this->stateFlags1 & 0x20000000) && LinkAnimation_OnFrame(&this->skelAnime, 15.0f)) { + if (!(this->stateFlags1 & PLAYER_STATE1_29) && LinkAnimation_OnFrame(&this->skelAnime, 15.0f)) { globalCtx->func_11D54(this, globalCtx); } } @@ -8800,7 +8811,7 @@ void func_80846408(Player* this, GlobalContext* globalCtx) { this->unk_850--; if (this->unk_850 == 0) { func_8083A098(this, &gPlayerAnim_003068, globalCtx); - this->stateFlags1 &= ~0x800; + this->stateFlags1 &= ~PLAYER_STATE1_11; func_80832698(this, NA_SE_VO_LI_DAMAGE_S); } } @@ -8918,7 +8929,7 @@ void func_80846660(GlobalContext* globalCtx, Player* this) { if ((globalCtx->sceneNum == SCENE_SPOT06) && (gSaveContext.sceneSetupIndex >= 4)) { this->unk_84F = 1; } - this->stateFlags1 |= 0x20000000; + this->stateFlags1 |= PLAYER_STATE1_29; LinkAnimation_Change(globalCtx, &this->skelAnime, &gPlayerAnim_003298, 2.0f / 3.0f, 0.0f, 24.0f, ANIMMODE_ONCE, 0.0f); this->actor.world.pos.y += 800.0f; @@ -8948,7 +8959,7 @@ static Vec3f D_808546F4 = { -1.0f, 69.0f, 20.0f }; void func_808467D4(GlobalContext* globalCtx, Player* this) { func_80835C58(globalCtx, this, func_8084E9AC, 0); - this->stateFlags1 |= 0x20000000; + this->stateFlags1 |= PLAYER_STATE1_29; Math_Vec3f_Copy(&this->actor.world.pos, &D_808546F4); this->currentYaw = this->actor.shape.rot.y = -0x8000; LinkAnimation_Change(globalCtx, &this->skelAnime, this->ageProperties->unk_A0, 2.0f / 3.0f, 0.0f, 0.0f, @@ -8968,7 +8979,7 @@ void func_808468A8(GlobalContext* globalCtx, Player* this) { void func_808468E8(GlobalContext* globalCtx, Player* this) { func_808389E8(this, &gPlayerAnim_002FE0, 12.0f, globalCtx); func_80835C58(globalCtx, this, func_8084F9C0, 0); - this->stateFlags1 |= 0x20000000; + this->stateFlags1 |= PLAYER_STATE1_29; this->fallStartHeight = this->actor.world.pos.y; OnePointCutscene_Init(globalCtx, 5110, 40, &this->actor, MAIN_CAM); } @@ -8980,7 +8991,7 @@ void func_80846978(GlobalContext* globalCtx, Player* this) { void func_808469BC(GlobalContext* globalCtx, Player* this) { func_80835C58(globalCtx, this, func_8084F698, 0); this->actor.draw = NULL; - this->stateFlags1 |= 0x20000000; + this->stateFlags1 |= PLAYER_STATE1_29; } static s16 D_80854700[] = { ACTOR_MAGIC_WIND, ACTOR_MAGIC_DARK, ACTOR_MAGIC_FIRE }; @@ -8993,7 +9004,7 @@ Actor* func_80846A00(GlobalContext* globalCtx, Player* this, s32 arg2) { void func_80846A68(GlobalContext* globalCtx, Player* this) { this->actor.draw = NULL; func_80835C58(globalCtx, this, func_8085076C, 0); - this->stateFlags1 |= 0x20000000; + this->stateFlags1 |= PLAYER_STATE1_29; } static InitChainEntry D_80854708[] = { @@ -9147,7 +9158,7 @@ void Player_Init(Actor* thisx, GlobalContext* globalCtx2) { if (gSaveContext.nayrusLoveTimer != 0) { gSaveContext.unk_13F0 = 3; func_80846A00(globalCtx, this, 1); - this->stateFlags3 &= ~0x40; + this->stateFlags3 &= ~PLAYER_STATE3_6; } if (gSaveContext.entranceSound != 0) { @@ -9231,19 +9242,21 @@ void func_808473D4(GlobalContext* globalCtx, Player* this) { s32 doAction = DO_ACTION_NONE; if (!Player_InBlockingCsMode(globalCtx, this)) { - if (this->stateFlags1 & 0x100000) { + if (this->stateFlags1 & PLAYER_STATE1_20) { doAction = DO_ACTION_RETURN; } else if ((this->heldItemActionParam == PLAYER_AP_FISHING_POLE) && (this->unk_860 != 0)) { if (this->unk_860 == 2) { doAction = DO_ACTION_REEL; } - } else if ((func_8084E3C4 != this->func_674) && !(this->stateFlags2 & 0x40000)) { + } else if ((func_8084E3C4 != this->func_674) && !(this->stateFlags2 & PLAYER_STATE2_18)) { if ((this->doorType != PLAYER_DOORTYPE_NONE) && - (!(this->stateFlags1 & 0x800) || ((heldActor != NULL) && (heldActor->id == ACTOR_EN_RU1)))) { + (!(this->stateFlags1 & PLAYER_STATE1_11) || + ((heldActor != NULL) && (heldActor->id == ACTOR_EN_RU1)))) { doAction = DO_ACTION_OPEN; - } else if ((!(this->stateFlags1 & 0x800) || (heldActor == NULL)) && (interactRangeActor != NULL) && + } else if ((!(this->stateFlags1 & PLAYER_STATE1_11) || (heldActor == NULL)) && + (interactRangeActor != NULL) && ((!sp1C && (this->getItemId == GI_NONE)) || - ((this->getItemId < 0) && !(this->stateFlags1 & 0x8000000)))) { + ((this->getItemId < 0) && !(this->stateFlags1 & PLAYER_STATE1_27)))) { if (this->getItemId < 0) { doAction = DO_ACTION_OPEN; } else if ((interactRangeActor->id == ACTOR_BG_TOKI_SWD) && LINK_IS_ADULT) { @@ -9251,33 +9264,35 @@ void func_808473D4(GlobalContext* globalCtx, Player* this) { } else { doAction = DO_ACTION_GRAB; } - } else if (!sp1C && (this->stateFlags2 & 1)) { + } else if (!sp1C && (this->stateFlags2 & PLAYER_STATE2_0)) { doAction = DO_ACTION_GRAB; - } else if ((this->stateFlags2 & 4) || (!(this->stateFlags1 & 0x800000) && (this->rideActor != NULL))) { + } else if ((this->stateFlags2 & PLAYER_STATE2_2) || + (!(this->stateFlags1 & PLAYER_STATE1_23) && (this->rideActor != NULL))) { doAction = DO_ACTION_CLIMB; - } else if ((this->stateFlags1 & 0x800000) && !EN_HORSE_CHECK_4((EnHorse*)this->rideActor) && + } else if ((this->stateFlags1 & PLAYER_STATE1_23) && !EN_HORSE_CHECK_4((EnHorse*)this->rideActor) && (func_8084D3E4 != this->func_674)) { - if ((this->stateFlags2 & 2) && (this->targetActor != NULL)) { + if ((this->stateFlags2 & PLAYER_STATE2_1) && (this->targetActor != NULL)) { if (this->targetActor->category == ACTORCAT_NPC) { doAction = DO_ACTION_SPEAK; } else { doAction = DO_ACTION_CHECK; } - } else if (!func_8002DD78(this) && !(this->stateFlags1 & 0x100000)) { + } else if (!func_8002DD78(this) && !(this->stateFlags1 & PLAYER_STATE1_20)) { doAction = DO_ACTION_FASTER; } - } else if ((this->stateFlags2 & 2) && (this->targetActor != NULL)) { + } else if ((this->stateFlags2 & PLAYER_STATE2_1) && (this->targetActor != NULL)) { if (this->targetActor->category == ACTORCAT_NPC) { doAction = DO_ACTION_SPEAK; } else { doAction = DO_ACTION_CHECK; } - } else if ((this->stateFlags1 & 0x202000) || - ((this->stateFlags1 & 0x800000) && (this->stateFlags2 & 0x400000))) { + } else if ((this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_21)) || + ((this->stateFlags1 & PLAYER_STATE1_23) && (this->stateFlags2 & PLAYER_STATE2_22))) { doAction = DO_ACTION_DOWN; - } else if (this->stateFlags2 & 0x10000) { + } else if (this->stateFlags2 & PLAYER_STATE2_16) { doAction = DO_ACTION_ENTER; - } else if ((this->stateFlags1 & 0x800) && (this->getItemId == GI_NONE) && (heldActor != NULL)) { + } else if ((this->stateFlags1 & PLAYER_STATE1_11) && (this->getItemId == GI_NONE) && + (heldActor != NULL)) { if ((this->actor.bgCheckFlags & 1) || (heldActor->id == ACTOR_EN_NIW)) { if (func_8083EAF0(this, heldActor) == 0) { doAction = DO_ACTION_DROP; @@ -9285,26 +9300,27 @@ void func_808473D4(GlobalContext* globalCtx, Player* this) { doAction = DO_ACTION_THROW; } } - } else if (!(this->stateFlags1 & 0x8000000) && func_8083A0D4(this) && (this->getItemId < GI_MAX)) { + } else if (!(this->stateFlags1 & PLAYER_STATE1_27) && func_8083A0D4(this) && + (this->getItemId < GI_MAX)) { doAction = DO_ACTION_GRAB; - } else if (this->stateFlags2 & 0x800) { + } else if (this->stateFlags2 & PLAYER_STATE2_11) { sp24 = (D_80854784[CUR_UPG_VALUE(UPG_SCALE)] - this->actor.yDistToWater) / 40.0f; sp24 = CLAMP(sp24, 0, 7); doAction = sDiveDoActions[sp24]; - } else if (sp1C && !(this->stateFlags2 & 0x400)) { + } else if (sp1C && !(this->stateFlags2 & PLAYER_STATE2_10)) { doAction = DO_ACTION_DIVE; - } else if (!sp1C && (!(this->stateFlags1 & 0x400000) || func_80833BCC(this) || + } else if (!sp1C && (!(this->stateFlags1 & PLAYER_STATE1_22) || func_80833BCC(this) || !Player_IsChildWithHylianShield(this))) { - if ((!(this->stateFlags1 & 0x4000) && (sp20 <= 0) && + if ((!(this->stateFlags1 & PLAYER_STATE1_14) && (sp20 <= 0) && (func_8008E9C4(this) || ((D_808535E4 != 7) && (func_80833B2C(this) || ((globalCtx->roomCtx.curRoom.unk_03 != 2) && - !(this->stateFlags1 & 0x400000) && (sp20 == 0))))))) { + !(this->stateFlags1 & PLAYER_STATE1_22) && (sp20 == 0))))))) { doAction = DO_ACTION_ATTACK; } else if ((globalCtx->roomCtx.curRoom.unk_03 != 2) && func_80833BCC(this) && (sp20 > 0)) { doAction = DO_ACTION_JUMP; } else if ((this->heldItemActionParam >= PLAYER_AP_SWORD_MASTER) || - ((this->stateFlags2 & 0x100000) && + ((this->stateFlags2 & PLAYER_STATE2_20) && (globalCtx->actorCtx.targetCtx.arrowPointedActor == NULL))) { doAction = DO_ACTION_PUTAWAY; } @@ -9321,7 +9337,7 @@ void func_808473D4(GlobalContext* globalCtx, Player* this) { Interface_SetDoAction(globalCtx, doAction); - if (this->stateFlags2 & 0x200000) { + if (this->stateFlags2 & PLAYER_STATE2_21) { if (this->unk_664 != NULL) { Interface_SetNaviCall(globalCtx, 0x1E); } else { @@ -9376,7 +9392,7 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { D_80853604 = this->unk_A7A; - if (this->stateFlags2 & 0x40000) { + if (this->stateFlags2 & PLAYER_STATE2_18) { spB0 = 10.0f; spAC = 15.0f; spA8 = 30.0f; @@ -9386,13 +9402,13 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { spA8 = this->ageProperties->unk_00; } - if (this->stateFlags1 & 0xA0000000) { - if (this->stateFlags1 & 0x80000000) { + if (this->stateFlags1 & (PLAYER_STATE1_29 | PLAYER_STATE1_31)) { + if (this->stateFlags1 & PLAYER_STATE1_31) { this->actor.bgCheckFlags &= ~1; spA4 = 0x38; - } else if ((this->stateFlags1 & 1) && ((this->unk_A84 - (s32)this->actor.world.pos.y) >= 100)) { + } else if ((this->stateFlags1 & PLAYER_STATE1_0) && ((this->unk_A84 - (s32)this->actor.world.pos.y) >= 100)) { spA4 = 0x39; - } else if (!(this->stateFlags1 & 1) && + } else if (!(this->stateFlags1 & PLAYER_STATE1_0) && ((func_80845EF8 == this->func_674) || (func_80845CA4 == this->func_674))) { this->actor.bgCheckFlags &= ~0x208; spA4 = 0x3C; @@ -9403,12 +9419,12 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { spA4 = 0x3F; } - if (this->stateFlags3 & 1) { + if (this->stateFlags3 & PLAYER_STATE3_0) { spA4 &= ~6; } if (spA4 & 4) { - this->stateFlags3 |= 0x10; + this->stateFlags3 |= PLAYER_STATE3_4; } Math_Vec3f_Copy(&spB4, &this->actor.world.pos); @@ -9434,7 +9450,7 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { this->unk_89E = 5; } } else { - if (this->stateFlags2 & 0x200) { + if (this->stateFlags2 & PLAYER_STATE2_9) { this->unk_89E = 1; } else { this->unk_89E = SurfaceType_GetSfx(&globalCtx->colCtx, spC0, this->actor.floorBgId); @@ -9478,7 +9494,8 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { D_80854798.y = 18.0f; D_80854798.z = this->ageProperties->unk_38 + 10.0f; - if (!(this->stateFlags2 & 0x40000) && func_80839768(globalCtx, this, &D_80854798, &spA0, &sp9C, &D_80858AA8)) { + if (!(this->stateFlags2 & PLAYER_STATE2_18) && + func_80839768(globalCtx, this, &D_80854798, &spA0, &sp9C, &D_80858AA8)) { this->actor.bgCheckFlags |= 0x200; if (this->actor.wallPoly != spA0) { this->actor.wallPoly = spA0; @@ -9636,19 +9653,19 @@ void Player_UpdateCamAndSeqModes(GlobalContext* globalCtx, Player* this) { if (this->csMode != 0) { Camera_ChangeMode(Gameplay_GetCamera(globalCtx, 0), CAM_MODE_NORMAL); - } else if (!(this->stateFlags1 & 0x100000)) { - if ((this->actor.parent != NULL) && (this->stateFlags3 & 0x80)) { + } else if (!(this->stateFlags1 & PLAYER_STATE1_20)) { + if ((this->actor.parent != NULL) && (this->stateFlags3 & PLAYER_STATE3_7)) { camMode = CAM_MODE_HOOKSHOT; Camera_SetParam(Gameplay_GetCamera(globalCtx, 0), 8, this->actor.parent); } else if (func_8084377C == this->func_674) { camMode = CAM_MODE_STILL; - } else if (this->stateFlags2 & 0x100) { + } else if (this->stateFlags2 & PLAYER_STATE2_8) { camMode = CAM_MODE_PUSHPULL; } else if ((unk_664 = this->unk_664) != NULL) { if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_8)) { camMode = CAM_MODE_TALK; - } else if (this->stateFlags1 & 0x10000) { - if (this->stateFlags1 & 0x2000000) { + } else if (this->stateFlags1 & PLAYER_STATE1_16) { + if (this->stateFlags1 & PLAYER_STATE1_25) { camMode = CAM_MODE_FOLLOWBOOMERANG; } else { camMode = CAM_MODE_FOLLOWTARGET; @@ -9657,39 +9674,39 @@ void Player_UpdateCamAndSeqModes(GlobalContext* globalCtx, Player* this) { camMode = CAM_MODE_BATTLE; } Camera_SetParam(Gameplay_GetCamera(globalCtx, 0), 8, unk_664); - } else if (this->stateFlags1 & 0x1000) { + } else if (this->stateFlags1 & PLAYER_STATE1_12) { camMode = CAM_MODE_CHARGE; - } else if (this->stateFlags1 & 0x2000000) { + } else if (this->stateFlags1 & PLAYER_STATE1_25) { camMode = CAM_MODE_FOLLOWBOOMERANG; Camera_SetParam(Gameplay_GetCamera(globalCtx, 0), 8, this->boomerangActor); - } else if (this->stateFlags1 & 0x6000) { + } else if (this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14)) { if (func_80833B2C(this)) { camMode = CAM_MODE_HANGZ; } else { camMode = CAM_MODE_HANG; } - } else if (this->stateFlags1 & 0x40020000) { + } else if (this->stateFlags1 & (PLAYER_STATE1_17 | PLAYER_STATE1_30)) { if (func_8002DD78(this) || func_808334B4(this)) { camMode = CAM_MODE_BOWARROWZ; - } else if (this->stateFlags1 & 0x200000) { + } else if (this->stateFlags1 & PLAYER_STATE1_21) { camMode = CAM_MODE_CLIMBZ; } else { camMode = CAM_MODE_TARGET; } - } else if (this->stateFlags1 & 0x240000) { - if ((func_80845668 == this->func_674) || (this->stateFlags1 & 0x200000)) { + } else if (this->stateFlags1 & (PLAYER_STATE1_18 | PLAYER_STATE1_21)) { + if ((func_80845668 == this->func_674) || (this->stateFlags1 & PLAYER_STATE1_21)) { camMode = CAM_MODE_CLIMB; } else { camMode = CAM_MODE_JUMP; } - } else if (this->stateFlags1 & 0x80000) { + } else if (this->stateFlags1 & PLAYER_STATE1_19) { camMode = CAM_MODE_FREEFALL; } else if ((this->swordState != 0) && (this->swordAnimation >= 0) && (this->swordAnimation < 0x18)) { camMode = CAM_MODE_STILL; } else { camMode = CAM_MODE_NORMAL; if ((this->linearVelocity == 0.0f) && - (!(this->stateFlags1 & 0x800000) || (this->rideActor->speedXZ == 0.0f))) { + (!(this->stateFlags1 & PLAYER_STATE1_23) || (this->rideActor->speedXZ == 0.0f))) { // not moving seqMode = SEQ_MODE_STILL; } @@ -9789,7 +9806,7 @@ void func_80848C74(GlobalContext* globalCtx, Player* this) { spawnedFlame = false; timerPtr = this->flameTimers; - if (this->stateFlags2 & 8) { + if (this->stateFlags2 & PLAYER_STATE2_3) { sp58 = 100; } else { sp58 = 0; @@ -9917,13 +9934,13 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { func_80848C74(globalCtx, this); } - if ((this->stateFlags3 & 0x40) && (gSaveContext.nayrusLoveTimer != 0) && (gSaveContext.unk_13F0 == 0)) { + if ((this->stateFlags3 & PLAYER_STATE3_6) && (gSaveContext.nayrusLoveTimer != 0) && (gSaveContext.unk_13F0 == 0)) { gSaveContext.unk_13F0 = 3; func_80846A00(globalCtx, this, 1); - this->stateFlags3 &= ~0x40; + this->stateFlags3 &= ~PLAYER_STATE3_6; } - if (this->stateFlags2 & 0x8000) { + if (this->stateFlags2 & PLAYER_STATE2_15) { if (!(this->actor.bgCheckFlags & 1)) { func_80832210(this); Actor_MoveForward(&this->actor); @@ -9936,17 +9953,17 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { if (this->currentBoots != this->prevBoots) { if (this->currentBoots == PLAYER_BOOTS_IRON) { - if (this->stateFlags1 & 0x8000000) { + if (this->stateFlags1 & PLAYER_STATE1_27) { func_80832340(globalCtx, this); if (this->ageProperties->unk_2C < this->actor.yDistToWater) { - this->stateFlags2 |= 0x400; + this->stateFlags2 |= PLAYER_STATE2_10; } } } else { - if (this->stateFlags1 & 0x8000000) { + if (this->stateFlags1 & PLAYER_STATE1_27) { if ((this->prevBoots == PLAYER_BOOTS_IRON) || (this->actor.bgCheckFlags & 1)) { func_8083D36C(globalCtx, this); - this->stateFlags2 &= ~0x400; + this->stateFlags2 &= ~PLAYER_STATE2_10; } } } @@ -9954,10 +9971,10 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { this->prevBoots = this->currentBoots; } - if ((this->actor.parent == NULL) && (this->stateFlags1 & 0x800000)) { + if ((this->actor.parent == NULL) && (this->stateFlags1 & PLAYER_STATE1_23)) { this->actor.parent = this->rideActor; func_8083A360(globalCtx, this); - this->stateFlags1 |= 0x800000; + this->stateFlags1 |= PLAYER_STATE1_23; func_80832264(globalCtx, this, &gPlayerAnim_0033B8); func_80832F54(globalCtx, this, 0x9B); this->unk_850 = 99; @@ -9986,7 +10003,8 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { if (!(this->skelAnime.moveFlags & 0x80)) { if (((this->actor.bgCheckFlags & 1) && (D_808535E4 == 5) && (this->currentBoots != PLAYER_BOOTS_IRON)) || - ((this->currentBoots == PLAYER_BOOTS_HOVER) && !(this->stateFlags1 & 0x28000000))) { + ((this->currentBoots == PLAYER_BOOTS_HOVER) && + !(this->stateFlags1 & (PLAYER_STATE1_27 | PLAYER_STATE1_29)))) { f32 sp70 = this->linearVelocity; s16 sp6E = this->currentYaw; s16 yawDiff = this->actor.world.rot.y - sp6E; @@ -10020,7 +10038,8 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { func_8002D868(&this->actor); - if ((this->windSpeed != 0.0f) && !Player_InCsMode(globalCtx) && !(this->stateFlags1 & 0x206000) && + if ((this->windSpeed != 0.0f) && !Player_InCsMode(globalCtx) && + !(this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_21)) && (func_80845668 != this->func_674) && (func_808507F4 != this->func_674)) { this->actor.velocity.x += this->windSpeed * Math_SinS(this->windDirection); this->actor.velocity.z += this->windSpeed * Math_CosS(this->windDirection); @@ -10032,7 +10051,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { D_808535E4 = 0; this->unk_A7A = 0; - if (!(this->stateFlags1 & 1) && (this->stateFlags1 & 0x800000)) { + if (!(this->stateFlags1 & PLAYER_STATE1_0) && (this->stateFlags1 & PLAYER_STATE1_23)) { EnHorse* rideActor = (EnHorse*)this->rideActor; CollisionPoly* sp5C; s32 sp58; @@ -10066,7 +10085,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { if (D_808535F8 == 0) { sp48 = D_80854820[D_808535F4]; - if (!(this->stateFlags1 & 0x8000000)) { + if (!(this->stateFlags1 & PLAYER_STATE1_27)) { sp48 *= 0.25f; } } else { @@ -10076,19 +10095,19 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { Math_StepToF(&this->windSpeed, sp48, sp48 * 0.1f); Math_ScaledStepToS(&this->windDirection, D_808535FC, - ((this->stateFlags1 & 0x8000000) ? 400.0f : 800.0f) * sp48); + ((this->stateFlags1 & PLAYER_STATE1_27) ? 400.0f : 800.0f) * sp48); } else if (this->windSpeed != 0.0f) { - Math_StepToF(&this->windSpeed, 0.0f, (this->stateFlags1 & 0x8000000) ? 0.5f : 1.0f); + Math_StepToF(&this->windSpeed, 0.0f, (this->stateFlags1 & PLAYER_STATE1_27) ? 0.5f : 1.0f); } - if (!Player_InBlockingCsMode(globalCtx, this) && !(this->stateFlags2 & 0x40000)) { + if (!Player_InBlockingCsMode(globalCtx, this) && !(this->stateFlags2 & PLAYER_STATE2_18)) { func_8083D53C(globalCtx, this); if ((this->actor.category == ACTORCAT_PLAYER) && (gSaveContext.health == 0)) { - if (this->stateFlags1 & 0x206000) { + if (this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_21)) { func_80832440(globalCtx, this); func_80837B9C(this, globalCtx); - } else if ((this->actor.bgCheckFlags & 1) || (this->stateFlags1 & 0x8000000)) { + } else if ((this->actor.bgCheckFlags & 1) || (this->stateFlags1 & PLAYER_STATE1_27)) { func_80836448(globalCtx, this, func_808332B8(this) ? &gPlayerAnim_003310 : (this->shockTimer != 0) ? &gPlayerAnim_002F08 @@ -10105,14 +10124,15 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { } } - if ((globalCtx->csCtx.state != CS_STATE_IDLE) && (this->csMode != 6) && !(this->stateFlags1 & 0x800000) && - !(this->stateFlags2 & 0x80) && (this->actor.category == ACTORCAT_PLAYER)) { + if ((globalCtx->csCtx.state != CS_STATE_IDLE) && (this->csMode != 6) && + !(this->stateFlags1 & PLAYER_STATE1_23) && !(this->stateFlags2 & PLAYER_STATE2_7) && + (this->actor.category == ACTORCAT_PLAYER)) { CsCmdActorAction* linkActionCsCmd = globalCtx->csCtx.linkAction; if ((linkActionCsCmd != NULL) && (D_808547C4[linkActionCsCmd->action] != 0)) { func_8002DF54(globalCtx, NULL, 6); func_80832210(this); - } else if ((this->csMode == 0) && !(this->stateFlags2 & 0x400) && + } else if ((this->csMode == 0) && !(this->stateFlags2 & PLAYER_STATE2_10) && (globalCtx->csCtx.state != CS_STATE_UNSKIPPABLE_INIT)) { func_8002DF54(globalCtx, NULL, 0x31); func_80832210(this); @@ -10120,7 +10140,8 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { } if (this->csMode != 0) { - if ((this->csMode != 7) || !(this->stateFlags1 & 0x4206000)) { + if ((this->csMode != 7) || + !(this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_21 | PLAYER_STATE1_26))) { this->unk_6AD = 3; } else if (func_80852E14 != this->func_674) { func_80852944(globalCtx, this, NULL); @@ -10132,17 +10153,19 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { func_8083D6EC(globalCtx, this); if ((this->unk_664 == NULL) && (this->naviTextId == 0)) { - this->stateFlags2 &= ~0x200002; + this->stateFlags2 &= ~(PLAYER_STATE2_1 | PLAYER_STATE2_21); } - this->stateFlags1 &= ~0x401202; - this->stateFlags2 &= ~0x441536D; - this->stateFlags3 &= ~0x10; + this->stateFlags1 &= ~(PLAYER_STATE1_1 | PLAYER_STATE1_9 | PLAYER_STATE1_12 | PLAYER_STATE1_22); + this->stateFlags2 &= ~(PLAYER_STATE2_0 | PLAYER_STATE2_2 | PLAYER_STATE2_3 | PLAYER_STATE2_5 | PLAYER_STATE2_6 | + PLAYER_STATE2_8 | PLAYER_STATE2_9 | PLAYER_STATE2_12 | PLAYER_STATE2_14 | + PLAYER_STATE2_16 | PLAYER_STATE2_22 | PLAYER_STATE2_26); + this->stateFlags3 &= ~PLAYER_STATE3_4; func_80847298(this); func_8083315C(globalCtx, this); - if (this->stateFlags1 & 0x8000000) { + if (this->stateFlags1 & PLAYER_STATE1_27) { D_808535E8 = 0.5f; } else { D_808535E8 = 1.0f; @@ -10152,7 +10175,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { D_80853614 = D_80853618 = 0; D_80858AA4 = this->currentMask; - if (!(this->stateFlags3 & 4)) { + if (!(this->stateFlags3 & PLAYER_STATE3_2)) { this->func_674(this, globalCtx); } @@ -10173,7 +10196,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { this->exchangeItemId = EXCH_ITEM_NONE; } - if (!(this->stateFlags1 & 0x800)) { + if (!(this->stateFlags1 & PLAYER_STATE1_11)) { this->interactRangeActor = NULL; this->getItemDirection = 0x6000; } @@ -10184,11 +10207,11 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { this->naviTextId = 0; - if (!(this->stateFlags2 & 0x2000000)) { + if (!(this->stateFlags2 & PLAYER_STATE2_25)) { this->unk_6A8 = NULL; } - this->stateFlags2 &= ~0x800000; + this->stateFlags2 &= ~PLAYER_STATE2_23; this->unk_6A4 = FLT_MAX; temp_f0 = this->actor.world.pos.y - this->actor.prevPos.y; @@ -10209,18 +10232,18 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { this->cylinder.dim.yShift = phi_f12 - this->actor.world.pos.y; - if (this->stateFlags1 & 0x400000) { + if (this->stateFlags1 & PLAYER_STATE1_22) { this->cylinder.dim.height = this->cylinder.dim.height * 0.8f; } Collider_UpdateCylinder(&this->actor, &this->cylinder); - if (!(this->stateFlags2 & 0x4000)) { - if (!(this->stateFlags1 & 0x806080)) { + if (!(this->stateFlags2 & PLAYER_STATE2_14)) { + if (!(this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_23))) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->cylinder.base); } - if (!(this->stateFlags1 & 0x4000080) && (this->invincibilityTimer <= 0)) { + if (!(this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_26)) && (this->invincibilityTimer <= 0)) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->cylinder.base); if (this->invincibilityTimer < 0) { @@ -10235,13 +10258,13 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); Math_Vec3f_Copy(&this->unk_A88, &this->bodyPartsPos[0]); - if (this->stateFlags1 & 0x30000080) { + if (this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29)) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; } else { this->actor.colChkInfo.mass = 50; } - this->stateFlags3 &= ~4; + this->stateFlags3 &= ~PLAYER_STATE3_2; Collider_ResetCylinderAC(globalCtx, &this->cylinder.base); @@ -10287,7 +10310,7 @@ void Player_Update(Actor* thisx, GlobalContext* globalCtx) { func_808323B4(globalCtx, this); } - if (this->stateFlags1 & 0x20000020) { + if (this->stateFlags1 & (PLAYER_STATE1_5 | PLAYER_STATE1_29)) { bzero(&sp44, sizeof(sp44)); } else { sp44 = globalCtx->state.input[0]; @@ -10354,7 +10377,7 @@ void func_8084A0E8(GlobalContext* globalCtx, Player* this, s32 lod, Gfx* cullDLi } if ((this->currentBoots == PLAYER_BOOTS_HOVER) && !(this->actor.bgCheckFlags & 1) && - !(this->stateFlags1 & 0x800000) && (this->hoverBootsTimer != 0)) { + !(this->stateFlags1 & PLAYER_STATE1_23) && (this->hoverBootsTimer != 0)) { s32 sp5C; s32 hoverBootsTimer = this->hoverBootsTimer; @@ -10398,7 +10421,7 @@ void Player_Draw(Actor* thisx, GlobalContext* globalCtx2) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_player.c", 19346); - if (!(this->stateFlags2 & 0x20000000)) { + if (!(this->stateFlags2 & PLAYER_STATE2_29)) { OverrideLimbDrawOpa overrideLimbDraw = func_80090014; s32 lod; s32 pad; @@ -10428,13 +10451,13 @@ void Player_Draw(Actor* thisx, GlobalContext* globalCtx2) { if (sp7C.z < -4.0f) { overrideLimbDraw = func_800902F0; } - } else if (this->stateFlags2 & 0x40000) { + } else if (this->stateFlags2 & PLAYER_STATE2_18) { if (this->actor.projectedPos.z < 0.0f) { overrideLimbDraw = func_80090440; } } - if (this->stateFlags2 & 0x4000000) { + if (this->stateFlags2 & PLAYER_STATE2_26) { f32 sp78 = ((u16)(globalCtx->gameplayFrames * 600) * M_PI) / 0x8000; f32 sp74 = ((u16)(globalCtx->gameplayFrames * 1000) * M_PI) / 0x8000; @@ -10465,7 +10488,7 @@ void Player_Draw(Actor* thisx, GlobalContext* globalCtx2) { POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP); } - if (this->stateFlags2 & 0x4000) { + if (this->stateFlags2 & PLAYER_STATE2_14) { f32 scale = (this->unk_84F >> 1) * 22.0f; gSPSegment(POLY_XLU_DISP++, 0x08, @@ -10515,7 +10538,7 @@ s16 func_8084ABD8(GlobalContext* globalCtx, Player* this, s32 arg2, s16 arg3) { temp2 = CLAMP(temp2, -3000, 3000); this->actor.focus.rot.y += temp2; } else { - temp1 = (this->stateFlags1 & 0x800000) ? 3500 : 14000; + temp1 = (this->stateFlags1 & PLAYER_STATE1_23) ? 3500 : 14000; temp3 = ((sControlInput->rel.stick_y >= 0) ? 1 : -1) * (s32)((1.0f - Math_CosS(sControlInput->rel.stick_y * 200)) * 1500.0f); this->actor.focus.rot.x += temp3; @@ -10577,7 +10600,7 @@ void func_8084B000(Player* this) { } phi_f18 = -0.1f - phi_f16; } else { - if (!(this->stateFlags1 & 0x80) && (this->currentBoots == PLAYER_BOOTS_IRON) && + if (!(this->stateFlags1 & PLAYER_STATE1_7) && (this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.velocity.y >= -3.0f)) { phi_f18 = -0.2f; } else { @@ -10592,7 +10615,7 @@ void func_8084B000(Player* this) { yDistToWater = this->actor.yDistToWater; if (yDistToWater > 100.0f) { - this->stateFlags2 |= 0x400; + this->stateFlags2 |= PLAYER_STATE2_10; } } @@ -10625,7 +10648,7 @@ void func_8084B158(GlobalContext* globalCtx, Player* this, Input* input, f32 arg } void func_8084B1D8(Player* this, GlobalContext* globalCtx) { - if (this->stateFlags1 & 0x8000000) { + if (this->stateFlags1 & PLAYER_STATE1_27) { func_8084B000(this); func_8084AEEC(this, &this->linearVelocity, 0, this->actor.shape.rot.y); } else { @@ -10665,7 +10688,7 @@ s32 func_8084B3CC(GlobalContext* globalCtx, Player* this) { func_80835F44(globalCtx, this, 3); } - this->stateFlags1 |= 0x100000; + this->stateFlags1 |= PLAYER_STATE1_20; func_80832264(globalCtx, this, func_80833338(this)); func_80832210(this); func_8083B010(this); @@ -10681,8 +10704,8 @@ void func_8084B498(Player* this) { } s32 func_8084B4D4(GlobalContext* globalCtx, Player* this) { - if (this->stateFlags3 & 0x20) { - this->stateFlags3 &= ~0x20; + if (this->stateFlags3 & PLAYER_STATE3_5) { + this->stateFlags3 &= ~PLAYER_STATE3_5; func_8084B498(this); this->unk_6AD = 4; func_8083B040(this, globalCtx); @@ -10693,21 +10716,21 @@ s32 func_8084B4D4(GlobalContext* globalCtx, Player* this) { } void func_8084B530(Player* this, GlobalContext* globalCtx) { - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; func_80836670(this, globalCtx); if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CLOSING) { this->actor.flags &= ~ACTOR_FLAG_8; if (!CHECK_FLAG_ALL(this->targetActor->flags, ACTOR_FLAG_0 | ACTOR_FLAG_2)) { - this->stateFlags2 &= ~0x2000; + this->stateFlags2 &= ~PLAYER_STATE2_13; } func_8005B1A4(Gameplay_GetCamera(globalCtx, 0)); if (!func_8084B4D4(globalCtx, this) && !func_8084B3CC(globalCtx, this) && !func_8083ADD4(globalCtx, this)) { if ((this->targetActor != this->interactRangeActor) || !func_8083E5A8(this, globalCtx)) { - if (this->stateFlags1 & 0x800000) { + if (this->stateFlags1 & PLAYER_STATE1_23) { s32 sp24 = this->unk_850; func_8083A360(globalCtx, this); this->unk_850 = sp24; @@ -10723,7 +10746,7 @@ void func_8084B530(Player* this, GlobalContext* globalCtx) { return; } - if (this->stateFlags1 & 0x800000) { + if (this->stateFlags1 & PLAYER_STATE1_23) { func_8084CC98(this, globalCtx); } else if (func_808332B8(this)) { func_8084D610(this, globalCtx); @@ -10751,7 +10774,7 @@ void func_8084B78C(Player* this, GlobalContext* globalCtx) { s16 sp32; s32 temp; - this->stateFlags2 |= 0x141; + this->stateFlags2 |= PLAYER_STATE2_0 | PLAYER_STATE2_6 | PLAYER_STATE2_8; func_8083F524(globalCtx, this); if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { @@ -10787,7 +10810,7 @@ void func_8084B898(Player* this, GlobalContext* globalCtx) { s16 sp32; s32 temp; - this->stateFlags2 |= 0x141; + this->stateFlags2 |= PLAYER_STATE2_0 | PLAYER_STATE2_6 | PLAYER_STATE2_8; if (func_80832CB0(globalCtx, this, &gPlayerAnim_003108)) { this->unk_850 = 1; @@ -10808,11 +10831,11 @@ void func_8084B898(Player* this, GlobalContext* globalCtx) { } else if (temp == 0) { func_8083F72C(this, &gPlayerAnim_0030E0, globalCtx); } else { - this->stateFlags2 |= 0x10; + this->stateFlags2 |= PLAYER_STATE2_4; } } - if (this->stateFlags2 & 0x10) { + if (this->stateFlags2 & PLAYER_STATE2_4) { func_8084B840(globalCtx, this, 2.0f); this->linearVelocity = 2.0f; } @@ -10838,7 +10861,7 @@ void func_8084B9E4(Player* this, GlobalContext* globalCtx) { Vec3f sp38; anim = D_80853C74[this->modelAnimType]; - this->stateFlags2 |= 0x141; + this->stateFlags2 |= PLAYER_STATE2_0 | PLAYER_STATE2_6 | PLAYER_STATE2_8; if (func_80832CB0(globalCtx, this, anim)) { this->unk_850 = 1; @@ -10862,11 +10885,11 @@ void func_8084B9E4(Player* this, GlobalContext* globalCtx) { } else if (temp1 == 0) { func_8083F72C(this, D_80853C8C[this->modelAnimType], globalCtx); } else { - this->stateFlags2 |= 0x10; + this->stateFlags2 |= PLAYER_STATE2_4; } } - if (this->stateFlags2 & 0x10) { + if (this->stateFlags2 & PLAYER_STATE2_4) { temp2 = func_8083973C(globalCtx, this, &D_80854880, &sp5C) - this->actor.world.pos.y; if (fabsf(temp2) < 20.0f) { sp44.x = this->actor.world.pos.x; @@ -10878,7 +10901,7 @@ void func_8084B9E4(Player* this, GlobalContext* globalCtx) { return; } } - this->stateFlags2 &= ~0x10; + this->stateFlags2 &= ~PLAYER_STATE2_4; } } @@ -10888,7 +10911,7 @@ void func_8084BBE4(Player* this, GlobalContext* globalCtx) { LinkAnimationHeader* anim; f32 temp; - this->stateFlags2 |= 0x40; + this->stateFlags2 |= PLAYER_STATE2_6; if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { // clang-format off @@ -10933,13 +10956,13 @@ void func_8084BBE4(Player* this, GlobalContext* globalCtx) { this->linearVelocity = 0.8f; } func_80837B9C(this, globalCtx); - this->stateFlags1 &= ~0x6000; + this->stateFlags1 &= ~(PLAYER_STATE1_13 | PLAYER_STATE1_14); } } } void func_8084BDFC(Player* this, GlobalContext* globalCtx) { - this->stateFlags2 |= 0x40; + this->stateFlags2 |= PLAYER_STATE2_6; if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { func_80832E48(this, 1); @@ -10950,7 +10973,7 @@ void func_8084BDFC(Player* this, GlobalContext* globalCtx) { if (LinkAnimation_OnFrame(&this->skelAnime, this->skelAnime.endFrame - 6.0f)) { func_808328A0(this); } else if (LinkAnimation_OnFrame(&this->skelAnime, this->skelAnime.endFrame - 34.0f)) { - this->stateFlags1 &= ~0x6000; + this->stateFlags1 &= ~(PLAYER_STATE1_13 | PLAYER_STATE1_14); func_8002F7DC(&this->actor, NA_SE_PL_CLIMB_CLIFF); func_80832698(this, NA_SE_VO_LI_CLIMB_END); } @@ -10977,7 +11000,7 @@ void func_8084BF1C(Player* this, GlobalContext* globalCtx) { sp80 = sControlInput->rel.stick_x; this->fallStartHeight = this->actor.world.pos.y; - this->stateFlags2 |= 0x40; + this->stateFlags2 |= PLAYER_STATE2_6; if ((this->unk_84F != 0) && (ABS(sp84) < ABS(sp80))) { phi_f0 = ABS(sp80) * 0.0325f; @@ -11031,13 +11054,13 @@ void func_8084BF1C(Player* this, GlobalContext* globalCtx) { if (this->actor.world.pos.y < temp_f0) { if (this->unk_84F != 0) { this->actor.world.pos.y = temp_f0; - this->stateFlags1 &= ~0x200000; + this->stateFlags1 &= ~PLAYER_STATE1_21; func_8083A5C4(globalCtx, this, this->actor.wallPoly, this->ageProperties->unk_3C, &gPlayerAnim_003000); this->currentYaw += 0x8000; this->actor.shape.rot.y = this->currentYaw; func_8083A9B8(this, &gPlayerAnim_003000, globalCtx); - this->stateFlags1 |= 0x4000; + this->stateFlags1 |= PLAYER_STATE1_14; } else { func_8083F070(this, this->ageProperties->unk_CC[this->unk_850], globalCtx); } @@ -11078,7 +11101,7 @@ void func_8084BF1C(Player* this, GlobalContext* globalCtx) { 0.0f, ANIMMODE_ONCE, 0.0f); } } else { - this->stateFlags2 |= 0x1000; + this->stateFlags2 |= PLAYER_STATE2_12; } } @@ -11118,18 +11141,18 @@ void func_8084C5F8(Player* this, GlobalContext* globalCtx) { s32 sp30; Vec3f sp24; - this->stateFlags2 |= 0x40; + this->stateFlags2 |= PLAYER_STATE2_6; temp = func_808374A0(globalCtx, this, &this->skelAnime, 4.0f); if (temp == 0) { - this->stateFlags1 &= ~0x200000; + this->stateFlags1 &= ~PLAYER_STATE1_21; return; } if ((temp > 0) || LinkAnimation_Update(globalCtx, &this->skelAnime)) { func_8083C0E8(this, globalCtx); - this->stateFlags1 &= ~0x200000; + this->stateFlags1 &= ~PLAYER_STATE1_21; return; } @@ -11157,10 +11180,10 @@ static struct_80832924 D_808548B4[] = { }; void func_8084C760(Player* this, GlobalContext* globalCtx) { - this->stateFlags2 |= 0x40; + this->stateFlags2 |= PLAYER_STATE2_6; if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { - if (!(this->stateFlags1 & 1)) { + if (!(this->stateFlags1 & PLAYER_STATE1_0)) { if (this->skelAnime.moveFlags != 0) { this->skelAnime.moveFlags = 0; return; @@ -11182,11 +11205,11 @@ static struct_80832924 D_808548D8[] = { }; void func_8084C81C(Player* this, GlobalContext* globalCtx) { - this->stateFlags2 |= 0x40; + this->stateFlags2 |= PLAYER_STATE2_6; if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { func_8083C0E8(this, globalCtx); - this->stateFlags2 &= ~0x40000; + this->stateFlags2 &= ~PLAYER_STATE2_18; return; } @@ -11247,7 +11270,7 @@ s32 func_8084C9BC(Player* this, GlobalContext* globalCtx) { if ((globalCtx->csCtx.state == CS_STATE_IDLE) && (globalCtx->transitionMode == 0) && (EN_HORSE_CHECK_1(rideActor) || EN_HORSE_CHECK_4(rideActor))) { - this->stateFlags2 |= 0x400000; + this->stateFlags2 |= PLAYER_STATE2_22; if (EN_HORSE_CHECK_1(rideActor) || (EN_HORSE_CHECK_4(rideActor) && CHECK_BTN_ALL(sControlInput->press.button, BTN_A))) { @@ -11330,7 +11353,7 @@ void func_8084CC98(Player* this, GlobalContext* globalCtx) { EnHorse* rideActor = (EnHorse*)this->rideActor; u8* arr; - this->stateFlags2 |= 0x40; + this->stateFlags2 |= PLAYER_STATE2_6; func_8084CBF4(this, 1.0f, 10.0f); @@ -11463,11 +11486,11 @@ void func_8084CC98(Player* this, GlobalContext* globalCtx) { } } - if (this->stateFlags1 & 0x100000) { + if (this->stateFlags1 & PLAYER_STATE1_20) { if (!func_8083AD4C(globalCtx, this) || CHECK_BTN_ANY(sControlInput->press.button, BTN_A) || func_80833BCC(this)) { this->unk_6AD = 0; - this->stateFlags1 &= ~0x100000; + this->stateFlags1 &= ~PLAYER_STATE1_20; } else { this->unk_6BE = func_8084ABD8(globalCtx, this, 1, -5000) - this->actor.shape.rot.y; this->unk_6BE += 5000; @@ -11505,14 +11528,14 @@ static struct_80832924 D_808549C4[] = { }; void func_8084D3E4(Player* this, GlobalContext* globalCtx) { - this->stateFlags2 |= 0x40; + this->stateFlags2 |= PLAYER_STATE2_6; func_8084CBF4(this, 1.0f, 10.0f); if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { EnHorse* rideActor = (EnHorse*)this->rideActor; func_8083C0E8(this, globalCtx); - this->stateFlags1 &= ~0x800000; + this->stateFlags1 &= ~PLAYER_STATE1_23; this->actor.parent = NULL; AREG(6) = 0; @@ -11599,7 +11622,7 @@ void func_8084D610(Player* this, GlobalContext* globalCtx) { void func_8084D7C4(Player* this, GlobalContext* globalCtx) { if (!func_8083B040(this, globalCtx)) { - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; func_8084B158(globalCtx, this, NULL, this->linearVelocity); func_8084B000(this); @@ -11615,7 +11638,7 @@ void func_8084D84C(Player* this, GlobalContext* globalCtx) { s16 sp32; s16 temp; - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; func_8084B158(globalCtx, this, sControlInput, this->linearVelocity); func_8084B000(this); @@ -11706,7 +11729,7 @@ void func_8084DBC4(GlobalContext* globalCtx, Player* this, f32 arg2) { void func_8084DC48(Player* this, GlobalContext* globalCtx) { f32 sp2C; - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; this->actor.gravity = 0.0f; func_80836670(this, globalCtx); @@ -11751,7 +11774,7 @@ void func_8084DC48(Player* this, GlobalContext* globalCtx) { } else if (!func_8083D12C(globalCtx, this, sControlInput)) { sp2C = (this->unk_850 * 0.018f) + 4.0f; - if (this->stateFlags1 & 0x800) { + if (this->stateFlags1 & PLAYER_STATE1_11) { sControlInput = NULL; } @@ -11769,7 +11792,7 @@ void func_8084DC48(Player* this, GlobalContext* globalCtx) { void func_8084DF6C(GlobalContext* globalCtx, Player* this) { this->unk_862 = 0; - this->stateFlags1 &= ~0xC00; + this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_11); this->getItemId = GI_NONE; func_8005B1A4(Gameplay_GetCamera(globalCtx, 0)); } @@ -11819,7 +11842,7 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) { globalCtx->sceneLoadFlag = 0x14; gSaveContext.nextCutsceneIndex = 0xFFF1; globalCtx->fadeTransition = 0xF; - this->stateFlags1 &= ~0x20000000; + this->stateFlags1 &= ~PLAYER_STATE1_29; func_80852FFC(globalCtx, NULL, 8); } this->getItemId = GI_NONE; @@ -11830,16 +11853,16 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) { } void func_8084E1EC(Player* this, GlobalContext* globalCtx) { - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { - if (!(this->stateFlags1 & 0x400) || func_8084DFF4(globalCtx, this)) { + if (!(this->stateFlags1 & PLAYER_STATE1_10) || func_8084DFF4(globalCtx, this)) { func_8084DF6C(globalCtx, this); func_80838F18(globalCtx, this); func_80832340(globalCtx, this); } } else { - if ((this->stateFlags1 & 0x400) && LinkAnimation_OnFrame(&this->skelAnime, 10.0f)) { + if ((this->stateFlags1 & PLAYER_STATE1_10) && LinkAnimation_OnFrame(&this->skelAnime, 10.0f)) { func_808332F4(this, globalCtx); func_80832340(globalCtx, this); func_80835EA4(globalCtx, 8); @@ -11878,8 +11901,8 @@ void func_8084E3C4(Player* this, GlobalContext* globalCtx) { if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { func_808322A4(globalCtx, this, &gPlayerAnim_0030A8); this->unk_850 = 1; - if (this->stateFlags2 & 0x2800000) { - this->stateFlags2 |= 0x1000000; + if (this->stateFlags2 & (PLAYER_STATE2_23 | PLAYER_STATE2_25)) { + this->stateFlags2 |= PLAYER_STATE2_24; } else { func_8010BD58(globalCtx, OCARINA_ACTION_FREE_PLAY); } @@ -11903,7 +11926,7 @@ void func_8084E3C4(Player* this, GlobalContext* globalCtx) { func_8083A098(this, &gPlayerAnim_003098, globalCtx); } - this->stateFlags2 &= ~0x3800000; + this->stateFlags2 &= ~(PLAYER_STATE2_23 | PLAYER_STATE2_24 | PLAYER_STATE2_25); this->unk_6A8 = NULL; } else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_02) { gSaveContext.respawn[RESPAWN_MODE_RETURN].entranceIndex = D_808549D4[globalCtx->msgCtx.lastPlayedSong]; @@ -11911,13 +11934,13 @@ void func_8084E3C4(Player* this, GlobalContext* globalCtx) { gSaveContext.respawn[RESPAWN_MODE_RETURN].data = globalCtx->msgCtx.lastPlayedSong; this->csMode = 0; - this->stateFlags1 &= ~0x20000000; + this->stateFlags1 &= ~PLAYER_STATE1_29; func_80852FFC(globalCtx, NULL, 8); globalCtx->mainCamera.unk_14C &= ~8; - this->stateFlags1 |= 0x30000000; - this->stateFlags2 |= 0x8000000; + this->stateFlags1 |= PLAYER_STATE1_28 | PLAYER_STATE1_29; + this->stateFlags2 |= PLAYER_STATE2_27; if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_KANKYO, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0xF) == NULL) { Environment_WarpSongLeave(globalCtx); @@ -11958,7 +11981,8 @@ void func_8084E6D4(Player* this, GlobalContext* globalCtx) { } if (func_8084DFF4(globalCtx, this) && (this->unk_850 == 1)) { - cond = ((this->targetActor != NULL) && (this->exchangeItemId < 0)) || (this->stateFlags3 & 0x20); + cond = ((this->targetActor != NULL) && (this->exchangeItemId < 0)) || + (this->stateFlags3 & PLAYER_STATE3_5); if (cond || (gSaveContext.healthAccumulator == 0)) { if (cond) { @@ -11977,7 +12001,7 @@ void func_8084E6D4(Player* this, GlobalContext* globalCtx) { func_80832DBC(this); if (this->getItemId == GI_ICE_TRAP) { - this->stateFlags1 &= ~0xC00; + this->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_11); if (this->getItemId != GI_ICE_TRAP) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, @@ -12164,7 +12188,7 @@ void func_8084ECA4(Player* this, GlobalContext* globalCtx) { if (i < 4) { this->unk_84F = i + 1; this->unk_850 = 0; - this->stateFlags1 |= 0x30000000; + this->stateFlags1 |= PLAYER_STATE1_28 | PLAYER_STATE1_29; this->interactRangeActor->parent = &this->actor; Player_UpdateBottleHeld(globalCtx, this, catchInfo->itemId, ABS(catchInfo->actionParam)); func_808322D0(globalCtx, this, sp24->unk_04); @@ -12177,7 +12201,7 @@ void func_8084ECA4(Player* this, GlobalContext* globalCtx) { } if (this->skelAnime.curFrame <= 7.0f) { - this->stateFlags1 |= 2; + this->stateFlags1 |= PLAYER_STATE1_1; } } @@ -12240,7 +12264,7 @@ static struct_80832924 D_80854A3C[] = { }; void func_8084F104(Player* this, GlobalContext* globalCtx) { - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { if (this->unk_850 < 0) { @@ -12297,7 +12321,7 @@ void func_8084F104(Player* this, GlobalContext* globalCtx) { } void func_8084F308(Player* this, GlobalContext* globalCtx) { - this->stateFlags2 |= 0x60; + this->stateFlags2 |= PLAYER_STATE2_5 | PLAYER_STATE2_6; if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { func_80832284(globalCtx, this, &gPlayerAnim_003128); @@ -12305,7 +12329,7 @@ void func_8084F308(Player* this, GlobalContext* globalCtx) { if (func_80832594(this, 0, 100)) { func_80839F90(this, globalCtx); - this->stateFlags2 &= ~0x80; + this->stateFlags2 &= ~PLAYER_STATE2_7; } } @@ -12318,7 +12342,7 @@ void func_8084F390(Player* this, GlobalContext* globalCtx) { s16 sp44; Vec3f sp38; - this->stateFlags2 |= 0x60; + this->stateFlags2 |= PLAYER_STATE2_5 | PLAYER_STATE2_6; LinkAnimation_Update(globalCtx, &this->skelAnime); func_8084269C(globalCtx, this); func_800F4138(&this->actor.projectedPos, NA_SE_PL_SLIP_LEVEL - SFX_FLAG, this->actor.speedXZ); @@ -12493,7 +12517,7 @@ void func_8084FB10(Player* this, GlobalContext* globalCtx) { EffectSsIcePiece_SpawnBurst(globalCtx, &this->actor.world.pos, this->actor.scale.x); func_8002F7DC(&this->actor, NA_SE_PL_ICE_BROKEN); } else { - this->stateFlags2 |= 0x4000; + this->stateFlags2 |= PLAYER_STATE2_14; } if ((globalCtx->gameplayFrames % 4) == 0) { @@ -12653,7 +12677,7 @@ s32 func_80850224(Player* this, GlobalContext* globalCtx) { func_80837948(globalCtx, this, sp24); if (sp24 >= 0x18) { - this->stateFlags2 |= 0x20000; + this->stateFlags2 |= PLAYER_STATE2_17; func_80837530(globalCtx, this, 0); return 1; } @@ -12670,15 +12694,15 @@ static Vec3f D_80854A40 = { 0.0f, 40.0f, 45.0f }; void func_808502D0(Player* this, GlobalContext* globalCtx) { struct_80854190* sp44 = &D_80854190[this->swordAnimation]; - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; if (!func_80842DF4(globalCtx, this)) { func_8084285C(this, 0.0f, sp44->unk_0C, sp44->unk_0D); - if ((this->stateFlags2 & 0x40000000) && (this->heldItemActionParam != PLAYER_AP_HAMMER) && + if ((this->stateFlags2 & PLAYER_STATE2_30) && (this->heldItemActionParam != PLAYER_AP_HAMMER) && LinkAnimation_OnFrame(&this->skelAnime, 0.0f)) { this->linearVelocity = 15.0f; - this->stateFlags2 &= ~0x40000000; + this->stateFlags2 &= ~PLAYER_STATE2_30; } if (this->linearVelocity > 12.0f) { @@ -12709,7 +12733,7 @@ void func_808502D0(Player* this, GlobalContext* globalCtx) { func_8083A098(this, sp3C, globalCtx); this->skelAnime.moveFlags = sp43; - this->stateFlags3 |= 8; + this->stateFlags3 |= PLAYER_STATE3_3; } } else if (this->heldItemActionParam == PLAYER_AP_HAMMER) { if ((this->swordAnimation == 0x16) || (this->swordAnimation == 0x13)) { @@ -12744,7 +12768,7 @@ void func_808505DC(Player* this, GlobalContext* globalCtx) { } void func_8085063C(Player* this, GlobalContext* globalCtx) { - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; LinkAnimation_Update(globalCtx, &this->skelAnime); func_80836670(this, globalCtx); @@ -12847,7 +12871,7 @@ void func_808507F4(Player* this, GlobalContext* globalCtx) { LinkAnimation_PlayOnceSetSpeed(globalCtx, &this->skelAnime, D_80854A58[this->unk_84F], 0.83f); if (func_80846A00(globalCtx, this, this->unk_84F) != NULL) { - this->stateFlags1 |= 0x30000000; + this->stateFlags1 |= PLAYER_STATE1_28 | PLAYER_STATE1_29; if ((this->unk_84F != 0) || (gSaveContext.respawn[RESPAWN_MODE_TOP].data <= 0)) { gSaveContext.unk_13F0 = 1; } @@ -12889,7 +12913,7 @@ void func_808507F4(Player* this, GlobalContext* globalCtx) { } else if (this->unk_850 == 1) { func_80832924(this, D_80854A8C[this->unk_84F]); if ((this->unk_84F == 2) && LinkAnimation_OnFrame(&this->skelAnime, 30.0f)) { - this->stateFlags1 &= ~0x30000000; + this->stateFlags1 &= ~(PLAYER_STATE1_28 | PLAYER_STATE1_29); } } else if (D_80854A7C[this->unk_84F] < this->unk_850++) { LinkAnimation_PlayOnceSetSpeed(globalCtx, &this->skelAnime, D_80854A70[this->unk_84F], 0.83f); @@ -12905,7 +12929,7 @@ void func_808507F4(Player* this, GlobalContext* globalCtx) { void func_80850AEC(Player* this, GlobalContext* globalCtx) { f32 temp; - this->stateFlags2 |= 0x20; + this->stateFlags2 |= PLAYER_STATE2_5; if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { func_80832284(globalCtx, this, &gPlayerAnim_002C98); @@ -12927,9 +12951,9 @@ void func_80850AEC(Player* this, GlobalContext* globalCtx) { this->linearVelocity = 1.0f; this->actor.velocity.y = 0.0f; func_80837B9C(this, globalCtx); - this->stateFlags2 &= ~0x400; + this->stateFlags2 &= ~PLAYER_STATE2_10; this->actor.bgCheckFlags |= 1; - this->stateFlags1 |= 4; + this->stateFlags1 |= PLAYER_STATE1_2; return; } @@ -13327,9 +13351,9 @@ void func_80851314(Player* this) { } void func_80851368(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { - this->stateFlags1 |= 0x8000000; - this->stateFlags2 |= 0x400; - this->stateFlags1 &= ~0xC0000; + this->stateFlags1 |= PLAYER_STATE1_27; + this->stateFlags2 |= PLAYER_STATE2_10; + this->stateFlags1 &= ~(PLAYER_STATE1_18 | PLAYER_STATE1_19); func_80832284(globalCtx, this, &gPlayerAnim_0032F0); } @@ -13370,7 +13394,7 @@ void func_808514C0(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg LinkAnimation_Update(globalCtx, &this->skelAnime); - if (func_8008F128(this) || (this->stateFlags1 & 0x800)) { + if (func_8008F128(this) || (this->stateFlags1 & PLAYER_STATE1_11)) { func_80836670(this, globalCtx); return; } @@ -13419,7 +13443,7 @@ void func_80851688(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg LinkAnimation_Update(globalCtx, &this->skelAnime); - if (func_8008F128(this) || (this->stateFlags1 & 0x800)) { + if (func_8008F128(this) || (this->stateFlags1 & PLAYER_STATE1_11)) { func_80836670(this, globalCtx); } } @@ -13436,7 +13460,7 @@ void func_80851750(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg } void func_80851788(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { - this->stateFlags1 &= ~0x2000000; + this->stateFlags1 &= ~PLAYER_STATE1_25; this->currentYaw = this->actor.shape.rot.y = this->actor.world.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_450); @@ -13818,7 +13842,7 @@ void func_80852554(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg } void func_80852564(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { - this->stateFlags3 |= 2; + this->stateFlags3 |= PLAYER_STATE3_1; this->linearVelocity = 2.0f; this->actor.velocity.y = -1.0f; @@ -14045,11 +14069,11 @@ s32 Player_StartFishing(GlobalContext* globalCtx) { s32 func_80852F38(GlobalContext* globalCtx, Player* this) { if (!Player_InBlockingCsMode(globalCtx, this) && (this->invincibilityTimer >= 0) && !func_8008F128(this) && - !(this->stateFlags3 & 0x80)) { + !(this->stateFlags3 & PLAYER_STATE3_7)) { func_80832564(globalCtx, this); func_80835C58(globalCtx, this, func_8084F308, 0); func_80832264(globalCtx, this, &gPlayerAnim_003120); - this->stateFlags2 |= 0x80; + this->stateFlags2 |= PLAYER_STATE2_7; func_80832224(this); func_80832698(this, NA_SE_VO_LI_HELD); return true; @@ -14084,7 +14108,7 @@ s32 Player_InflictDamage(GlobalContext* globalCtx, s32 damage) { Player* this = GET_PLAYER(globalCtx); if (!Player_InBlockingCsMode(globalCtx, this) && !func_80837B18(globalCtx, this, damage)) { - this->stateFlags2 &= ~0x80; + this->stateFlags2 &= ~PLAYER_STATE2_7; return 1; } @@ -14116,7 +14140,7 @@ void func_80853148(GlobalContext* globalCtx, Actor* actor) { this->actor.textId = actor->textId; } - if (this->stateFlags1 & 0x800000) { + if (this->stateFlags1 & PLAYER_STATE1_23) { s32 sp24 = this->unk_850; func_80832528(globalCtx, this); @@ -14150,7 +14174,7 @@ void func_80853148(GlobalContext* globalCtx, Actor* actor) { func_80832224(this); } - this->stateFlags1 |= 0x20000040; + this->stateFlags1 |= PLAYER_STATE1_6 | PLAYER_STATE1_29; } if ((this->naviActor == this->targetActor) && ((this->targetActor->textId & 0xFF00) != 0x200)) {