summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2022-10-15 19:12:01 -0300
committerGitHub <noreply@github.com>2022-10-15 19:12:01 -0300
commitbd373940ac7bb230b4a135a5c5675ca8f42cd700 (patch)
treeefa23eb003ff945fd8ab1d78b8c357dceda3c39c /src
parent638f5062cbf6e9289f624cbdeee918d35642fb3a (diff)
`z_player_lib`: Part 2 (#938)
* preparations * import data * PLAYER_STATE1 * PLAYER_STATE2 * PLAYER_STATE3 * import bss * format stuff * bss cleanup * more cleaning and some naming * face * cleaning up link human object a bit * Remove PHYSICAL_TO_VIRTUAL2 * Update src/code/z_player_lib.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * review Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * format * /* CAT */ Co-authored-by: Isghj <42048411+isghj5@users.noreply.github.com> * naming some stuff on objects * format * invert flags endian * review Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * format * drawmask Co-authored-by: Isghj <42048411+isghj5@users.noreply.github.com> * naming * another round of human object naming * enum renames * sActionModelGroups and use enum as types * PlayerAnimType * PLAYER_MODELTYPE_ * determined ranges of PlayerModelType * name PLAYER_MODELGROUP_DEFAULT * format * sheath * dlist groups placeholder namse * PLAYER_MODELGROUP_BOTTLE * Some fierce deity naming * Right hands * zora skel dlists * deku limb dlists * left hands * name most modelgroups * more hand naming * regs as dec * fix in horse * Use BUTTON_ITEM_EQUIP macro * review Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * reformat D_801AED58 * Sword sheaths * swords and shields * Update src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * playerForm on Player_DrawImpl * fomat * Update src/code/z_player_lib.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * Update assets/xml/objects/gameplay_keep.xml Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * review Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * VIRTUAL_TO_PHYSICAL(SEGMENTED_TO_VIRTUAL(gEffBubble1Tex)) Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * singular limb enum names * fix bss * Update src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * review Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * name goron shielding limbs * name limb * Update src/code/z_player_lib.c Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * bss * bss * format * namefixer * bss * bss * bss * bss * format * bss * review Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * fix bss Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> Co-authored-by: Isghj <42048411+isghj5@users.noreply.github.com> Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/boot_O2_g3/idle.c1
-rw-r--r--src/code/z_actor.c81
-rw-r--r--src/code/z_collision_check.c1
-rw-r--r--src/code/z_demo.c5
-rw-r--r--src/code/z_en_item00.c2
-rw-r--r--src/code/z_kaleido_setup.c2
-rw-r--r--src/code/z_player_lib.c1358
-rw-r--r--src/code/z_shrink_window.c2
-rw-r--r--src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c66
-rw-r--r--src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h2
-rw-r--r--src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c18
-rw-r--r--src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c4
-rw-r--r--src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c5
-rw-r--r--src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c4
-rw-r--r--src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c6
-rw-r--r--src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c4
-rw-r--r--src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c3
-rw-r--r--src/overlays/actors/ovl_Boss_02/z_boss_02.c4
-rw-r--r--src/overlays/actors/ovl_Boss_04/z_boss_04.c2
-rw-r--r--src/overlays/actors/ovl_Boss_06/z_boss_06.c13
-rw-r--r--src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c2
-rw-r--r--src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c4
-rw-r--r--src/overlays/actors/ovl_Door_Ana/z_door_ana.c7
-rw-r--r--src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c5
-rw-r--r--src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c5
-rw-r--r--src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c2
-rw-r--r--src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c1
-rw-r--r--src/overlays/actors/ovl_En_Ah/z_en_ah.c2
-rw-r--r--src/overlays/actors/ovl_En_Al/z_en_al.c2
-rw-r--r--src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c4
-rw-r--r--src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c4
-rw-r--r--src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c4
-rw-r--r--src/overlays/actors/ovl_En_Bom/z_en_bom.c2
-rw-r--r--src/overlays/actors/ovl_En_Bombf/z_en_bombf.c10
-rw-r--r--src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c6
-rw-r--r--src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c16
-rw-r--r--src/overlays/actors/ovl_En_Boom/z_en_boom.c6
-rw-r--r--src/overlays/actors/ovl_En_Dai/z_en_dai.c4
-rw-r--r--src/overlays/actors/ovl_En_Dg/z_en_dg.c8
-rw-r--r--src/overlays/actors/ovl_En_Dnq/z_en_dnq.c2
-rw-r--r--src/overlays/actors/ovl_En_Dns/z_en_dns.c2
-rw-r--r--src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c4
-rw-r--r--src/overlays/actors/ovl_En_Door/z_en_door.c2
-rw-r--r--src/overlays/actors/ovl_En_Dragon/z_en_dragon.c4
-rw-r--r--src/overlays/actors/ovl_En_Elf/z_en_elf.c28
-rw-r--r--src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c10
-rw-r--r--src/overlays/actors/ovl_En_Elforg/z_en_elforg.c6
-rw-r--r--src/overlays/actors/ovl_En_Fishing/z_en_fishing.c2
-rw-r--r--src/overlays/actors/ovl_En_Floormas/z_en_floormas.c2
-rw-r--r--src/overlays/actors/ovl_En_Fu/z_en_fu.c24
-rw-r--r--src/overlays/actors/ovl_En_Gg/z_en_gg.c4
-rw-r--r--src/overlays/actors/ovl_En_Gk/z_en_gk.c4
-rw-r--r--src/overlays/actors/ovl_En_Gm/z_en_gm.c4
-rw-r--r--src/overlays/actors/ovl_En_Go/z_en_go.c6
-rw-r--r--src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c11
-rw-r--r--src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c3
-rw-r--r--src/overlays/actors/ovl_En_Hg/z_en_hg.c4
-rw-r--r--src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c2
-rw-r--r--src/overlays/actors/ovl_En_Holl/z_en_holl.c2
-rw-r--r--src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c2
-rw-r--r--src/overlays/actors/ovl_En_Ig/z_en_ig.c2
-rw-r--r--src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c12
-rw-r--r--src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c4
-rw-r--r--src/overlays/actors/ovl_En_Kame/z_en_kame.c6
-rw-r--r--src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c46
-rw-r--r--src/overlays/actors/ovl_En_Kgy/z_en_kgy.c4
-rw-r--r--src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c26
-rw-r--r--src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c2
-rw-r--r--src/overlays/actors/ovl_En_Ma4/z_en_ma4.c16
-rw-r--r--src/overlays/actors/ovl_En_Mm3/z_en_mm3.c6
-rw-r--r--src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c4
-rw-r--r--src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c3
-rw-r--r--src/overlays/actors/ovl_En_Nwc/z_en_nwc.c5
-rw-r--r--src/overlays/actors/ovl_En_Ossan/z_en_ossan.c12
-rw-r--r--src/overlays/actors/ovl_En_Ot/z_en_ot.c4
-rw-r--r--src/overlays/actors/ovl_En_Owl/z_en_owl.c4
-rw-r--r--src/overlays/actors/ovl_En_Pm/z_en_pm.c2
-rw-r--r--src/overlays/actors/ovl_En_Pr/z_en_pr.c10
-rw-r--r--src/overlays/actors/ovl_En_Pr2/z_en_pr2.c6
-rw-r--r--src/overlays/actors/ovl_En_Prz/z_en_prz.c6
-rw-r--r--src/overlays/actors/ovl_En_Raf/z_en_raf.c8
-rw-r--r--src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c15
-rw-r--r--src/overlays/actors/ovl_En_Rd/z_en_rd.c11
-rw-r--r--src/overlays/actors/ovl_En_Rg/z_en_rg.c7
-rw-r--r--src/overlays/actors/ovl_En_Rr/z_en_rr.c7
-rw-r--r--src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c10
-rw-r--r--src/overlays/actors/ovl_En_Sb/z_en_sb.c2
-rw-r--r--src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c4
-rw-r--r--src/overlays/actors/ovl_En_Shn/z_en_shn.c2
-rw-r--r--src/overlays/actors/ovl_En_Snowman/z_en_snowman.c6
-rw-r--r--src/overlays/actors/ovl_En_Sob1/z_en_sob1.c12
-rw-r--r--src/overlays/actors/ovl_En_Stream/z_en_stream.c2
-rw-r--r--src/overlays/actors/ovl_En_Suttari/z_en_suttari.c14
-rw-r--r--src/overlays/actors/ovl_En_Sw/z_en_sw.c2
-rw-r--r--src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c46
-rw-r--r--src/overlays/actors/ovl_En_Tab/z_en_tab.c2
-rw-r--r--src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c21
-rw-r--r--src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c2
-rw-r--r--src/overlays/actors/ovl_En_Test4/z_en_test4.c12
-rw-r--r--src/overlays/actors/ovl_En_Test7/z_en_test7.c10
-rw-r--r--src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c11
-rw-r--r--src/overlays/actors/ovl_En_Toto/z_en_toto.c2
-rw-r--r--src/overlays/actors/ovl_En_Trt/z_en_trt.c18
-rw-r--r--src/overlays/actors/ovl_En_Trt2/z_en_trt2.c4
-rw-r--r--src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c6
-rw-r--r--src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c9
-rw-r--r--src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c2
-rw-r--r--src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c2
-rw-r--r--src/overlays/actors/ovl_En_Yb/z_en_yb.c4
-rw-r--r--src/overlays/actors/ovl_En_Zob/z_en_zob.c2
-rw-r--r--src/overlays/actors/ovl_En_Zog/z_en_zog.c4
-rw-r--r--src/overlays/actors/ovl_En_Zot/z_en_zot.c2
-rw-r--r--src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c6
-rw-r--r--src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c7
-rw-r--r--src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c4
-rw-r--r--src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c2
-rw-r--r--src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c2
-rw-r--r--src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c2
-rw-r--r--src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c12
-rw-r--r--src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c6
-rw-r--r--src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c2
-rw-r--r--src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c2
122 files changed, 1743 insertions, 548 deletions
diff --git a/src/boot_O2_g3/idle.c b/src/boot_O2_g3/idle.c
index da93f13fd..942435fa7 100644
--- a/src/boot_O2_g3/idle.c
+++ b/src/boot_O2_g3/idle.c
@@ -1,4 +1,3 @@
-#include "prevent_bss_reordering.h"
#include "global.h"
u8 D_80096B20 = 1;
diff --git a/src/code/z_actor.c b/src/code/z_actor.c
index 52b113c76..1a2404c1a 100644
--- a/src/code/z_actor.c
+++ b/src/code/z_actor.c
@@ -172,7 +172,7 @@ void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, PlayState* play) {
u8 shadowAlpha = actor->shape.shadowAlpha;
f32 alphaRatio;
- if ((actor->id == ACTOR_PLAYER) && (((Player*)actor)->stateFlags3 & 0x8000)) {
+ if ((actor->id == ACTOR_PLAYER) && (((Player*)actor)->stateFlags3 & PLAYER_STATE3_8000)) {
f32 prevScaleZ = actor->scale.z;
actor->scale.z += 0.03f * fabsf(Math_CosS(((Player*)actor)->unk_AAA));
@@ -469,7 +469,8 @@ void Actor_TargetContextInit(TargetContext* targetCtx, Actor* actor, PlayState*
void Actor_DrawZTarget(TargetContext* targetCtx, PlayState* play) {
Player* player = GET_PLAYER(play);
- if (!(player->stateFlags1 & 0x300006C2)) {
+ if (!(player->stateFlags1 & (PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 |
+ PLAYER_STATE1_400 | PLAYER_STATE1_10000000 | PLAYER_STATE1_20000000))) {
Actor* actor = targetCtx->targetedActor;
OPEN_DISPS(play->state.gfxCtx);
@@ -519,7 +520,7 @@ void Actor_DrawZTarget(TargetContext* targetCtx, PlayState* play) {
Target_SetPos(targetCtx, targetCtx->unk4C, projectedPos.x, projectedPos.y, projectedPos.z);
- if ((!(player->stateFlags1 & 0x40)) || (actor != player->unk_730)) {
+ if ((!(player->stateFlags1 & PLAYER_STATE1_40)) || (actor != player->unk_730)) {
OVERLAY_DISP = Gfx_CallSetupDL(OVERLAY_DISP, 0x39);
for (spB0 = 0, spAC = targetCtx->unk4C; spB0 < spB8; spB0++, spAC = (spAC + 1) % 3) {
@@ -1291,7 +1292,7 @@ void func_800B6F20(PlayState* play, Input* input, f32 magnitude, s16 baseYaw) {
f32 Player_GetHeight(Player* player) {
f32 extraHeight;
- if (player->stateFlags1 & 0x800000) {
+ if (player->stateFlags1 & PLAYER_STATE1_800000) {
extraHeight = 32.0f;
} else {
extraHeight = 0.0f;
@@ -1302,8 +1303,7 @@ f32 Player_GetHeight(Player* player) {
case PLAYER_FORM_FIERCE_DEITY:
return extraHeight + 124.0f;
case PLAYER_FORM_GORON:
- // (player->stateFlags3 & 0x1000): being curled?
- return extraHeight + ((player->stateFlags3 & 0x1000) ? 34.0f : 80.0f);
+ return extraHeight + ((player->stateFlags3 & PLAYER_STATE3_1000) ? 34.0f : 80.0f);
case PLAYER_FORM_ZORA:
return extraHeight + 68.0f;
case PLAYER_FORM_DEKU:
@@ -1314,9 +1314,9 @@ f32 Player_GetHeight(Player* player) {
}
f32 Player_GetRunSpeedLimit(Player* player) {
- if (player->stateFlags1 & 0x800000) {
+ if (player->stateFlags1 & PLAYER_STATE1_800000) {
return 15.0f;
- } else if (player->stateFlags1 & 0x8000000) {
+ } else if (player->stateFlags1 & PLAYER_STATE1_8000000) {
return (R_RUN_SPEED_LIMIT / 100.0f) * 0.6f;
} else {
return R_RUN_SPEED_LIMIT / 100.0f;
@@ -1324,7 +1324,7 @@ f32 Player_GetRunSpeedLimit(Player* player) {
}
s32 func_800B7118(Player* player) {
- return player->stateFlags1 & 0x8;
+ return player->stateFlags1 & PLAYER_STATE1_8;
}
s32 func_800B7128(Player* player) {
@@ -1334,7 +1334,7 @@ s32 func_800B7128(Player* player) {
s32 func_800B715C(PlayState* play) {
Player* player = GET_PLAYER(play);
- return player->stateFlags2 & 0x8;
+ return player->stateFlags2 & PLAYER_STATE2_8;
}
void Actor_SetCameraHorseSetting(PlayState* play, Player* player) {
@@ -1349,12 +1349,12 @@ void Actor_SetCameraHorseSetting(PlayState* play, Player* player) {
void Actor_MountHorse(PlayState* play, Player* player, Actor* horse) {
player->rideActor = horse;
- player->stateFlags1 |= 0x800000;
+ player->stateFlags1 |= PLAYER_STATE1_800000;
horse->child = &player->actor;
}
s32 func_800B7200(Player* player) {
- return (player->stateFlags1 & 0x20000080) || (player->csMode != 0);
+ return (player->stateFlags1 & (PLAYER_STATE1_20000000 | PLAYER_STATE1_80)) || (player->csMode != 0);
}
void func_800B722C(GameState* gameState, Player* player) {
@@ -1999,13 +1999,16 @@ s32 Actor_HasParent(Actor* actor, PlayState* play) {
s32 Actor_PickUp(Actor* actor, PlayState* play, s32 getItemId, f32 xzRange, f32 yRange) {
Player* player = GET_PLAYER(play);
- if (!(player->stateFlags1 & 0x3C7080) && Player_GetExplosiveHeld(player) < 0) {
+ if (!(player->stateFlags1 &
+ (PLAYER_STATE1_80 | PLAYER_STATE1_1000 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 |
+ PLAYER_STATE1_80000 | PLAYER_STATE1_100000 | PLAYER_STATE1_200000)) &&
+ Player_GetExplosiveHeld(player) < 0) {
if ((actor->xzDistToPlayer <= xzRange) && (fabsf(actor->playerHeightRel) <= fabsf(yRange))) {
if ((getItemId == GI_MASK_CIRCUS_LEADER || getItemId == GI_PENDANT_OF_MEMORIES ||
getItemId == GI_DEED_LAND ||
((player->heldActor != NULL || actor == player->targetActor) &&
(getItemId > GI_NONE && getItemId < GI_MAX))) ||
- !(player->stateFlags1 & 0x20000800)) {
+ !(player->stateFlags1 & (PLAYER_STATE1_800 | PLAYER_STATE1_20000000))) {
s16 yawDiff = actor->yawTowardsPlayer - player->actor.shape.rot.y;
s32 absYawDiff = ABS_ALT(yawDiff);
@@ -2081,7 +2084,9 @@ s32 Actor_HasRider(PlayState* play, Actor* horse) {
s32 Actor_SetRideActor(PlayState* play, Actor* horse, s32 mountSide) {
Player* player = GET_PLAYER(play);
- if (!(player->stateFlags1 & 0x003C7880)) {
+ if (!(player->stateFlags1 &
+ (PLAYER_STATE1_80 | PLAYER_STATE1_800 | PLAYER_STATE1_1000 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 |
+ PLAYER_STATE1_40000 | PLAYER_STATE1_80000 | PLAYER_STATE1_100000 | PLAYER_STATE1_200000))) {
player->rideActor = horse;
player->mountSide = mountSide;
ActorCutscene_SetIntentToPlay(0x7C);
@@ -2353,7 +2358,7 @@ Actor* Actor_UpdateActor(UpdateActor_Params* params) {
if (((params->unk_08) && !(actor->flags & params->unk_08)) ||
((tmp = (params->unk_08 == 0)) &&
(!(actor->flags & ACTOR_FLAG_100000) ||
- ((actor->category == ACTORCAT_EXPLOSIVES) && (params->player->stateFlags1 & 0x200))) &&
+ ((actor->category == ACTORCAT_EXPLOSIVES) && (params->player->stateFlags1 & PLAYER_STATE1_200))) &&
(params->unkC != 0) && (actor != params->unk10) && ((actor != params->player->heldActor)) &&
(actor->parent != &params->player->actor))) {
CollisionCheck_ResetDamage(&actor->colChkInfo);
@@ -2395,9 +2400,35 @@ Actor* Actor_UpdateActor(UpdateActor_Params* params) {
return nextActor;
}
-u32 D_801AED58[] = {
- 0x100002C2, 0x100002C2, 0x00000200, 0x100006C2, 0x00000282, 0x300002C2,
- 0x10000282, 0x00000002, 0x300002C2, 0x100006C2, 0x00000002, 0x100002C2,
+u32 D_801AED58[ACTORCAT_MAX] = {
+ /* ACTORCAT_SWITCH */
+ PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000,
+ /* ACTORCAT_BG */
+ PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000,
+ /* ACTORCAT_PLAYER */
+ PLAYER_STATE1_200,
+ /* ACTORCAT_EXPLOSIVES */
+ PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_400 |
+ PLAYER_STATE1_10000000,
+ /* ACTORCAT_NPC */
+ PLAYER_STATE1_2 | PLAYER_STATE1_80 | PLAYER_STATE1_200,
+ /* ACTORCAT_ENEMY */
+ PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000 |
+ PLAYER_STATE1_20000000,
+ /* ACTORCAT_PROP */
+ PLAYER_STATE1_2 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000,
+ /* ACTORCAT_ITEMACTION */
+ PLAYER_STATE1_2,
+ /* ACTORCAT_MISC */
+ PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000 |
+ PLAYER_STATE1_20000000,
+ /* ACTORCAT_BOSS */
+ PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_400 |
+ PLAYER_STATE1_10000000,
+ /* ACTORCAT_DOOR */
+ PLAYER_STATE1_2,
+ /* ACTORCAT_CHEST */
+ PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000,
};
void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
@@ -2427,13 +2458,13 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
tmp = D_801AED58;
- if (player->stateFlags2 & 0x8000000) {
+ if (player->stateFlags2 & PLAYER_STATE2_8000000) {
params.unk_08 = 0x2000000;
} else {
params.unk_08 = 0;
}
- if ((player->stateFlags1 & 0x40) && ((player->actor.textId & 0xFF00) != 0x1900)) {
+ if ((player->stateFlags1 & PLAYER_STATE1_40) && ((player->actor.textId & 0xFF00) != 0x1900)) {
params.unk10 = player->targetActor;
} else {
params.unk10 = NULL;
@@ -2486,7 +2517,7 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
}
}
- if (!(player->stateFlags1 & 2)) {
+ if (!(player->stateFlags1 & PLAYER_STATE1_2)) {
func_800B5814(&actorCtx->targetContext, player, actor, &play->state);
}
@@ -2835,7 +2866,7 @@ void Actor_DrawAll(PlayState* play, ActorContext* actorCtx) {
if (play->actorCtx.lensActive) {
Math_StepToC(&play->actorCtx.lensMaskSize, LENS_MASK_ACTIVE_SIZE, 20);
- if (GET_PLAYER(play)->stateFlags2 & 0x8000000) {
+ if (GET_PLAYER(play)->stateFlags2 & PLAYER_STATE2_8000000) {
Actor_DeactivateLens(play);
}
} else {
@@ -3658,7 +3689,7 @@ s16 Actor_TestFloorInDirection(Actor* actor, PlayState* play, f32 distance, s16
s32 Actor_IsTargeted(PlayState* play, Actor* actor) {
Player* player = GET_PLAYER(play);
- if ((player->stateFlags3 & 0x80000000) && actor->isTargeted) {
+ if ((player->stateFlags3 & PLAYER_STATE3_80000000) && actor->isTargeted) {
return true;
}
@@ -3671,7 +3702,7 @@ s32 Actor_IsTargeted(PlayState* play, Actor* actor) {
s32 Actor_OtherIsTargeted(PlayState* play, Actor* actor) {
Player* player = GET_PLAYER(play);
- if ((player->stateFlags3 & 0x80000000) && !actor->isTargeted) {
+ if ((player->stateFlags3 & PLAYER_STATE3_80000000) && !actor->isTargeted) {
return true;
}
diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c
index edaa159c6..0e36f1c54 100644
--- a/src/code/z_collision_check.c
+++ b/src/code/z_collision_check.c
@@ -1,3 +1,4 @@
+#include "prevent_bss_reordering.h"
#include "global.h"
Vec3f D_801EDE00;
diff --git a/src/code/z_demo.c b/src/code/z_demo.c
index 25b2b471a..646b91522 100644
--- a/src/code/z_demo.c
+++ b/src/code/z_demo.c
@@ -1,3 +1,4 @@
+#include "prevent_bss_reordering.h"
#include "global.h"
#include "z64quake.h"
#include "z64rumble.h"
@@ -270,10 +271,10 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c
gSaveContext.save.playerForm = PLAYER_FORM_DEKU;
break;
case 0x17:
- player->stateFlags2 |= 0x4000000;
+ player->stateFlags2 |= PLAYER_STATE2_4000000;
break;
case 0x18:
- player->stateFlags2 &= ~0x4000000;
+ player->stateFlags2 &= ~PLAYER_STATE2_4000000;
break;
case 0x19:
sCutsceneStoredPlayerForm = gSaveContext.save.playerForm;
diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c
index a07e31e2f..969368e26 100644
--- a/src/code/z_en_item00.c
+++ b/src/code/z_en_item00.c
@@ -487,7 +487,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) {
EnItem00* this = THIS;
s32 pad;
Player* player = GET_PLAYER(play);
- s32 sp38 = player->stateFlags3 & 0x1000;
+ s32 sp38 = player->stateFlags3 & PLAYER_STATE3_1000;
s32 getItemId = GI_NONE;
s32 params;
diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c
index a096aaabe..ce23b6506 100644
--- a/src/code/z_kaleido_setup.c
+++ b/src/code/z_kaleido_setup.c
@@ -79,7 +79,7 @@ void KaleidoSetup_Update(PlayState* play) {
if (!Play_InCsMode(play) || ((msgCtx->msgMode != 0) && (msgCtx->currentTextId == 0xFF))) {
if ((play->unk_1887C < 2) && (gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY) &&
(gSaveContext.magicState != MAGIC_STATE_FILL)) {
- if (!(gSaveContext.eventInf[1] & 0x80) && !(player->stateFlags1 & 0x20)) {
+ if (!(gSaveContext.eventInf[1] & 0x80) && !(player->stateFlags1 & PLAYER_STATE1_20)) {
if (!(play->actorCtx.flags & ACTORCTX_FLAG_1) &&
!(play->actorCtx.flags & ACTORCTX_FLAG_2)) {
if ((play->actorCtx.unk268 == 0) && CHECK_BTN_ALL(input->press.button, BTN_START)) {
diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c
index 6f4198fc7..a6f45dccb 100644
--- a/src/code/z_player_lib.c
+++ b/src/code/z_player_lib.c
@@ -1,9 +1,38 @@
+#include "prevent_bss_reordering.h"
#include "global.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+
+#include "objects/object_link_boy/object_link_boy.h"
#include "objects/object_link_goron/object_link_goron.h"
#include "objects/object_link_zora/object_link_zora.h"
-
+#include "objects/object_link_nuts/object_link_nuts.h"
+#include "objects/object_link_child/object_link_child.h"
+
+#include "objects/object_mask_truth/object_mask_truth.h"
+#include "objects/object_mask_kerfay/object_mask_kerfay.h"
+#include "objects/object_mask_yofukasi/object_mask_yofukasi.h"
+#include "objects/object_mask_rabit/object_mask_rabit.h"
+#include "objects/object_mask_ki_tan/object_mask_ki_tan.h"
+#include "objects/object_mask_json/object_mask_json.h"
+#include "objects/object_mask_romerny/object_mask_romerny.h"
+#include "objects/object_mask_zacho/object_mask_zacho.h"
+#include "objects/object_mask_posthat/object_mask_posthat.h"
#include "objects/object_mask_meoto/object_mask_meoto.h"
+#include "objects/object_mask_bigelf/object_mask_bigelf.h"
+#include "objects/object_mask_gibudo/object_mask_gibudo.h"
+#include "objects/object_mask_gero/object_mask_gero.h"
+#include "objects/object_mask_dancer/object_mask_dancer.h"
+#include "objects/object_mask_skj/object_mask_skj.h"
+#include "objects/object_mask_stone/object_mask_stone.h"
+#include "objects/object_mask_bree/object_mask_bree.h"
+#include "objects/object_mask_bakuretu/object_mask_bakuretu.h"
+#include "objects/object_mask_bu_san/object_mask_bu_san.h"
+#include "objects/object_mask_kyojin/object_mask_kyojin.h"
+#include "objects/object_mask_boy/object_mask_boy.h"
+#include "objects/object_mask_goron/object_mask_goron.h"
+#include "objects/object_mask_zora/object_mask_zora.h"
+#include "objects/object_mask_nuts/object_mask_nuts.h"
void PlayerCall_Init(Actor* thisx, PlayState* play);
void PlayerCall_Destroy(Actor* thisx, PlayState* play);
@@ -17,15 +46,34 @@ typedef struct {
/* 0x1A */ s16 unk_1A;
} struct_801F58B0; // size = 0x1C
-extern struct_801F58B0 D_801F58B0[3][3];
+struct_801F58B0 D_801F58B0[3][3];
+
+Vec3f D_801F59B0[2];
+
+s32 D_801F59C8[2];
+
+typedef struct {
+ /* 0x0 */ s16 unk_0;
+ /* 0x2 */ s16 unk_2;
+ /* 0x4 */ s16 unk_4;
+ /* 0x6 */ s16 unk_6;
+ /* 0x8 */ s16 unk_8;
+} struct_801F59D0; // size = 0xA
+
+struct_801F59D0 D_801F59D0;
+
+Vec3f* D_801F59DC;
-extern s32 D_801F59C8[2];
+s32 D_801F59E0;
-extern s32 D_801F59E0;
+s32 D_801F59E4;
-extern Vec3f D_801F59E8;
+Vec3f D_801F59E8;
-void func_80127B64(struct_801F58B0 arg0[], UNK_TYPE arg1, Vec3f* arg2);
+s32 D_801F59F4;
+s32 D_801F59F8;
+
+void func_80127B64(struct_801F58B0 arg0[], s32 count, Vec3f* arg2);
s32 func_801226E0(PlayState* play, s32 arg1) {
if (arg1 == 0) {
@@ -103,8 +151,6 @@ void func_801229A0(PlayState* play, Player* player) {
void func_801229EC(UNK_TYPE arg0, UNK_TYPE arg1) {
}
-extern s16 sMaskObjectIds[PLAYER_MASK_MAX - 1];
-#if 0
s16 sMaskObjectIds[PLAYER_MASK_MAX - 1] = {
OBJECT_MASK_TRUTH, OBJECT_MASK_KERFAY, OBJECT_MASK_YOFUKASI, OBJECT_MASK_RABIT, OBJECT_MASK_KI_TAN,
OBJECT_MASK_JSON, OBJECT_MASK_ROMERNY, OBJECT_MASK_ZACHO, OBJECT_MASK_POSTHAT, OBJECT_MASK_MEOTO,
@@ -112,7 +158,6 @@ s16 sMaskObjectIds[PLAYER_MASK_MAX - 1] = {
OBJECT_MASK_STONE, OBJECT_MASK_BREE, OBJECT_MASK_BAKURETU, OBJECT_MASK_BU_SAN, OBJECT_MASK_KYOJIN,
OBJECT_MASK_BOY, OBJECT_MASK_GORON, OBJECT_MASK_ZORA, OBJECT_MASK_NUTS,
};
-#endif
// Load mask object?
/**
@@ -197,14 +242,11 @@ typedef struct {
/* 0x4 */ Gfx* dList;
} struct_801BFDD0; // size = 0x08
-extern struct_801BFDD0 D_801BFDD0[];
-#if 0
struct_801BFDD0 D_801BFDD0[] = {
{ { 180, 200, 255 }, gLinkGoronCurledDL },
{ { 155, 0, 0 }, gLinkGoronRollingSpikesAndEffectDL },
{ { 255, 0, 0 }, gLinkGoronGoronPunchEffectDL },
};
-#endif
void func_80122D44(PlayState* play, struct_80122D44_arg1* arg1) {
struct_801BFDD0* temp_s3;
@@ -240,8 +282,6 @@ void func_80122D44(PlayState* play, struct_80122D44_arg1* arg1) {
CLOSE_DISPS(play->state.gfxCtx);
}
-extern u8 sMaskItemIds[PLAYER_MASK_MAX - 1];
-#if 0
u8 sMaskItemIds[PLAYER_MASK_MAX - 1] = {
ITEM_MASK_TRUTH, // PLAYER_MASK_TRUTH
ITEM_MASK_KAFEIS_MASK, // PLAYER_MASK_KAFEIS_MASK
@@ -268,7 +308,6 @@ u8 sMaskItemIds[PLAYER_MASK_MAX - 1] = {
ITEM_MASK_ZORA, // PLAYER_MASK_ZORA
ITEM_MASK_DEKU, // PLAYER_MASK_DEKU
};
-#endif
u8 Player_MaskIdToItemId(s32 maskIdMinusOne) {
return sMaskItemIds[maskIdMinusOne];
@@ -286,8 +325,8 @@ s32 Player_GetCurMaskItemId(PlayState* play) {
void func_80122F28(Player* player) {
if ((player->actor.category == ACTORCAT_PLAYER) &&
- (!(player->stateFlags1 & (PLAYER_STATE1_20000000 | PLAYER_STATE1_800000 | PLAYER_STATE1_200000 |
- PLAYER_STATE1_800 | PLAYER_STATE1_400))) &&
+ (!(player->stateFlags1 & (PLAYER_STATE1_400 | PLAYER_STATE1_800 | PLAYER_STATE1_200000 | PLAYER_STATE1_800000 |
+ PLAYER_STATE1_20000000))) &&
(!(player->stateFlags2 & PLAYER_STATE2_1))) {
if (player->doorType < 0) {
ActorCutscene_SetIntentToPlay(0x7C);
@@ -341,7 +380,20 @@ void func_8012301C(Player* player, PlayState* play2) {
}
}
-extern s16 D_801BFE14[][18];
+FlexSkeletonHeader* gPlayerSkeletons[PLAYER_FORM_MAX] = {
+ &gLinkFierceDeitySkel, &gLinkGoronSkel, &gLinkZoraSkel, &gLinkDekuSkel, &gLinkHumanSkel,
+};
+
+s16 D_801BFE14[][18] = {
+ { 200, 666, 200, 700, 366, 200, 600, 175, 60, 800, 1000, -100, 600, 590, 800, 125, 300, 65 },
+ { 200, 1000, 300, 800, 500, 400, 800, 400, 120, 800, 550, -100, 600, 540, 750, 125, 400, 200 },
+ { 100, 1000, 300, 800, 250, 200, 800, 200, 90, 800, 350, -80, 600, 540, 750, 60, 200, 200 },
+ { 200, 1000, 300, 700, 550, 270, 600, 1000, 120, 800, 600, -100, 600, 590, 750, 125, 200, 130 },
+ { 200, 1000, 300, 700, 550, 270, 700, 300, 120, 800, 600, -100, 600, 590, 750, 125, 200, 130 },
+ { 200, 1000, 300, 700, 550, 270, 700, 300, 120, 800, 600, -100, 600, 590, 750, 125, 200, 130 },
+ { 200, 1000, 300, 700, 550, 270, 700, 200, 120, 800, 600, -140, 600, 590, 750, 125, 200, 130 },
+ { 80, 800, 150, 700, 480, 270, 600, 50, 120, 800, 300, -40, 400, 540, 270, 25, 0, 80 },
+};
// OoT's Player_SetBootData
void func_80123140(PlayState* play, Player* player) {
@@ -403,7 +455,7 @@ void func_80123140(PlayState* play, Player* player) {
}
s32 Player_InBlockingCsMode(PlayState* play, Player* player) {
- return (player->stateFlags1 & (PLAYER_STATE1_20000000 | PLAYER_STATE1_200 | PLAYER_STATE1_80)) ||
+ return (player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_20000000)) ||
(player->csMode != 0) || (play->transitionTrigger == TRANS_TRIGGER_START) ||
(play->transitionMode != TRANS_MODE_OFF) || (player->stateFlags1 & PLAYER_STATE1_1) ||
(player->stateFlags3 & PLAYER_STATE3_80) || (play->actorCtx.unk268 != 0);
@@ -420,7 +472,7 @@ s32 func_80123420(Player* player) {
}
s32 func_80123434(Player* player) {
- return player->stateFlags1 & (PLAYER_STATE1_40000000 | PLAYER_STATE1_20000 | PLAYER_STATE1_10000);
+ return player->stateFlags1 & (PLAYER_STATE1_10000 | PLAYER_STATE1_20000 | PLAYER_STATE1_40000000);
}
// Unused
@@ -478,7 +530,7 @@ s32 func_801235DC(PlayState* play, f32 arg1, s16 arg2) {
return false;
}
-s32 func_8012364C(PlayState* play, Player* player, s32 arg2) {
+ItemId func_8012364C(PlayState* play, Player* player, s32 arg2) {
if (arg2 >= 4) {
return ITEM_NONE;
}
@@ -506,42 +558,161 @@ s32 func_8012364C(PlayState* play, Player* player, s32 arg2) {
}
if (arg2 == 1) {
- return (gSaveContext.buttonStatus[1] != BTN_DISABLED)
- ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_LEFT]
- : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C)
- ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_LEFT]
- : ITEM_NONE;
+ return (gSaveContext.buttonStatus[EQUIP_SLOT_C_LEFT] != BTN_DISABLED) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_LEFT)
+ : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_LEFT)
+ : ITEM_NONE;
}
if (arg2 == 2) {
- return (gSaveContext.buttonStatus[2] != BTN_DISABLED)
- ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_DOWN]
- : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C)
- ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_DOWN]
- : ITEM_NONE;
+ return (gSaveContext.buttonStatus[EQUIP_SLOT_C_DOWN] != BTN_DISABLED) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_DOWN)
+ : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_DOWN)
+ : ITEM_NONE;
}
- return (gSaveContext.buttonStatus[3] != BTN_DISABLED) ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_RIGHT]
- : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C)
- ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_RIGHT]
- : ITEM_NONE;
+ return (gSaveContext.buttonStatus[EQUIP_SLOT_C_RIGHT] != BTN_DISABLED) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_RIGHT)
+ : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_RIGHT)
+ : ITEM_NONE;
}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80123810.s")
+u16 sCItemButtons[] = { BTN_CLEFT, BTN_CDOWN, BTN_CRIGHT };
+
+s32 func_80123810(PlayState* play) {
+ Player* player = GET_PLAYER(play);
+ s32 temp_v0;
+ ItemId itemId;
+ s32 i;
+
+ if (gSaveContext.save.unk_06 == 0) {
+ if (CHECK_BTN_ANY(CONTROLLER1(&play->state)->press.button, BTN_A | BTN_B)) {
+ play->interfaceCtx.unk_222 = 0;
+ play->interfaceCtx.unk_224 = 0;
+ Interface_SetHudVisibility(play->msgCtx.unk_120BC);
+ return -1;
+ }
+ } else {
+ gSaveContext.save.unk_06--;
+ }
-extern u8 sActionModelGroups[];
+ for (i = 0; i < ARRAY_COUNT(sCItemButtons); i++) {
+ if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, sCItemButtons[i])) {
+ i++;
+ itemId = func_8012364C(play, player, i);
-s32 Player_ActionToModelGroup(Player* player, s32 actionParam) {
- s32 modelGroup = sActionModelGroups[actionParam];
+ play->interfaceCtx.unk_222 = 0;
+ play->interfaceCtx.unk_224 = 0;
+ Interface_SetHudVisibility(play->msgCtx.unk_120BC);
- if ((modelGroup == 2) && Player_IsGoronOrDeku(player)) {
- return 1;
+ if ((itemId >= ITEM_FD) || (temp_v0 = play->unk_18794(play, player, itemId, i), (temp_v0 < 0))) {
+ play_sound(NA_SE_SY_ERROR);
+ return -1;
+ } else {
+ s32 pad;
+
+ player->heldItemButton = i;
+ return temp_v0;
+ }
+ }
+ }
+
+ return 0;
+}
+
+// Used to map action params to model groups
+u8 sActionModelGroups[PLAYER_AP_MAX] = {
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_NONE
+ PLAYER_MODELGROUP_13, // PLAYER_AP_LAST_USED
+ PLAYER_MODELGROUP_STICK, // PLAYER_AP_FISHING_ROD
+ PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_AP_SWORD_KOKIRI
+ PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_AP_SWORD_RAZOR
+ PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_AP_SWORD_GILDED
+ PLAYER_MODELGROUP_TWO_HAND_SWORD, // PLAYER_AP_SWORD_GREAT_FAIRY
+ PLAYER_MODELGROUP_STICK, // PLAYER_AP_STICK
+ PLAYER_MODELGROUP_ZORA_FINS, // PLAYER_AP_ZORA_FINS
+ PLAYER_MODELGROUP_BOW, // PLAYER_AP_BOW
+ PLAYER_MODELGROUP_BOW, // PLAYER_AP_BOW_FIRE
+ PLAYER_MODELGROUP_BOW, // PLAYER_AP_BOW_ICE
+ PLAYER_MODELGROUP_BOW, // PLAYER_AP_BOW_LIGHT
+ PLAYER_MODELGROUP_HOOKSHOT, // PLAYER_AP_HOOKSHOT
+ PLAYER_MODELGROUP_EXPLOSIVES, // PLAYER_AP_BOMB
+ PLAYER_MODELGROUP_EXPLOSIVES, // PLAYER_AP_POWDER_KEG
+ PLAYER_MODELGROUP_EXPLOSIVES, // PLAYER_AP_BOMBCHU
+ PLAYER_MODELGROUP_8, // PLAYER_AP_11
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_NUT
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_PICTO_BOX
+ PLAYER_MODELGROUP_INSTRUMENT, // PLAYER_AP_OCARINA
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_FISH
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_SPRING_WATER
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_HOT_SPRING_WATER
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_ZORA_EGG
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_DEKU_PRINCESS
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_GOLD_DUST
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_1C
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_SEAHORSE
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_MUSHROOM
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_HYLIAN_LOACH
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_BUG
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_POE
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_BIG_POE
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_POTION_RED
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_POTION_BLUE
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_POTION_GREEN
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_MILK
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_MILK_HALF
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_CHATEAU
+ PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_FAIRY
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MOON_TEAR
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_DEED_LAND
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_ROOM_KEY
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_LETTER_TO_KAFEI
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MAGIC_BEANS
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_DEED_SWAMP
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_DEED_MOUNTAIN
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_DEED_OCEAN
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_32
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_LETTER_MAMA
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_34
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_35
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_PENDANT_OF_MEMORIES
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_37
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_38
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_39
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_TRUTH
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_KAFEIS_MASK
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_ALL_NIGHT
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_BUNNY
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_KEATON
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_GARO
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_ROMANI
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_CIRCUS_LEADER
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_POSTMAN
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_COUPLE
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_GREAT_FAIRY
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_GIBDO
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_DON_GERO
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_KAMARO
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_CAPTAIN
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_STONE
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_BREMEN
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_BLAST
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_SCENTS
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_GIANT
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_FIERCE_DEITY
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_GORON
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_ZORA
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_DEKU
+ PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_LENS
+};
+
+PlayerModelGroup Player_ActionToModelGroup(Player* player, PlayerActionParam actionParam) {
+ PlayerModelGroup modelGroup = sActionModelGroups[actionParam];
+
+ if ((modelGroup == PLAYER_MODELGROUP_ONE_HAND_SWORD) && Player_IsGoronOrDeku(player)) {
+ return PLAYER_MODELGROUP_1;
}
return modelGroup;
}
-extern u8 D_801BFF90[PLAYER_FORM_MAX];
-#if 0
u8 D_801BFF90[PLAYER_FORM_MAX] = {
PLAYER_BOOTS_FIERCE_DEITY, // PLAYER_FORM_FIERCE_DEITY
PLAYER_BOOTS_GORON, // PLAYER_FORM_GORON
@@ -549,10 +720,7 @@ u8 D_801BFF90[PLAYER_FORM_MAX] = {
PLAYER_BOOTS_DEKU, // PLAYER_FORM_DEKU
PLAYER_BOOTS_HYLIAN, // PLAYER_FORM_HUMAN
};
-#endif
-extern u8 sPlayerStrengths[PLAYER_FORM_MAX];
-#if 0
u8 sPlayerStrengths[PLAYER_FORM_MAX] = {
PLAYER_STRENGTH_HUMAN, // PLAYER_FORM_FIERCE_DEITY
PLAYER_STRENGTH_GORON, // PLAYER_FORM_GORON
@@ -560,44 +728,470 @@ u8 sPlayerStrengths[PLAYER_FORM_MAX] = {
PLAYER_STRENGTH_DEKU, // PLAYER_FORM_DEKU
PLAYER_STRENGTH_HUMAN, // PLAYER_FORM_HUMAN
};
-#endif
typedef struct {
/* 0x00 */ u8 flag;
/* 0x02 */ u16 textId;
} TextTriggerEntry; // size = 0x04
-extern TextTriggerEntry sEnvironmentTextTriggers[];
// These textIds are OoT remnants. The corresponding text entries are not present in this game, and so these don't point
// to anything relevant.
-#if 0
TextTriggerEntry sEnvironmentTextTriggers[] = {
{ 1, 0x26FC },
{ 2, 0x26FD },
{ 0, 0 },
{ 2, 0x26FD },
};
-#endif
-extern Gfx** sPlayerDListGroups[];
+PlayerModelIndices gPlayerModelTypes[PLAYER_MODELGROUP_MAX] = {
+ /* PLAYER_MODELGROUP_0 */
+ { PLAYER_ANIMTYPE_2, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_SHIELD, PLAYER_MODELTYPE_SHEATH_12,
+ PLAYER_MODELTYPE_WAIST },
+ /* PLAYER_MODELGROUP_1 */
+ { PLAYER_ANIMTYPE_1, PLAYER_MODELTYPE_LH_ONE_HAND_SWORD, PLAYER_MODELTYPE_RH_CLOSED, PLAYER_MODELTYPE_SHEATH_15,
+ PLAYER_MODELTYPE_WAIST },
+ /* PLAYER_MODELGROUP_ONE_HAND_SWORD */
+ { PLAYER_ANIMTYPE_1, PLAYER_MODELTYPE_LH_ONE_HAND_SWORD, PLAYER_MODELTYPE_RH_SHIELD, PLAYER_MODELTYPE_SHEATH_13,
+ PLAYER_MODELTYPE_WAIST },
+ /* PLAYER_MODELGROUP_DEFAULT */
+ { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_14,
+ PLAYER_MODELTYPE_WAIST },
+ /* PLAYER_MODELGROUP_4 */
+ { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_14,
+ PLAYER_MODELTYPE_WAIST },
+ /* PLAYER_MODELGROUP_TWO_HAND_SWORD */
+ { PLAYER_ANIMTYPE_3, PLAYER_MODELTYPE_LH_TWO_HAND_SWORD, PLAYER_MODELTYPE_RH_CLOSED, PLAYER_MODELTYPE_SHEATH_14,
+ PLAYER_MODELTYPE_WAIST },
+ /* PLAYER_MODELGROUP_BOW */
+ { PLAYER_ANIMTYPE_4, PLAYER_MODELTYPE_LH_CLOSED, PLAYER_MODELTYPE_RH_BOW, PLAYER_MODELTYPE_SHEATH_14,
+ PLAYER_MODELTYPE_WAIST },
+ /* PLAYER_MODELGROUP_EXPLOSIVES */
+ { PLAYER_ANIMTYPE_5, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_14,
+ PLAYER_MODELTYPE_WAIST },
+ /* PLAYER_MODELGROUP_8 */
+ { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_4, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_14,
+ PLAYER_MODELTYPE_WAIST },
+ /* PLAYER_MODELGROUP_HOOKSHOT */
+ { PLAYER_ANIMTYPE_4, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_HOOKSHOT, PLAYER_MODELTYPE_SHEATH_14,
+ PLAYER_MODELTYPE_WAIST },
+ /* PLAYER_MODELGROUP_STICK */
+ { PLAYER_ANIMTYPE_3, PLAYER_MODELTYPE_LH_CLOSED, PLAYER_MODELTYPE_RH_CLOSED, PLAYER_MODELTYPE_SHEATH_14,
+ PLAYER_MODELTYPE_WAIST },
+ /* PLAYER_MODELGROUP_INSTRUMENT */
+ { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_INSTRUMENT, PLAYER_MODELTYPE_SHEATH_14,
+ PLAYER_MODELTYPE_WAIST },
+ /* PLAYER_MODELGROUP_BOTTLE */
+ { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_BOTTLE, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_14,
+ PLAYER_MODELTYPE_WAIST },
+ /* PLAYER_MODELGROUP_13 */
+ { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_ONE_HAND_SWORD, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_15,
+ PLAYER_MODELTYPE_WAIST },
+ /* PLAYER_MODELGROUP_ZORA_FINS */
+ { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_CLOSED, PLAYER_MODELTYPE_RH_CLOSED, PLAYER_MODELTYPE_SHEATH_14,
+ PLAYER_MODELTYPE_WAIST },
+};
+
+/* DLists groups start */
+// Note: Only the ones with size 2 * PLAYER_FORM_MAX
+
+Gfx* gPlayerWaistDLs[2 * PLAYER_FORM_MAX] = {
+ gLinkFierceDeityWaistDL, gLinkFierceDeityWaistDL, gLinkGoronWaistDL, gLinkGoronWaistDL, gLinkZoraWaistDL,
+ gLinkZoraWaistDL, gLinkDekuWaistDL, gLinkDekuWaistDL, gLinkHumanWaistDL, gLinkHumanWaistDL,
+};
+
+Gfx* gPlayerHandHoldingShields[PLAYER_SHIELD_MAX - 1][2] = {
+ { gLinkHumanRightHandHoldingHylianShieldDL, gLinkHumanRightHandHoldingHylianShieldDL },
+ { gLinkHumanRightHandHoldingMirrorShieldDL, gLinkHumanRightHandHoldingMirrorShieldDL },
+};
+
+Gfx* gPlayerSheath12DLs[2 * PLAYER_FORM_MAX] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ gLinkDekuSheathDL,
+ gLinkDekuSheathDL,
+ gLinkHumanSheathEmptyDL,
+ gLinkHumanSheathEmptyDL,
+};
+
+Gfx* gPlayerSheath13DLs[2 * PLAYER_FORM_MAX] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ gLinkDekuSheathDL,
+ gLinkDekuSheathDL,
+ gLinkHumanSheathEmptyDL,
+ gLinkHumanSheathEmptyDL,
+};
+
+Gfx* gPlayerSheath14DLs[2 * PLAYER_FORM_MAX] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ gLinkDekuSheathDL,
+ gLinkDekuSheathDL,
+ gLinkHumanSheathEmptyDL,
+ gLinkHumanSheathEmptyDL,
+};
+
+Gfx* gPlayerShields[][2] = {
+ { gLinkHumanHylianShieldWithMtxDL, gLinkHumanHylianShieldWithMtxDL },
+ { gLinkHumanMirrorShieldWithMtxDL, gLinkHumanMirrorShieldWithMtxDL },
+};
+
+Gfx* gPlayerSheathedSwords[][2] = {
+ { gLinkHumanSheathedKokiriSwordDL, gLinkHumanSheathedKokiriSwordDL },
+ { gLinkHumanSheathedRazorSwordDL, gLinkHumanSheathedRazorSwordDL },
+ { gLinkHumanSheathedGildedSwordDL, gLinkHumanSheathedGildedSwordDL },
+};
+
+Gfx* gPlayerSwordSheaths[][2] = {
+ { gLinkHumanKokiriSwordSheathDL, gLinkHumanKokiriSwordSheathDL },
+ { gLinkHumanRazorSwordSheathDL, gLinkHumanRazorSwordSheathDL },
+ { gLinkHumanGildedSwordSheathDL, gLinkHumanGildedSwordSheathDL },
+};
+
+Gfx* gPlayerLeftHandTwoHandSwordDLs[2 * PLAYER_FORM_MAX] = {
+ gLinkFierceDeityLeftHandHoldingSwordDL,
+ gLinkFierceDeityLeftHandHoldingSwordDL,
+ gLinkGoronLeftHandOpenDL,
+ gLinkGoronLeftHandOpenDL,
+ gLinkZoraLeftHandOpenDL,
+ gLinkZoraLeftHandOpenDL,
+ gLinkDekuLeftHandDL,
+ gLinkDekuLeftHandDL,
+ gLinkHumanLeftHandHoldingGreatFairysSwordDL,
+ gLinkHumanLeftHandHoldingGreatFairysSwordDL,
+};
+
+Gfx* gPlayerLeftHandOpenDLs[2 * PLAYER_FORM_MAX] = {
+ gLinkFierceDeityLeftHandDL, gLinkFierceDeityLeftHandDL, gLinkGoronLeftHandOpenDL, gLinkGoronLeftHandOpenDL,
+ gLinkZoraLeftHandOpenDL, gLinkZoraLeftHandOpenDL, gLinkDekuLeftHandDL, gLinkDekuLeftHandDL,
+ gLinkHumanLeftHandOpenDL, gLinkHumanLeftHandOpenDL,
+};
+
+Gfx* gPlayerLeftHandClosedDLs[2 * PLAYER_FORM_MAX] = {
+ gLinkFierceDeityLeftHandDL, gLinkFierceDeityLeftHandDL, gLinkGoronLeftHandClosedDL, gLinkGoronLeftHandClosedDL,
+ gLinkZoraLeftHandClosedDL, gLinkZoraLeftHandClosedDL, gLinkDekuLeftHandDL, gLinkDekuLeftHandDL,
+ gLinkHumanLeftHandClosedDL, gLinkHumanLeftHandClosedDL,
+};
+
+Gfx* gPlayerLeftHandOneHandSwordDLs[2 * PLAYER_FORM_MAX] = {
+ gLinkFierceDeityLeftHandDL,
+ gLinkFierceDeityLeftHandDL,
+ gLinkGoronLeftHandOpenDL,
+ gLinkGoronLeftHandOpenDL,
+ gLinkZoraLeftHandClosedDL,
+ gLinkZoraLeftHandClosedDL,
+ gLinkDekuLeftHandDL,
+ gLinkDekuLeftHandDL,
+ gLinkHumanLeftHandHoldingKokiriSwordDL,
+ gLinkHumanLeftHandHoldingKokiriSwordDL,
+};
+
+Gfx* D_801C018C[][2] = {
+ { gLinkHumanLeftHandHoldingKokiriSwordDL, gLinkHumanLeftHandHoldingKokiriSwordDL },
+ { gLinkHumanLeftHandHoldingRazorSwordDL, gLinkHumanLeftHandHoldingRazorSwordDL },
+ { gLinkHumanLeftHandHoldingGildedSwordDL, gLinkHumanLeftHandHoldingGildedSwordDL },
+};
+
+Gfx* gPlayerRightHandOpenDLs[2 * PLAYER_FORM_MAX] = {
+ gLinkFierceDeityRightHandDL, gLinkFierceDeityRightHandDL, gLinkGoronRightHandOpenDL, gLinkGoronRightHandOpenDL,
+ gLinkZoraRightHandOpenDL, gLinkZoraRightHandOpenDL, gLinkDekuRightHandDL, gLinkDekuRightHandDL,
+ gLinkHumanRightHandOpenDL, gLinkHumanRightHandOpenDL,
+};
+
+Gfx* gPlayerRightHandClosedDLs[2 * PLAYER_FORM_MAX] = {
+ gLinkFierceDeityRightHandDL, gLinkFierceDeityRightHandDL, gLinkGoronRightHandClosedDL, gLinkGoronRightHandClosedDL,
+ gLinkZoraRightHandClosedDL, gLinkZoraRightHandClosedDL, gLinkDekuRightHandDL, gLinkDekuRightHandDL,
+ gLinkHumanRightHandClosedDL, gLinkHumanRightHandClosedDL,
+};
+
+Gfx* gPlayerRightHandBowDLs[2 * PLAYER_FORM_MAX] = {
+ gLinkFierceDeityRightHandDL,
+ gLinkFierceDeityRightHandDL,
+ gLinkGoronRightHandOpenDL,
+ gLinkGoronRightHandOpenDL,
+ gLinkZoraRightHandOpenDL,
+ gLinkZoraRightHandOpenDL,
+ gLinkDekuRightHandDL,
+ gLinkDekuRightHandDL,
+ gLinkHumanRightHandHoldingBowDL,
+ gLinkHumanRightHandHoldingBowDL,
+};
+
+Gfx* gPlayerRightHandInstrumentDLs[2 * PLAYER_FORM_MAX] = {
+ gLinkFierceDeityRightHandDL,
+ gLinkFierceDeityRightHandDL,
+ gLinkGoronRightHandOpenDL,
+ gLinkGoronRightHandOpenDL,
+ gLinkZoraRightHandOpenDL,
+ gLinkZoraRightHandOpenDL,
+ gLinkDekuRightHandDL,
+ gLinkDekuRightHandDL,
+ gLinkHumanRightHandHoldingOcarinaDL,
+ gLinkHumanRightHandHoldingOcarinaDL,
+};
+
+Gfx* gPlayerRightHandHookshotDLs[2 * PLAYER_FORM_MAX] = {
+ gLinkFierceDeityRightHandDL,
+ gLinkFierceDeityRightHandDL,
+ gLinkGoronRightHandOpenDL,
+ gLinkGoronRightHandOpenDL,
+ gLinkZoraRightHandOpenDL,
+ gLinkZoraRightHandOpenDL,
+ gLinkDekuRightHandDL,
+ gLinkDekuRightHandDL,
+ gLinkHumanRightHandHoldingHookshotDL,
+ gLinkHumanRightHandHoldingHookshotDL,
+};
+
+Gfx* gPlayerLeftHandBottleDLs[2 * PLAYER_FORM_MAX] = {
+ gLinkFierceDeityLeftHandDL,
+ gLinkFierceDeityLeftHandDL,
+ gLinkGoronLeftHandHoldBottleDL,
+ gLinkGoronLeftHandHoldBottleDL,
+ gLinkZoraLeftHandHoldBottleDL,
+ gLinkZoraLeftHandHoldBottleDL,
+ gLinkDekuLeftHandDL,
+ gLinkDekuLeftHandDL,
+ gLinkHumanLeftHandHoldBottleDL,
+ gLinkHumanLeftHandHoldBottleDL,
+};
+
+/* DLists groups end */
+
+Gfx* D_801C0294[PLAYER_FORM_MAX] = {
+ gLinkFierceDeityLeftForearmDL, gLinkGoronLeftForearmDL, gLinkZoraLeftForearmDL,
+ gLinkDekuLeftForearmDL, gLinkHumanLeftForearmDL,
+};
+
+Gfx* D_801C02A8[PLAYER_FORM_MAX] = {
+ gLinkFierceDeityLeftHandDL, gLinkGoronLeftHandOpenDL, gLinkZoraLeftHandClosedDL,
+ gLinkDekuLeftHandDL, gLinkHumanLeftHandClosedDL,
+};
+
+Gfx* D_801C02BC[PLAYER_FORM_MAX] = {
+ gLinkFierceDeityRightShoulderDL, gLinkGoronRightShoulderDL, gLinkZoraRightShoulderDL,
+ gLinkDekuRightShoulderDL, gLinkHumanRightShoulderDL,
+};
+
+Gfx* D_801C02D0[PLAYER_FORM_MAX] = {
+ gLinkFierceDeityRightHandDL,
+ //! @bug This is in the middle of a texture in the link_goron object. It has the same offset as a link_nuts dlist
+ 0x060038C0,
+ gLinkZoraRightHandOpenDL,
+ gLinkDekuRightHandDL,
+ object_link_child_DL_018490,
+};
+
+Gfx* D_801C02E4[PLAYER_FORM_MAX] = {
+ gLinkFierceDeityRightHandDL,
+ //! @bug This is in the middle of a texture in the link_goron object. It has the same offset as a link_nuts dlist
+ 0x060038C0,
+ gLinkZoraRightHandOpenDL,
+ gLinkDekuRightHandDL,
+ object_link_child_DL_017B40,
+};
-void func_801239AC(Player* player) {
+// Indexed by model types (left hand, right hand, sheath or waist)
+Gfx** sPlayerDListGroups[PLAYER_MODELTYPE_MAX] = {
+ gPlayerLeftHandOpenDLs, // PLAYER_MODELTYPE_LH_OPEN
+ gPlayerLeftHandClosedDLs, // PLAYER_MODELTYPE_LH_CLOSED
+ gPlayerLeftHandOneHandSwordDLs, // PLAYER_MODELTYPE_LH_ONE_HAND_SWORD
+ gPlayerLeftHandTwoHandSwordDLs, // PLAYER_MODELTYPE_LH_TWO_HAND_SWORD
+ gPlayerLeftHandOpenDLs, // PLAYER_MODELTYPE_LH_4
+ gPlayerLeftHandBottleDLs, // PLAYER_MODELTYPE_LH_BOTTLE
+ gPlayerRightHandOpenDLs, // PLAYER_MODELTYPE_RH_OPEN
+ gPlayerRightHandClosedDLs, // PLAYER_MODELTYPE_RH_CLOSED
+ gPlayerRightHandClosedDLs, // PLAYER_MODELTYPE_RH_SHIELD
+ gPlayerRightHandBowDLs, // PLAYER_MODELTYPE_RH_BOW
+ gPlayerRightHandInstrumentDLs, // PLAYER_MODELTYPE_RH_INSTRUMENT
+ gPlayerRightHandHookshotDLs, // PLAYER_MODELTYPE_RH_HOOKSHOT
+ gPlayerSheath12DLs, // PLAYER_MODELTYPE_SHEATH_12
+ gPlayerSheath13DLs, // PLAYER_MODELTYPE_SHEATH_13
+ gPlayerSheath14DLs, // PLAYER_MODELTYPE_SHEATH_14
+ gPlayerSheath14DLs, // PLAYER_MODELTYPE_SHEATH_15
+ gPlayerWaistDLs, // PLAYER_MODELTYPE_WAIST
+ NULL, // PLAYER_MODELTYPE_17
+};
+
+struct_80124618 D_801C0340[] = {
+ { 0, { 0, 0, 0 } }, { 5, { 0, 0, 0 } }, { 7, { 100, 100, 100 } },
+ { 9, { 110, 110, 110 } }, { 11, { 100, 100, 100 } },
+};
+struct_80124618 D_801C0368[] = {
+ { 0, { 0, 0, 0 } }, { 4, { 0, 0, 0 } }, { 6, { 120, 150, 60 } }, { 8, { 130, 80, 160 } },
+ { 9, { 100, 100, 100 } }, { 10, { 90, 100, 90 } }, { 11, { 100, 100, 100 } },
+};
+struct_80124618 D_801C03A0[] = {
+ { 0, { 100, 100, 100 } },
+ { 2, { 120, 120, 120 } },
+ { 6, { 90, 90, 90 } },
+ { 7, { 93, 93, 93 } },
+};
+struct_80124618 D_801C03C0[] = {
+ { 0, { 200, 100, 110 } },
+ { 2, { 90, 100, 100 } },
+ { 3, { 100, 100, 100 } },
+ { 7, { 100, 100, 100 } },
+};
+struct_80124618 D_801C03E0[] = {
+ { 0, { 100, 100, 110 } }, { 2, { 60, 100, 80 } }, { 3, { 130, 105, 110 } },
+ { 7, { 130, 105, 110 } }, { 10, { 100, 100, 100 } }, { 19, { 100, 100, 100 } },
+};
+struct_80124618 D_801C0410[] = {
+ { 0, { 0, 0, 0 } },
+ { 2, { 80, 110, 80 } },
+ { 3, { 100, 100, 100 } },
+};
+struct_80124618 D_801C0428[] = {
+ { 0, { 0, 0, 0 } }, { 6, { 0, 0, 0 } }, { 7, { 60, 60, 50 } }, { 8, { 120, 130, 100 } },
+ { 9, { 100, 120, 80 } }, { 11, { 100, 100, 100 } }, { 13, { 100, 100, 100 } },
+};
+struct_80124618 D_801C0460[] = {
+ { 0, { 100, 100, 100 } }, { 5, { 100, 100, 100 } }, { 7, { 100, 74, 80 } },
+ { 8, { 100, 180, 130 } }, { 10, { 100, 80, 80 } }, { 13, { 100, 100, 100 } },
+};
+struct_80124618 D_801C0490[] = {
+ { 0, { 100, 100, 100 } }, { 1, { 100, 100, 100 } }, { 2, { 90, 100, 105 } }, { 4, { 110, 100, 100 } },
+ { 5, { 90, 100, 105 } }, { 6, { 100, 100, 100 } }, { 7, { 90, 100, 105 } }, { 8, { 100, 100, 100 } },
+ { 9, { 90, 100, 105 } }, { 10, { 100, 100, 100 } }, { 11, { 90, 100, 105 } }, { 12, { 110, 100, 100 } },
+ { 13, { 100, 100, 100 } }, { 14, { 90, 100, 105 } }, { 15, { 90, 100, 105 } }, { 17, { 100, 100, 100 } },
+};
+struct_80124618 D_801C0510[] = {
+ { 0, { 100, 100, 100 } }, { 4, { 100, 100, 100 } }, { 5, { 90, 110, 100 } },
+ { 6, { 110, 105, 100 } }, { 8, { 100, 100, 100 } },
+};
+struct_80124618 D_801C0538[] = {
+ { 0, { 100, 100, 100 } }, { 5, { 100, 100, 100 } }, { 6, { 0, 0, 0 } },
+ { 8, { 100, 100, 100 } }, { 14, { 100, 100, 100 } },
+};
+struct_80124618 D_801C0560[] = {
+ { 0, { 100, 100, 100 } },
+ { 2, { 95, 95, 100 } },
+ { 3, { 105, 105, 100 } },
+ { 5, { 102, 102, 102 } },
+};
+struct_80124618 D_801C0580[] = {
+ { 0, { 100, 100, 100 } }, { 9, { 100, 100, 100 } }, { 10, { 150, 150, 150 } },
+ { 12, { 0, 0, 0 } }, { 14, { 0, 0, 0 } },
+};
+struct_80124618 D_801C05A8[] = {
+ { 0, { 100, 100, 100 } },
+ { 6, { 100, 100, 100 } },
+ { 7, { 0, 0, 0 } },
+ { 17, { 0, 0, 0 } },
+};
+struct_80124618 D_801C05C8[] = {
+ { 0, { 0, 0, 0 } },
+ { 17, { 50, 50, 50 } },
+};
+struct_80124618 D_801C05D8[] = {
+ { 0, { 0, 0, 0 } },
+ { 5, { 0, 0, 0 } },
+ { 9, { 100, 100, 100 } },
+};
+struct_80124618 D_801C05F0[] = {
+ { 0, { 100, 100, 100 } },
+ { 5, { 100, 100, 100 } },
+ { 9, { 0, 0, 0 } },
+};
+struct_80124618 D_801C0608[] = {
+ { 0, { 100, 100, 100 } },
+ { 10, { 100, 100, 100 } },
+ { 32, { 100, 115, 105 } },
+ { 58, { 100, 101, 100 } },
+};
+struct_80124618 D_801C0628[] = {
+ { 0, { 100, 100, 100 } }, { 5, { 100, 100, 100 } }, { 15, { 100, 100, 105 } }, { 25, { 100, 100, 105 } },
+ { 34, { 100, 100, 100 } }, { 46, { 100, 100, 100 } }, { 57, { 100, 100, 105 } }, { 67, { 100, 100, 105 } },
+ { 76, { 100, 100, 100 } }, { 78, { 100, 100, 100 } },
+};
+struct_80124618 D_801C0678[] = {
+ { 0, { 0, 0, 0 } },
+ { 6, { 0, 0, 0 } },
+ { 8, { 100, 100, 100 } },
+ { 11, { 100, 100, 100 } },
+};
+struct_80124618 D_801C0698[] = {
+ { 0, { 0, 0, 0 } },
+ { 7, { 1120, 112, 112 } },
+ { 8, { 140, 168, 168 } },
+ { 11, { 140, 140, 140 } },
+};
+struct_80124618 D_801C06B8[] = {
+ { 0, { 100, 100, 100 } }, { 7, { 100, 100, 100 } }, { 8, { 70, 30, 70 } }, { 10, { 0, 0, 0 } }, { 14, { 0, 0, 0 } },
+};
+struct_80124618 D_801C06E0[] = {
+ { 0, { 140, 140, 140 } },
+ { 1, { 0, 0, 0 } },
+ { 14, { 0, 0, 0 } },
+};
+struct_80124618 D_801C06F8[] = {
+ { 0, { 100, 100, 100 } },
+ { 5, { 100, 100, 100 } },
+ { 6, { 0, 0, 0 } },
+ { 10, { 0, 0, 0 } },
+};
+struct_80124618 D_801C0718[] = {
+ { 0, { 140, 140, 140 } },
+ { 1, { 0, 0, 0 } },
+ { 10, { 0, 0, 0 } },
+};
+struct_80124618 D_801C0730[] = {
+ { 0, { 100, 100, 100 } },
+ { 13, { 100, 100, 100 } },
+};
+struct_80124618 D_801C0740[] = {
+ { 0, { 140, 140, 140 } },
+ { 13, { 140, 140, 140 } },
+};
+struct_80124618 D_801C0750[] = {
+ { 0, { 100, 100, 100 } }, { 5, { 100, 100, 100 } }, { 6, { 200, 200, 200 } },
+ { 10, { 200, 200, 200 } }, { 11, { 100, 100, 100 } },
+};
+
+// alpha values
+u8 D_801C0778[] = {
+ 0, 0, 0, 0, 0, 100, 200, 255, 255, 255, 200, 100,
+};
+
+struct_80124618 D_801C0784[] = {
+ { 0, { 100, 100, 100 } }, { 14, { 100, 100, 100 } }, { 15, { 200, 200, 200 } },
+ { 16, { 200, 200, 200 } }, { 18, { 100, 100, 100 } },
+};
+
+u8 D_801C07AC[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 200, 255, 255, 255, 200, 100, 0,
+};
+
+void Player_SetModelsForHoldingShield(Player* player) {
if (player->stateFlags1 & PLAYER_STATE1_400000) {
if ((player->heldItemActionParam < 0) || (player->heldItemActionParam == player->itemActionParam)) {
if (!Player_IsHoldingTwoHandedWeapon(player)) {
if (!Player_IsGoronOrDeku(player)) {
D_801F59E0 = player->transformation * 2;
- player->rightHandType = 8;
- player->rightHandDLists = &sPlayerDListGroups[8][D_801F59E0];
+ player->rightHandType = PLAYER_MODELTYPE_RH_SHIELD;
+ player->rightHandDLists = &sPlayerDListGroups[PLAYER_MODELTYPE_RH_SHIELD][D_801F59E0];
- if (player->sheathType == 14) {
- player->sheathType = 12;
- } else if (player->sheathType == 15) {
- player->sheathType = 13;
+ if (player->sheathType == PLAYER_MODELTYPE_SHEATH_14) {
+ player->sheathType = PLAYER_MODELTYPE_SHEATH_12;
+ } else if (player->sheathType == PLAYER_MODELTYPE_SHEATH_15) {
+ player->sheathType = PLAYER_MODELTYPE_SHEATH_13;
}
player->sheathDLists = &sPlayerDListGroups[player->sheathType][D_801F59E0];
- player->modelAnimType = 2;
+ player->modelAnimType = PLAYER_ANIMTYPE_2;
player->heldItemActionParam = -1;
}
}
@@ -605,43 +1199,43 @@ void func_801239AC(Player* player) {
}
}
-void Player_SetModels(Player* player, s32 modelGroup) {
- u8* playerModelTypes;
+void Player_SetModels(Player* player, PlayerModelGroup modelGroup) {
+ PlayerModelIndices* playerModelTypes;
D_801F59E0 = player->transformation * 2;
- player->leftHandType = gPlayerModelTypes[modelGroup][1];
- player->rightHandType = gPlayerModelTypes[modelGroup][2];
- player->sheathType = gPlayerModelTypes[modelGroup][3];
+ player->leftHandType = gPlayerModelTypes[modelGroup].leftHandType;
+ player->rightHandType = gPlayerModelTypes[modelGroup].rightHandType;
+ player->sheathType = gPlayerModelTypes[modelGroup].sheathType;
- if (player->sheathType == 14) {
+ if (player->sheathType == PLAYER_MODELTYPE_SHEATH_14) {
if (CUR_FORM_EQUIP(EQUIP_SLOT_B) == ITEM_NONE) {
- player->sheathType = 15;
+ player->sheathType = PLAYER_MODELTYPE_SHEATH_15;
}
}
- playerModelTypes = gPlayerModelTypes[modelGroup];
+ playerModelTypes = &gPlayerModelTypes[modelGroup];
- player->leftHandDLists = &sPlayerDListGroups[playerModelTypes[1]][D_801F59E0];
- player->rightHandDLists = &sPlayerDListGroups[playerModelTypes[2]][D_801F59E0];
- player->sheathDLists = &sPlayerDListGroups[playerModelTypes[3]][D_801F59E0];
- player->waistDLists = &sPlayerDListGroups[playerModelTypes[4]][D_801F59E0];
+ player->leftHandDLists = &sPlayerDListGroups[playerModelTypes->leftHandType][D_801F59E0];
+ player->rightHandDLists = &sPlayerDListGroups[playerModelTypes->rightHandType][D_801F59E0];
+ player->sheathDLists = &sPlayerDListGroups[playerModelTypes->sheathType][D_801F59E0];
+ player->waistDLists = &sPlayerDListGroups[playerModelTypes->waistType][D_801F59E0];
- func_801239AC(player);
+ Player_SetModelsForHoldingShield(player);
}
-void Player_SetModelGroup(Player* player, s32 modelGroup) {
+void Player_SetModelGroup(Player* player, PlayerModelGroup modelGroup) {
player->modelGroup = modelGroup;
- if (modelGroup == 1) {
- player->modelAnimType = 0;
+ if (modelGroup == PLAYER_MODELGROUP_1) {
+ player->modelAnimType = PLAYER_ANIMTYPE_0;
} else {
- player->modelAnimType = gPlayerModelTypes[modelGroup][0];
+ player->modelAnimType = gPlayerModelTypes[modelGroup].modelAnimType;
}
- if (player->modelAnimType < 3) {
+ if (player->modelAnimType < PLAYER_ANIMTYPE_3) {
if (((player->transformation != PLAYER_FORM_FIERCE_DEITY) && (player->transformation != PLAYER_FORM_HUMAN)) ||
(player->currentShield == PLAYER_SHIELD_NONE)) {
- player->modelAnimType = 0;
+ player->modelAnimType = PLAYER_ANIMTYPE_0;
}
}
@@ -669,7 +1263,7 @@ void Player_SetEquipmentData(PlayState* play, Player* player) {
}
}
-void func_80123D50(PlayState* play, Player* player, s32 itemId, s32 actionParam) {
+void func_80123D50(PlayState* play, Player* player, ItemId itemId, PlayerActionParam actionParam) {
Inventory_UpdateBottleItem(play, itemId, player->heldItemButton);
if (itemId != ITEM_BOTTLE) {
@@ -687,16 +1281,16 @@ void func_80123DA4(Player* player) {
void func_80123DC0(Player* player) {
if ((player->actor.bgCheckFlags & 1) ||
- (player->stateFlags1 & (PLAYER_STATE1_8000000 | PLAYER_STATE1_800000 | PLAYER_STATE1_200000)) ||
- (!(player->stateFlags1 & (PLAYER_STATE1_80000 | PLAYER_STATE1_40000)) &&
+ (player->stateFlags1 & (PLAYER_STATE1_200000 | PLAYER_STATE1_800000 | PLAYER_STATE1_8000000)) ||
+ (!(player->stateFlags1 & (PLAYER_STATE1_40000 | PLAYER_STATE1_80000)) &&
((player->actor.world.pos.y - player->actor.floorHeight) < 100.0f))) {
- player->stateFlags1 &= ~(PLAYER_STATE1_40000000 | PLAYER_STATE1_80000 | PLAYER_STATE1_40000 |
- PLAYER_STATE1_20000 | PLAYER_STATE1_10000 | PLAYER_STATE1_8000);
- } else if (!(player->stateFlags1 & (PLAYER_STATE1_200000 | PLAYER_STATE1_80000 | PLAYER_STATE1_40000))) {
+ player->stateFlags1 &= ~(PLAYER_STATE1_8000 | PLAYER_STATE1_10000 | PLAYER_STATE1_20000 | PLAYER_STATE1_40000 |
+ PLAYER_STATE1_80000 | PLAYER_STATE1_40000000);
+ } else if (!(player->stateFlags1 & (PLAYER_STATE1_40000 | PLAYER_STATE1_80000 | PLAYER_STATE1_200000))) {
player->stateFlags1 |= PLAYER_STATE1_80000;
} else if ((player->stateFlags1 & PLAYER_STATE1_40000) && (player->transformation == PLAYER_FORM_DEKU)) {
player->stateFlags1 &=
- ~(PLAYER_STATE1_40000000 | PLAYER_STATE1_20000 | PLAYER_STATE1_10000 | PLAYER_STATE1_8000);
+ ~(PLAYER_STATE1_8000 | PLAYER_STATE1_10000 | PLAYER_STATE1_20000 | PLAYER_STATE1_40000000);
}
func_80123DA4(player);
@@ -764,7 +1358,7 @@ s32 Player_HasMirrorShieldEquipped(PlayState* play) {
s32 Player_IsHoldingMirrorShield(PlayState* play) {
Player* player = GET_PLAYER(play);
- return (player->transformation == PLAYER_FORM_HUMAN) && (player->rightHandType == 8) &&
+ return (player->transformation == PLAYER_FORM_HUMAN) && (player->rightHandType == PLAYER_MODELTYPE_RH_SHIELD) &&
(player->currentShield == PLAYER_SHIELD_MIRROR_SHIELD);
}
@@ -776,7 +1370,7 @@ s32 func_801240DC(Player* player) {
return Player_IsHoldingHookshot(player) && (player->heldActor == NULL);
}
-s32 func_80124110(Player* player, s32 actionParam) {
+s32 func_80124110(Player* player, PlayerActionParam actionParam) {
s32 temp_v0 = actionParam - PLAYER_AP_FISHING_ROD;
if (player->transformation != PLAYER_FORM_GORON) {
@@ -793,7 +1387,7 @@ s32 func_80124148(Player* player) {
return func_80124110(player, player->itemActionParam);
}
-s32 Player_ActionToMeleeWeapon(s32 actionParam) {
+s32 Player_ActionToMeleeWeapon(PlayerActionParam actionParam) {
s32 weapon = actionParam - (PLAYER_AP_SWORD_KOKIRI - 1);
if ((weapon > 0) && (weapon <= (PLAYER_AP_ZORA_FINS - (PLAYER_AP_SWORD_KOKIRI - 1)))) {
@@ -815,7 +1409,7 @@ s32 Player_IsHoldingTwoHandedWeapon(Player* player) {
return false;
}
-s32 Player_ActionToBottle(Player* player, s32 actionParam) {
+s32 Player_ActionToBottle(Player* player, PlayerActionParam actionParam) {
s32 bottle = actionParam - PLAYER_AP_BOTTLE;
// Relies on bottle-related action params to be contiguous
@@ -830,7 +1424,7 @@ s32 Player_GetBottleHeld(Player* Player) {
return Player_ActionToBottle(Player, Player->itemActionParam);
}
-s32 Player_ActionToExplosive(Player* player, s32 actionParam) {
+s32 Player_ActionToExplosive(Player* player, PlayerActionParam actionParam) {
s32 explosive = actionParam - PLAYER_AP_BOMB;
// Relies on explosive-related action params to be contiguous
@@ -845,8 +1439,7 @@ s32 Player_GetExplosiveHeld(Player* player) {
return Player_ActionToExplosive(player, player->itemActionParam);
}
-// Convert actionParam to sword
-s32 func_80124278(Actor* actor, s32 actionParam) {
+s32 Player_ActionToSword(Actor* actor, PlayerActionParam actionParam) {
s32 sword = 0;
//! FAKE:
@@ -896,6 +1489,7 @@ s32 Player_GetEnvTimerType(PlayState* play) {
return envTimerType + 1;
}
+void func_80124420(Player* player);
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80124420.s")
void func_80124618(struct_80124618 arg0[], f32 curFrame, Vec3f* arg2) {
@@ -911,7 +1505,6 @@ void func_80124618(struct_80124618 arg0[], f32 curFrame, Vec3f* arg2) {
} while (temp_v1 < currentFrame);
temp_f0 = arg0[-1].unk_0;
-
progress = (curFrame - temp_f0) / (temp_v1 - temp_f0);
temp_f14 = arg0[-1].unk_2.x;
@@ -924,16 +1517,185 @@ void func_80124618(struct_80124618 arg0[], f32 curFrame, Vec3f* arg2) {
arg2->z = LERPIMP(temp_f14, arg0->unk_2.z, progress) * 0.01f;
}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_801246F4.s")
+struct_80124618 D_801C07C0[] = {
+ { 0, { 100, 100, 100 } }, { 10, { 100, 100, 100 } }, { 11, { 100, 120, 120 } },
+ { 12, { 100, 120, 120 } }, { 14, { 100, 100, 100 } }, { 19, { 100, 100, 100 } },
+};
+
+struct_80124618 D_801C07F0[] = {
+ { 0, { 40, 60, 70 } }, { 3, { 40, 60, 70 } }, { 4, { 75, 90, 85 } },
+ { 5, { 110, 120, 100 } }, { 7, { 100, 100, 100 } }, { 8, { 100, 100, 100 } },
+};
+struct_80124618 D_801C0820[] = {
+ { 0, { 100, 100, 100 } },
+ { 7, { 100, 100, 100 } },
+ { 12, { 40, 60, 70 } },
+};
+struct_80124618 D_801C0838[] = {
+ { 0, { 40, 60, 70 } },
+ { 7, { 40, 60, 70 } },
+ { 12, { 100, 100, 100 } },
+};
+
+Gfx gCullBackDList[] = {
+ gsSPSetGeometryMode(G_CULL_BACK),
+ gsSPEndDisplayList(),
+};
+Gfx gCullFrontDList[] = {
+ gsSPSetGeometryMode(G_CULL_FRONT),
+ gsSPEndDisplayList(),
+};
+
+TexturePtr sPlayerEyesTextures[] = {
+ gLinkHumanEyesOpenTex, gLinkHumanEyesHalfTex, gLinkHumanEyesClosedTex, gLinkHumanEyesRollRightTex,
+ gLinkHumanEyesRollLeftTex, gLinkHumanEyesRollUpTex, gLinkHumanEyesRollDownTex, object_link_child_Tex_003800,
+};
+
+TexturePtr sPlayerMouthTextures[] = {
+ gLinkHumanMouthClosedTex,
+ gLinkHumanMouthTeethTex,
+ gLinkHumanMouthAngryTex,
+ gLinkHumanMouthHappyTex,
+};
+
+typedef struct PlayerFaceIndices {
+ /* 0x00 */ u8 eyeIndex;
+ /* 0x01 */ u8 mouthIndex;
+} PlayerFaceIndices; // size = 0x02
+
+PlayerFaceIndices sPlayerFaces[] = {
+ { PLAYER_EYES_OPEN, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_0
+ { PLAYER_EYES_HALF, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_1
+ { PLAYER_EYES_CLOSED, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_2
+ { PLAYER_EYES_OPEN, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_3
+ { PLAYER_EYES_HALF, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_4
+ { PLAYER_EYES_CLOSED, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_5
+ { PLAYER_EYES_ROLL_LEFT, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_6
+ { PLAYER_EYES_ROLL_UP, PLAYER_MOUTH_TEETH }, // PLAYER_FACE_7
+ { PLAYER_EYES_7, PLAYER_MOUTH_ANGRY }, // PLAYER_FACE_8
+ { PLAYER_EYES_OPEN, PLAYER_MOUTH_ANGRY }, // PLAYER_FACE_9
+ { PLAYER_EYES_ROLL_RIGHT, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_10
+ { PLAYER_EYES_ROLL_LEFT, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_11
+ { PLAYER_EYES_CLOSED, PLAYER_MOUTH_ANGRY }, // PLAYER_FACE_12
+ { PLAYER_EYES_HALF, PLAYER_MOUTH_TEETH }, // PLAYER_FACE_13
+ { PLAYER_EYES_OPEN, PLAYER_MOUTH_ANGRY }, // PLAYER_FACE_14
+ { PLAYER_EYES_OPEN, PLAYER_MOUTH_HAPPY }, // PLAYER_FACE_15
+};
+
+// Note the correct pointer to pass as the jointTable is the jointTable pointer from the SkelAnime struct, not the
+// buffer from the Player struct itself since that one may be misaligned.
+void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod,
+ PlayerTransformation playerForm, s32 boots, s32 face, OverrideLimbDrawFlex overrideLimbDraw,
+ PostLimbDrawFlex postLimbDraw, Actor* actor) {
+ s32 eyeIndex = (jointTable[22].x & 0xF) - 1;
+ s32 mouthIndex = ((jointTable[22].x >> 4) & 0xF) - 1;
+ Gfx* gfx;
+
+ OPEN_DISPS(play->state.gfxCtx);
+
+ gfx = POLY_OPA_DISP;
+
+ if (eyeIndex < 0) {
+ eyeIndex = sPlayerFaces[face].eyeIndex;
+ }
+
+ if (playerForm == PLAYER_FORM_GORON) {
+ if ((eyeIndex >= PLAYER_EYES_ROLL_RIGHT) && (eyeIndex <= PLAYER_EYES_ROLL_DOWN)) {
+ eyeIndex = PLAYER_EYES_OPEN;
+ } else if (eyeIndex == PLAYER_EYES_7) {
+ eyeIndex = PLAYER_EYES_ROLL_RIGHT;
+ }
+ }
+
+ gSPSegment(&gfx[0], 0x08, Lib_SegmentedToVirtual(sPlayerEyesTextures[eyeIndex]));
+
+ if (mouthIndex < 0) {
+ mouthIndex = sPlayerFaces[face].mouthIndex;
+ }
+
+ gSPSegment(&gfx[1], 0x09, Lib_SegmentedToVirtual(sPlayerMouthTextures[mouthIndex]));
+
+ POLY_OPA_DISP = &gfx[2];
+
+ D_801F59E0 = playerForm * 2;
+ D_801F59E4 = lod;
+ SkelAnime_DrawFlexLod(play, skeleton, jointTable, dListCount, overrideLimbDraw, postLimbDraw, actor, lod);
+
+ CLOSE_DISPS(play->state.gfxCtx);
+}
+
+Vec3f D_801C08C0[PLAYER_FORM_MAX] = {
+ { 1304.0f, 0.0f, 0.0f }, { 1156.0f, 0.0f, 0.0f }, { 1406.0f, 0.0f, 0.0f },
+ { 408.0f, 0.0f, 0.0f }, { 695.0f, 0.0f, 0.0f },
+};
+
+f32 D_801C08FC[PLAYER_FORM_MAX] = {
+ 1265.0f, 1056.0f, 1506.0f, 359.0f, 826.0f,
+};
+f32 D_801C0910[PLAYER_FORM_MAX] = {
+ 170.0416f, 133.63359f, 197.68358f, 16.646399f, 48.302498f,
+};
+f32 D_801C0924[PLAYER_FORM_MAX] = {
+ 10.019104f, 22.120003f, -29.12001f, 3.7582989f, -19.925102f,
+};
+f32 D_801C0938[PLAYER_FORM_MAX] = {
+ 5.0f, 4.0f, 1.0f, 1.0f, 3.0f,
+};
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80124870.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80124CC4.s")
+void func_80124CC4(PlayState* play, Player* player, f32 arg2) {
+ static Vec3f D_801C094C = { -500.0f, -100.0f, 0.0f };
+ CollisionPoly* poly;
+ s32 bgId;
+ Vec3f sp7C;
+ Vec3f sp70;
+ Vec3f pos;
+ Vec3f sp58;
+ f32 sp54;
+ f32 scale;
+
+ D_801C094C.z = 0.0f;
+ Matrix_MultVec3f(&D_801C094C, &sp7C);
+ D_801C094C.z = arg2;
+ Matrix_MultVec3f(&D_801C094C, &sp70);
+
+ if (BgCheck_AnyLineTest3(&play->colCtx, &sp7C, &sp70, &pos, &poly, true, true, true, true, &bgId)) {
+ if (!func_800B90AC(play, &player->actor, poly, bgId, &pos) ||
+ BgCheck_ProjectileLineTest(&play->colCtx, &sp7C, &sp70, &pos, &poly, true, true, true, true, &bgId)) {
+ OPEN_DISPS(play->state.gfxCtx);
+
+ OVERLAY_DISP = Gfx_CallSetupDL(OVERLAY_DISP, 7);
+
+ SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &pos, &sp58, &sp54);
+ if (sp54 < 200.0f) {
+ scale = 0.08f;
+ } else {
+ scale = (sp54 / 200.0f) * 0.08f;
+ }
+ Matrix_Translate(pos.x, pos.y, pos.z, MTXMODE_NEW);
+ Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
+
+ gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+
+ gSPSegment(OVERLAY_DISP++, 0x06, play->objectCtx.status[player->actor.objBankIndex].segment);
+ gSPDisplayList(OVERLAY_DISP++, gameplay_keep_DL_04F250);
+
+ CLOSE_DISPS(play->state.gfxCtx);
+ }
+ }
+}
-extern s32 D_801C0958;
-#if 0
s32 D_801C0958 = false;
-#endif
+
+Gfx** D_801C095C[] = {
+ gPlayerLeftHandClosedDLs,
+ gPlayerLeftHandOpenDLs,
+};
+Gfx** D_801C0964[] = {
+ gPlayerRightHandClosedDLs,
+ gPlayerRightHandOpenDLs,
+};
void func_80124F18(s16* arg0, f32* arg1, s16 arg2, f32 arg3, f32 arg4) {
f32 phi_f12;
@@ -1067,14 +1829,11 @@ s32 func_801263FC(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80126440.s")
-extern u8 D_801C096C[PLAYER_SHIELD_MAX];
-#if 0
u8 D_801C096C[PLAYER_SHIELD_MAX] = {
COLTYPE_METAL,
COLTYPE_METAL,
COLTYPE_METAL,
};
-#endif
void func_801265C8(PlayState* play, Player* player, ColliderQuad* collider, Vec3f arg3[4]) {
if (player->stateFlags1 & PLAYER_STATE1_400000) {
@@ -1094,6 +1853,146 @@ void func_801265C8(PlayState* play, Player* player, ColliderQuad* collider, Vec3
}
}
+Vec3f D_801C0970[] = {
+ { 0.0f, 400.0f, 0.0f },
+ { 0.0f, 1400.0f, -1000.0f },
+ { 0.0f, -400.0f, 1000.0f },
+};
+
+Vec3f D_801C0994[] = {
+ { 5000.0f, 400.0f, 0.0f },
+ { 5000.0f, -400.0f, 1000.0f },
+ { 5000.0f, 1400.0f, -1000.0f },
+};
+
+Vec3f D_801C09B8[] = {
+ { 0.0f, 750.0f, 750.0f },
+ { 1500.0f, 1500.0f, 1500.0f },
+ { -2500.0f, -2000.0f, -3000.0f },
+};
+
+Vec3f D_801C09DC[] = {
+ { 900.0f, 300.0f, 100.0f },
+ { 1300.0f, 700.0f, -300.0f },
+ { 500.0f, -100.0f, 500.0f },
+};
+
+Vec3f D_801C0A00[] = {
+ { -2500.0f, 1400.0f, 1100.0f },
+ { -2900.0f, 1000.0f, 1500.0f },
+ { -2100.0f, 1800.0f, 700.0f },
+};
+
+Vec3f D_801C0A24[] = {
+ { 0.0f, 0.0f, 0.0f },
+ { -800.0f, 800.0f, 800.0f },
+ { -800.0f, -800.0f, -800.0f },
+};
+
+Vec3f D_801C0A48[] = {
+ { 2000.0f, 0.0f, 0.0f },
+ { 2800.0f, -800.0f, -800.0f },
+ { 2800.0f, 800.0f, 800.0f },
+};
+
+Vec3f D_801C0A6C[] = {
+ { -400.0f, 800.0f, 0.0f },
+ { -5000.0f, -500.0f, -4000.0f },
+ { -5000.0f, 8000.0f, 4000.0f },
+};
+
+Vec3f D_801C0A90[] = {
+ { -400.0f, 1800.0f, 0.0f },
+ { 5000.0f, 8000.0f, 4000.0f },
+ { 5000.0f, -500.0f, -4000.0f },
+};
+
+Gfx* D_801C0AB4[] = {
+ object_link_zora_DL_00CC38,
+ object_link_zora_DL_00CDA0,
+};
+
+Gfx* D_801C0ABC[] = {
+ object_link_zora_DL_010868,
+ object_link_zora_DL_010978,
+};
+
+Vec3f D_801C0AC4[] = {
+ { 5400.0f, 1700.0f, 1800.0f },
+ { 5400.0f, 1700.0f, -1800.0f },
+};
+
+Vec3f D_801C0ADC[] = {
+ { 5250.0f, 570.0f, 2400.0f },
+ { 5250.0f, 570.0f, -2400.0f },
+};
+
+struct_80124618* D_801C0AF4[] = {
+ D_801C0678,
+ D_801C0698,
+};
+
+struct_80124618* D_801C0AFC[] = {
+ D_801C06B8,
+ D_801C06E0,
+};
+
+struct_80124618* D_801C0B04[] = {
+ D_801C06F8,
+ D_801C0718,
+};
+
+struct_80124618* D_801C0B0C[] = {
+ D_801C0730,
+ D_801C0740,
+};
+
+Gfx* D_801C0B14[] = {
+ object_link_nuts_DL_008760,
+ object_link_nuts_DL_008660,
+};
+
+u8 D_801C0B1C[] = {
+ 0x0C,
+ 0x0F,
+};
+
+Gfx* D_801C0B20[] = {
+ object_mask_truth_DL_0001A0,
+ object_mask_kerfay_DL_000D40,
+ object_mask_yofukasi_DL_000490,
+ object_mask_rabit_DL_000610,
+ object_mask_ki_tan_DL_0004A0,
+ object_mask_json_DL_0004C0,
+ object_mask_romerny_DL_0007A0,
+ object_mask_zacho_DL_000700,
+ object_mask_posthat_DL_000290,
+ object_mask_meoto_DL_0005A0,
+ object_mask_bigelf_DL_0016F0,
+ object_mask_gibudo_DL_000250,
+ gDonGeroMaskDL,
+ object_mask_dancer_DL_000EF0,
+ object_mask_skj_DL_0009F0,
+ object_mask_stone_DL_000820,
+ object_mask_bree_DL_0003C0,
+ object_mask_bakuretu_DL_0005C0,
+ object_mask_bu_san_DL_000710,
+ object_mask_kyojin_DL_000380,
+ gameplay_keep_DL_00B260,
+ gameplay_keep_DL_005A10,
+ gameplay_keep_DL_005360,
+ gameplay_keep_DL_0056C0,
+ object_mask_boy_DL_000900,
+ object_mask_goron_DL_0014A0,
+ object_mask_zora_DL_000DB0,
+ object_mask_nuts_DL_001D90,
+};
+
+Vec3f D_801C0B90[] = {
+ { 950.0f, -800.0f, 300.0f },
+ { 950.0f, -800.0f, -300.0f },
+};
+
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8012669C.s")
void Player_DrawGetItemImpl(PlayState* play, Player* player, Vec3f* refPos, s32 drawIdPlusOne) {
@@ -1191,21 +2090,270 @@ void Player_DrawCouplesMask(PlayState* play, Player* player) {
AnimatedMat_DrawOpa(play, Lib_SegmentedToVirtual(&object_mask_meoto_Matanimheader_001CD8));
}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80127594.s")
+void Player_DrawCircusLeadersMask(PlayState* play, Actor* actor) {
+ static Vec3f bubbleVelocity = { 0.0f, 0.0f, 0.0f };
+ static Vec3f bubbleAccel = { 0.0f, 0.0f, 0.0f };
+ Gfx* gfx;
+ s32 i;
+
+ OPEN_DISPS(play->state.gfxCtx);
+
+ gfx = POLY_XLU_DISP;
+
+ for (i = 0; i < ARRAY_COUNT(D_801C0B90); i++) {
+ f32 scaleY = (D_801F59C8[i] / 400.0f) * 0.1f;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_801278F8.s")
+ Matrix_MultVec3f(&D_801C0B90[i], &D_801F59B0[i]);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80127A60.s")
+ //! FAKE
+ if (1) {}
+
+ D_801F59B0[i].y += -10.0f * scaleY;
+
+ if (D_801F59C8[i] < 0x190) {
+ f32 scaleXZ = CLAMP_MAX(scaleY, 0.05f);
+
+ Matrix_Push();
+ Matrix_Translate(D_801F59B0[i].x, D_801F59B0[i].y, D_801F59B0[i].z, MTXMODE_NEW);
+ Matrix_Scale(scaleXZ, scaleY, scaleXZ, MTXMODE_APPLY);
+
+ gSPMatrix(&gfx[0], Matrix_NewMtx(play->state.gfxCtx), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPSegment(&gfx[1], 0x08, VIRTUAL_TO_PHYSICAL(SEGMENTED_TO_VIRTUAL(gEffBubble1Tex)));
+ gDPSetPrimColor(&gfx[2], 0, 0, 255, 255, 255, 255);
+ gDPSetEnvColor(&gfx[3], 150, 150, 150, 0);
+ gSPDisplayList(&gfx[4], gEffBubbleDL);
+ gSPPopMatrix(&gfx[5], G_MTX_MODELVIEW);
+
+ Matrix_Pop();
+
+ gfx = &gfx[6];
+ } else {
+ Player* player = (Player*)actor;
+ f32 temp_f0 = sqrtf(SQ(player->actor.velocity.x) + SQ(player->actor.velocity.z));
+ s16 phi_s0 = temp_f0 * 2000.0f;
+ f32 temp_f20;
+
+ bubbleVelocity.y = temp_f0 * 0.4f;
+ bubbleAccel.y = -0.3f;
+
+ if (phi_s0 > 0x3E80) {
+ phi_s0 = 0x3E80;
+ }
+
+ phi_s0 = player->actor.focus.rot.y + ((i != 0) ? phi_s0 : -phi_s0);
+ temp_f20 = temp_f0 * 0.2f;
+
+ if (temp_f20 > 4.0f) {
+ temp_f20 = 4.0f;
+ }
+
+ bubbleVelocity.x = -Math_SinS(phi_s0) * temp_f20;
+ bubbleVelocity.z = -Math_CosS(phi_s0) * temp_f20;
+
+ EffectSsDtBubble_SpawnColorProfile(play, &D_801F59B0[i], &bubbleVelocity, &bubbleAccel, 20, 20, 3, 0);
+ D_801F59C8[i] -= 0x190;
+ }
+ }
+
+ POLY_XLU_DISP = gfx;
+
+ CLOSE_DISPS(play->state.gfxCtx);
+}
+
+void Player_DrawBlastMask(PlayState* play, Player* player) {
+ static Gfx D_801C0BC0[] = {
+ gsDPSetEnvColor(0, 0, 0, 255),
+ gsSPEndDisplayList(),
+ };
+ static Gfx D_801C0BD0[] = {
+ gsDPSetRenderMode(AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL |
+ G_RM_FOG_SHADE_A,
+ AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL |
+ GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)),
+ gsSPEndDisplayList(),
+ };
+
+ OPEN_DISPS(play->state.gfxCtx);
+
+ if (player->unk_B60 != 0) {
+ s32 alpha;
+
+ gSegments[0xA] = VIRTUAL_TO_PHYSICAL(player->maskObjectSegment);
+
+ AnimatedMat_DrawOpa(play, Lib_SegmentedToVirtual(&object_mask_bakuretu_Matanimheader_0011F8));
+
+ if (player->unk_B60 < 11) {
+ alpha = (player->unk_B60 / 10.0f) * 255;
+ } else {
+ alpha = 255;
+ }
+
+ gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, (u8)alpha);
+ gSPDisplayList(POLY_OPA_DISP++, object_mask_bakuretu_DL_000440);
+ gSPSegment(POLY_OPA_DISP++, 0x09, D_801C0BD0);
+ gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, (u8)(255 - alpha));
+ } else {
+ gSPSegment(POLY_OPA_DISP++, 0x09, D_801C0BC0);
+ }
+
+ CLOSE_DISPS(play->state.gfxCtx);
+}
+
+Vec3f D_801C0BE0 = { 0.0f, 0.3f, 0.0f };
+Vec3f D_801C0BEC = { 0.0f, -0.025f, 0.0f };
+Color_RGBA8 D_801C0BF8 = { 250, 100, 100, 0 };
+Color_RGBA8 D_801C0BFC = { 0, 0, 100, 0 };
+
+Vec3f D_801C0C00 = { 0.0f, 20.0f, 0.0f };
+
+Vec3f D_801C0C0C[] = {
+ { 174.0f, -1269.0f, -1.0f },
+ { 401.0f, -729.0f, -701.0f },
+ { 401.0f, -729.0f, 699.0f },
+};
+
+Vec3f D_801C0C30[] = {
+ { 74.0f, -1269.0f, -1.0f },
+ { 301.0f, -729.0f, -701.0f },
+ { 301.0f, -729.0f, 699.0f },
+};
+
+typedef struct {
+ /* 0x00 */ f32 unk_00;
+ /* 0x04 */ s16 unk_04;
+ /* 0x06 */ s16 unk_06;
+ /* 0x08 */ Vec3f unk_08;
+ /* 0x14 */ f32 unk_14;
+ /* 0x18 */ s16 unk_18;
+ /* 0x1A */ s16 unk_1A;
+} struct_80128388_arg1; // size = 0x1C
+
+struct_80128388_arg1 D_801C0C54[] = {
+ { 0.0f, 0x0000, 0x8000, { 0.0f, 0.0f, 0.0f }, 0.0f, 0x0000, 0x0000 },
+ { 16.8f, 0x0000, 0x0000, { 0.0f, 0.0f, 0.0f }, 20.0f, 0x1388, 0x1388 },
+ { 30.0f, 0x0000, 0x0000, { 0.0f, 0.0f, 0.0f }, 20.0f, 0x1F40, 0x2EE0 },
+};
+
+Color_RGB8 D_801C0CA8[] = {
+ { 255, 255, 255 }, { 80, 80, 255 }, { 136, 192, 255 }, { 136, 192, 255 }, { 184, 232, 232 }, { 248, 200, 0 },
+ { 255, 180, 0 }, { 0, 128, 0 }, { 252, 238, 0 }, { 131, 0, 174 }, { 64, 64, 32 }, { 0, 0, 255 },
+ { 255, 0, 255 }, { 255, 0, 255 }, { 255, 0, 0 }, { 0, 0, 255 }, { 0, 200, 0 }, { 255, 255, 255 },
+ { 255, 255, 255 }, { 255, 255, 255 }, { 80, 80, 255 },
+};
+
+Vec3f D_801C0CE8[PLAYER_FORM_MAX] = {
+ { 0.0f, 0.0f, 0.0f }, { 300.0f, 300.0f, -230.0f }, { 0.0f, 90.0f, -50.0f },
+ { 0.0f, 20.0f, -60.0f }, { 0.0f, 0.0f, 0.0f },
+};
+Vec3f D_801C0D24[PLAYER_FORM_MAX] = {
+ { 200.0f, 300.0f, 0.0f }, { 200.0f, 200.0f, 0.0f }, { 200.0f, 300.0f, 0.0f },
+ { 200.0f, 150.0f, 0.0f }, { 200.0f, 200.0f, 0.0f },
+};
+Vec3f D_801C0D60 = { 398.0f, 1419.0f, 244.0f };
+Vec3f D_801C0D6C = { 420.0f, 1210.0f, 380.0f };
+
+f32 D_801C0D78[] = {
+ 0.0f, // Player is not holding a melee weapon
+ 3000.0f, // PLAYER_AP_SWORD_KOKIRI
+ 3000.0f, // PLAYER_AP_SWORD_RAZOR
+ 4000.0f, // PLAYER_AP_SWORD_GILDED
+ 5500.0f, // PLAYER_AP_SWORD_GREAT_FAIRY
+ -1.0f, // PLAYER_AP_STICK
+ 2500.0f, // PLAYER_AP_ZORA_FINS
+};
+
+Gfx* D_801C0D94 = object_link_child_DL_017818;
+
+f32 D_801C0D98 = -35.0f;
+
+f32 D_801C0D9C = -395.0f;
+f32 D_801C0DA0 = 0.0f;
+
+f32 D_801C0DA4 = 0.0f;
+
+Vec3f D_801C0DA8[4] = {
+ { -4500.0f, -3000.0f, -600.0f },
+ { 1500.0f, -3000.0f, -600.0f },
+ { -4500.0f, 3000.0f, -600.0f },
+ { 1500.0f, 3000.0f, -600.0f },
+};
+
+Vec3f D_801C0DD8 = { 50.0f, 800.0f, 0.0f };
+Vec3f D_801C0DE4 = { 50.0f, 850.0f, 0.0f };
+Gfx* D_801C0DF0[] = {
+ object_link_goron_DL_010590, object_link_goron_DL_010368, object_link_goron_DL_010140,
+ object_link_goron_DL_00FF18, object_link_goron_DL_00FCF0,
+};
+
+Vec2f D_801C0E04[PLAYER_FORM_MAX] = {
+ { 140.0f, -130.0f }, { 0.0f, -200.0f }, { -160.0f, 0.0f }, { 220.0f, -200.0f }, { 0.0f, 0.0f },
+};
+
+Gfx* D_801C0E2C[] = {
+ object_link_nuts_DL_007A28, object_link_nuts_DL_0077D0, object_link_nuts_DL_007548,
+ object_link_nuts_DL_007900, object_link_nuts_DL_0076A0,
+};
+Vec3f D_801C0E40[PLAYER_FORM_MAX] = {
+ { 0.0f, 0.0f, 0.0f }, { -578.3f, -1100.9f, 0.0f }, { -189.5f, -594.87f, 0.0f },
+ { -570.0f, -812.0f, 0.0f }, { -230.0f, -520.0f, 0.0f },
+};
+Vec3f D_801C0E7C = { 1100.0f, -700.0f, 0.0f };
+
+// unused
+Vec3f D_801C0E88 = { 1600.0f, -1700.0f, -70.0f };
+
+Vec3f D_801C0E94 = { 1800.0f, -300.0f, 0.0f };
+Vec3f D_801C0EA0 = { 1300.0f, -400.0f, 0.0f };
+Vec3f D_801C0EAC = { 630.0f, 100.0f, -30.0f };
+Vec3s D_801C0EB8 = { 0, 0, 0x7FFF };
+
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/Player_DrawBunnyHood.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80127B64.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80127BE8.s")
+void func_80127DA4(PlayState* play, struct_801F58B0 arg1[], struct_80128388_arg1 arg2[], s32 arg3, Vec3f* arg4,
+ Vec3f* arg5, u32* arg6);
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80127DA4.s")
+void func_80128388(struct_801F58B0 arg0[], struct_80128388_arg1 arg1[], s32 arg2, Mtx** arg3);
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80128388.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_801284A0.s")
+void Player_DrawGreatFairysMask(PlayState* play, Player* player) {
+ s32 pad;
+ Mtx* sp90 = GRAPH_ALLOC(play->state.gfxCtx, 6 * sizeof(Mtx));
+ Vec3f sp84;
+ Vec3f sp78;
+ Vec3f* iter = D_801C0C0C;
+ Vec3f* iter2 = D_801C0C30;
+ u32 sp6C = play->gameplayFrames;
+ s32 i;
+
+ OPEN_DISPS(play->state.gfxCtx);
+
+ gSPSegment(POLY_OPA_DISP++, 0x0B, sp90);
+
+ Matrix_MultVec3f(&D_801C0C00, &D_801C0C54[1].unk_08);
+ Math_Vec3f_Lerp(&player->bodyPartsPos[7], &player->bodyPartsPos[0], 0.2f, &D_801C0C54[2].unk_08);
+
+ for (i = 0; i < ARRAY_COUNT(D_801C0C0C); i++) {
+ Matrix_MultVec3f(iter, &sp84);
+ Matrix_MultVec3f(iter2, &sp78);
+
+ func_80127DA4(play, D_801F58B0[i], D_801C0C54, 3, &sp84, &sp78, &sp6C);
+ sp6C += 11;
+
+ Matrix_Push();
+ Matrix_Translate(iter->x, iter->y, iter->z, MTXMODE_APPLY);
+ func_80128388(D_801F58B0[i], D_801C0C54, 3, &sp90);
+ Matrix_Pop();
+ iter++;
+ iter2++;
+ }
+
+ CLOSE_DISPS(play->state.gfxCtx);
+}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80128640.s")
diff --git a/src/code/z_shrink_window.c b/src/code/z_shrink_window.c
index acbdb5c5b..21d8bde40 100644
--- a/src/code/z_shrink_window.c
+++ b/src/code/z_shrink_window.c
@@ -2,7 +2,7 @@
* File: z_shrink_window.c
* Description: Draws black top/bottom/side borders on the viewing window (e.g. Z-targeting, talking to NPC)
*/
-#include "prevent_bss_reordering.h"
+
#include "global.h"
#include "z64shrink_window.h"
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 8325427ad..8d0b2e2d8 100644
--- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c
+++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c
@@ -107,9 +107,10 @@ void ArmsHook_DetachHookFromActor(ArmsHook* this) {
s32 ArmsHook_CheckForCancel(ArmsHook* this) {
Player* player = (Player*)this->actor.parent;
+
if (Player_IsHoldingHookshot(player)) {
- if ((player->heldItemActionParam != player->itemActionParam) || ((player->actor.flags & ACTOR_FLAG_100)) ||
- ((player->stateFlags1 & 0x4000080))) {
+ if ((player->heldItemActionParam != player->itemActionParam) || (player->actor.flags & ACTOR_FLAG_100) ||
+ (player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_4000000))) {
this->timer = 0;
ArmsHook_DetachHookFromActor(this);
Math_Vec3f_Copy(&this->actor.world.pos, &player->rightHandWorld.pos);
@@ -143,7 +144,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
if ((touchedActor->update != NULL) && (touchedActor->flags & (ACTOR_FLAG_200 | ACTOR_FLAG_400))) {
if (this->collider.info.atHitInfo->bumperFlags & BUMP_HOOKABLE) {
ArmsHook_AttachHookToActor(this, touchedActor);
- if ((touchedActor->flags & ACTOR_FLAG_400) == ACTOR_FLAG_400) {
+ if (CHECK_FLAG_ALL(touchedActor->flags, ACTOR_FLAG_400)) {
func_808C1154(this);
}
}
@@ -155,28 +156,25 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
}
if (DECR(this->timer) == 0) {
- Actor* grabbed;
+ Actor* grabbed = this->grabbed;
Vec3f bodyDistDiffVec;
Vec3f newPos;
f32 bodyDistDiff;
f32 phi_f16;
s32 pad;
- grabbed = this->grabbed;
if (grabbed != NULL) {
if ((grabbed->update == NULL) || !CHECK_FLAG_ALL(grabbed->flags, ACTOR_FLAG_2000)) {
grabbed = NULL;
this->grabbed = NULL;
- } else {
- if (this->actor.child != NULL) {
- f32 sp94 = Actor_DistanceBetweenActors(&this->actor, grabbed);
- f32 sp90 = sqrtf(SQXYZ(this->unk1FC));
-
- Math_Vec3f_Diff(&grabbed->world.pos, &this->unk1FC, &this->actor.world.pos);
- if (50.0f < (sp94 - sp90)) {
- ArmsHook_DetachHookFromActor(this);
- grabbed = NULL;
- }
+ } else if (this->actor.child != NULL) {
+ f32 sp94 = Actor_DistanceBetweenActors(&this->actor, grabbed);
+ f32 sp90 = sqrtf(SQXYZ(this->unk1FC));
+
+ Math_Vec3f_Diff(&grabbed->world.pos, &this->unk1FC, &this->actor.world.pos);
+ if (50.0f < (sp94 - sp90)) {
+ ArmsHook_DetachHookFromActor(this);
+ grabbed = NULL;
}
}
}
@@ -257,11 +255,10 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
this->actor.world.pos.z += 10.0f * nz;
this->timer = 1;
if (SurfaceType_IsHookshotSurface(&play->colCtx, poly, bgId)) {
- {
- DynaPolyActor* dynaPolyActor;
- if (bgId != BGCHECK_SCENE && (dynaPolyActor = DynaPoly_GetActor(&play->colCtx, bgId)) != NULL) {
- ArmsHook_AttachHookToActor(this, &dynaPolyActor->actor);
- }
+ DynaPolyActor* dynaPolyActor;
+
+ if ((bgId != BGCHECK_SCENE) && (dynaPolyActor = DynaPoly_GetActor(&play->colCtx, bgId)) != NULL) {
+ ArmsHook_AttachHookToActor(this, &dynaPolyActor->actor);
}
func_808C1154(this);
Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_IT_HOOKSHOT_STICK_OBJ);
@@ -269,12 +266,11 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
CollisionCheck_SpawnShieldParticlesMetal(play, &this->actor.world.pos);
Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_IT_HOOKSHOT_REFLECT);
}
- } else {
- if (CHECK_BTN_ANY(CONTROLLER1(&play->state)->press.button,
- BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) {
- s32 pad;
- this->timer = 1;
- }
+ } else if (CHECK_BTN_ANY(CONTROLLER1(&play->state)->press.button,
+ BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) {
+ s32 pad;
+
+ this->timer = 1;
}
}
}
@@ -286,19 +282,19 @@ void ArmsHook_Update(Actor* thisx, PlayState* play) {
this->unk1EC = this->unk1E0;
}
-static Vec3f D_808C1C10 = { 0.0f, 0.0f, 0.0f };
-static Vec3f D_808C1C1C = { 0.0f, 0.0f, 900.0f };
-static Vec3f D_808C1C28 = { 0.0f, 500.0f, -3000.0f };
-static Vec3f D_808C1C34 = { 0.0f, -500.0f, -3000.0f };
-static Vec3f D_808C1C40 = { 0.0f, 500.0f, 0.0f };
-static Vec3f D_808C1C4C = { 0.0f, -500.0f, 0.0f };
+Vec3f D_808C1C10 = { 0.0f, 0.0f, 0.0f };
+Vec3f D_808C1C1C = { 0.0f, 0.0f, 900.0f };
+Vec3f D_808C1C28 = { 0.0f, 500.0f, -3000.0f };
+Vec3f D_808C1C34 = { 0.0f, -500.0f, -3000.0f };
+Vec3f D_808C1C40 = { 0.0f, 500.0f, 0.0f };
+Vec3f D_808C1C4C = { 0.0f, -500.0f, 0.0f };
void ArmsHook_Draw(Actor* thisx, PlayState* play) {
ArmsHook* this = THIS;
f32 f0;
Player* player = GET_PLAYER(play);
- if (player->actor.draw != NULL && player->rightHandType == 0xB) {
+ if ((player->actor.draw != NULL) && (player->rightHandType == PLAYER_MODELTYPE_RH_HOOKSHOT)) {
Vec3f sp68;
Vec3f sp5C;
Vec3f sp50;
@@ -311,13 +307,13 @@ void ArmsHook_Draw(Actor* thisx, PlayState* play) {
Matrix_MultVec3f(&D_808C1C10, &this->unk1E0);
Matrix_MultVec3f(&D_808C1C28, &sp5C);
Matrix_MultVec3f(&D_808C1C34, &sp50);
- this->unk_1C4.active = false;
+ this->weaponInfo.active = false;
} else {
Matrix_MultVec3f(&D_808C1C1C, &this->unk1E0);
Matrix_MultVec3f(&D_808C1C40, &sp5C);
Matrix_MultVec3f(&D_808C1C4C, &sp50);
}
- func_80126440(play, &this->collider, &this->unk_1C4, &sp5C, &sp50);
+ func_80126440(play, &this->collider, &this->weaponInfo, &sp5C, &sp50);
func_8012C28C(play->state.gfxCtx);
func_80122868(play, player);
diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h
index 7afe3a2ce..95208ba4f 100644
--- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h
+++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h
@@ -10,7 +10,7 @@ typedef void (*ArmsHookActionFunc)(struct ArmsHook*, PlayState*);
typedef struct ArmsHook {
/* 0x000 */ Actor actor;
/* 0x144 */ ColliderQuad collider;
- /* 0x1C4 */ WeaponInfo unk_1C4;
+ /* 0x1C4 */ WeaponInfo weaponInfo;
/* 0x1E0 */ Vec3f unk1E0;
/* 0x1EC */ Vec3f unk1EC;
/* 0x1F8 */ Actor* grabbed;
diff --git a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c
index 6026e139b..203b404a8 100644
--- a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c
+++ b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c
@@ -390,7 +390,7 @@ void func_80A2A32C(BgDblueMovebg* this, PlayState* play) {
this->unk_172 |= 8;
this->actionFunc = func_80A2A444;
} else {
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
}
}
@@ -410,7 +410,7 @@ void func_80A2A444(BgDblueMovebg* this, PlayState* play) {
this->dyna.actor.shape.rot.y =
(s32)((this->unk_18C + temp_v0) * 0.1f * (0x10000 / 360.0f)) + this->dyna.actor.home.rot.y;
- if ((player->stateFlags2 & 0x10) && (this->unk_184 > 0.0f)) {
+ if ((player->stateFlags2 & PLAYER_STATE2_10) && (this->unk_184 > 0.0f)) {
player->actor.world.pos.x =
(Math_SinS(this->dyna.actor.shape.rot.y - this->unk_18E) * this->unk_184) + this->dyna.actor.home.pos.x;
player->actor.world.pos.z =
@@ -420,7 +420,7 @@ void func_80A2A444(BgDblueMovebg* this, PlayState* play) {
}
if (sp20) {
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
Flags_SetSwitch(play, this->unk_1C0);
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
@@ -498,7 +498,7 @@ void func_80A2A7F8(BgDblueMovebg* this, PlayState* play) {
this->dyna.actor.shape.rot.y =
(s32)((this->unk_18C + sp26) * 0.1f * (0x10000 / 360.0f)) + this->dyna.actor.home.rot.y;
- if ((player->stateFlags2 & 0x10) && (this->unk_184 > 0.0f)) {
+ if ((player->stateFlags2 & PLAYER_STATE2_10) && (this->unk_184 > 0.0f)) {
player->actor.world.pos.x =
(Math_SinS(this->dyna.actor.shape.rot.y - this->unk_18E) * this->unk_184) + this->dyna.actor.home.pos.x;
player->actor.world.pos.z =
@@ -516,8 +516,8 @@ void func_80A2A7F8(BgDblueMovebg* this, PlayState* play) {
Flags_UnsetSwitch(play, this->unk_1C0);
}
- player->stateFlags1 |= 0x20;
- player->stateFlags2 &= ~0x10;
+ player->stateFlags1 |= PLAYER_STATE1_20;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
this->unk_18C = (this->unk_18C + sp26 + 3600) % 3600;
@@ -565,12 +565,12 @@ void func_80A2AAB8(BgDblueMovebg* this, PlayState* play) {
if (this->unk_1D0 == 1) {
this->dyna.pushForce = 0.0f;
- player->stateFlags1 |= 0x20;
- player->stateFlags2 &= ~0x10;
+ player->stateFlags1 |= PLAYER_STATE1_20;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
}
if (this->unk_1D0 <= 0) {
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
this->actionFunc = func_80A2A714;
}
}
diff --git a/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c b/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c
index 0a4c31d12..689dcd76c 100644
--- a/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c
+++ b/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c
@@ -240,7 +240,7 @@ void func_80B7F0D0(BgIkanaBlock* this, PlayState* play) {
if ((sp24 != 2) && (this->unk_17A & (0x8 | 0x4 | 0x2 | 0x1))) {
Player* player = GET_PLAYER(play);
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
}
@@ -297,7 +297,7 @@ void func_80B7F290(BgIkanaBlock* this, PlayState* play) {
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
}
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
if (func_80B7EDC4(this, play)) {
diff --git a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c
index 017f9ef04..61e022b62 100644
--- a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c
+++ b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c
@@ -226,7 +226,8 @@ void BgIkninSusceil_Update(Actor* thisx, PlayState* play) {
BgIkninSusceil* this = THIS;
Player* player = GET_PLAYER(play);
- if ((this->unk168 == 0) && (this->unk166 > 0) && (player->stateFlags3 & 0x100) && (player->unk_B48 > 1000.0f)) {
+ if ((this->unk168 == 0) && (this->unk166 > 0) && (player->stateFlags3 & PLAYER_STATE3_100) &&
+ (player->unk_B48 > 1000.0f)) {
this->unk168 = 2;
if ((func_80C0A95C(this, play) != 0) && (this->actionFunc != func_80C0AE5C)) {
func_800B8E58(player, NA_SE_PL_BODY_HIT);
@@ -242,7 +243,7 @@ void BgIkninSusceil_Update(Actor* thisx, PlayState* play) {
if ((this->dyna.actor.home.pos.y + 70.0f) < this->dyna.actor.world.pos.y) {
this->unk166 = 0;
- } else if (player->stateFlags3 & 0x100) {
+ } else if (player->stateFlags3 & PLAYER_STATE3_100) {
this->unk166 = 3;
} else {
if (this->unk166 > 0) {
diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c
index 43b7f27aa..cdbd18e7f 100644
--- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c
+++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c
@@ -215,11 +215,11 @@ void func_80953F9C(BgIngate* this, PlayState* play) {
if (ActorCutscene_GetCurrentIndex() != this->unk16E) {
if (ActorCutscene_GetCurrentIndex() != -1) {
Camera_ChangeSetting(mainCam, CAM_SET_NORMAL0);
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
play->actorCtx.flags &= ~ACTORCTX_FLAG_2;
} else {
Camera_ChangeSetting(mainCam, CAM_SET_BOAT_CRUISE);
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
}
}
this->unk16E = ActorCutscene_GetCurrentIndex();
diff --git a/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c b/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c
index 8080c4444..dde66e620 100644
--- a/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c
+++ b/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c
@@ -260,7 +260,7 @@ void func_80B700C0(BgKin2Shelf* this, PlayState* play) {
} else {
Player* player = GET_PLAYER(play);
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
}
} else {
@@ -292,7 +292,7 @@ void func_80B70230(BgKin2Shelf* this, PlayState* play) {
Player* player = GET_PLAYER(play);
this->unk_160 = 1.0f;
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
if (this->unk_164 & 8) {
@@ -339,7 +339,7 @@ void func_80B704B4(BgKin2Shelf* this, PlayState* play) {
Player* player = GET_PLAYER(play);
this->unk_160 = 1.0f;
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
if (this->unk_164 & 4) {
diff --git a/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c b/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c
index 1fca8ea9c..2a7096de9 100644
--- a/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c
+++ b/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c
@@ -311,7 +311,7 @@ void func_809CE4C8(BgSpdweb* this, PlayState* play) {
this->unk_164 = temp_f12;
this->unk_162 = 12;
if (sp3A > 50) {
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
this->unk_161 = 1;
}
} else if (player->actor.speedXZ != 0.0f) {
@@ -332,7 +332,7 @@ void func_809CE4C8(BgSpdweb* this, PlayState* play) {
player->actor.velocity.y = this->unk_164 * 0.7f;
player->unk_B68 = (SQ(this->unk_164) * 0.15f) + this->dyna.actor.world.pos.y;
this->unk_161 = 0;
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
}
} else if (this->unk_162 == 11) {
if (this->unk_164 > 3.0f) {
diff --git a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c
index 55276b217..b2b180701 100644
--- a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c
+++ b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c
@@ -67,7 +67,8 @@ void BgTobira01_Open(BgTobira01* this, PlayState* play) {
this->timer2 = 180;
}
- if (!(player->stateFlags1 & 0x40) && (gSaveContext.save.weekEventReg[88] & 0x40) && (DECR(this->timer2) == 0)) {
+ if (!(player->stateFlags1 & PLAYER_STATE1_40) && (gSaveContext.save.weekEventReg[88] & 0x40) &&
+ (DECR(this->timer2) == 0)) {
gSaveContext.save.weekEventReg[88] &= (u8)~0x40;
}
}
diff --git a/src/overlays/actors/ovl_Boss_02/z_boss_02.c b/src/overlays/actors/ovl_Boss_02/z_boss_02.c
index 28008a674..1e2db7a60 100644
--- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c
+++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c
@@ -1632,7 +1632,7 @@ void func_809DD934(Boss02* this, PlayState* play) {
switch (this->unk_1D18) {
case 0:
- if (player->stateFlags1 & 0x100) {
+ if (player->stateFlags1 & PLAYER_STATE1_100) {
Cutscene_Start(play, &play->csCtx);
this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT);
@@ -1755,7 +1755,7 @@ void func_809DD934(Boss02* this, PlayState* play) {
this->subCamId = SUB_CAM_ID_DONE;
Cutscene_End(play, &play->csCtx);
this->actor.flags |= ACTOR_FLAG_1;
- player->stateFlags1 &= ~0x100;
+ player->stateFlags1 &= ~PLAYER_STATE1_100;
this->unk_1D70 = 0.01f;
func_80165690();
break;
diff --git a/src/overlays/actors/ovl_Boss_04/z_boss_04.c b/src/overlays/actors/ovl_Boss_04/z_boss_04.c
index 1179d8eca..d5098b78b 100644
--- a/src/overlays/actors/ovl_Boss_04/z_boss_04.c
+++ b/src/overlays/actors/ovl_Boss_04/z_boss_04.c
@@ -252,7 +252,7 @@ void func_809EC568(Boss04* this, PlayState* play) {
case 0:
this->unk_2C8 = 50;
this->unk_2D0 = 2000.0f;
- if ((player->stateFlags1 & 0x100000) && (this->actor.projectedPos.z > 0.0f) &&
+ if ((player->stateFlags1 & PLAYER_STATE1_100000) && (this->actor.projectedPos.z > 0.0f) &&
(fabsf(this->actor.projectedPos.x) < 300.0f) && (fabsf(this->actor.projectedPos.y) < 300.0f)) {
if ((this->unk_704 >= 15) && (ActorCutscene_GetCurrentIndex() == -1)) {
Actor* boss;
diff --git a/src/overlays/actors/ovl_Boss_06/z_boss_06.c b/src/overlays/actors/ovl_Boss_06/z_boss_06.c
index f693ffdea..cd3c57f9d 100644
--- a/src/overlays/actors/ovl_Boss_06/z_boss_06.c
+++ b/src/overlays/actors/ovl_Boss_06/z_boss_06.c
@@ -4,7 +4,6 @@
* Description: Igos du Ikana window - curtains and ray effects
*/
-#include "prevent_bss_reordering.h"
#include "z_boss_06.h"
#include "z64shrink_window.h"
#include "overlays/actors/ovl_En_Knight/z_en_knight.h"
@@ -29,11 +28,11 @@ void func_809F2E34(Boss06* this, PlayState* play);
void func_809F2ED0(Boss06* this, PlayState* play);
void func_809F2EE8(Boss06* this, PlayState* play);
-static Vec3f D_809F4370[128];
-static EnKnight* D_809F4970;
-static s32 D_809F4974;
-static s32 D_809F4978;
-static s32 D_809F497C;
+Vec3f D_809F4370[128];
+EnKnight* D_809F4970;
+s32 D_809F4974;
+s32 D_809F4978;
+s32 D_809F497C;
static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(0, 0xF),
@@ -102,7 +101,7 @@ static ColliderCylinderInit sCylinderInit = {
{ 90, 140, 10, { 0, 0, 0 } },
};
-static Vec3f D_809F40EC[] = {
+Vec3f D_809F40EC[] = {
{ 1081.0f, 235.0f, 3224.0f },
{ 676.0f, 235.0f, 3224.0f },
};
diff --git a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c
index 9f4c7cf1c..75dbacc54 100644
--- a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c
+++ b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c
@@ -164,7 +164,7 @@ void func_80AA8698(DmChar01* this, PlayState* play) {
return;
}
- if ((player->stateFlags2 & 0x8000000) && (player2->actor.world.pos.x > -40.0f) &&
+ if ((player->stateFlags2 & PLAYER_STATE2_8000000) && (player2->actor.world.pos.x > -40.0f) &&
(player2->actor.world.pos.x < 40.0f) && (player2->actor.world.pos.z > 1000.0f) &&
(player2->actor.world.pos.z < 1078.0f)) {
if (!D_80AAAAB4) {
diff --git a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c
index 24b9ae857..4fa6acb23 100644
--- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c
+++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c
@@ -1272,7 +1272,7 @@ void DmStk_ClockTower_DeflectHit(DmStk* this, PlayState* play) {
this->deflectCount++;
if (this->deflectCount >= 3) {
this->deflectCount = 0;
- if (!(player->stateFlags2 & 0x8000000)) {
+ if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) {
// That won't do you any good
Message_StartTextbox(play, 0x2013, &this->actor);
}
@@ -1720,7 +1720,7 @@ void DmStk_ClockTower_IdleWithOcarina(DmStk* this, PlayState* play) {
this->tatlMessageTimer++;
if (this->tatlMessageTimer > 800) {
this->tatlMessageTimer = 0;
- if (!(player->stateFlags2 & 0x8000000)) {
+ if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) {
// Why are you just standing around?
Message_StartTextbox(play, 0x2014, &this->actor);
}
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 173c3ea52..92f99462c 100644
--- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c
+++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c
@@ -131,7 +131,8 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) {
if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f)) {
if ((this->actor.targetMode != 0) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
- (play->transitionMode == TRANS_MODE_OFF) && (player->stateFlags1 & 0x80000000) && (player->unk_AE7 == 0)) {
+ (play->transitionMode == TRANS_MODE_OFF) && (player->stateFlags1 & PLAYER_STATE1_80000000) &&
+ (player->unk_AE7 == 0)) {
if (grottoType == DOORANA_TYPE_VISIBLE_SCENE_EXIT) {
s32 exitIndex = DOORANA_GET_EXIT_INDEX(&this->actor);
@@ -157,10 +158,10 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) {
DoorAna_SetupAction(this, DoorAna_GrabLink);
- } else if (!Play_InCsMode(play) && !(player->stateFlags1 & 0x08800000) &&
+ } else if (!Play_InCsMode(play) && !(player->stateFlags1 & (PLAYER_STATE1_8000000 | PLAYER_STATE1_800000)) &&
(this->actor.xzDistToPlayer <= 20.0f) && (this->actor.playerHeightRel >= -50.0f) &&
(this->actor.playerHeightRel <= 15.0f)) {
- player->stateFlags1 |= 0x80000000;
+ player->stateFlags1 |= PLAYER_STATE1_80000000;
this->actor.targetMode = 1;
} else {
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 6812db67a..34247cd7f 100644
--- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c
+++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c
@@ -566,7 +566,7 @@ void func_808A1884(DoorShutter* this, PlayState* play) {
this->unk_15C = 0;
this->actor.velocity.y = 0.0f;
- if (DoorShutter_SetupDoor(this, play) && !(player->stateFlags1 & 0x800)) {
+ if (DoorShutter_SetupDoor(this, play) && !(player->stateFlags1 & PLAYER_STATE1_800)) {
DoorShutter_SetupAction(this, func_808A1C50);
if (ActorCutscene_GetCurrentIndex() == 0x7D) {
func_801226E0(play, ((void)0, gSaveContext.respawn[RESPAWN_MODE_DOWN].data));
@@ -633,7 +633,8 @@ void DoorShutter_Update(Actor* thisx, PlayState* play) {
DoorShutter* this = THIS;
Player* player = GET_PLAYER(play);
- if (!(player->stateFlags1 & 0x100004C0) || (this->actionFunc == DoorShutter_SetupType)) {
+ if (!(player->stateFlags1 & (PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_400 | PLAYER_STATE1_10000000)) ||
+ (this->actionFunc == DoorShutter_SetupType)) {
this->actionFunc(this, play);
if (this->unk_163 == 7) {
diff --git a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c
index 0d13c89c6..e80fc9908 100644
--- a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c
+++ b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c
@@ -290,7 +290,7 @@ void DoorSpiral_Wait(DoorSpiral* this, PlayState* play) {
void DoorSpiral_PlayerClimb(DoorSpiral* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- if (!(player->stateFlags1 & 0x20000000)) {
+ if (!(player->stateFlags1 & PLAYER_STATE1_20000000)) {
DoorSpiral_SetupAction(this, DoorSpiral_WaitForObject);
this->shouldClimb = 0;
}
@@ -301,7 +301,8 @@ void DoorSpiral_Update(Actor* thisx, PlayState* play) {
s32 pad;
Player* player = GET_PLAYER(play);
- if ((!(player->stateFlags1 & 0x100004C0)) || (this->actionFunc == DoorSpiral_WaitForObject)) {
+ if (!(player->stateFlags1 & (PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_400 | PLAYER_STATE1_10000000)) ||
+ (this->actionFunc == DoorSpiral_WaitForObject)) {
this->actionFunc(this, play);
}
}
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 3bf039360..3004930d7 100644
--- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c
+++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c
@@ -171,7 +171,7 @@ void func_80919230(EffDust* this, PlayState* play) {
s32 i;
s32 j;
- if (parent == NULL || parent->update == NULL || !(player->stateFlags1 & 0x1000)) {
+ if (parent == NULL || parent->update == NULL || !(player->stateFlags1 & PLAYER_STATE1_1000)) {
if (this->life != 0) {
this->life--;
} else {
diff --git a/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c b/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c
index 2de3d8604..9af256450 100644
--- a/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c
+++ b/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c
@@ -4,6 +4,7 @@
* Description: Wave Created by Turtle Awakening
*/
+#include "prevent_bss_reordering.h"
#include "z_eff_kamejima_wave.h"
#include "objects/object_kamejima/object_kamejima.h"
diff --git a/src/overlays/actors/ovl_En_Ah/z_en_ah.c b/src/overlays/actors/ovl_En_Ah/z_en_ah.c
index 72bdb7a7c..7d992caa6 100644
--- a/src/overlays/actors/ovl_En_Ah/z_en_ah.c
+++ b/src/overlays/actors/ovl_En_Ah/z_en_ah.c
@@ -307,7 +307,7 @@ s32 func_80BD3198(EnAh* this, PlayState* play) {
Player* player = GET_PLAYER(play);
u16 temp = play->msgCtx.currentTextId;
- if (player->stateFlags1 & 0x40) {
+ if (player->stateFlags1 & PLAYER_STATE1_40) {
if (this->unk_2DA != temp) {
if (temp == 0x2954) {
this->unk_18C = func_80BD3118;
diff --git a/src/overlays/actors/ovl_En_Al/z_en_al.c b/src/overlays/actors/ovl_En_Al/z_en_al.c
index 8792f8038..efad50317 100644
--- a/src/overlays/actors/ovl_En_Al/z_en_al.c
+++ b/src/overlays/actors/ovl_En_Al/z_en_al.c
@@ -575,7 +575,7 @@ s32 func_80BDF064(EnAl* this, PlayState* play) {
Actor* sp1C = func_80BDE1A0(this, play, 4, 0xA4);
Actor* temp_v0 = func_80BDE1A0(this, play, 4, 0x234);
- if (player->stateFlags1 & 0x40) {
+ if (player->stateFlags1 & PLAYER_STATE1_40) {
this->unk_4C2 |= 0x400;
if (this->unk_4C4 != sp22) {
switch (sp22) {
diff --git a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c
index 575cf2d35..6024689c7 100644
--- a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c
+++ b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c
@@ -489,7 +489,7 @@ void func_809C1EC8(EnAob01* this, PlayState* play) {
func_809C10B0(this, 3);
SubS_FillLimbRotTables(play, this->unk_2F8, this->unk_318, ARRAY_COUNT(this->unk_2F8));
func_809C165C(this, play);
- if (player->stateFlags1 & 0x20) {
+ if (player->stateFlags1 & PLAYER_STATE1_20) {
func_809C1124();
}
}
@@ -876,7 +876,7 @@ void func_809C2F34(EnAob01* this, PlayState* play) {
player->actor.world.pos.z = 1464.0f;
player->actor.shape.rot.y = player->actor.world.rot.y;
player->actor.draw = NULL;
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
this->actor.world.pos.x = -4308.0f;
this->actor.world.pos.z = 1620.0f;
this->actor.prevPos = this->actor.world.pos;
diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c
index f2fe54dae..4232e19ae 100644
--- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c
+++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c
@@ -381,7 +381,7 @@ void EnBigokuta_PlayDeathCutscene(EnBigokuta* this, PlayState* play) {
func_800B724C(play, &this->picto.actor, 7);
} else {
player = GET_PLAYER(play);
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
}
if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
@@ -458,7 +458,7 @@ void EnBigokuta_PlayDeathEffects(EnBigokuta* this, PlayState* play) {
} else {
Player* player = GET_PLAYER(play);
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
}
}
diff --git a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c
index 1cac3caff..ef508ac48 100644
--- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c
+++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c
@@ -728,7 +728,7 @@ void EnBigslime_SetMinislimeBreakLocation(EnBigslime* this) {
void EnBigslime_SetPlayerParams(EnBigslime* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- if (player->stateFlags2 & 0x80) {
+ if (player->stateFlags2 & PLAYER_STATE2_80) {
player->actor.parent = NULL;
player->unk_AE8 = 100;
func_800B8D98(play, &this->actor, 10.0f, this->actor.world.rot.y, 10.0f);
@@ -1709,7 +1709,7 @@ void EnBigslime_WindupThrowPlayer(EnBigslime* this, PlayState* play) {
scale = 0.5f - cos_rad(-this->windupPunchTimer * (M_PI / 5)) * 0.5f;
if (this->windupPunchTimer == -5) {
- if (player->stateFlags2 & 0x80) {
+ if (player->stateFlags2 & PLAYER_STATE2_80) {
player->actor.parent = NULL;
player->unk_AE8 = 100;
}
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 ea02e9fe7..9eba18afc 100644
--- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c
+++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c
@@ -433,7 +433,7 @@ void EnBom_Update(Actor* thisx, PlayState* play) {
s32 pad;
Player* player = GET_PLAYER(play);
- if (player->stateFlags1 & 2) {
+ if (player->stateFlags1 & PLAYER_STATE1_2) {
return;
}
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 c9c7e623b..4f17e74c8 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 func_808AEAE0(EnBombf* this, PlayState* play) {
player->heldActor = NULL;
player->interactRangeActor = NULL;
this->actor.parent = NULL;
- player->stateFlags1 &= ~0x800;
+ player->stateFlags1 &= ~PLAYER_STATE1_800;
}
} else if ((this->colliderCylinder.base.acFlags & AC_HIT) &&
((this->colliderCylinder.info.acHitInfo->toucher.dmgFlags & 0x13828) ||
@@ -200,7 +200,7 @@ void func_808AEAE0(EnBombf* this, PlayState* play) {
player->heldActor = NULL;
player->interactRangeActor = NULL;
this->actor.parent = NULL;
- player->stateFlags1 &= ~0x800;
+ player->stateFlags1 &= ~PLAYER_STATE1_800;
this->actor.world.pos = this->actor.home.pos;
}
}
@@ -217,7 +217,7 @@ void func_808AEAE0(EnBombf* this, PlayState* play) {
player->heldActor = NULL;
player->interactRangeActor = NULL;
this->actor.parent = NULL;
- player->stateFlags1 &= ~0x800;
+ player->stateFlags1 &= ~PLAYER_STATE1_800;
this->actor.world.pos = this->actor.home.pos;
}
}
@@ -299,11 +299,11 @@ void func_808AEFD4(EnBombf* this, PlayState* play) {
if (this->timer == 0) {
Player* player = GET_PLAYER(play);
- if ((player->stateFlags1 & 0x800) && (&this->actor == player->heldActor)) {
+ if ((player->stateFlags1 & PLAYER_STATE1_800) && (&this->actor == player->heldActor)) {
player->actor.child = NULL;
player->heldActor = NULL;
player->interactRangeActor = NULL;
- player->stateFlags1 &= ~0x800;
+ player->stateFlags1 &= ~PLAYER_STATE1_800;
}
Actor_Kill(&this->actor);
}
diff --git a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c
index b55762e7d..b23c93cd0 100644
--- a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c
+++ b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c
@@ -471,7 +471,7 @@ void func_80BFF03C(EnBomjima* this, PlayState* play) {
} else if (!ActorCutscene_GetCanPlayNext(this->cutscenes[0])) {
ActorCutscene_SetIntentToPlay(this->cutscenes[0]);
} else {
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
gSaveContext.save.weekEventReg[83] &= (u8)~4;
this->actor.world.rot.y = Camera_GetCamDirYaw(GET_ACTIVE_CAM(play));
this->unk_2DC = Camera_GetCamDirYaw(GET_ACTIVE_CAM(play));
@@ -935,8 +935,8 @@ void func_80C00284(EnBomjima* this, PlayState* play) {
if ((this->action == EN_BOMJIMA_ACTION_4) || (this->unk_2CA == 1) ||
((this->unk_2CA == 3) && (this->unk_2C8 >= 2))) {
this->unk_28E = 0;
- if (player->stateFlags1 & 0x20) {
- player->stateFlags1 &= ~0x20;
+ if (player->stateFlags1 & PLAYER_STATE1_20) {
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
}
if ((this->bombal == 0) || (this->bombal->actor.update == NULL) ||
diff --git a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c
index f1f85077b..4258b2397 100644
--- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c
+++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c
@@ -333,7 +333,7 @@ void func_80C014E4(EnBomjimb* this, PlayState* play) {
break;
}
- if (player->stateFlags3 != 0x1000000) {
+ if (player->stateFlags3 != PLAYER_STATE3_1000000) {
phi_f0 = 200.0f;
abs = ABS_ALT(BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.world.rot.y));
@@ -538,7 +538,7 @@ void func_80C0217C(EnBomjimb* this, PlayState* play) {
return;
}
- if (player->stateFlags3 == 0x1000000) {
+ if (player->stateFlags3 == PLAYER_STATE3_1000000) {
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 3000, 0);
func_80C01494(this);
return;
@@ -631,7 +631,7 @@ void func_80C02570(EnBomjimb* this, PlayState* play) {
this->unk_2D6 = BINANG_ROT180(this->actor.yawTowardsPlayer);
func_80C0113C(this, 19, 2.0f);
this->actionFunc = func_80C0217C;
- } else if ((player->stateFlags3 == 0x1000000) || (this->actor.xzDistToPlayer > 410.0f)) {
+ } else if ((player->stateFlags3 == PLAYER_STATE3_1000000) || (this->actor.xzDistToPlayer > 410.0f)) {
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 3000, 0);
func_80C01494(this);
}
@@ -666,7 +666,7 @@ void func_80C02740(EnBomjimb* this, PlayState* play) {
if ((player->transformation != PLAYER_FORM_DEKU) && (player->transformation != PLAYER_FORM_HUMAN)) {
func_80C0113C(this, 17, 1.0f);
Message_StartTextbox(play, 0x72E, &this->actor);
- player->stateFlags1 |= 0x10000000;
+ player->stateFlags1 |= PLAYER_STATE1_10000000;
player->actor.freezeTimer = 3;
func_80C012E0(this);
this->unk_2CA = 9;
@@ -678,7 +678,7 @@ void func_80C02740(EnBomjimb* this, PlayState* play) {
((player->transformation == PLAYER_FORM_HUMAN) && !(gSaveContext.save.weekEventReg[85] & 2))) {
func_80C0113C(this, 17, 1.0f);
Message_StartTextbox(play, 0x72E, &this->actor);
- player->stateFlags1 |= 0x10000000;
+ player->stateFlags1 |= PLAYER_STATE1_10000000;
player->actor.freezeTimer = 3;
func_80C012E0(this);
this->unk_2CA = 9;
@@ -726,7 +726,7 @@ void func_80C02740(EnBomjimb* this, PlayState* play) {
if (!Play_InCsMode(play)) {
Player* player = GET_PLAYER(play);
- player->stateFlags1 |= 0x10000000;
+ player->stateFlags1 |= PLAYER_STATE1_10000000;
player->actor.freezeTimer = 3;
}
this->unk_2CA = 8;
@@ -765,7 +765,7 @@ void func_80C02A14(EnBomjimb* this, PlayState* play) {
func_80C02CA4(this, play);
} else {
if (this->unk_2CA == 8) {
- player->stateFlags1 &= ~0x10000000;
+ player->stateFlags1 &= ~PLAYER_STATE1_10000000;
}
func_80C01FD4(this);
}
@@ -781,7 +781,7 @@ void func_80C02BCC(EnBomjimb* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
func_801477B4(play);
this->unk_2C0 = 1;
- player->stateFlags1 &= ~0x10000000;
+ player->stateFlags1 &= ~PLAYER_STATE1_10000000;
}
} else if (this->actor.xzDistToPlayer > 200.0f) {
func_80C01494(this);
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 b760c4435..ee8ea02e0 100644
--- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c
+++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c
@@ -155,10 +155,10 @@ void EnBoom_Destroy(Actor* thisx, PlayState* play) {
temp->child = NULL;
} else {
player->boomerangActor = NULL;
- player->stateFlags1 &= ~0x2000000;
+ player->stateFlags1 &= ~PLAYER_STATE1_2000000;
}
}
- player->stateFlags3 |= 0x800000;
+ player->stateFlags3 |= PLAYER_STATE3_800000;
}
}
@@ -286,7 +286,7 @@ void EnBoom_Update(Actor* thisx, PlayState* play) {
Player* player = GET_PLAYER(play);
Actor* actor;
- if (!(player->stateFlags1 & 0x20000000)) {
+ if (!(player->stateFlags1 & PLAYER_STATE1_20000000)) {
this->actionFunc(this, play);
if (((actor = this->actor.child) != NULL) || ((actor = this->actor.parent) != NULL)) {
diff --git a/src/overlays/actors/ovl_En_Dai/z_en_dai.c b/src/overlays/actors/ovl_En_Dai/z_en_dai.c
index 0404f4ecb..5537d28c2 100644
--- a/src/overlays/actors/ovl_En_Dai/z_en_dai.c
+++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.c
@@ -415,7 +415,7 @@ void func_80B3EEDC(EnDai* this, PlayState* play) {
(play->msgCtx.lastPlayedSong == OCARINA_SONG_GORON_LULLABY)) {
func_80B3E5DC(this, 1);
this->actionFunc = func_80B3EE8C;
- } else if (!(player->stateFlags2 & 0x08000000)) {
+ } else if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) {
func_80B3E96C(this, play);
this->unk_A6C = 0;
} else if (this->unk_A6C == 0) {
@@ -557,7 +557,7 @@ void EnDai_Update(Actor* thisx, PlayState* play) {
func_80B3E460(this);
} else {
this->actionFunc(this, play);
- if (!(player->stateFlags2 & 0x8000000)) {
+ if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) {
SkelAnime_Update(&this->skelAnime);
func_80B3E834(this);
if (!(this->unk_1CE & 0x200)) {
diff --git a/src/overlays/actors/ovl_En_Dg/z_en_dg.c b/src/overlays/actors/ovl_En_Dg/z_en_dg.c
index 7e540c83a..d8bb2b095 100644
--- a/src/overlays/actors/ovl_En_Dg/z_en_dg.c
+++ b/src/overlays/actors/ovl_En_Dg/z_en_dg.c
@@ -547,7 +547,7 @@ s32 EnDg_FindFollowerForBremenMask(PlayState* play) {
void EnDg_CheckForBremenMaskMarch(EnDg* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- if (player->stateFlags3 & 0x20000000) { // bremen mask march
+ if (player->stateFlags3 & PLAYER_STATE3_20000000) {
if (sBremenMaskFollowerIndex == ENDG_INDEX_NO_BREMEN_MASK_FOLLOWER) {
EnDg_FindFollowerForBremenMask(play);
}
@@ -865,7 +865,7 @@ void EnDg_SitNextToPlayer(EnDg* this, PlayState* play) {
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xC00);
this->actor.world.rot.y = this->actor.shape.rot.y;
} else {
- if (player->stateFlags3 & 0x20000000) { // bremen mask march
+ if (player->stateFlags3 & PLAYER_STATE3_20000000) {
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK);
} else {
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
@@ -992,7 +992,7 @@ void EnDg_ApproachPlayer(EnDg* this, PlayState* play) {
if (this->actor.xzDistToPlayer < 40.0f) {
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_SIT_DOWN);
this->actionFunc = EnDg_SitNextToPlayer;
- } else if (player->stateFlags3 & 0x20000000) { // bremen mask march
+ } else if (player->stateFlags3 & PLAYER_STATE3_20000000) {
if ((this->actor.xzDistToPlayer > 40.0f) && (player->linearVelocity == 0.0f)) {
Math_ApproachF(&this->actor.speedXZ, 1.5f, 0.2f, 1.0f);
} else {
@@ -1340,7 +1340,7 @@ void EnDg_Update(Actor* thisx, PlayState* play) {
Vec3f floorRot = { 0.0f, 0.0f, 0.0f };
this->selectedDogIndex = sSelectedRacetrackDogInfo.index;
- if (!(player->stateFlags1 & 0x20) || (play->sceneId != SCENE_CLOCKTOWER)) {
+ if (!(player->stateFlags1 & PLAYER_STATE1_20) || (play->sceneId != SCENE_CLOCKTOWER)) {
if (EnDg_ShouldReactToNonHumanPlayer(this, play)) {
EnDg_ChooseActionForForm(this, play);
} else if (this->behavior != DOG_BEHAVIOR_DEFAULT) {
diff --git a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c
index 3e252c034..90c651241 100644
--- a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c
+++ b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c
@@ -260,7 +260,7 @@ s32 func_80A52B68(EnDnq* this, PlayState* play) {
Player* player = GET_PLAYER(play);
u16 temp = play->msgCtx.currentTextId;
- if ((player->stateFlags1 & 0x40) && (player->targetActor == &this->picto.actor)) {
+ if ((player->stateFlags1 & PLAYER_STATE1_40) && (player->targetActor == &this->picto.actor)) {
switch (temp) {
case 0x89B:
func_80A5257C(this, 18);
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 3e4cf3154..38942387f 100644
--- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c
+++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c
@@ -398,7 +398,7 @@ void func_8092D1B8(EnDns* this, PlayState* play) {
if (!ENDNS_GET_4000(&this->actor) || (this->unk_2D2 != 0)) {
if (!(gSaveContext.save.weekEventReg[23] & 0x20) && !(gSaveContext.eventInf[1] & 0x20) && func_8092CC68(play)) {
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
this->unk_2C6 |= 0x100;
SubS_UpdateFlags(&this->unk_2C6, 4, 7);
play_sound(NA_SE_SY_FOUND);
diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c
index 95ce32645..bba07ce4b 100644
--- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c
+++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c
@@ -587,7 +587,7 @@ void func_80877500(EnDodongo* this, PlayState* play) {
Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x1F4);
if (this->actor.xzDistToPlayer < (100.0f * this->unk_334)) {
if ((ABS_ALT(temp_v1) < 0x1388) && (this->actor.playerHeightRel < 60.0f) &&
- !(player->stateFlags1 & 0x800000)) {
+ !(player->stateFlags1 & PLAYER_STATE1_800000)) {
func_808777A8(this);
}
}
@@ -823,7 +823,7 @@ void func_80878424(EnDodongo* this, PlayState* play) {
this->timer++;
if (SkelAnime_Update(&this->skelAnime)) {
- if (!(player->stateFlags1 & 0x800000) && (Player_GetMask(play) != PLAYER_MASK_STONE)) {
+ if (!(player->stateFlags1 & PLAYER_STATE1_800000) && (Player_GetMask(play) != PLAYER_MASK_STONE)) {
this->collider1.base.atFlags &= ~AT_ON;
func_808777A8(this);
} else {
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 ca64711ad..34f0266f4 100644
--- a/src/overlays/actors/ovl_En_Door/z_en_door.c
+++ b/src/overlays/actors/ovl_En_Door/z_en_door.c
@@ -480,7 +480,7 @@ void func_80866B20(EnDoor* this, PlayState* play) {
if (this->unk_1A1 != 0) {
this->actionFunc = func_80867144;
Animation_PlayOnceSetSpeed(&this->skelAnime, sAnimations[this->animIndex],
- (player->stateFlags1 & 0x8000000) ? 0.75f : 1.5f);
+ (player->stateFlags1 & PLAYER_STATE1_8000000) ? 0.75f : 1.5f);
if (this->unk_1A6 != 0) {
gSaveContext.save.inventory.dungeonKeys[gSaveContext.mapIndex]--;
Flags_SetSwitch(play, this->switchFlag);
diff --git a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c
index 870bed49f..2621ed1d8 100644
--- a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c
+++ b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c
@@ -612,13 +612,13 @@ void EnDragon_Attack(EnDragon* this, PlayState* play) {
}
if (((this->state != DEEP_PYTHON_ATTACK_STATE_START) && (this->endFrame <= currentFrame)) ||
- (!(player->stateFlags2 & 0x80)) || ((this->collider.elements[0].info.bumperFlags & BUMP_HIT)) ||
+ (!(player->stateFlags2 & PLAYER_STATE2_80)) || ((this->collider.elements[0].info.bumperFlags & BUMP_HIT)) ||
(this->collider.elements[1].info.bumperFlags & BUMP_HIT) ||
(this->collider.elements[2].info.bumperFlags & BUMP_HIT)) {
player->actor.parent = NULL;
this->grabWaitTimer = 30;
ActorCutscene_Stop(this->grabCutsceneIndex);
- if (player->stateFlags2 & 0x80) {
+ if (player->stateFlags2 & PLAYER_STATE2_80) {
player->unk_AE8 = 100;
}
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 aaa552b45..f00963f12 100644
--- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c
+++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c
@@ -844,13 +844,13 @@ void func_8088E60C(EnElf* this, PlayState* play) {
s16 glowLightRadius;
Player* player = GET_PLAYER(play);
- if (player->stateFlags1 & 0x400) {
+ if (player->stateFlags1 & PLAYER_STATE1_400) {
glowLightRadius = 200;
} else {
glowLightRadius = 100;
}
- if ((this->unk_244 == 6) || (player->stateFlags1 & 2) || (this->fairyFlags & 0x8000)) {
+ if ((this->unk_244 == 6) || (player->stateFlags1 & PLAYER_STATE1_2) || (this->fairyFlags & 0x8000)) {
glowLightRadius = 0;
}
@@ -967,7 +967,7 @@ void func_8088E850(EnElf* this, PlayState* play) {
default:
arrowPointedActor = play->actorCtx.targetContext.arrowPointedActor;
- if ((player->stateFlags1 & 0x40) && (player->targetActor != NULL)) {
+ if ((player->stateFlags1 & PLAYER_STATE1_40) && (player->targetActor != NULL)) {
Math_Vec3f_Copy(&nextPos, &player->targetActor->focus.pos);
} else {
Math_Vec3f_Copy(&nextPos, &play->actorCtx.targetContext.unk0);
@@ -1133,13 +1133,13 @@ void func_8088F214(EnElf* this, PlayState* play) {
func_800B9010(&this->actor, NA_SE_EV_BELL_ANGER - SFX_FLAG);
} else {
arrowPointedActor = play->actorCtx.targetContext.arrowPointedActor;
- if (player->stateFlags1 & 0x400) {
+ if (player->stateFlags1 & PLAYER_STATE1_400) {
sp34 = 10;
this->unk_25C = 100;
} else if ((arrowPointedActor == NULL) || (arrowPointedActor->category == 4)) {
if (arrowPointedActor != NULL) {
this->unk_25C = 100;
- player->stateFlags2 |= 0x100000;
+ player->stateFlags2 |= PLAYER_STATE2_100000;
sp34 = 0;
} else {
switch (this->unk_244) {
@@ -1147,7 +1147,7 @@ void func_8088F214(EnElf* this, PlayState* play) {
if (this->unk_25C != 0) {
this->unk_25C--;
sp34 = 0;
- } else if (!(player->stateFlags1 & 0x40)) {
+ } else if (!(player->stateFlags1 & PLAYER_STATE1_40)) {
if (this->unk_269 == 0) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_NAVY_VANISH);
}
@@ -1163,7 +1163,7 @@ void func_8088F214(EnElf* this, PlayState* play) {
this->unk_24A--;
sp34 = 5;
} else {
- player->stateFlags2 |= 0x100000;
+ player->stateFlags2 |= PLAYER_STATE2_100000;
sp34 = 0;
}
} else {
@@ -1195,7 +1195,7 @@ void func_8088F214(EnElf* this, PlayState* play) {
switch (sp34) {
case 0:
- if (!(player->stateFlags2 & 0x100000)) {
+ if (!(player->stateFlags2 & PLAYER_STATE2_100000)) {
sp34 = 5;
if (this->unk_269 == 0) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_NAVY_VANISH);
@@ -1204,25 +1204,25 @@ void func_8088F214(EnElf* this, PlayState* play) {
break;
case 6:
- if (player->stateFlags2 & 0x100000) {
+ if (player->stateFlags2 & PLAYER_STATE2_100000) {
sp34 = 9;
this->unk_25C = 0x2A;
if (this->unk_269 == 0) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_DASH_NORMAL);
}
- } else if (player->stateFlags1 & 0x40) {
- player->stateFlags2 |= 0x100000;
+ } else if (player->stateFlags1 & PLAYER_STATE1_40) {
+ player->stateFlags2 |= PLAYER_STATE2_100000;
sp34 = 0;
this->unk_25C = 0;
}
break;
case 5:
- player->stateFlags2 &= ~0x100000;
+ player->stateFlags2 &= ~PLAYER_STATE2_100000;
break;
default:
- player->stateFlags2 |= 0x100000;
+ player->stateFlags2 |= PLAYER_STATE2_100000;
break;
}
}
@@ -1578,7 +1578,7 @@ void EnElf_Draw(Actor* thisx, PlayState* play) {
if (!(this->fairyFlags & 8) &&
(!Cutscene_CheckActorAction(play, 201) ||
(play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 201)]->action != 6)) &&
- (!(player->stateFlags1 & 0x100000) || (kREG(90) < this->actor.projectedPos.z))) {
+ (!(player->stateFlags1 & PLAYER_STATE1_100000) || (kREG(90) < this->actor.projectedPos.z))) {
Gfx* dListHead = GRAPH_ALLOC(play->state.gfxCtx, sizeof(Gfx) * 4);
f32 alphaScale;
s32 envAlpha;
diff --git a/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c b/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c
index 897641a9e..1792f4de4 100644
--- a/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c
+++ b/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c
@@ -483,11 +483,11 @@ void func_80A3A610(EnElfgrp* this, PlayState* play) {
if (this->unk_144 > 0) {
player->actor.freezeTimer = 100;
- player->stateFlags1 |= 0x20000000;
+ player->stateFlags1 |= PLAYER_STATE1_20000000;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_GROUP_HEAL - SFX_FLAG);
} else {
player->actor.freezeTimer = 0;
- player->stateFlags1 &= ~0x20000000;
+ player->stateFlags1 &= ~PLAYER_STATE1_20000000;
this->actionFunc = func_80A3A600;
this->unk_14A |= 8;
}
@@ -499,7 +499,7 @@ void func_80A3A6F4(EnElfgrp* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
player->actor.freezeTimer = 100;
- player->stateFlags1 |= 0x20000000;
+ player->stateFlags1 |= PLAYER_STATE1_20000000;
this->unk_144 = func_80A39FBC(play);
this->actionFunc = func_80A3A610;
this->unk_14A &= ~8;
@@ -510,7 +510,7 @@ void func_80A3A77C(EnElfgrp* this, PlayState* play) {
Player* player = GET_PLAYER(play);
player->actor.freezeTimer = 100;
- player->stateFlags1 |= 0x20000000;
+ player->stateFlags1 |= PLAYER_STATE1_20000000;
if (Actor_TextboxIsClosing(&this->actor, play)) {
this->unk_144 = func_80A39FBC(play);
this->actionFunc = func_80A3A610;
@@ -558,7 +558,7 @@ void func_80A3A8F8(EnElfgrp* this, PlayState* play) {
if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) {
this->actor.flags &= ~ACTOR_FLAG_10000;
player->actor.freezeTimer = 100;
- player->stateFlags1 |= 0x20000000;
+ player->stateFlags1 |= PLAYER_STATE1_20000000;
Message_StartTextbox(play, this->actor.textId, &this->actor);
this->actionFunc = func_80A3A77C;
gSaveContext.save.weekEventReg[9] |= this->unk_146;
diff --git a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c
index 11a4b1136..c13709930 100644
--- a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c
+++ b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c
@@ -425,10 +425,10 @@ void EnElforg_ClockTownFairyCollected(EnElforg* this, PlayState* play) {
EnElforg_CirclePlayer(this, play);
player->actor.freezeTimer = 100;
- player->stateFlags1 |= 0x20000000;
+ player->stateFlags1 |= PLAYER_STATE1_20000000;
if (Actor_TextboxIsClosing(&this->actor, play)) {
player->actor.freezeTimer = 0;
- player->stateFlags1 &= ~0x20000000;
+ player->stateFlags1 &= ~PLAYER_STATE1_20000000;
Actor_Kill(&this->actor);
gSaveContext.save.weekEventReg[8] |= 0x80;
ActorCutscene_Stop(0x7C);
@@ -481,7 +481,7 @@ void EnElforg_FreeFloating(EnElforg* this, PlayState* play) {
if (STRAY_FAIRY_TYPE(&this->actor) == STRAY_FAIRY_TYPE_CLOCK_TOWN) {
player->actor.freezeTimer = 100;
- player->stateFlags1 |= 0x20000000;
+ player->stateFlags1 |= PLAYER_STATE1_20000000;
// Bring me back to North Clock Town!
Message_StartTextbox(play, 0x579, NULL);
this->actionFunc = EnElforg_ClockTownFairyCollected;
diff --git a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c
index 0af2c8f61..db1dadbda 100644
--- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c
+++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c
@@ -2151,7 +2151,7 @@ void EnFishing_UpdateLure(EnFishing* this, PlayState* play) {
Math_ApproachF(&D_809101C0, 195.0f, 1.0f, 1.0f);
- if (player->stateFlags1 & 0x8000000) {
+ if (player->stateFlags1 & PLAYER_STATE1_8000000) {
D_80917204 = 0;
player->unk_B28 = 0;
}
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 48f694e8a..b8a0d9699 100644
--- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c
+++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c
@@ -745,7 +745,7 @@ void func_808D22C8(EnFloormas* this, PlayState* play) {
Math_Vec3f_Sum(&player->actor.world.pos, &this->actor.home.pos, &this->actor.world.pos);
- if (!(player->stateFlags2 & 0x80) || (player->invincibilityTimer < 0)) {
+ if (!(player->stateFlags2 & PLAYER_STATE2_80) || (player->invincibilityTimer < 0)) {
EnFloormas* parent = (EnFloormas*)this->actor.parent;
EnFloormas* child = (EnFloormas*)this->actor.child;
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 7d1166ef2..f02a04aee 100644
--- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c
+++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c
@@ -410,7 +410,7 @@ void func_80962340(EnFu* this, PlayState* play) {
this->unk_552 = 0x2889;
}
this->actor.flags &= ~ACTOR_FLAG_10000;
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
this->unk_54A = 1;
} else {
Message_StartTextbox(play, 0x283C, &this->actor);
@@ -535,7 +535,7 @@ void func_80962660(EnFu* this, PlayState* play) {
gSaveContext.save.weekEventReg[63] |= 1;
gSaveContext.save.weekEventReg[63] &= (u8)~2;
func_801477B4(play);
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
this->unk_53C = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
func_801A2BB8(NA_BGM_TIMED_MINI_GAME);
@@ -644,7 +644,7 @@ void func_80962A10(EnFu* this, PlayState* play) {
}
play_sound(NA_SE_SY_FOUND);
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
Interface_StartTimer(TIMER_ID_MINIGAME_2, 60);
if (this->unk_546 == 1) {
func_809616E0(this, play);
@@ -680,8 +680,8 @@ void func_80962BCC(EnFu* this, PlayState* play) {
}
play_sound(NA_SE_SY_FOUND);
- player->stateFlags1 &= ~0x20;
- player->stateFlags3 |= 0x400000;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
+ player->stateFlags3 |= PLAYER_STATE3_400000;
Interface_StartTimer(TIMER_ID_MINIGAME_2, 60);
if (this->unk_546 == 1) {
@@ -711,8 +711,8 @@ void func_80962D60(EnFu* this, PlayState* play) {
}
play_sound(NA_SE_SY_FOUND);
- player->stateFlags1 &= ~0x20;
- player->stateFlags3 |= 0x400000;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
+ player->stateFlags3 |= PLAYER_STATE3_400000;
Interface_StartTimer(TIMER_ID_MINIGAME_2, 60);
if (this->unk_546 == 1) {
@@ -748,7 +748,7 @@ void func_80962F4C(EnFu* this, PlayState* play) {
switch (this->unk_542) {
case 0:
if (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) {
- player->stateFlags3 |= 0x400;
+ player->stateFlags3 |= PLAYER_STATE3_400;
}
break;
@@ -778,9 +778,9 @@ void func_80962F4C(EnFu* this, PlayState* play) {
if ((!DynaPolyActor_IsInRidingRotatingState((DynaPolyActor*)this->actor.child) &&
(player->actor.bgCheckFlags & 1)) ||
(gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] <= SECONDS_TO_TIMER(0)) || (this->unk_548 == this->unk_54C)) {
- player->stateFlags3 &= ~0x400000;
+ player->stateFlags3 &= ~PLAYER_STATE3_400000;
func_80961E88(play);
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
if (this->unk_548 < this->unk_54C) {
if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] == SECONDS_TO_TIMER(0)) {
Message_StartTextbox(play, 0x2885, &this->actor);
@@ -932,7 +932,7 @@ void func_80963630(EnFu* this, PlayState* play) {
break;
}
}
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
} else {
this->actor.child->freezeTimer = 10;
func_800B85E0(&this->actor, play, 500.0f, PLAYER_AP_MINUS1);
@@ -1174,7 +1174,7 @@ void func_80963F88(EnFu* this, PlayState* play) {
void func_80963FF8(EnFu* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- if (player->stateFlags1 & 0x100000) {
+ if (player->stateFlags1 & PLAYER_STATE1_100000) {
play->actorCtx.unk268 = 1;
play->actorCtx.unk_26C.press.button = 0x8000;
} else {
diff --git a/src/overlays/actors/ovl_En_Gg/z_en_gg.c b/src/overlays/actors/ovl_En_Gg/z_en_gg.c
index a4bfc759a..8693e2fe5 100644
--- a/src/overlays/actors/ovl_En_Gg/z_en_gg.c
+++ b/src/overlays/actors/ovl_En_Gg/z_en_gg.c
@@ -390,11 +390,11 @@ void func_80B359DC(EnGg* this, PlayState* play) {
if (this->actor.xzDistToPlayer < 200.0f) {
if (this->unk_306 == 0) {
- if (player->stateFlags2 & 0x8000000) {
+ if (player->stateFlags2 & PLAYER_STATE2_8000000) {
this->unk_306 = 1;
play_sound(NA_SE_SY_TRE_BOX_APPEAR);
}
- } else if (!(player->stateFlags2 & 0x8000000)) {
+ } else if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) {
this->unk_306 = 0;
}
diff --git a/src/overlays/actors/ovl_En_Gk/z_en_gk.c b/src/overlays/actors/ovl_En_Gk/z_en_gk.c
index 61ae3e91a..242412a16 100644
--- a/src/overlays/actors/ovl_En_Gk/z_en_gk.c
+++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.c
@@ -247,11 +247,11 @@ s32 func_80B50854(EnGk* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (!(this->unk_1E4 & 0x40)) {
- if (player->stateFlags2 & 0x8000000) {
+ if (player->stateFlags2 & PLAYER_STATE2_8000000) {
this->unk_1E4 |= 0x40;
play_sound(NA_SE_SY_TRE_BOX_APPEAR);
}
- } else if (!(player->stateFlags2 & 0x8000000)) {
+ } else if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) {
this->unk_1E4 &= ~0x40;
}
diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c
index 23406fe7a..8b8456bde 100644
--- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c
+++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c
@@ -892,7 +892,7 @@ s32 func_8094F53C(EnGm* this, PlayState* play) {
Actor* al = func_8094DEE0(this, play, ACTORCAT_NPC, ACTOR_EN_AL);
Actor* toto = func_8094DEE0(this, play, ACTORCAT_NPC, ACTOR_EN_TOTO);
- if (player->stateFlags1 & 0x440) {
+ if (player->stateFlags1 & (PLAYER_STATE1_40 | PLAYER_STATE1_400)) {
this->unk_3A4 |= 0x400;
if (this->unk_3A6 != sp32) {
switch (sp32) {
@@ -1412,7 +1412,7 @@ s32 func_80950690(EnGm* this, PlayState* play) {
al = func_8094DEE0(this, play, ACTORCAT_NPC, ACTOR_EN_AL);
toto = func_8094DEE0(this, play, ACTORCAT_NPC, ACTOR_EN_TOTO);
if ((al != NULL) && (al->update != NULL) && (toto != NULL) && (toto->update != NULL) &&
- !(player->stateFlags1 & 0x40)) {
+ !(player->stateFlags1 & PLAYER_STATE1_40)) {
if (DECR(this->unk_3B8) == 0) {
if (al == this->unk_268) {
this->unk_268 = toto;
diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c
index e1659259f..80e927694 100644
--- a/src/overlays/actors/ovl_En_Go/z_en_go.c
+++ b/src/overlays/actors/ovl_En_Go/z_en_go.c
@@ -525,7 +525,7 @@ void func_80A1213C(EnGo* this, PlayState* play) {
s32 func_80A121F4(PlayState* play) {
Player* player = GET_PLAYER(play);
- if ((player->transformation == PLAYER_FORM_GORON) && (player->stateFlags3 & 0x2000000)) {
+ if ((player->transformation == PLAYER_FORM_GORON) && (player->stateFlags3 & PLAYER_STATE3_2000000)) {
return false;
}
return true;
@@ -637,7 +637,7 @@ void func_80A12660(EnGo* this, PlayState* play) {
void func_80A126BC(EnGo* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- if (!(player->stateFlags2 & 0x4000)) {
+ if (!(player->stateFlags2 & PLAYER_STATE2_4000)) {
if (this->unk_3C6 != 0) {
this->unk_3C6--;
}
@@ -830,7 +830,7 @@ s32 func_80A12E80(EnGo* this, PlayState* play) {
return false;
}
- if (player->stateFlags1 & 0x40) {
+ if (player->stateFlags1 & PLAYER_STATE1_40) {
if (this->unk_392 != temp) {
switch (temp) {
case 0xE1A:
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 c6ef6a97c..31103b11c 100644
--- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c
+++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c
@@ -1134,7 +1134,7 @@ void func_80941A10(EnGoroiwa* this, PlayState* play) {
s32 pad2;
if (!func_8094156C(this, play)) {
- if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & 0x80000)) {
+ if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & PLAYER_STATE3_80000)) {
s32 sp34 = this->actor.home.rot.z & 3;
if (sp34 == 2) {
@@ -1264,7 +1264,7 @@ void func_80941FA4(EnGoroiwa* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (func_8094156C(this, play) == 0) {
- if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & 0x80000)) {
+ if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & PLAYER_STATE3_80000)) {
func_800B8D50(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 0);
func_800B8E58(player, NA_SE_PL_BODY_HIT);
if (((this->actor.home.rot.z & 3) == 1) || ((this->actor.home.rot.z & 3) == 2)) {
@@ -1292,7 +1292,7 @@ void func_809420F0(EnGoroiwa* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (func_8094156C(this, play) == 0) {
- if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & 0x80000)) {
+ if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & PLAYER_STATE3_80000)) {
func_800B8D50(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 0);
func_800B8E58(player, NA_SE_PL_BODY_HIT);
if (((this->actor.home.rot.z & 3) == 1) || ((this->actor.home.rot.z & 3) == 2)) {
@@ -1434,7 +1434,8 @@ void EnGoroiwa_Update(Actor* thisx, PlayState* play) {
u32 temp_v0_2;
CollisionPoly* tmp;
- if (!(player->stateFlags1 & (0x30000000 | 0x80 | 0x40))) {
+ if (!(player->stateFlags1 &
+ (PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_10000000 | PLAYER_STATE1_20000000))) {
if (this->unk_1CC > 0) {
this->unk_1CC--;
}
@@ -1515,7 +1516,7 @@ void EnGoroiwa_Update(Actor* thisx, PlayState* play) {
func_8093E938(this);
if ((this->unk_1E5 & 1) && (this->unk_1CC <= 0) &&
- (!(player->stateFlags3 & 0x2000000) || (player->transformation != PLAYER_FORM_GORON) ||
+ (!(player->stateFlags3 & PLAYER_STATE3_2000000) || (player->transformation != PLAYER_FORM_GORON) ||
((params != ENGOROIWA_C000_1) && (params != ENGOROIWA_C000_2)))) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
} else {
diff --git a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c
index 174c507d1..272ea909e 100644
--- a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c
+++ b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c
@@ -276,7 +276,8 @@ void func_80B22500(EnHakurock* this, PlayState* play) {
(this->collider.base.oc->params == EN_HAKUROCK_TYPE_UNK_2))) {
func_80B21EA4(this, 3);
func_80B21FFC(this);
- } else if ((&player->actor == this->collider.base.oc) && ((player->stateFlags3 & 0x81000) != 0) &&
+ } else if ((&player->actor == this->collider.base.oc) &&
+ (player->stateFlags3 & (PLAYER_STATE3_1000 | PLAYER_STATE3_80000)) &&
(player->linearVelocity > 8.0f)) {
player->unk_B08[0] = player->linearVelocity = -5.0f;
player->unk_B08[1] += (player->linearVelocity * 0.05f);
diff --git a/src/overlays/actors/ovl_En_Hg/z_en_hg.c b/src/overlays/actors/ovl_En_Hg/z_en_hg.c
index 3e089d185..05311e64b 100644
--- a/src/overlays/actors/ovl_En_Hg/z_en_hg.c
+++ b/src/overlays/actors/ovl_En_Hg/z_en_hg.c
@@ -175,7 +175,7 @@ void func_80BCF4AC(EnHg* this, PlayState* play) {
s32 pad;
this->actor.speedXZ = 1.6f;
- if (!(player->stateFlags2 & 0x08000000) && Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) {
+ if (!(player->stateFlags2 & PLAYER_STATE2_8000000) && Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) {
if (((this->skelAnime.curFrame > 9.0f) && (this->skelAnime.curFrame < 16.0f)) ||
((this->skelAnime.curFrame > 44.0f) && (this->skelAnime.curFrame < 51.0f))) {
Actor_MoveWithGravity(&this->actor);
@@ -348,7 +348,7 @@ void func_80BCFC0C(EnHg* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (this->actor.colChkInfo.health == 1 && !(fabsf(this->actor.playerHeightRel) >= 80.0f)) {
- if (player->stateFlags2 & 0x08000000) {
+ if (player->stateFlags2 & PLAYER_STATE2_8000000) {
if (!D_80BD00C8) {
play_sound(NA_SE_SY_TRE_BOX_APPEAR);
}
diff --git a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c
index 04434510b..2a209b86b 100644
--- a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c
+++ b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c
@@ -147,7 +147,7 @@ void func_80BDB2B8(EnHiddenNuts* this, PlayState* play) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NEMURI_SLEEP - SFX_FLAG);
- if (player->stateFlags2 & 0x8000000) {
+ if (player->stateFlags2 & PLAYER_STATE2_8000000) {
if (this->unk_20A == 0) {
play_sound(NA_SE_SY_TRE_BOX_APPEAR);
this->unk_20A = 1;
diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.c b/src/overlays/actors/ovl_En_Holl/z_en_holl.c
index 8f634369b..a3a27f536 100644
--- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c
+++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c
@@ -310,7 +310,7 @@ void EnHoll_Update(Actor* thisx, PlayState* play) {
Player* player = GET_PLAYER(play);
if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF) &&
- !(player->stateFlags1 & 0x200)) {
+ !(player->stateFlags1 & PLAYER_STATE1_200)) {
this->actionFunc(this, play);
}
}
diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c
index 3cfa65ddb..8ea49f0c6 100644
--- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c
+++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c
@@ -169,7 +169,7 @@ s32 func_808F8EB0(EnHorseGameCheck* this, PlayState* play) {
}
D_801BDA9C = 0;
- if (player->stateFlags1 & 0x800000) {
+ if (player->stateFlags1 & PLAYER_STATE1_800000) {
D_801BDAA0 = 1;
}
play->nextEntrance = ENTRANCE(GORMAN_TRACK, 2);
diff --git a/src/overlays/actors/ovl_En_Ig/z_en_ig.c b/src/overlays/actors/ovl_En_Ig/z_en_ig.c
index bc1ca559b..497f6d9e3 100644
--- a/src/overlays/actors/ovl_En_Ig/z_en_ig.c
+++ b/src/overlays/actors/ovl_En_Ig/z_en_ig.c
@@ -469,7 +469,7 @@ s32 func_80BF1B40(EnIg* this, PlayState* play) {
u16 temp = play->msgCtx.currentTextId;
s32 pad;
- if (player->stateFlags1 & 0xC40) {
+ if (player->stateFlags1 & (PLAYER_STATE1_40 | PLAYER_STATE1_400 | PLAYER_STATE1_800)) {
this->unk_3D0 |= 0x400;
if (this->unk_3D2 != temp) {
if ((this->unk_3FC == 2) || (this->unk_3FC == 3)) {
diff --git a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c
index d44ed193c..376d79900 100644
--- a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c
+++ b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c
@@ -189,7 +189,7 @@ void func_80C13BB8(EnJgameTsn* this, PlayState* play) {
func_800B8614(&this->actor, play, 80.0f);
}
- if ((player->actor.bgCheckFlags & 1) && !(player->stateFlags1 & 0x2000) && (this->unk_2FE == 0) &&
+ if ((player->actor.bgCheckFlags & 1) && !(player->stateFlags1 & PLAYER_STATE1_2000) && (this->unk_2FE == 0) &&
(gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) && func_80C149B0(play, &this->unk_1F8)) {
this->unk_2FE = 1;
func_80C13E6C(this);
@@ -282,7 +282,7 @@ void func_80C14044(EnJgameTsn* this, PlayState* play) {
void func_80C1410C(EnJgameTsn* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
func_801A2BB8(0x25);
play->interfaceCtx.unk_280 = 1;
func_80112AFC(play);
@@ -296,7 +296,7 @@ void func_80C1418C(EnJgameTsn* this, PlayState* play) {
if (play->interfaceCtx.unk_280 == 8) {
func_80C141DC(this);
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
}
}
@@ -338,7 +338,7 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
Message_StartTextbox(play, 0x109F, &this->actor);
this->unk_300 = 0x109F;
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
*this->unk_208[this->unk_218] &= ~OBJLUPYGAMELIFT_IGNITE_FIRE;
func_801A2C20();
func_80C14030(this);
@@ -346,7 +346,7 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
Message_StartTextbox(play, 0x10A0, &this->actor);
this->unk_300 = 0x10A0;
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
*this->unk_208[this->unk_218] &= ~OBJLUPYGAMELIFT_IGNITE_FIRE;
func_801A2C20();
func_80C14030(this);
@@ -355,7 +355,7 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) {
if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] == SECONDS_TO_TIMER(0)) {
Message_StartTextbox(play, 0x10A1, &this->actor);
this->unk_300 = 0x10A1;
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
*this->unk_208[this->unk_218] &= ~OBJLUPYGAMELIFT_IGNITE_FIRE;
func_801A2C20();
func_80C14030(this);
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 3acbece16..2a8323104 100644
--- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c
+++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c
@@ -308,12 +308,12 @@ void EnKakasi_TimeSkipDialogue(EnKakasi* this, PlayState* play) {
this->picto.actor.textId = 0x1653;
gSaveContext.save.weekEventReg[83] &= (u8)~1;
this->talkState = TEXT_STATE_5;
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
this->picto.actor.flags |= ACTOR_FLAG_10000;
}
if (Actor_ProcessTalkRequest(&this->picto.actor, &play->state)) {
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
this->unkState196 = 2;
this->picto.actor.flags &= ~ACTOR_FLAG_10000;
this->actionFunc = EnKakasi_RegularDialogue;
diff --git a/src/overlays/actors/ovl_En_Kame/z_en_kame.c b/src/overlays/actors/ovl_En_Kame/z_en_kame.c
index 4f1f9ea2e..abc8f520d 100644
--- a/src/overlays/actors/ovl_En_Kame/z_en_kame.c
+++ b/src/overlays/actors/ovl_En_Kame/z_en_kame.c
@@ -197,7 +197,7 @@ void func_80AD70EC(EnKame* this, PlayState* play) {
this->unk_2A0 = 40;
}
- if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & 0x800000) &&
+ if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & PLAYER_STATE1_800000) &&
(this->actor.xzDistToPlayer < 240.0f)) {
func_80AD73A8(this);
} else if (SkelAnime_Update(&this->skelAnime1)) {
@@ -218,7 +218,7 @@ void func_80AD71B4(EnKame* this) {
void func_80AD7254(EnKame* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & 0x800000) &&
+ if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & PLAYER_STATE1_800000) &&
(this->actor.xzDistToPlayer < 240.0f)) {
func_80AD73A8(this);
return;
@@ -257,7 +257,7 @@ void func_80AD7424(EnKame* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (SkelAnime_Update(&this->skelAnime1)) {
- if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & 0x800000) &&
+ if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & PLAYER_STATE1_800000) &&
((this->unk_29E == 0) || (this->actor.xzDistToPlayer < 120.0f))) {
func_80AD76CC(this);
} else {
diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c
index 08ec15b14..ade18b707 100644
--- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c
+++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c
@@ -281,7 +281,7 @@ void func_80B269A4(EnKendoJs* this, PlayState* play) {
case 0x2719:
func_801477B4(play);
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
func_80B2701C(this);
break;
@@ -298,7 +298,7 @@ void func_80B269A4(EnKendoJs* this, PlayState* play) {
case 0x273B:
func_801477B4(play);
func_80112AFC(play);
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
func_80B273D0(this);
break;
@@ -337,7 +337,7 @@ void func_80B26AFC(EnKendoJs* this, PlayState* play) {
gSaveContext.minigameState = 3;
}
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
func_80B26538(this);
}
@@ -358,18 +358,18 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) {
return 0;
}
- if ((player->meleeWeaponState != 0) || (player->stateFlags3 & 0x8000000) ||
- (player->stateFlags2 & 0x80000)) {
+ if ((player->meleeWeaponState != 0) || (player->stateFlags3 & PLAYER_STATE3_8000000) ||
+ (player->stateFlags2 & PLAYER_STATE2_80000)) {
return 1;
}
break;
case 1:
- if ((player->stateFlags3 & 0x8000000)) {
+ if ((player->stateFlags3 & PLAYER_STATE3_8000000)) {
return 0;
}
- if ((player->meleeWeaponState != 0) || (player->stateFlags2 & 0x80000)) {
+ if ((player->meleeWeaponState != 0) || (player->stateFlags2 & PLAYER_STATE2_80000)) {
return 1;
}
break;
@@ -379,8 +379,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) {
return 0;
}
- if ((player->meleeWeaponState != 0) || (player->stateFlags3 & 0x8000000) ||
- (player->stateFlags2 & 0x80000)) {
+ if ((player->meleeWeaponState != 0) || (player->stateFlags3 & PLAYER_STATE3_8000000) ||
+ (player->stateFlags2 & PLAYER_STATE2_80000)) {
return 1;
}
this->unk_28E = 0;
@@ -393,7 +393,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) {
return 0;
}
- if ((this->unk_28E == 1) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) {
+ if ((this->unk_28E == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) ||
+ (player->stateFlags2 & PLAYER_STATE2_80000)) {
this->unk_28E = 0;
return 1;
}
@@ -406,7 +407,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) {
return 0;
}
- if ((this->unk_28E == 1) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) {
+ if ((this->unk_28E == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) ||
+ (player->stateFlags2 & PLAYER_STATE2_80000)) {
this->unk_28E = 0;
return 1;
}
@@ -418,7 +420,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) {
return 0;
}
- if ((this->unk_28E == 1) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) {
+ if ((this->unk_28E == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) ||
+ (player->stateFlags2 & PLAYER_STATE2_80000)) {
this->unk_28E = 0;
return 1;
}
@@ -431,7 +434,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) {
return 0;
}
- if ((this->unk_28E == 1) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) {
+ if ((this->unk_28E == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) ||
+ (player->stateFlags2 & PLAYER_STATE2_80000)) {
this->unk_28E = 0;
return 1;
}
@@ -488,7 +492,7 @@ void func_80B27030(EnKendoJs* this, PlayState* play) {
this->actor.flags |= ACTOR_FLAG_10000;
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
this->actor.flags &= ~ACTOR_FLAG_10000;
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
func_80B279F0(this, play, 0);
Message_StartTextbox(play, 0x271A, &this->actor);
this->unk_288 = 0x271A;
@@ -520,7 +524,7 @@ void func_80B27188(EnKendoJs* this, PlayState* play) {
}
this->unk_286 = 2;
func_801477B4(play);
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
}
} else if (this->unk_286 == 2) {
this->unk_286 = 1;
@@ -531,14 +535,14 @@ void func_80B27188(EnKendoJs* this, PlayState* play) {
case 0:
this->unk_286 = 0;
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR);
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
func_80B26EB4(this, play);
break;
case 1:
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_ERROR);
this->unk_286 = 0;
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
Message_StartTextbox(play, 0x2729, &this->actor);
this->unk_288 = 0x2729;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
@@ -583,7 +587,7 @@ void func_80B2740C(EnKendoJs* this, PlayState* play) {
if (func_80B278C4(play, sp18)) {
this->unk_28C = 0;
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
this->actionFunc = func_80B274BC;
}
}
@@ -600,7 +604,7 @@ void func_80B274BC(EnKendoJs* this, PlayState* play) {
Message_StartTextbox(play, 0x272E, &this->actor);
this->unk_288 = 0x272E;
}
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
gSaveContext.save.weekEventReg[82] &= (u8)~8;
func_80B26AE8(this);
return;
@@ -623,7 +627,7 @@ void func_80B274BC(EnKendoJs* this, PlayState* play) {
(player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_FINISH)) {
play->interfaceCtx.unk_25C = 3;
if (gSaveContext.minigameScore >= 27) {
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
}
} else if (player->meleeWeaponAnimation == PLAYER_MWA_STAB_1H) {
play->interfaceCtx.unk_25C = 2;
@@ -668,7 +672,7 @@ void func_80B27774(EnKendoJs* this, PlayState* play) {
this->unk_288 = 0x2730;
}
func_80B26AE8(this);
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
} else {
func_800B85E0(&this->actor, play, 1000.0f, -1);
}
diff --git a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c
index c9349b2c5..67131febe 100644
--- a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c
+++ b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c
@@ -1149,10 +1149,10 @@ void func_80B43074(EnKgy* this, PlayState* play) {
gSPMatrix(gfx, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (func_80B40D8C(play)) {
- gSPDisplayList(&gfx[1], gameplay_keep_DL_001D00);
+ gSPDisplayList(&gfx[1], gRazorSwordHandleDL);
gSPDisplayList(&gfx[2], object_kgy_DL_00F180);
} else {
- gSPDisplayList(&gfx[1], gameplay_keep_DL_0021A8);
+ gSPDisplayList(&gfx[1], gKokiriSwordHandleDL);
gSPDisplayList(&gfx[2], object_kgy_DL_00E8F0);
}
POLY_OPA_DISP = &gfx[3];
diff --git a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c
index 064677b3b..9d9d43078 100644
--- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c
+++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c
@@ -44,14 +44,14 @@ void func_80A5E6F0(Actor* thisx, PlayState* play);
void func_80A5E9B4(Actor* thisx, PlayState* play);
void func_80A5EA48(Actor* thisx, PlayState* play);
-static EnKusa2UnkBssStruct D_80A5F1C0;
-static u32 D_80A60900;
-static MtxF D_80A60908[8];
-static s16 D_80A60B08;
-static s16 D_80A60B0A;
-static s16 D_80A60B0C;
-static s16 D_80A60B0E;
-static s16 D_80A60B10;
+EnKusa2UnkBssStruct D_80A5F1C0;
+u32 D_80A60900;
+MtxF D_80A60908[8];
+s16 D_80A60B08;
+s16 D_80A60B0A;
+s16 D_80A60B0C;
+s16 D_80A60B0E;
+s16 D_80A60B10;
const ActorInit En_Kusa2_InitVars = {
ACTOR_EN_KUSA2,
@@ -85,11 +85,11 @@ static ColliderCylinderInit sCylinderInit = {
{ 6, 44, 0, { 0, 0, 0 } },
};
-static u8 D_80A5EAEC = 1;
-static s16 D_80A5EAF0 = 0;
-static Vec3s D_80A5EAF4 = { 0, 0, 0 };
-static Vec3s D_80A5EAFC = { 0, 0, 0 };
-static Vec3s D_80A5EB04 = { 0, 0, 0 };
+u8 D_80A5EAEC = 1;
+s16 D_80A5EAF0 = 0;
+Vec3s D_80A5EAF4 = { 0, 0, 0 };
+Vec3s D_80A5EAFC = { 0, 0, 0 };
+Vec3s D_80A5EB04 = { 0, 0, 0 };
void func_80A5B160(EnKusa2* this, PlayState* play) {
s32 i;
diff --git a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c
index cac761db7..8f9d4232a 100644
--- a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c
+++ b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c
@@ -355,7 +355,7 @@ void EnLookNuts_Update(Actor* thisx, PlayState* play) {
if ((this->isPlayerDetected == true) || (this->actor.xzDistToPlayer < 20.0f)) {
Player* player = GET_PLAYER(play);
- if (!(player->stateFlags3 & 0x100) && !Play_InCsMode(play)) {
+ if (!(player->stateFlags3 & PLAYER_STATE3_100) && !Play_InCsMode(play)) {
Math_Vec3f_Copy(&this->headRotTarget, &gZeroVec3f);
this->state = PALACE_GUARD_RUNNING_TO_PLAYER;
play_sound(NA_SE_SY_FOUND);
diff --git a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c
index 0860857c8..ae6a89b4d 100644
--- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c
+++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c
@@ -347,7 +347,7 @@ void EnMa4_Wait(EnMa4* this, PlayState* play) {
EnMa4_StartDialogue(this, play);
EnMa4_SetupDialogueHandler(this);
} else if (this->type != MA4_TYPE_ALIENS_WON || ABS_ALT(yaw) < 0x4000) {
- if (!(player->stateFlags1 & 0x800000)) {
+ if (!(player->stateFlags1 & PLAYER_STATE1_800000)) {
func_800B8614(&this->actor, play, 100.0f);
}
}
@@ -596,7 +596,7 @@ void EnMa4_ChooseNextDialogue(EnMa4* this, PlayState* play) {
this->textId = 0x334C;
} else {
func_801477B4(play);
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
EnMa4_SetupBeginEponasSongCs(this);
EnMa4_BeginEponasSongCs(this, play);
}
@@ -692,7 +692,7 @@ void EnMa4_InitHorsebackGame(EnMa4* this, PlayState* play) {
Interface_StartTimer(TIMER_ID_MINIGAME_2, 0);
gSaveContext.save.weekEventReg[8] |= 1;
func_80112AFC(play);
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
this->actionFunc = EnMa4_SetupHorsebackGameWait;
}
@@ -701,7 +701,7 @@ void EnMa4_SetupHorsebackGameWait(EnMa4* this, PlayState* play) {
if (play->interfaceCtx.unk_280 == 8) {
this->actionFunc = EnMa4_HorsebackGameWait;
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
}
}
@@ -709,7 +709,7 @@ void EnMa4_HorsebackGameWait(EnMa4* this, PlayState* play) {
static s16 D_80AC0258 = 0;
Player* player = GET_PLAYER(play);
- player->stateFlags3 |= 0x400;
+ player->stateFlags3 |= PLAYER_STATE3_400;
EnMa4_HorsebackGameCheckPlayerInteractions(this, play);
if (this->poppedBalloonCounter != D_80AC0258) {
@@ -736,7 +736,7 @@ void EnMa4_HorsebackGameEnd(EnMa4* this, PlayState* play) {
static s32 sFrameCounter = 0;
Player* player = GET_PLAYER(play);
- if (player->stateFlags1 & 0x100000) {
+ if (player->stateFlags1 & PLAYER_STATE1_100000) {
play->actorCtx.unk268 = 1;
play->actorCtx.unk_26C.press.button = BTN_A;
} else {
@@ -827,7 +827,7 @@ void EnMa4_EponasSongCs(EnMa4* this, PlayState* play) {
} else {
Player* player = GET_PLAYER(play);
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
func_800B85E0(&this->actor, play, 200.0f, PLAYER_AP_MINUS1);
D_80AC0260 = 99;
this->hasBow = true;
@@ -844,7 +844,7 @@ void EnMa4_EndEponasSongCs(EnMa4* this, PlayState* play) {
this->actor.flags |= ACTOR_FLAG_10000;
if (Actor_ProcessTalkRequest(&this->actor, &play->state) != 0) {
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
Message_StartTextbox(play, 0x334C, &this->actor);
this->textId = 0x334C;
this->actor.flags &= ~ACTOR_FLAG_10000;
diff --git a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c
index ac3c8322e..c747c625f 100644
--- a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c
+++ b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c
@@ -341,7 +341,7 @@ void func_80A6F9DC(EnMm3* this, PlayState* play) {
if (this->unk_2B4 == 0x2790) {
Player* player = GET_PLAYER(play);
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
if (Player_GetMask(play) == PLAYER_MASK_BUNNY) {
Interface_StartPostmanTimer(0, POSTMAN_MINIGAME_BUNNY_HOOD_ON);
} else {
@@ -383,7 +383,7 @@ void func_80A6FBFC(EnMm3* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (gSaveContext.timerStates[TIMER_ID_POSTMAN] == TIMER_STATE_POSTMAN_END) {
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
this->actor.flags |= ACTOR_FLAG_10000;
if (gSaveContext.timerCurTimes[TIMER_ID_POSTMAN] > SECONDS_TO_TIMER(15)) {
gSaveContext.timerCurTimes[TIMER_ID_POSTMAN] = SECONDS_TO_TIMER(15);
@@ -445,7 +445,7 @@ void func_80A6FEEC(EnMm3* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
Message_StartTextbox(play, 0x2794, &this->actor);
this->unk_2B4 = 0x2794;
func_80151BB4(play, 0xB);
diff --git a/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c b/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c
index e13d26051..757a43ff2 100644
--- a/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c
+++ b/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c
@@ -318,7 +318,7 @@ void EnMttag_RaceStart(EnMttag* this, PlayState* play) {
play->interfaceCtx.unk_280 = 1;
Audio_QueueSeqCmd(NA_BGM_GORON_RACE | 0x8000);
play->envCtx.unk_E4 = 0xFE;
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
} else if ((this->timer < 60) && (play->interfaceCtx.unk_280 == 8)) {
this->timer = 0;
gSaveContext.eventInf[1] |= 1;
@@ -480,7 +480,7 @@ void EnMttag_Init(Actor* thisx, PlayState* play) {
if (gSaveContext.save.entrance == ENTRANCE(GORON_RACETRACK, 1)) {
player = GET_PLAYER(play);
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
this->raceInitialized = false;
this->timer = 100;
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 a890cb0e5..3fa3ac6ec 100644
--- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c
+++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c
@@ -97,7 +97,8 @@ void EnNutsball_Update(Actor* thisx, PlayState* play2) {
s32 bgId;
CollisionPoly* poly;
- if (!(player->stateFlags1 & 0x300000C0)) {
+ if (!(player->stateFlags1 &
+ (PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_10000000 | PLAYER_STATE1_20000000))) {
this->timer--;
if (this->timer < 0) {
this->actor.velocity.y += this->actor.gravity;
diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c
index de2469c5a..fc9d7606f 100644
--- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c
+++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c
@@ -147,7 +147,7 @@ s32 EnNwc_PlayerReleasedBremanMarch(EnNwc* this, PlayState* play) {
return false;
}
- if (player->stateFlags3 & 0x20000000) { // breman mask march
+ if (player->stateFlags3 & PLAYER_STATE3_20000000) {
return false;
}
@@ -165,8 +165,7 @@ s32 EnNwc_IsFound(EnNwc* this, PlayState* play) {
return false;
}
- if (player->stateFlags3 & 0x20000000 && // breman mask march
- this->actor.xzDistToPlayer < 100.0f) {
+ if ((player->stateFlags3 & PLAYER_STATE3_20000000) && this->actor.xzDistToPlayer < 100.0f) {
return true;
}
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 167c01a31..80ae68e95 100644
--- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c
+++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c
@@ -306,7 +306,7 @@ void EnOssan_EndInteraction(PlayState* play, EnOssan* this) {
this->drawCursor = 0;
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false;
- player->stateFlags2 &= ~0x20000000;
+ player->stateFlags2 &= ~PLAYER_STATE2_20000000;
play->interfaceCtx.unk_222 = 0;
play->interfaceCtx.unk_224 = 0;
if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_PLAYING) {
@@ -366,7 +366,7 @@ void EnOssan_Idle(EnOssan* this, PlayState* play) {
SubS_FillLimbRotTables(play, this->limbRotTableY, this->limbRotTableZ, ARRAY_COUNT(this->limbRotTableY));
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
- player->stateFlags2 |= 0x20000000;
+ player->stateFlags2 |= PLAYER_STATE2_20000000;
EnOssan_SetupAction(this, EnOssan_BeginInteraction);
if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_STOPPED) {
if (ActorCutscene_GetCurrentIndex() == 0x7C) {
@@ -984,7 +984,7 @@ void EnOssan_SetupBuyItemWithFanfare(PlayState* play, EnOssan* this) {
Actor_PickUp(&this->actor, play, this->items[this->cursorIndex]->getItemId, 300.0f, 300.0f);
play->msgCtx.msgMode = 0x43;
play->msgCtx.stateTimer = 4;
- player->stateFlags2 &= ~0x20000000;
+ player->stateFlags2 &= ~PLAYER_STATE2_20000000;
Interface_SetHudVisibility(HUD_VISIBILITY_ALL);
this->drawCursor = 0;
EnOssan_SetupAction(this, EnOssan_BuyItemWithFanfare);
@@ -1129,7 +1129,7 @@ void EnOssan_ContinueShopping(EnOssan* this, PlayState* play) {
case 0:
func_8019F208();
player->actor.shape.rot.y = BINANG_ROT180(player->actor.shape.rot.y);
- player->stateFlags2 |= 0x20000000;
+ player->stateFlags2 |= PLAYER_STATE2_20000000;
Message_StartTextbox(play, this->textId, &this->actor);
EnOssan_SetupStartShopping(play, this, true);
func_800B85E0(&this->actor, play, 100.0f, PLAYER_AP_MINUS1);
@@ -1147,7 +1147,7 @@ void EnOssan_ContinueShopping(EnOssan* this, PlayState* play) {
item = this->items[this->cursorIndex];
item->restockFunc(play, item);
player->actor.shape.rot.y = BINANG_ROT180(player->actor.shape.rot.y);
- player->stateFlags2 |= 0x20000000;
+ player->stateFlags2 |= PLAYER_STATE2_20000000;
Message_StartTextbox(play, this->textId, &this->actor);
EnOssan_SetupStartShopping(play, this, true);
func_800B85E0(&this->actor, play, 100.0f, PLAYER_AP_MINUS1);
@@ -1160,7 +1160,7 @@ void EnOssan_ItemPurchased(EnOssan* this, PlayState* play) {
if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_STOPPED) {
if (ActorCutscene_GetCanPlayNext(this->cutscene)) {
ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor);
- player->stateFlags2 |= 0x20000000;
+ player->stateFlags2 |= PLAYER_STATE2_20000000;
EnOssan_SetupAction(this, EnOssan_ContinueShopping);
this->cutsceneState = ENOSSAN_CUTSCENESTATE_PLAYING;
} else {
diff --git a/src/overlays/actors/ovl_En_Ot/z_en_ot.c b/src/overlays/actors/ovl_En_Ot/z_en_ot.c
index e86d0c62f..ba2a283de 100644
--- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c
+++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c
@@ -629,7 +629,7 @@ void func_80B5CCA0(EnOt* this, PlayState* play) {
if (SubS_StartActorCutscene(&this->actor, this->cutscenes[0], 0x7C, SUBS_CUTSCENE_NORMAL)) {
Player* player = GET_PLAYER(play);
- player->stateFlags2 |= 0x20000000;
+ player->stateFlags2 |= PLAYER_STATE2_20000000;
func_80B5CCF4(this, play);
}
}
@@ -666,7 +666,7 @@ void func_80B5CD40(EnOt* this, PlayState* play) {
if (Message_ShouldAdvance(play) && (play->msgCtx.currentTextId == 0x1069)) {
this->unk_32C |= 4;
ActorCutscene_Stop(this->cutscenes[0]);
- player->stateFlags2 &= ~0x20000000;
+ player->stateFlags2 &= ~PLAYER_STATE2_20000000;
func_80B5CE6C(this, play);
}
break;
diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c
index f4baec9e6..528fd50c2 100644
--- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c
+++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c
@@ -478,7 +478,7 @@ void func_8095B3DC(EnOwl* this, PlayState* play) {
void func_8095B480(EnOwl* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- if (player->stateFlags3 & 0x10000000) {
+ if (player->stateFlags3 & PLAYER_STATE3_10000000) {
this->actor.textId = 0xBF1;
EnOwl_ChangeMode(this, func_8095BF58, func_8095C484, &this->skelAnime2, &object_owl_Anim_00CDB0, 0.0f);
this->eyeTexIndex = 0;
@@ -1066,7 +1066,7 @@ void func_8095CCF4(Actor* thisx, PlayState* play) {
EnOwl* this = THIS;
Player* player = GET_PLAYER(play);
- if (player->stateFlags3 & 0x10000000) {
+ if (player->stateFlags3 & PLAYER_STATE3_10000000) {
Actor_Kill(&this->actor);
return;
}
diff --git a/src/overlays/actors/ovl_En_Pm/z_en_pm.c b/src/overlays/actors/ovl_En_Pm/z_en_pm.c
index 7c17627a0..fd37fc39d 100644
--- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c
+++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c
@@ -1170,7 +1170,7 @@ s32 func_80AF8DD4(EnPm* this, PlayState* play) {
u16 textId = play->msgCtx.currentTextId;
s32 pad;
- if (player->stateFlags1 & (0x400 | 0x40)) {
+ if (player->stateFlags1 & (PLAYER_STATE1_40 | PLAYER_STATE1_400)) {
this->unk_356 |= 0x400;
if (this->unk_358 != textId) {
if ((this->unk_384 == 0) || (this->unk_384 == 1)) {
diff --git a/src/overlays/actors/ovl_En_Pr/z_en_pr.c b/src/overlays/actors/ovl_En_Pr/z_en_pr.c
index a40c16073..322749f0d 100644
--- a/src/overlays/actors/ovl_En_Pr/z_en_pr.c
+++ b/src/overlays/actors/ovl_En_Pr/z_en_pr.c
@@ -262,7 +262,7 @@ void func_80A32740(EnPr* this, PlayState* play) {
if (this->unk_2C8 < sqrtf(SQ(this->actor.world.pos.x - this->actor.home.pos.x) +
SQ(this->actor.world.pos.z - this->actor.home.pos.z))) {
func_80A32854(this);
- } else if ((this->unk_20E == 0) && (player->stateFlags1 & 0x8000000)) {
+ } else if ((this->unk_20E == 0) && (player->stateFlags1 & PLAYER_STATE1_8000000)) {
if (sqrtf(SQ(player->actor.world.pos.x - this->actor.home.pos.x) +
SQ(player->actor.world.pos.z - this->actor.home.pos.z)) < this->unk_2C8) {
func_80A32AF8(this);
@@ -298,7 +298,7 @@ void func_80A3295C(EnPr* this) {
void func_80A32984(EnPr* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- if ((player->stateFlags1 & 0x8000000) && (this->unk_20E == 0)) {
+ if ((player->stateFlags1 & PLAYER_STATE1_8000000) && (this->unk_20E == 0)) {
this->unk_22C = this->actor.world.rot.y;
func_80A32AF8(this);
} else if (!func_80A325E4(this)) {
@@ -348,7 +348,7 @@ void func_80A32B20(EnPr* this, PlayState* play) {
this->unk_2B8 = D_80A338C0[(void)0, gSaveContext.save.playerForm] + player->actor.world.pos.y;
func_80A324E0(this, play);
- if (!(player->stateFlags1 & 0x8000000)) {
+ if (!(player->stateFlags1 & PLAYER_STATE1_8000000)) {
this->skelAnime.playSpeed = 1.0f;
this->actor.speedXZ = 1.0f;
func_80A32854(this);
@@ -375,7 +375,7 @@ void func_80A32CDC(EnPr* this) {
void func_80A32D28(EnPr* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- if (!(player->stateFlags1 & 0x8000000)) {
+ if (!(player->stateFlags1 & PLAYER_STATE1_8000000)) {
this->skelAnime.playSpeed = 1.0f;
this->actor.speedXZ = 1.0f;
func_80A32854(this);
@@ -463,7 +463,7 @@ void func_80A33098(EnPr* this, PlayState* play) {
this->actor.focus.pos.z, 0, 0, 0, CLEAR_TAG_LARGE_LIGHT_RAYS);
}
- if ((player->stateFlags1 & 0x8000000) && (this->actor.colChkInfo.damageEffect == 5)) {
+ if ((player->stateFlags1 & PLAYER_STATE1_8000000) && (this->actor.colChkInfo.damageEffect == 5)) {
this->drawDmgEffAlpha = 40;
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_MEDIUM;
}
diff --git a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c
index ed04ae0f6..c8faf718d 100644
--- a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c
+++ b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c
@@ -206,7 +206,7 @@ s32 func_80A7429C(EnPr2* this, PlayState* play) {
return false;
}
- if (!(player->stateFlags1 & 0x8000000)) {
+ if (!(player->stateFlags1 & PLAYER_STATE1_8000000)) {
return false;
} else {
return true;
@@ -356,7 +356,7 @@ void func_80A748E8(EnPr2* this, PlayState* play) {
temp_f12 = player->actor.world.pos.z - this->unk_228.z;
sqrtXZ = sqrtf(SQ(temp_f2) + SQ(temp_f12));
- if (sp48 && (player->stateFlags1 & 0x8000000) && (sqrtXZ < this->unk_208)) {
+ if (sp48 && (player->stateFlags1 & PLAYER_STATE1_8000000) && (sqrtXZ < this->unk_208)) {
sp4C = true;
func_80A74DEC(this, play);
}
@@ -446,7 +446,7 @@ void func_80A74E90(EnPr2* this, PlayState* play) {
WaterBox* sp40;
Math_ApproachF(&this->unk_204, 0.02f, 0.1f, 0.005f);
- if ((this->unk_1D8 == 0) || !(player->stateFlags1 & 0x8000000) || (this->unk_1E0 == 0)) {
+ if ((this->unk_1D8 == 0) || !(player->stateFlags1 & PLAYER_STATE1_8000000) || (this->unk_1E0 == 0)) {
func_80A74888(this);
return;
}
diff --git a/src/overlays/actors/ovl_En_Prz/z_en_prz.c b/src/overlays/actors/ovl_En_Prz/z_en_prz.c
index fd1dee986..5ca54fc8d 100644
--- a/src/overlays/actors/ovl_En_Prz/z_en_prz.c
+++ b/src/overlays/actors/ovl_En_Prz/z_en_prz.c
@@ -234,7 +234,7 @@ void func_80A763E8(EnPrz* this, PlayState* play) {
return;
}
- if ((player->stateFlags1 & 0x8000000) && (this->unk_1F2 == 0)) {
+ if ((player->stateFlags1 & PLAYER_STATE1_8000000) && (this->unk_1F2 == 0)) {
func_80A76748(this);
return;
}
@@ -291,7 +291,7 @@ void func_80A76634(EnPrz* this, PlayState* play) {
if (func_80A762C0(this, play) != 0) {
this->unk_1E4 += 0x1500;
this->unk_1E4 += (s16)Rand_ZeroFloat(5000.0f);
- } else if ((player->stateFlags1 & 0x8000000) && (player->actor.floorHeight < 30.0f)) {
+ } else if ((player->stateFlags1 & PLAYER_STATE1_8000000) && (player->actor.floorHeight < 30.0f)) {
this->actionFunc = func_80A763E8;
} else {
this->unk_1EE = 10;
@@ -325,7 +325,7 @@ void func_80A767A8(EnPrz* this, PlayState* play) {
distXZ = sqrtf(SQ(player->actor.world.pos.x - this->actor.parent->home.pos.x) +
SQ(player->actor.world.pos.z - this->actor.parent->home.pos.z));
- if (!(player->stateFlags1 & 0x8000000) || (pr->unk_2C8 < distXZ)) {
+ if (!(player->stateFlags1 & PLAYER_STATE1_8000000) || (pr->unk_2C8 < distXZ)) {
this->unk_1F2 = 100;
this->skelAnime.playSpeed = 1.0f;
func_80A76388(this);
diff --git a/src/overlays/actors/ovl_En_Raf/z_en_raf.c b/src/overlays/actors/ovl_En_Raf/z_en_raf.c
index 5d7a59e90..0e7b88718 100644
--- a/src/overlays/actors/ovl_En_Raf/z_en_raf.c
+++ b/src/overlays/actors/ovl_En_Raf/z_en_raf.c
@@ -310,7 +310,7 @@ void EnRaf_Idle(EnRaf* this, PlayState* play) {
if (this->timer == 0) {
if ((player->transformation != PLAYER_FORM_DEKU) &&
(this->dyna.actor.xzDistToPlayer < (BREG(48) + 80.0f) && (player->invincibilityTimer == 0) &&
- DynaPolyActor_IsInRidingMovingState(&this->dyna) && !(player->stateFlags1 & 0x8000000) &&
+ DynaPolyActor_IsInRidingMovingState(&this->dyna) && !(player->stateFlags1 & PLAYER_STATE1_8000000) &&
play->grabPlayer(play, player))) {
player->actor.parent = &this->dyna.actor;
this->grabTarget = EN_RAF_GRAB_TARGET_PLAYER;
@@ -372,7 +372,7 @@ void EnRaf_Grab(EnRaf* this, PlayState* play) {
Player* player = GET_PLAYER(play);
f32 curFrame = this->skelAnime.curFrame;
- if ((this->grabTarget != EN_RAF_GRAB_TARGET_EXPLOSIVE) && (player->stateFlags2 & 0x80) &&
+ if ((this->grabTarget != EN_RAF_GRAB_TARGET_EXPLOSIVE) && (player->stateFlags2 & PLAYER_STATE2_80) &&
(&this->dyna.actor == player->actor.parent)) {
Math_ApproachF(&player->actor.world.pos.x, this->dyna.actor.world.pos.x, 0.3f, 10.0f);
Math_ApproachF(&player->actor.world.pos.y, this->dyna.actor.world.pos.y, 0.3f, 10.0f);
@@ -414,7 +414,7 @@ void EnRaf_Chew(EnRaf* this, PlayState* play) {
targetChewScale = (BREG(51) / 100.0f) + 0.2f;
Math_ApproachF(&this->chewScale, targetChewScale, 0.2f, 0.03f);
- if ((player->stateFlags2 & 0x80) && (this->grabTarget != EN_RAF_GRAB_TARGET_EXPLOSIVE) &&
+ if ((player->stateFlags2 & PLAYER_STATE2_80) && (this->grabTarget != EN_RAF_GRAB_TARGET_EXPLOSIVE) &&
(&this->dyna.actor == player->actor.parent)) {
Math_ApproachF(&player->actor.world.pos.x, this->dyna.actor.world.pos.x, 0.3f, 10.0f);
Math_ApproachF(&player->actor.world.pos.y, this->dyna.actor.world.pos.y, 0.3f, 10.0f);
@@ -432,7 +432,7 @@ void EnRaf_Chew(EnRaf* this, PlayState* play) {
play->damagePlayer(play, -2);
func_800B8E58((Player*)this, player->ageProperties->unk_92 + NA_SE_VO_LI_DAMAGE_S);
CollisionCheck_GreenBlood(play, NULL, &player->actor.world.pos);
- if ((this->chewCount > (BREG(53) + 5)) || !(player->stateFlags2 & 0x80)) {
+ if ((this->chewCount > (BREG(53) + 5)) || !(player->stateFlags2 & PLAYER_STATE2_80)) {
player->actor.freezeTimer = 10;
EnRaf_SetupThrow(this, play);
return;
diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c
index 443d92d59..d046d5192 100644
--- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c
+++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c
@@ -438,7 +438,7 @@ void EnRailgibud_Grab(EnRailgibud* this, PlayState* play) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (inPositionToAttack == true)) {
this->grabState = EN_RAILGIBUD_GRAB_ATTACK;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_GRAB_ATTACK);
- } else if (!(player->stateFlags2 & 0x80)) {
+ } else if (!(player->stateFlags2 & PLAYER_STATE2_80)) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_GRAB_END);
this->actor.flags |= ACTOR_FLAG_1;
this->grabState = EN_RAILGIBUD_GRAB_RELEASE;
@@ -463,9 +463,9 @@ void EnRailgibud_Grab(EnRailgibud* this, PlayState* play) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_ATTACK);
}
- if (!(player->stateFlags2 & 0x80) || (player->unk_B62 != 0)) {
- if ((player->unk_B62 != 0) && (player->stateFlags2 & 0x80)) {
- player->stateFlags2 &= ~0x80;
+ if (!(player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B62 != 0)) {
+ if ((player->unk_B62 != 0) && (player->stateFlags2 & PLAYER_STATE2_80)) {
+ player->stateFlags2 &= ~PLAYER_STATE2_80;
player->unk_AE8 = 100;
}
@@ -750,9 +750,10 @@ s32 EnRailgibud_PlayerInRangeWithCorrectState(EnRailgibud* this, PlayState* play
return false;
}
- if ((Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 100.0f) &&
- !(player->stateFlags1 & (0x200000 | 0x80000 | 0x40000 | 0x4000 | 0x2000 | 0x80)) &&
- !(player->stateFlags2 & (0x4000 | 0x80))) {
+ if (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 100.0f &&
+ !(player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 |
+ PLAYER_STATE1_80000 | PLAYER_STATE1_200000)) &&
+ !(player->stateFlags2 & (PLAYER_STATE2_80 | PLAYER_STATE2_4000))) {
return true;
}
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 2fdfc650d..e33405138 100644
--- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c
+++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c
@@ -654,8 +654,9 @@ void EnRd_WalkToPlayer(EnRd* this, PlayState* play) {
}
if ((ABS_ALT(yaw) < 0x1554) && (Actor_DistanceBetweenActors(&this->actor, &player->actor) <= 150.0f)) {
- if (!(player->stateFlags1 & (0x200000 | 0x80000 | 0x40000 | 0x4000 | 0x2000 | 0x80)) &&
- !(player->stateFlags2 & (0x4000 | 0x80))) {
+ if (!(player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 |
+ PLAYER_STATE1_80000 | PLAYER_STATE1_200000)) &&
+ !(player->stateFlags2 & (PLAYER_STATE2_80 | PLAYER_STATE2_4000))) {
if (this->playerStunWaitTimer == 0) {
if (!(this->flags & EN_RD_FLAG_CANNOT_FREEZE_PLAYER)) {
player->actor.freezeTimer = 40;
@@ -838,9 +839,9 @@ void EnRd_Grab(EnRd* this, PlayState* play) {
Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 1500, 0);
case EN_RD_GRAB_ATTACK:
- if (!(player->stateFlags2 & 0x80) || (player->unk_B62 != 0)) {
- if ((player->unk_B62 != 0) && (player->stateFlags2 & 0x80)) {
- player->stateFlags2 &= ~0x80;
+ if (!(player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B62 != 0)) {
+ if ((player->unk_B62 != 0) && (player->stateFlags2 & PLAYER_STATE2_80)) {
+ player->stateFlags2 &= ~PLAYER_STATE2_80;
player->unk_AE8 = 100;
}
Animation_Change(&this->skelAnime, &gGibdoRedeadGrabEndAnim, 0.5f, 0.0f,
diff --git a/src/overlays/actors/ovl_En_Rg/z_en_rg.c b/src/overlays/actors/ovl_En_Rg/z_en_rg.c
index a2f2f044c..18f23576f 100644
--- a/src/overlays/actors/ovl_En_Rg/z_en_rg.c
+++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.c
@@ -564,8 +564,9 @@ void func_80BF4AB8(EnRg* this, PlayState* play) {
} while (phi_s0 != NULL);
}
- if ((phi_s0 == NULL) && (D_80BF5C10 == 0) && (this->unk_326 == 0) && (player->stateFlags3 & 0x80000) &&
- (player->invincibilityTimer == 0) && func_80BF4220(this, play, &player->actor)) {
+ if ((phi_s0 == NULL) && (D_80BF5C10 == 0) && (this->unk_326 == 0) &&
+ (player->stateFlags3 & PLAYER_STATE3_80000) && (player->invincibilityTimer == 0) &&
+ func_80BF4220(this, play, &player->actor)) {
this->unk_18C = &player->actor;
this->unk_310 |= 0x800;
D_80BF5C10 = 1;
@@ -586,7 +587,7 @@ void func_80BF4AB8(EnRg* this, PlayState* play) {
this->unk_320 = CLAMP_MAX(this->unk_320, 0x190);
} else if (this->collider2.base.at->id == ACTOR_PLAYER) {
this->unk_326 = 0x28;
- if (player->stateFlags3 & 0x1000) {
+ if (player->stateFlags3 & PLAYER_STATE3_1000) {
player->linearVelocity *= 0.5f;
player->unk_B08[0] = player->linearVelocity;
player->unk_B08[1] += player->linearVelocity * 0.05f;
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 9d9f14973..e67be51f6 100644
--- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c
+++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c
@@ -296,7 +296,7 @@ void func_808FA4F4(EnRr* this, PlayState* play) {
f32 sp30;
f32 sp2C;
- if (player->stateFlags2 & 0x80) {
+ if (player->stateFlags2 & PLAYER_STATE2_80) {
player->actor.parent = NULL;
player->unk_AE8 = 100;
this->actor.flags |= ACTOR_FLAG_1;
@@ -571,7 +571,8 @@ void func_808FAF94(EnRr* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 10, 500, 0);
this->actor.world.rot.y = this->actor.shape.rot.y;
- if ((this->unk_1E6 == 0) && !(player->stateFlags2 & 0x80) && (Player_GetMask(play) != PLAYER_MASK_STONE) &&
+ if ((this->unk_1E6 == 0) && !(player->stateFlags2 & PLAYER_STATE2_80) &&
+ (Player_GetMask(play) != PLAYER_MASK_STONE) &&
(this->actor.xzDistToPlayer < (8421.053f * this->actor.scale.x))) {
func_808FA260(this);
} else if ((this->actor.xzDistToPlayer < 400.0f) && (this->actor.speedXZ == 0.0f)) {
@@ -812,7 +813,7 @@ void EnRr_Update(Actor* thisx, PlayState* play) {
if (this->unk_1FC > 0) {
Player* player = GET_PLAYER(play);
- if (!(player->stateFlags2 & 0x80)) {
+ if (!(player->stateFlags2 & PLAYER_STATE2_80)) {
this->unk_1FC--;
if (this->unk_1FC == 0) {
this->collider1.base.ocFlags1 |= OC1_TYPE_PLAYER;
diff --git a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c
index 63d5aed38..bfeca23c5 100644
--- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c
+++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c
@@ -240,7 +240,7 @@ s32 EnRuppecrow_CanSpawnBlueRupees(PlayState* play) {
case PLAYER_FORM_ZORA:
return false;
case PLAYER_FORM_HUMAN:
- if (player->stateFlags1 & 0x800000) {
+ if (player->stateFlags1 & PLAYER_STATE1_800000) {
return true;
} else {
return false;
@@ -268,7 +268,7 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, PlayState* play) {
EnItem00* rupee;
s16 rupeeIndex = this->rupeeIndex;
- if (!(player->stateFlags3 & 0x1000)) {
+ if (!(player->stateFlags3 & PLAYER_STATE3_1000)) {
xOffset = (this->rupeeIndex & 1) ? 10.0f : -10.0f;
} else {
xOffset = 0.0f;
@@ -407,7 +407,7 @@ void EnRuppecrow_UpdateSpeed(EnRuppecrow* this, PlayState* play) {
this->speedModifier = 7.0f;
break;
case PLAYER_FORM_GORON:
- if (player->stateFlags3 & 0x1000) { // Goron Link is curled
+ if (player->stateFlags3 & PLAYER_STATE3_1000) { // Goron Link is curled
this->speedModifier = 19.0f;
} else {
this->speedModifier = 7.0f;
@@ -417,7 +417,7 @@ void EnRuppecrow_UpdateSpeed(EnRuppecrow* this, PlayState* play) {
this->speedModifier = 7.0f;
break;
case PLAYER_FORM_HUMAN:
- if (player->stateFlags1 & 0x800000) {
+ if (player->stateFlags1 & PLAYER_STATE1_800000) {
this->speedModifier = 16.0f;
} else {
this->speedModifier = 7.0f;
@@ -507,7 +507,7 @@ void EnRuppecrow_HandleSong(EnRuppecrow* this, PlayState* play) {
this->actionFunc = EnRuppecrow_HandleSongCutscene;
}
- if (player->stateFlags2 & 0x8000000) {
+ if (player->stateFlags2 & PLAYER_STATE2_8000000) {
Math_ApproachF(&this->actor.speedXZ, 0.0f, 0.1f, 1.0f);
} else {
Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.1f, 0.1f);
diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c
index 5391d650b..e89600744 100644
--- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c
+++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c
@@ -377,7 +377,7 @@ void EnSb_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 25.0f, 20.0f, 5);
EnSb_UpdateDamage(this, play);
- if (player->stateFlags1 & 0x8000000) {
+ if (player->stateFlags1 & PLAYER_STATE1_8000000) {
Collider_UpdateCylinder(&this->actor, &this->collider);
if (this->vulnerableTimer == 0) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
diff --git a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c
index 4d3c4d637..2de4c88fb 100644
--- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c
+++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c
@@ -704,10 +704,10 @@ void func_80ADC5A4(EnSellnuts* this, PlayState* play) {
this->unk_338 |= 1;
this->actor.draw = EnSellnuts_Draw;
D_80ADD940 = 0;
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
this->actionFunc = func_80ADC7B4;
} else {
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
this->actionFunc = func_80ADC6D0;
}
} else if (func_80ADB08C(play) < 80.0f) {
diff --git a/src/overlays/actors/ovl_En_Shn/z_en_shn.c b/src/overlays/actors/ovl_En_Shn/z_en_shn.c
index 93b75e96b..844d65973 100644
--- a/src/overlays/actors/ovl_En_Shn/z_en_shn.c
+++ b/src/overlays/actors/ovl_En_Shn/z_en_shn.c
@@ -201,7 +201,7 @@ s32 func_80AE65F4(EnShn* this, PlayState* play) {
Player* player = GET_PLAYER(play);
u16 temp = play->msgCtx.currentTextId;
- if (player->stateFlags1 & 0x40) {
+ if (player->stateFlags1 & PLAYER_STATE1_40) {
if (this->unk_1DA != temp) {
if ((this->unk_1D8 & 0x80) || (this->unk_1D8 & 0x100)) {
this->unk_1D8 |= 8;
diff --git a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c
index 30352048b..7476e0681 100644
--- a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c
+++ b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c
@@ -395,7 +395,7 @@ void EnSnowman_MoveSnowPile(EnSnowman* this, PlayState* play) {
EnSnowman_SetupCombine(this, play, &combinePos);
} else if ((this->work.timer == 0) && (fabsf(this->actor.playerHeightRel) < 60.0f) &&
(this->actor.xzDistToPlayer < this->attackRange) && (Player_GetMask(play) != PLAYER_MASK_STONE) &&
- !(player->stateFlags1 & 0x800000)) {
+ !(player->stateFlags1 & PLAYER_STATE1_800000)) {
EnSnowman_SetupEmerge(this, play);
} else if (this->snowPileTargetRotY != this->actor.shape.rot.y) {
if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->snowPileTargetRotY, 0x100)) {
@@ -439,7 +439,7 @@ void EnSnowman_Emerge(EnSnowman* this, PlayState* play) {
if (SkelAnime_Update(&this->skelAnime)) {
if (this->combineState == EN_SNOWMAN_COMBINE_STATE_ACTIVE) {
EnSnowman_SetupSubmerge(this, play);
- } else if (!(player->stateFlags1 & 0x800000) && (Player_GetMask(play) != PLAYER_MASK_STONE)) {
+ } else if (!(player->stateFlags1 & PLAYER_STATE1_800000) && (Player_GetMask(play) != PLAYER_MASK_STONE)) {
this->collider.base.acFlags |= AC_ON;
this->work.snowballsToThrowBeforeIdling = 3;
EnSnowman_SetupReadySnowball(this);
@@ -529,7 +529,7 @@ void EnSnowman_ThrowSnowball(EnSnowman* this, PlayState* play) {
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000);
if (SkelAnime_Update(&this->skelAnime)) {
if ((this->work.snowballsToThrowBeforeIdling != 0) && (Player_GetMask(play) != PLAYER_MASK_STONE) &&
- !(player->stateFlags1 & 0x800000)) {
+ !(player->stateFlags1 & PLAYER_STATE1_800000)) {
EnSnowman_SetupReadySnowball(this);
} else {
this->work.snowballsToThrowBeforeIdling = 0;
diff --git a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c
index b7ea5d194..58465b8f0 100644
--- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c
+++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c
@@ -446,7 +446,7 @@ void EnSob1_EndInteraction(PlayState* play, EnSob1* this) {
this->drawCursor = 0;
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false;
- player->stateFlags2 &= ~0x20000000;
+ player->stateFlags2 &= ~PLAYER_STATE2_20000000;
play->interfaceCtx.unk_222 = 0;
play->interfaceCtx.unk_224 = 0;
EnSob1_SetupAction(this, EnSob1_Idle);
@@ -533,7 +533,7 @@ void EnSob1_Idle(EnSob1* this, PlayState* play) {
ActorCutscene_SetIntentToPlay(this->cutscene);
this->cutsceneState = ENSOB1_CUTSCENESTATE_WAITING;
}
- player->stateFlags2 |= 0x20000000;
+ player->stateFlags2 |= PLAYER_STATE2_20000000;
this->welcomeTextId = EnSob1_GetWelcome(this, play);
Message_StartTextbox(play, this->welcomeTextId, &this->actor);
if (ENSOB1_GET_SHOPTYPE(&this->actor) == BOMB_SHOP) {
@@ -790,7 +790,7 @@ void EnSob1_Walking(EnSob1* this, PlayState* play) {
ActorCutscene_SetIntentToPlay(this->cutscene);
this->cutsceneState = ENSOB1_CUTSCENESTATE_WAITING;
}
- player->stateFlags2 |= 0x20000000;
+ player->stateFlags2 |= PLAYER_STATE2_20000000;
this->welcomeTextId = EnSob1_GetWelcome(this, play);
Message_StartTextbox(play, this->welcomeTextId, &this->actor);
this->wasTalkedToWhileWalking = true;
@@ -810,7 +810,7 @@ void EnSob1_ItemPurchased(EnSob1* this, PlayState* play) {
if (this->cutsceneState == ENSOB1_CUTSCENESTATE_STOPPED) {
if (ActorCutscene_GetCanPlayNext(this->cutscene)) {
ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor);
- player->stateFlags2 |= 0x20000000;
+ player->stateFlags2 |= PLAYER_STATE2_20000000;
EnSob1_SetupAction(this, EnSob1_ContinueShopping);
this->cutsceneState = ENSOB1_CUTSCENESTATE_PLAYING;
} else {
@@ -932,7 +932,7 @@ void EnSob1_SetupBuyItemWithFanfare(PlayState* play, EnSob1* this) {
Actor_PickUp(&this->actor, play, this->items[this->cursorIndex]->getItemId, 300.0f, 300.0f);
play->msgCtx.msgMode = 0x43;
play->msgCtx.stateTimer = 4;
- player->stateFlags2 &= ~0x20000000;
+ player->stateFlags2 &= ~PLAYER_STATE2_20000000;
Interface_SetHudVisibility(HUD_VISIBILITY_ALL);
this->drawCursor = 0;
EnSob1_SetupAction(this, EnSob1_BuyItemWithFanfare);
@@ -1093,7 +1093,7 @@ void EnSob1_ContinueShopping(EnSob1* this, PlayState* play) {
item = this->items[this->cursorIndex];
item->restockFunc(play, item);
player->actor.shape.rot.y += 0x8000;
- player->stateFlags2 |= 0x20000000;
+ player->stateFlags2 |= PLAYER_STATE2_20000000;
Message_StartTextbox(play, this->welcomeTextId, &this->actor);
EnSob1_SetupStartShopping(play, this, true);
func_800B85E0(&this->actor, play, 200.0f, PLAYER_AP_MINUS1);
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 782f32c0d..76a98f9ac 100644
--- a/src/overlays/actors/ovl_En_Stream/z_en_stream.c
+++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.c
@@ -104,7 +104,7 @@ void EnStream_SuckPlayer(EnStream* this, PlayState* play) {
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_80000000;
}
}
} else {
diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c
index 9f24c2735..51b3f0ef6 100644
--- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c
+++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c
@@ -861,9 +861,9 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) {
if (!(gSaveContext.save.weekEventReg[83] & 4) && !(this->flags1 & 0x1000)) {
if (ActorCutscene_GetCanPlayNext(this->cutscenes[0])) {
ActorCutscene_Start(this->cutscenes[0], &this->actor);
- if (!(player->stateFlags1 & 0x10000000)) {
+ if (!(player->stateFlags1 & PLAYER_STATE1_10000000)) {
this->flags2 |= 0x10;
- player->stateFlags1 |= 0x10000000;
+ player->stateFlags1 |= PLAYER_STATE1_10000000;
}
this->flags1 |= 0x1000;
this->flags2 |= 2;
@@ -926,9 +926,9 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) {
if (this->flags2 & 2) {
this->flags2 &= ~2;
}
- if (!(player->stateFlags1 & 0x10000000)) {
+ if (!(player->stateFlags1 & PLAYER_STATE1_10000000)) {
this->flags2 |= 0x10;
- player->stateFlags1 |= 0x10000000;
+ player->stateFlags1 |= PLAYER_STATE1_10000000;
}
this->textId = 0x2A30;
Message_StartTextbox(play, this->textId, &this->actor);
@@ -1201,7 +1201,7 @@ void func_80BAD380(EnSuttari* this, PlayState* play) {
u8 talkState = Message_GetState(&play->msgCtx);
Player* player = GET_PLAYER(play);
- if ((player->stateFlags1 & 0x40) && (play->msgCtx.currentTextId != 0x2A31)) {
+ if ((player->stateFlags1 & PLAYER_STATE1_40) && (play->msgCtx.currentTextId != 0x2A31)) {
this->flags1 |= 0x8000;
this->actor.speedXZ = 0.0f;
} else {
@@ -1209,7 +1209,7 @@ void func_80BAD380(EnSuttari* this, PlayState* play) {
func_80BABA90(this, 1, 1);
if ((this->flags1 & 0x4000) && (talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
this->flags2 &= ~0x10;
- player->stateFlags1 &= ~0x10000000;
+ player->stateFlags1 &= ~PLAYER_STATE1_10000000;
this->flags1 &= ~0x4000;
ActorCutscene_Stop(this->cutscenes[1]);
play->msgCtx.msgMode = 0x43;
@@ -1476,7 +1476,7 @@ void EnSuttari_Update(Actor* thisx, PlayState* play) {
Player* player = GET_PLAYER(play);
this->actionFunc(this, play);
- if ((this->flags1 & 8) && (this->flags2 & 0x10) && (player->stateFlags1 & 0x10000000)) {
+ if ((this->flags1 & 8) && (this->flags2 & 0x10) && (player->stateFlags1 & PLAYER_STATE1_10000000)) {
player->actor.freezeTimer = 3;
}
if (!(this->flags1 & 0x8000)) {
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 24326e7e8..c96b485d4 100644
--- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c
+++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c
@@ -738,7 +738,7 @@ s32 func_808DA08C(EnSw* this, PlayState* play) {
void func_808DA350(EnSw* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- if ((player->stateFlags1 & 0x200000) && (this->actor.xyzDistToPlayerSq < 8000.0f)) {
+ if ((player->stateFlags1 & PLAYER_STATE1_200000) && (this->actor.xyzDistToPlayerSq < 8000.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_LAUGH);
Math_Vec3f_Copy(&this->unk_374, &player->actor.world.pos);
this->unk_410 &= ~0x20;
diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c
index 838eaa2a5..c22f6d478 100644
--- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c
+++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c
@@ -346,7 +346,7 @@ void EnSyatekiMan_Swamp_HandleChoice(EnSyatekiMan* this, PlayState* play) {
play->msgCtx.msgMode = 0x43;
play->msgCtx.stateTimer = 4;
this->shootingGameState = SG_GAME_STATE_MOVING_PLAYER;
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
this->actionFunc = EnSyatekiMan_Swamp_MovePlayerAndExplainRules;
}
} else {
@@ -410,7 +410,7 @@ void EnSyatekiMan_Swamp_HandleNormalMessage(EnSyatekiMan* this, PlayState* play)
case 0xA32: // You have to try harder!
if (gSaveContext.save.weekEventReg[63] & 2) {
func_801477B4(play);
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
gSaveContext.save.weekEventReg[63] &= (u8)~1;
gSaveContext.save.weekEventReg[63] &= (u8)~2;
this->actionFunc = EnSyatekiMan_Swamp_Idle;
@@ -435,7 +435,7 @@ void EnSyatekiMan_Swamp_HandleNormalMessage(EnSyatekiMan* this, PlayState* play)
play->msgCtx.stateTimer = 4;
player->actor.freezeTimer = 0;
gSaveContext.minigameState = 3;
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
this->actionFunc = EnSyatekiMan_Swamp_SetupGiveReward;
EnSyatekiMan_Swamp_SetupGiveReward(this, play);
break;
@@ -446,8 +446,8 @@ void EnSyatekiMan_Swamp_HandleNormalMessage(EnSyatekiMan* this, PlayState* play)
void EnSyatekiMan_Swamp_Talk(EnSyatekiMan* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- if (player->stateFlags1 & 0x20) {
- player->stateFlags1 |= 0x20;
+ if (player->stateFlags1 & PLAYER_STATE1_20) {
+ player->stateFlags1 |= PLAYER_STATE1_20;
}
switch (Message_GetState(&play->msgCtx)) {
@@ -468,7 +468,7 @@ void EnSyatekiMan_Swamp_Talk(EnSyatekiMan* this, PlayState* play) {
if (Message_ShouldAdvance(play)) {
play->msgCtx.msgMode = 0x43;
play->msgCtx.stateTimer = 4;
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
gSaveContext.save.weekEventReg[63] &= (u8)~1;
gSaveContext.save.weekEventReg[63] &= (u8)~2;
this->actionFunc = EnSyatekiMan_Swamp_Idle;
@@ -640,7 +640,7 @@ void EnSyatekiMan_Town_HandleChoice(EnSyatekiMan* this, PlayState* play) {
}
if (this->shootingGameState == SG_GAME_STATE_ONE_MORE_GAME) {
- player->stateFlags3 &= ~0x400;
+ player->stateFlags3 &= ~PLAYER_STATE3_400;
gSaveContext.minigameState = 3;
}
@@ -676,7 +676,7 @@ void EnSyatekiMan_Town_HandleChoice(EnSyatekiMan* this, PlayState* play) {
}
if (this->shootingGameState == SG_GAME_STATE_ONE_MORE_GAME) {
- player->stateFlags3 &= ~0x400;
+ player->stateFlags3 &= ~PLAYER_STATE3_400;
gSaveContext.minigameState = 3;
}
@@ -746,7 +746,7 @@ void EnSyatekiMan_Town_HandleNormalMessage(EnSyatekiMan* this, PlayState* play)
play->msgCtx.stateTimer = 4;
player->actor.freezeTimer = 0;
this->shootingGameState = SG_GAME_STATE_MOVING_PLAYER;
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
gSaveContext.save.weekEventReg[63] |= 1;
gSaveContext.save.weekEventReg[63] &= (u8)~2;
this->actionFunc = EnSyatekiMan_Town_MovePlayerAndSayHighScore;
@@ -819,8 +819,8 @@ void EnSyatekiMan_Town_HandleNormalMessage(EnSyatekiMan* this, PlayState* play)
void EnSyatekiMan_Town_Talk(EnSyatekiMan* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- if (player->stateFlags1 & 0x20) {
- player->stateFlags1 |= 0x20;
+ if (player->stateFlags1 & PLAYER_STATE1_20) {
+ player->stateFlags1 |= PLAYER_STATE1_20;
}
switch (Message_GetState(&play->msgCtx)) {
@@ -841,7 +841,7 @@ void EnSyatekiMan_Town_Talk(EnSyatekiMan* this, PlayState* play) {
if (Message_ShouldAdvance(play)) {
gSaveContext.save.weekEventReg[63] &= (u8)~1;
gSaveContext.save.weekEventReg[63] &= (u8)~2;
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
this->actionFunc = EnSyatekiMan_Town_Idle;
this->shootingGameState = SG_GAME_STATE_NONE;
}
@@ -902,7 +902,7 @@ void EnSyatekiMan_Swamp_GiveReward(EnSyatekiMan* this, PlayState* play) {
this->prevTextId = 0xA37;
}
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
this->actor.flags &= ~ACTOR_FLAG_10000;
this->score = 0;
this->shootingGameState = SG_GAME_STATE_NONE;
@@ -955,7 +955,7 @@ void EnSyatekiMan_Town_GiveReward(EnSyatekiMan* this, PlayState* play) {
if (CURRENT_DAY != 3) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) {
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
this->score = 0;
this->shootingGameState = SG_GAME_STATE_NONE;
gSaveContext.save.weekEventReg[63] &= (u8)~1;
@@ -966,7 +966,7 @@ void EnSyatekiMan_Town_GiveReward(EnSyatekiMan* this, PlayState* play) {
// This may be our last day in business...
Message_StartTextbox(play, 0x408, &this->actor);
this->prevTextId = 0x408;
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
this->actor.flags &= ~ACTOR_FLAG_10000;
this->score = 0;
this->shootingGameState = SG_GAME_STATE_NONE;
@@ -980,7 +980,7 @@ void EnSyatekiMan_Swamp_MovePlayerAndExplainRules(EnSyatekiMan* this, PlayState*
Player* player = GET_PLAYER(play);
if (EnSyatekiMan_MovePlayerToPos(play, sSwampPlayerPos)) {
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
this->shootingGameState = SG_GAME_STATE_EXPLAINING_RULES;
if (this->talkFlags != TALK_FLAG_SWAMP_HAS_EXPLAINED_THE_RULES) {
this->talkFlags = TALK_FLAG_SWAMP_HAS_EXPLAINED_THE_RULES;
@@ -1011,7 +1011,7 @@ void EnSyatekiMan_Swamp_StartGame(EnSyatekiMan* this, PlayState* play) {
sGameStartTimer = 30;
this->flagsIndex = 0;
this->score = 0;
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_FOUND);
this->dekuScrubFlags = (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) | (1 << 0);
this->guayFlags = 0;
@@ -1076,7 +1076,7 @@ void EnSyatekiMan_Swamp_RunGame(EnSyatekiMan* this, PlayState* play) {
this->actor.draw = EnSyatekiMan_Draw;
this->flagsIndex = 0;
this->currentWave = 0;
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
sHasSpawnedGuaysForThisWave = false;
func_801A2C20();
this->actionFunc = EnSyatekiMan_Swamp_EndGame;
@@ -1085,7 +1085,7 @@ void EnSyatekiMan_Swamp_RunGame(EnSyatekiMan* this, PlayState* play) {
this->actor.draw = EnSyatekiMan_Draw;
this->flagsIndex = 0;
this->currentWave = 0;
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
sHasSpawnedGuaysForThisWave = false;
func_801A2C20();
this->shootingGameState = SG_GAME_STATE_GIVING_BONUS;
@@ -1155,7 +1155,7 @@ void EnSyatekiMan_Swamp_AddBonusPoints(EnSyatekiMan* this, PlayState* play) {
static s32 sBonusTimer = 0;
Player* player = GET_PLAYER(play);
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
if (play->interfaceCtx.unk_286 == 0) {
if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_1] == SECONDS_TO_TIMER(0)) {
gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_1] = SECONDS_TO_TIMER(0);
@@ -1216,14 +1216,14 @@ void EnSyatekiMan_Town_StartGame(EnSyatekiMan* this, PlayState* play) {
player->actor.shape.rot.y = -0x8000;
player->actor.world.rot.y = player->actor.shape.rot.y;
play->unk_18790(play, -0x8000, &this->actor);
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
sGameStartTimer--;
} else if (sGameStartTimer > 0) {
player->actor.shape.rot.y = -0x8000;
player->actor.world.rot.y = player->actor.shape.rot.y;
sGameStartTimer--;
} else if (sGameStartTimer == 0) {
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
this->score = 0;
this->flagsIndex = 0;
this->perGameVar1.octorokState = SG_OCTO_STATE_INITIAL;
@@ -1352,7 +1352,7 @@ void EnSyatekiMan_Town_RunGame(EnSyatekiMan* this, PlayState* play) {
this->perGameVar1.octorokState = SG_OCTO_STATE_HIDING;
gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_1] = SECONDS_TO_TIMER(0);
gSaveContext.timerStates[TIMER_ID_MINIGAME_1] = TIMER_STATE_STOP;
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
sModFromLosingTime = 0;
this->actor.draw = EnSyatekiMan_Draw;
func_801A2C20();
diff --git a/src/overlays/actors/ovl_En_Tab/z_en_tab.c b/src/overlays/actors/ovl_En_Tab/z_en_tab.c
index ffa557746..27b9a8db4 100644
--- a/src/overlays/actors/ovl_En_Tab/z_en_tab.c
+++ b/src/overlays/actors/ovl_En_Tab/z_en_tab.c
@@ -428,7 +428,7 @@ s32 func_80BE10BC(EnTab* this, PlayState* play) {
switch (this->unk_1D8) {
case 1:
- if ((player->stateFlags1 & 0x40) && !(play->msgCtx.currentTextId <= 0x2B00) &&
+ if ((player->stateFlags1 & PLAYER_STATE1_40) && !(play->msgCtx.currentTextId <= 0x2B00) &&
(play->msgCtx.currentTextId < 0x2B08)) {
this->actor.child = &this->unk_1E4->actor;
this->unk_2FC |= 8;
diff --git a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c
index e1f80e24e..77793d991 100644
--- a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c
+++ b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c
@@ -420,9 +420,9 @@ void EnTalkGibud_Grab(EnTalkGibud* this, PlayState* play) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_ATTACK);
}
- if (!(player->stateFlags2 & 0x80) || (player->unk_B62 != 0)) {
- if ((player->unk_B62 != 0) && (player->stateFlags2 & 0x80)) {
- player->stateFlags2 &= ~0x80;
+ if (!(player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B62 != 0)) {
+ if ((player->unk_B62 != 0) && (player->stateFlags2 & PLAYER_STATE2_80)) {
+ player->stateFlags2 &= ~PLAYER_STATE2_80;
player->unk_AE8 = 100;
}
@@ -824,8 +824,8 @@ void EnTalkGibud_Talk(EnTalkGibud* this, PlayState* play) {
} else {
func_80123D50(play, player, ITEM_BOTTLE, PLAYER_AP_BOTTLE);
}
- player->stateFlags1 |= 0x20;
- player->stateFlags1 |= 0x20000000;
+ player->stateFlags1 |= PLAYER_STATE1_20;
+ player->stateFlags1 |= PLAYER_STATE1_20000000;
this->actor.flags |= ACTOR_FLAG_100000;
EnTalkGibud_SetupDisappear(this);
} else {
@@ -868,14 +868,14 @@ void EnTalkGibud_Disappear(EnTalkGibud* this, PlayState* play) {
func_800B3030(play, &pos, &velocity, &accel, 100, 0, 1);
}
func_800B9010(&this->actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG);
- player->stateFlags1 |= 0x20000000;
+ player->stateFlags1 |= PLAYER_STATE1_20000000;
this->disappearanceTimer--;
} else {
if (this->switchFlag != -1) {
Flags_SetSwitch(play, this->switchFlag);
}
- player->stateFlags1 &= ~0x20;
- player->stateFlags1 &= ~0x20000000;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20000000;
Actor_Kill(&this->actor);
}
}
@@ -895,8 +895,9 @@ s32 EnTalkGibud_PlayerInRangeWithCorrectState(EnTalkGibud* this, PlayState* play
Player* player = GET_PLAYER(play);
if ((Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 150.0f) &&
- !(player->stateFlags1 & (0x200000 | 0x80000 | 0x40000 | 0x4000 | 0x2000 | 0x80)) &&
- !(player->stateFlags2 & (0x4000 | 0x80))) {
+ !(player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 |
+ PLAYER_STATE1_80000 | PLAYER_STATE1_200000)) &&
+ !(player->stateFlags2 & (PLAYER_STATE2_80 | PLAYER_STATE2_4000))) {
return true;
}
diff --git a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c
index 2b7f7ff35..a5f1b1e95 100644
--- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c
+++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c
@@ -211,7 +211,7 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) {
// If the player gets eaten by Gyorg, or if the attack timer ran out,
// stop chasing the player for a little bit.
- if (this->workTimer[WORK_TIMER_ATTACK] == 0 || (player->stateFlags2 & 0x80)) {
+ if (this->workTimer[WORK_TIMER_ATTACK] == 0 || (player->stateFlags2 & PLAYER_STATE2_80)) {
this->workTimer[WORK_TIMER_WAIT] = 150;
this->isNonHostile = true;
}
diff --git a/src/overlays/actors/ovl_En_Test4/z_en_test4.c b/src/overlays/actors/ovl_En_Test4/z_en_test4.c
index c9c849b30..03295c989 100644
--- a/src/overlays/actors/ovl_En_Test4/z_en_test4.c
+++ b/src/overlays/actors/ovl_En_Test4/z_en_test4.c
@@ -333,7 +333,7 @@ void EnTest4_Init(Actor* thisx, PlayState* play) {
func_80A41D70(this, play);
if ((gSaveContext.cutsceneTrigger == 0) && (sCutscenes[this->unk_144] >= 0) &&
!(play->actorCtx.flags & ACTORCTX_FLAG_1)) {
- player->stateFlags1 |= 0x200;
+ player->stateFlags1 |= PLAYER_STATE1_200;
}
} else {
if ((gSaveContext.save.time > CLOCK_TIME(18, 0)) || (gSaveContext.save.time < CLOCK_TIME(6, 0))) {
@@ -399,7 +399,7 @@ void func_80A42AB8(EnTest4* this, PlayState* play) {
Play_SetRespawnData(&play->state, RESPAWN_MODE_DOWN, Entrance_CreateFromSpawn(0), player->unk_3CE,
0xBFF, &player->unk_3C0, player->unk_3CC);
func_80169EFC(&play->state);
- if (player->stateFlags1 & 0x800000) {
+ if (player->stateFlags1 & PLAYER_STATE1_800000) {
EnHorse* rideActor = (EnHorse*)player->rideActor;
if ((rideActor->type == HORSE_TYPE_EPONA) || (rideActor->type == HORSE_TYPE_2)) {
@@ -418,7 +418,7 @@ void func_80A42AB8(EnTest4* this, PlayState* play) {
}
if ((sCutscenes[this->unk_144] >= 0) && !(play->actorCtx.flags & ACTORCTX_FLAG_1)) {
- player->stateFlags1 |= 0x200;
+ player->stateFlags1 |= PLAYER_STATE1_200;
this->unk_146 = gSaveContext.save.time;
} else {
if (this->unk_144 == 0) {
@@ -456,7 +456,7 @@ void func_80A42AB8(EnTest4* this, PlayState* play) {
gSaveContext.nextCutsceneIndex = 0xFFF1;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_02;
- player->stateFlags1 |= 0x200;
+ player->stateFlags1 |= PLAYER_STATE1_200;
Actor_Kill(&this->actor);
}
func_80A42198(this);
@@ -494,7 +494,7 @@ void func_80A42F20(EnTest4* this, PlayState* play) {
gSaveContext.save.time += CLOCK_TIME_MINUTE;
this->unk_146 = gSaveContext.save.time;
play->numSetupActors = -play->numSetupActors;
- player->stateFlags1 &= ~0x200;
+ player->stateFlags1 &= ~PLAYER_STATE1_200;
}
} else {
this->actionFunc = func_80A42AB8;
@@ -563,7 +563,7 @@ void EnTest4_Update(Actor* thisx, PlayState* play) {
EnTest4* this = THIS;
Player* player = GET_PLAYER(play);
- if (!(player->stateFlags1 & 2)) {
+ if (!(player->stateFlags1 & PLAYER_STATE1_2)) {
this->actionFunc(this, play);
if (func_800FE4B8(play) != 0) {
diff --git a/src/overlays/actors/ovl_En_Test7/z_en_test7.c b/src/overlays/actors/ovl_En_Test7/z_en_test7.c
index 272d4dbdd..22e4c70b1 100644
--- a/src/overlays/actors/ovl_En_Test7/z_en_test7.c
+++ b/src/overlays/actors/ovl_En_Test7/z_en_test7.c
@@ -418,7 +418,7 @@ void EnTest7_Init(Actor* thisx, PlayState* play2) {
}
ActorCutscene_SetIntentToPlay(play->playerActorCsIds[8]);
- player2->stateFlags1 |= 0x20;
+ player2->stateFlags1 |= PLAYER_STATE1_20;
Lights_PointNoGlowSetInfo(&this->lightInfo, (Math_SinS(this->unk_1E8E) * 90.0f) + player->actor.world.pos.x,
player->actor.world.pos.y + 10.0f,
(Math_CosS(this->unk_1E8E) * 90.0f) + player->actor.world.pos.z, 255, 255, 255, 255);
@@ -759,7 +759,7 @@ void func_80AF2938(EnTest7* this, PlayState* play) {
this->unk_1E98 = player->actor.draw;
player->actor.draw = NULL;
- player->stateFlags2 |= 0x20000000;
+ player->stateFlags2 |= PLAYER_STATE2_20000000;
this->unk_144 |= 2;
this->unk_148.unk_04 = 30.0f;
if (play->roomCtx.curRoom.unk3 != 1) {
@@ -911,7 +911,7 @@ void func_80AF2F98(EnTest7* this, PlayState* play) {
this->unk_148.unk_00 = this->unk_148.unk_04;
this->unk_148.unk_08 = ((this->unk_148.unk_04 * -0.29999998f) / 11.0f) + 0.7f;
this->unk_148.unk_0C = ((this->unk_148.unk_04 * -0.29999998f) / 11.0f) + 0.7f;
- player->stateFlags2 &= ~0x20000000;
+ player->stateFlags2 &= ~PLAYER_STATE2_20000000;
}
}
@@ -919,8 +919,8 @@ void func_80AF30F4(EnTest7* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (this->unk_1E54 > 90) {
- player->stateFlags1 &= ~0x20;
- player->stateFlags1 &= ~0x20000000;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20000000;
Actor_Kill(&this->actor);
}
}
diff --git a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c
index ae3e6a7aa..88e88c2df 100644
--- a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c
+++ b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c
@@ -521,8 +521,9 @@ void func_80C11590(EnThiefbird* this, PlayState* play) {
this->unk_18E--;
}
- if ((this->unk_18E == 0) && (this->actor.xzDistToPlayer < 300.0f) && !(player->stateFlags1 & 0x800000) &&
- (Player_GetMask(play) != PLAYER_MASK_STONE) && (this->actor.depthInWater < -40.0f)) {
+ if ((this->unk_18E == 0) && (this->actor.xzDistToPlayer < 300.0f) &&
+ !(player->stateFlags1 & PLAYER_STATE1_800000) && (Player_GetMask(play) != PLAYER_MASK_STONE) &&
+ (this->actor.depthInWater < -40.0f)) {
func_80C118E4(this);
}
}
@@ -565,9 +566,9 @@ void func_80C1193C(EnThiefbird* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, rot, 4, 0x1000, 0x100);
}
- if ((this->unk_18E == 0) || (player->stateFlags1 & 0x800000) || (Player_GetMask(play) == PLAYER_MASK_STONE) ||
- (this->collider.base.atFlags & AT_HIT) || (this->actor.bgCheckFlags & 1) ||
- (this->actor.depthInWater > -40.0f)) {
+ if ((this->unk_18E == 0) || (player->stateFlags1 & PLAYER_STATE1_800000) ||
+ (Player_GetMask(play) == PLAYER_MASK_STONE) || (this->collider.base.atFlags & AT_HIT) ||
+ (this->actor.bgCheckFlags & 1) || (this->actor.depthInWater > -40.0f)) {
if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_THIEFBIRD_VOICE);
diff --git a/src/overlays/actors/ovl_En_Toto/z_en_toto.c b/src/overlays/actors/ovl_En_Toto/z_en_toto.c
index 3c1f35af3..51d58a1f5 100644
--- a/src/overlays/actors/ovl_En_Toto/z_en_toto.c
+++ b/src/overlays/actors/ovl_En_Toto/z_en_toto.c
@@ -333,7 +333,7 @@ void func_80BA3DBC(EnToto* this, PlayState* play) {
}
} else {
player = GET_PLAYER(play);
- if (player->stateFlags1 & 0x400 && player->unk_AE7 != 0) {
+ if ((player->stateFlags1 & PLAYER_STATE1_400) && player->unk_AE7 != 0) {
func_80151BB4(play, 48);
func_80151BB4(play, 9);
func_80151BB4(play, 10);
diff --git a/src/overlays/actors/ovl_En_Trt/z_en_trt.c b/src/overlays/actors/ovl_En_Trt/z_en_trt.c
index 71abb140a..3795acdb7 100644
--- a/src/overlays/actors/ovl_En_Trt/z_en_trt.c
+++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.c
@@ -223,7 +223,7 @@ void EnTrt_EndInteraction(PlayState* play, EnTrt* this) {
this->drawCursor = 0;
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false;
- player->stateFlags2 &= ~0x20000000;
+ player->stateFlags2 &= ~PLAYER_STATE2_20000000;
play->interfaceCtx.unk_222 = 0;
play->interfaceCtx.unk_224 = 0;
this->textId = 0x834;
@@ -341,7 +341,7 @@ void EnTrt_GetMushroom(EnTrt* this, PlayState* play) {
if (this->cutsceneState != ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) {
EnTrt_SetupGetMushroomCutscene(this);
if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) {
- player->stateFlags2 &= ~0x20000000;
+ player->stateFlags2 &= ~PLAYER_STATE2_20000000;
}
} else if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
switch (this->textId) {
@@ -450,7 +450,7 @@ void EnTrt_GiveRedPotionForKoume(EnTrt* this, PlayState* play) {
gSaveContext.save.weekEventReg[12] |= 0x10;
}
gSaveContext.save.weekEventReg[84] |= 0x40;
- player->stateFlags2 &= ~0x20000000;
+ player->stateFlags2 &= ~PLAYER_STATE2_20000000;
this->actionFunc = EnTrt_GivenRedPotionForKoume;
} else if (gSaveContext.save.weekEventReg[12] & 0x10) {
Actor_PickUp(&this->actor, play, GI_POTION_RED, 300.0f, 300.0f);
@@ -467,7 +467,7 @@ void EnTrt_GivenRedPotionForKoume(EnTrt* this, PlayState* play) {
if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) {
if (ActorCutscene_GetCanPlayNext(this->cutscene)) {
ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor);
- player->stateFlags2 |= 0x20000000;
+ player->stateFlags2 |= PLAYER_STATE2_20000000;
//! @bug: EnTrt_ContinueShopping gets overwritten by EnTrt_ItemGiven
this->actionFunc = EnTrt_ContinueShopping;
this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING;
@@ -652,7 +652,7 @@ void EnTrt_SetupBuyItemWithFanfare(PlayState* play, EnTrt* this) {
Actor_PickUp(&this->actor, play, this->items[this->cursorIndex]->getItemId, 300.0f, 300.0f);
play->msgCtx.msgMode = 0x43;
play->msgCtx.stateTimer = 4;
- player->stateFlags2 &= ~0x20000000;
+ player->stateFlags2 &= ~PLAYER_STATE2_20000000;
Interface_SetHudVisibility(HUD_VISIBILITY_ALL);
this->drawCursor = 0;
this->actionFunc = EnTrt_BuyItemWithFanfare;
@@ -797,7 +797,7 @@ void EnTrt_IdleSleeping(EnTrt* this, PlayState* play) {
ActorCutscene_SetIntentToPlay(this->cutscene);
this->cutsceneState = ENTRT_CUTSCENESTATE_WAITING;
}
- player->stateFlags2 |= 0x20000000;
+ player->stateFlags2 |= PLAYER_STATE2_20000000;
this->timer = 45;
this->actionFunc = EnTrt_BeginInteraction;
} else if (((player->actor.world.pos.x >= -50.0f) && (player->actor.world.pos.x <= -25.0f)) &&
@@ -838,7 +838,7 @@ void EnTrt_IdleAwake(EnTrt* this, PlayState* play) {
ActorCutscene_SetIntentToPlay(this->cutscene);
this->cutsceneState = ENTRT_CUTSCENESTATE_WAITING;
}
- player->stateFlags2 |= 0x20000000;
+ player->stateFlags2 |= PLAYER_STATE2_20000000;
if (player->transformation == PLAYER_FORM_HUMAN) {
this->flags |= ENTRT_MET;
}
@@ -999,7 +999,7 @@ void EnTrt_ItemGiven(EnTrt* this, PlayState* play) {
if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) {
if (ActorCutscene_GetCanPlayNext(this->cutscene)) {
ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor);
- player->stateFlags2 |= 0x20000000;
+ player->stateFlags2 |= PLAYER_STATE2_20000000;
this->actionFunc = EnTrt_ContinueShopping;
this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING;
} else {
@@ -1124,7 +1124,7 @@ void EnTrt_ContinueShopping(EnTrt* this, PlayState* play) {
case 0:
func_8019F208();
player->actor.shape.rot.y = BINANG_ROT180(player->actor.shape.rot.y);
- player->stateFlags2 |= 0x20000000;
+ player->stateFlags2 |= PLAYER_STATE2_20000000;
Message_StartTextbox(play, this->textId, &this->actor);
EnTrt_SetupStartShopping(play, this, true);
func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1);
diff --git a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c
index 9e4375ae6..f1835edcf 100644
--- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c
+++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c
@@ -468,7 +468,7 @@ void func_80AD4298(EnTrt2* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->unk_3DA)) {
ActorCutscene_StartAndSetUnkLinkFields(this->unk_3DA, &this->actor);
- player->stateFlags1 |= 0x20;
+ player->stateFlags1 |= PLAYER_STATE1_20;
this->unk_3B2 = 6;
} else {
if (ActorCutscene_GetCurrentIndex() == 0x7C) {
@@ -481,7 +481,7 @@ void func_80AD4298(EnTrt2* this, PlayState* play) {
void func_80AD431C(EnTrt2* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- player->stateFlags1 &= ~0x20;
+ player->stateFlags1 &= ~PLAYER_STATE1_20;
Actor_Kill(&this->actor);
}
diff --git a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c
index 3982e0420..75d279f9f 100644
--- a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c
+++ b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c
@@ -346,7 +346,7 @@ void func_80B76980(EnTruMt* this, PlayState* play) {
Message_StartTextbox(play, 0x87F, &this->actor);
gSaveContext.eventInf[3] |= 0x40;
gSaveContext.eventInf[4] |= 1;
- player->stateFlags3 &= ~0x400;
+ player->stateFlags3 &= ~PLAYER_STATE3_400;
this->actor.speedXZ = 0.0f;
this->actionFunc = func_80B76BB8;
} else if (gSaveContext.eventInf[4] & 1) {
@@ -366,7 +366,7 @@ void func_80B76A64(EnTruMt* this, PlayState* play) {
func_80B76924(this);
func_80B76980(this, play);
- player->stateFlags3 |= 0x400;
+ player->stateFlags3 |= PLAYER_STATE3_400;
if (this->path != NULL) {
func_80B76540(this->path, this->unk_36C, &this->actor.world.pos, &sp34);
@@ -406,7 +406,7 @@ void func_80B76C38(EnTruMt* this, PlayState* play) {
func_80B76924(this);
func_80B76980(this, play);
- player->stateFlags3 |= 0x400;
+ player->stateFlags3 |= PLAYER_STATE3_400;
}
void EnTruMt_Init(Actor* thisx, PlayState* play) {
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 13f3efff8..e84d59ec5 100644
--- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c
+++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c
@@ -243,8 +243,9 @@ void EnWallmas_WaitToDrop(EnWallmas* this, PlayState* play) {
this->timer--;
}
- if ((player->stateFlags1 & 0x08100000) || (player->stateFlags2 & 0x80) || (player->unk_B5E > 0) ||
- (player->actor.freezeTimer > 0) || !(player->actor.bgCheckFlags & 1) ||
+ if ((player->stateFlags1 & (PLAYER_STATE1_100000 | PLAYER_STATE1_8000000)) ||
+ (player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B5E > 0) || (player->actor.freezeTimer > 0) ||
+ !(player->actor.bgCheckFlags & 1) ||
((WALLMASTER_GET_TYPE(&this->actor) == WALLMASTER_TYPE_PROXIMITY) &&
(Math_Vec3f_DistXZ(&this->actor.home.pos, playerPos) > (120.f + this->detectionRadius)))) {
AudioSfx_StopById(NA_SE_EN_FALL_AIM);
@@ -279,9 +280,9 @@ void EnWallmas_SetupDrop(EnWallmas* this, PlayState* play) {
void EnWallmas_Drop(EnWallmas* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- if ((player->stateFlags2 & 0x80) || (player->actor.freezeTimer > 0)) {
+ if ((player->stateFlags2 & PLAYER_STATE2_80) || (player->actor.freezeTimer > 0)) {
EnWallmas_SetupReturnToCeiling(this);
- } else if (!Play_InCsMode(play) && !(player->stateFlags2 & 0x10) && (player->invincibilityTimer >= 0) &&
+ } else if (!Play_InCsMode(play) && !(player->stateFlags2 & PLAYER_STATE2_10) && (player->invincibilityTimer >= 0) &&
(this->actor.xzDistToPlayer < 30.0f) && (this->actor.playerHeightRel < -5.0f) &&
(-(f32)(player->cylinder.dim.height + 10) < this->actor.playerHeightRel)) {
EnWallmas_SetupTakePlayer(this, play);
diff --git a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c
index 2b4feee16..69e9ca3c7 100644
--- a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c
+++ b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c
@@ -176,7 +176,7 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) {
player->actor.world.pos.z = this->dyna.actor.world.pos.z + (diffZ * distance);
if (Math_StepToS(&this->unkValue15E, 0x2710, 0xC8)) {
- player->stateFlags3 |= 0x1;
+ player->stateFlags3 |= PLAYER_STATE3_1;
player->actor.gravity = -0.5f;
if (this->dyna.actor.playerHeightRel < -80.0f) {
diff --git a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c
index 543865e0b..bce9f6282 100644
--- a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c
+++ b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c
@@ -636,7 +636,7 @@ void EnWizFire_Update(Actor* thisx, PlayState* play2) {
}
}
- if ((player->stateFlags2 & 0x4000) && (player->unk_AE8 < 90)) {
+ if ((player->stateFlags2 & PLAYER_STATE2_4000) && (player->unk_AE8 < 90)) {
player->unk_AE8 = 90;
}
diff --git a/src/overlays/actors/ovl_En_Yb/z_en_yb.c b/src/overlays/actors/ovl_En_Yb/z_en_yb.c
index 486790dfd..d96a8f94e 100644
--- a/src/overlays/actors/ovl_En_Yb/z_en_yb.c
+++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.c
@@ -372,10 +372,10 @@ void EnYb_Idle(EnYb* this, PlayState* play) {
}
if (this->playerOcarinaOut & 1) {
- if (!(player->stateFlags2 & 0x8000000)) {
+ if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) {
this->playerOcarinaOut &= ~1;
}
- } else if ((player->stateFlags2 & 0x8000000) && this->actor.xzDistToPlayer < 180.0f &&
+ } else if ((player->stateFlags2 & PLAYER_STATE2_8000000) && this->actor.xzDistToPlayer < 180.0f &&
fabsf(this->actor.playerHeightRel) < 50.0f) {
this->playerOcarinaOut |= 1;
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR);
diff --git a/src/overlays/actors/ovl_En_Zob/z_en_zob.c b/src/overlays/actors/ovl_En_Zob/z_en_zob.c
index 710b82e4d..d89e1b53a 100644
--- a/src/overlays/actors/ovl_En_Zob/z_en_zob.c
+++ b/src/overlays/actors/ovl_En_Zob/z_en_zob.c
@@ -525,7 +525,7 @@ void func_80BA0374(EnZob* this, PlayState* play) {
func_801477B4(play);
this->actionFunc = func_80BA0318;
player->unk_A90 = &this->actor;
- player->stateFlags3 |= 0x20;
+ player->stateFlags3 |= PLAYER_STATE3_20;
break;
}
}
diff --git a/src/overlays/actors/ovl_En_Zog/z_en_zog.c b/src/overlays/actors/ovl_En_Zog/z_en_zog.c
index f572e8257..4f1c73473 100644
--- a/src/overlays/actors/ovl_En_Zog/z_en_zog.c
+++ b/src/overlays/actors/ovl_En_Zog/z_en_zog.c
@@ -601,10 +601,10 @@ void func_80B943EC(EnZog* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (this->unk_30A & 0x10) {
- if (!(player->stateFlags2 & 0x8000000)) {
+ if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) {
this->unk_30A &= ~0x10;
}
- } else if ((player->stateFlags2 & 0x8000000) && (this->actor.xzDistToPlayer < 120.0f)) {
+ } else if ((player->stateFlags2 & PLAYER_STATE2_8000000) && (this->actor.xzDistToPlayer < 120.0f)) {
this->unk_30A |= 0x10;
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR);
}
diff --git a/src/overlays/actors/ovl_En_Zot/z_en_zot.c b/src/overlays/actors/ovl_En_Zot/z_en_zot.c
index db054d1f8..90e712a80 100644
--- a/src/overlays/actors/ovl_En_Zot/z_en_zot.c
+++ b/src/overlays/actors/ovl_En_Zot/z_en_zot.c
@@ -553,7 +553,7 @@ void func_80B97708(EnZot* this, PlayState* play) {
return;
}
- if (!(player->stateFlags1 & 0x2000000)) {
+ if (!(player->stateFlags1 & PLAYER_STATE1_2000000)) {
phi_v1 = func_80B96CE4(this);
} else {
phi_v1 = 0;
diff --git a/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c b/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c
index b9310b27e..1325a9a16 100644
--- a/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c
+++ b/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c
@@ -252,7 +252,7 @@ void func_809A54E0(ObjArmos* this, PlayState* play) {
func_809A518C(this, sp20);
func_809A5610(this);
} else {
- GET_PLAYER(play)->stateFlags2 &= ~0x10;
+ GET_PLAYER(play)->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
}
}
@@ -289,7 +289,7 @@ void func_809A562C(ObjArmos* this, PlayState* play) {
sp20 = true;
}
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
if (!sp20) {
@@ -309,7 +309,7 @@ void func_809A57D8(ObjArmos* this) {
void func_809A57F4(ObjArmos* this, PlayState* play) {
if (fabsf(this->dyna.pushForce) > 0.1f) {
- GET_PLAYER(play)->stateFlags2 &= ~0x10;
+ GET_PLAYER(play)->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
}
}
diff --git a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c
index f8a7d38d7..f3a9d7c38 100644
--- a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c
+++ b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c
@@ -135,7 +135,7 @@ void ObjEtcetera_Idle(ObjEtcetera* this, PlayState* play) {
s16 minOscillationTimer;
Player* player = GET_PLAYER(play);
- if ((player->stateFlags3 & 0x200) && (this->dyna.actor.xzDistToPlayer < 20.0f)) {
+ if ((player->stateFlags3 & PLAYER_STATE3_200) && (this->dyna.actor.xzDistToPlayer < 20.0f)) {
// Player is launching out of the Deku Flower
Animation_Change(&this->skelAnime, &gDekuFlowerBounceAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gDekuFlowerBounceAnim), ANIMMODE_ONCE, 0.0f);
@@ -146,7 +146,7 @@ void ObjEtcetera_Idle(ObjEtcetera* this, PlayState* play) {
this->bounceOscillationScale = 0.003f;
this->oscillationTimer = 30;
this->burrowFlag &= ~1;
- } else if ((player->stateFlags3 & 0x2000) && (this->dyna.actor.xzDistToPlayer < 30.0f) &&
+ } else if ((player->stateFlags3 & PLAYER_STATE3_2000) && (this->dyna.actor.xzDistToPlayer < 30.0f) &&
(this->dyna.actor.playerHeightRel > 0.0f)) {
// Player is hovering above the Deku Flower
minOscillationTimer = 10 - (s32)(this->dyna.actor.playerHeightRel * 0.05f);
@@ -159,7 +159,8 @@ void ObjEtcetera_Idle(ObjEtcetera* this, PlayState* play) {
// Player is walking onto the Deku Flower, or falling on it from a height
this->oscillationTimer = 10;
ObjEtcetera_StartRustleAnimation(this);
- } else if ((player->actor.speedXZ > 0.1f) || ((player->unk_ABC < 0.0f) && !(player->stateFlags3 & 0x100))) {
+ } else if ((player->actor.speedXZ > 0.1f) ||
+ ((player->unk_ABC < 0.0f) && !(player->stateFlags3 & PLAYER_STATE3_100))) {
// Player is walking on top of the Deku Flower, is at the very start of burrowing, or is at the very
// start of launching
this->oscillationTimer = 10;
diff --git a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c
index a9a10f755..15c564df2 100644
--- a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c
+++ b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c
@@ -89,7 +89,7 @@ void func_80B3C39C(ObjGhaka* this, PlayState* play) {
player->transformation == PLAYER_FORM_GORON) {
func_80B3C2B0(this);
} else {
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
}
}
@@ -136,7 +136,7 @@ void func_80B3C624(ObjGhaka* this, PlayState* play) {
this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z + this->unk_168;
if (stepTemp) {
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
func_80B3C2C4(this, play);
gSaveContext.save.weekEventReg[20] |= 0x20;
diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c
index 69e542c6b..5d438239d 100644
--- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c
+++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c
@@ -178,7 +178,7 @@ void func_80931A38(ObjIcePoly* this, PlayState* play) {
s32 pad3;
f32 sp58;
- if (!(player->stateFlags2 & 0x4000) && (this->unk_14A != 0)) {
+ if (!(player->stateFlags2 & PLAYER_STATE2_4000) && (this->unk_14A != 0)) {
this->unk_14A--;
}
diff --git a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c
index 9e351dc23..b75db4261 100644
--- a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c
+++ b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c
@@ -849,7 +849,7 @@ void func_80A25404(ObjIceblock* this) {
void func_80A2541C(ObjIceblock* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
}
diff --git a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c
index 5d1931c1c..c02092e9e 100644
--- a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c
+++ b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c
@@ -137,7 +137,7 @@ void ObjMoonStone_Update(Actor* thisx, PlayState* play) {
ObjMoonStone* this = THIS;
Player* player = GET_PLAYER(play);
- if (!(player->stateFlags1 & 0x10000282)) {
+ if (!(player->stateFlags1 & (PLAYER_STATE1_2 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000))) {
this->actionFunc(this, play);
}
}
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 d4d716e90..c88d36797 100644
--- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c
+++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c
@@ -406,11 +406,11 @@ void ObjOshihiki_OnScene(ObjOshihiki* this, PlayState* play) {
return;
}
}
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
}
} else if (fabsf(this->dyna.pushForce) > 0.001f) {
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
}
}
@@ -466,7 +466,7 @@ void ObjOshihiki_OnActor(ObjOshihiki* this, PlayState* play) {
}
if (!sp20 && (fabsf(this->dyna.pushForce) > 0.001f)) {
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
}
}
@@ -494,7 +494,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, PlayState* play) {
if (!ObjOshihiki_CheckFloor(this, play)) {
this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x;
this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z;
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
this->pushDist = 0.0f;
this->pushSpeed = 0.0f;
@@ -508,7 +508,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, PlayState* play) {
this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x;
this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z;
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
this->pushDist = 0.0f;
this->pushSpeed = 0.0f;
@@ -542,7 +542,7 @@ void ObjOshihiki_Fall(ObjOshihiki* this, PlayState* play) {
if (fabsf(this->dyna.pushForce) > 0.001f) {
this->dyna.pushForce = 0.0f;
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
}
Actor_MoveWithGravity(&this->dyna.actor);
diff --git a/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c b/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c
index 9f024b0c0..f3e047020 100644
--- a/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c
+++ b/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c
@@ -268,7 +268,7 @@ void func_809A3A74(ObjPzlblock* this, PlayState* play) {
}
}
- GET_PLAYER(play)->stateFlags2 &= ~0x10;
+ GET_PLAYER(play)->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
}
}
@@ -299,7 +299,7 @@ void func_809A3BC0(ObjPzlblock* this, PlayState* play) {
sp20 = 1;
}
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
if (sp20 == 0) {
func_809A3A48(this);
@@ -318,7 +318,7 @@ void func_809A3D1C(ObjPzlblock* this) {
void func_809A3D38(ObjPzlblock* this, PlayState* play) {
if (fabsf(this->dyna.pushForce) > 0.1f) {
- GET_PLAYER(play)->stateFlags2 &= ~0x10;
+ GET_PLAYER(play)->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
}
}
diff --git a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c
index 3eee8491a..e22c73cda 100644
--- a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c
+++ b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c
@@ -369,7 +369,7 @@ void func_80A21C88(ObjSkateblock* this, s32 arg1) {
void func_80A21CB4(ObjSkateblock* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- player->stateFlags2 &= ~0x10;
+ player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
}
diff --git a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c
index 5d546a78f..1c6d53e7f 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c
@@ -52,7 +52,7 @@ void EffectSsStick_Draw(PlayState* play, u32 index, EffectSs* this) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_8012C28C(gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->rObjBankIndex].segment);
- gSPSegment(POLY_OPA_DISP++, 0x0C, D_801C0850);
+ gSPSegment(POLY_OPA_DISP++, 0x0C, gCullBackDList);
gSPDisplayList(POLY_OPA_DISP++, gDekuStickDL);
CLOSE_DISPS(gfxCtx);