From 65cf949bc04f71c93a8f7f3862339e1f1cac7337 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sun, 6 Nov 2022 21:31:55 -0300 Subject: [PATCH] Rename `ActionParam` to `ItemAction` (#1069) * Rename `ActionParam` to `ItemParam` * namefixer * ItemAction * merge issues * merge * fixes * format * renames * format * <= PLAYER_IA_MINUS1 * fixes * more fixes * e * revew * simple replace in namefixer * fixes * merge fixes * merge fixes --- include/functions.h | 22 +- include/z64.h | 2 +- include/z64player.h | 180 ++++++------ src/code/z_actor.c | 10 +- src/code/z_fireobj.c | 2 +- src/code/z_player_lib.c | 270 +++++++++--------- .../actors/ovl_Arms_Hook/z_arms_hook.c | 2 +- .../actors/ovl_Bg_Spdweb/z_bg_spdweb.c | 2 +- src/overlays/actors/ovl_En_Ah/z_en_ah.c | 2 +- .../ovl_En_Akindonuts/z_en_akindonuts.c | 22 +- src/overlays/actors/ovl_En_Al/z_en_al.c | 4 +- src/overlays/actors/ovl_En_Az/z_en_az.c | 2 +- src/overlays/actors/ovl_En_Baba/z_en_baba.c | 2 +- .../actors/ovl_En_Bba_01/z_en_bba_01.c | 2 +- .../actors/ovl_En_Bji_01/z_en_bji_01.c | 4 +- src/overlays/actors/ovl_En_Bjt/z_en_bjt.c | 33 +-- .../ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c | 4 +- src/overlays/actors/ovl_En_Butte/z_en_butte.c | 5 +- .../actors/ovl_En_Cne_01/z_en_cne_01.c | 2 +- src/overlays/actors/ovl_En_Dai/z_en_dai.c | 2 +- src/overlays/actors/ovl_En_Dno/z_en_dno.c | 2 +- src/overlays/actors/ovl_En_Dnp/z_en_dnp.c | 4 +- src/overlays/actors/ovl_En_Dnq/z_en_dnq.c | 2 +- src/overlays/actors/ovl_En_Dns/z_en_dns.c | 2 +- src/overlays/actors/ovl_En_Fsn/z_en_fsn.c | 19 +- src/overlays/actors/ovl_En_Fu/z_en_fu.c | 2 +- .../actors/ovl_En_Ginko_Man/z_en_ginko_man.c | 2 +- src/overlays/actors/ovl_En_Gm/z_en_gm.c | 2 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 4 +- src/overlays/actors/ovl_En_Gs/z_en_gs.c | 2 +- .../actors/ovl_En_Guruguru/z_en_guruguru.c | 4 +- src/overlays/actors/ovl_En_Hs/z_en_hs.c | 4 +- src/overlays/actors/ovl_En_Ig/z_en_ig.c | 2 +- src/overlays/actors/ovl_En_In/z_en_in.c | 6 +- .../actors/ovl_En_Invadepoh/z_en_invadepoh.c | 2 +- src/overlays/actors/ovl_En_Ja/z_en_ja.c | 2 +- src/overlays/actors/ovl_En_Js/z_en_js.c | 77 ++--- .../actors/ovl_En_Kakasi/z_en_kakasi.c | 2 +- src/overlays/actors/ovl_En_Kgy/z_en_kgy.c | 24 +- src/overlays/actors/ovl_En_Ma4/z_en_ma4.c | 4 +- .../actors/ovl_En_Ma_Yto/z_en_ma_yto.c | 2 +- .../actors/ovl_En_Minifrog/z_en_minifrog.c | 4 +- src/overlays/actors/ovl_En_Mk/z_en_mk.c | 2 +- src/overlays/actors/ovl_En_Ms/z_en_ms.c | 4 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 8 +- src/overlays/actors/ovl_En_Ot/z_en_ot.c | 6 +- src/overlays/actors/ovl_En_Owl/z_en_owl.c | 10 +- src/overlays/actors/ovl_En_Pm/z_en_pm.c | 4 +- src/overlays/actors/ovl_En_Pst/z_en_pst.c | 21 +- src/overlays/actors/ovl_En_Rz/z_en_rz.c | 2 +- .../actors/ovl_En_Sellnuts/z_en_sellnuts.c | 21 +- src/overlays/actors/ovl_En_Shn/z_en_shn.c | 6 +- src/overlays/actors/ovl_En_Sob1/z_en_sob1.c | 6 +- src/overlays/actors/ovl_En_Sth/z_en_sth.c | 8 +- .../ovl_En_Stone_heishi/z_en_stone_heishi.c | 21 +- .../ovl_En_Syateki_Man/z_en_syateki_man.c | 4 +- src/overlays/actors/ovl_En_Tab/z_en_tab.c | 2 +- .../ovl_En_Talk_Gibud/z_en_talk_gibud.c | 51 ++-- .../ovl_En_Talk_Gibud/z_en_talk_gibud.h | 2 +- .../actors/ovl_En_Tanron1/z_en_tanron1.c | 2 +- src/overlays/actors/ovl_En_Test3/z_en_test3.c | 4 +- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 6 +- src/overlays/actors/ovl_En_Toto/z_en_toto.c | 2 +- src/overlays/actors/ovl_En_Trt/z_en_trt.c | 24 +- src/overlays/actors/ovl_En_Tru/z_en_tru.c | 19 +- src/overlays/actors/ovl_En_Tsn/z_en_tsn.c | 15 +- src/overlays/actors/ovl_En_Yb/z_en_yb.c | 8 +- src/overlays/actors/ovl_En_Zos/z_en_zos.c | 19 +- src/overlays/actors/ovl_En_Zot/z_en_zot.c | 17 +- src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c | 2 +- .../ovl_Obj_Spidertent/z_obj_spidertent.c | 2 +- .../actors/ovl_Obj_Syokudai/z_obj_syokudai.c | 2 +- tools/namefixer.py | 35 ++- 73 files changed, 548 insertions(+), 535 deletions(-) diff --git a/include/functions.h b/include/functions.h index 33ce75a9cc..57166a1862 100644 --- a/include/functions.h +++ b/include/functions.h @@ -677,13 +677,13 @@ PosRot* Actor_GetWorldPosShapeRot(PosRot* dest, Actor* actor); s32 func_800B83F8(Actor* actor, Player* player, s32 flag); s32 Actor_ProcessTalkRequest(Actor* actor, GameState* gameState); -s32 func_800B8500(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, PlayerActionParam exchangeItemId); -s32 func_800B85E0(Actor* actor, PlayState* play, f32 radius, PlayerActionParam exchangeItemId); +s32 func_800B8500(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, PlayerItemAction exchangeItemId); +s32 func_800B85E0(Actor* actor, PlayState* play, f32 radius, PlayerItemAction exchangeItemId); s32 func_800B8614(Actor* actor, PlayState* play, f32 radius); s32 func_800B863C(Actor* actor, PlayState* play); s32 Actor_TextboxIsClosing(Actor* actor, PlayState* play); s32 Actor_ChangeFocus(Actor* actor1, PlayState* play, Actor* actor2); -PlayerActionParam Player_GetExchangeItemId(PlayState* play); +PlayerItemAction Player_GetExchangeItemId(PlayState* play); s32 func_800B8718(Actor* actor, GameState* gameState); s32 func_800B874C(Actor* actor, PlayState* play, f32 xzRange, f32 yRange); s32 func_800B8804(Actor* actor, PlayState* play, f32 xzRange); @@ -1801,14 +1801,14 @@ s32 Player_IsGoronOrDeku(Player* player); s32 func_801234D4(PlayState* play); s32 func_80123590(PlayState* play, Actor* actor); ItemId func_8012364C(PlayState* play, Player* player, s32 arg2); -PlayerActionParam func_80123810(PlayState* play); -PlayerModelGroup Player_ActionToModelGroup(Player* player, PlayerActionParam actionParam); +PlayerItemAction func_80123810(PlayState* play); +PlayerModelGroup Player_ActionToModelGroup(Player* player, PlayerItemAction itemAction); void Player_SetModelsForHoldingShield(Player* player); void Player_SetModels(Player* player, PlayerModelGroup modelGroup); void Player_SetModelGroup(Player* player, PlayerModelGroup modelGroup); void func_80123C58(Player* player); void Player_SetEquipmentData(PlayState* play, Player* player); -void Player_UpdateBottleHeld(PlayState* play, Player* player, ItemId itemId, PlayerActionParam actionParam); +void Player_UpdateBottleHeld(PlayState* play, Player* player, ItemId itemId, PlayerItemAction itemAction); void func_80123DA4(Player* player); void func_80123DC0(Player* player); void func_80123E90(PlayState* play, Actor* actor); @@ -1821,16 +1821,16 @@ s32 Player_HasMirrorShieldEquipped(PlayState* play); s32 Player_IsHoldingMirrorShield(PlayState* play); s32 Player_IsHoldingHookshot(Player* player); s32 func_801240DC(Player* player); -s32 func_80124110(Player* player, PlayerActionParam actionParam); +s32 func_80124110(Player* player, PlayerItemAction itemAction); s32 func_80124148(Player* player); -s32 Player_ActionToMeleeWeapon(PlayerActionParam actionParam); +s32 Player_ActionToMeleeWeapon(PlayerItemAction itemAction); s32 Player_GetMeleeWeaponHeld(Player* player); s32 Player_IsHoldingTwoHandedWeapon(Player* player); -s32 Player_ActionToBottle(Player* player, PlayerActionParam actionParam); +s32 Player_ActionToBottle(Player* player, PlayerItemAction itemAction); s32 Player_GetBottleHeld(Player* Player); -s32 Player_ActionToExplosive(Player* player, PlayerActionParam actionParam); +s32 Player_ActionToExplosive(Player* player, PlayerItemAction itemAction); s32 Player_GetExplosiveHeld(Player* player); -s32 Player_ActionToSword(Actor* actor, PlayerActionParam actionParam); +s32 Player_ActionToSword(Actor* actor, PlayerItemAction itemAction); s32 func_801242B4(Player* player); s32 Player_GetEnvTimerType(PlayState* play); void func_80124420(Player* player); diff --git a/include/z64.h b/include/z64.h index bde54d5bcc..922f5eeb72 100644 --- a/include/z64.h +++ b/include/z64.h @@ -1048,7 +1048,7 @@ struct PlayState { /* 0x18788 */ void (*talkWithPlayer)(struct PlayState* play, Actor* actor); /* 0x1878C */ void (*unk_1878C)(struct PlayState* play); /* 0x18790 */ void (*unk_18790)(struct PlayState* play, s16 arg1); - /* 0x18794 */ PlayerActionParam (*unk_18794)(struct PlayState* play, Player* player, ItemId itemId); + /* 0x18794 */ PlayerItemAction (*unk_18794)(struct PlayState* play, Player* player, ItemId itemId); /* 0x18798 */ s32 (*setPlayerTalkAnim)(struct PlayState* play, LinkAnimationHeader* talkAnim, s32 animMode); /* 0x1879C */ s16 playerActorCsIds[10]; /* 0x187B0 */ MtxF viewProjectionMtxF; diff --git a/include/z64player.h b/include/z64player.h index 077dbe94ba..21a1c0ca47 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -79,93 +79,93 @@ typedef enum { /* 4 */ PLAYER_ENV_TIMER_UNDERWATER_FREE } PlayerEnvTimerType; -typedef enum PlayerActionParam { - /* -1 */ PLAYER_AP_MINUS1 = -1, - /* 0x00 */ PLAYER_AP_NONE, - /* 0x01 */ PLAYER_AP_LAST_USED, - /* 0x02 */ PLAYER_AP_FISHING_ROD, - /* 0x03 */ PLAYER_AP_SWORD_KOKIRI, - /* 0x04 */ PLAYER_AP_SWORD_RAZOR, - /* 0x05 */ PLAYER_AP_SWORD_GILDED, - /* 0x06 */ PLAYER_AP_SWORD_GREAT_FAIRY, - /* 0x07 */ PLAYER_AP_STICK, - /* 0x08 */ PLAYER_AP_ZORA_FINS, - /* 0x09 */ PLAYER_AP_BOW, - /* 0x0A */ PLAYER_AP_BOW_FIRE, - /* 0x0B */ PLAYER_AP_BOW_ICE, - /* 0x0C */ PLAYER_AP_BOW_LIGHT, - /* 0x0D */ PLAYER_AP_HOOKSHOT, - /* 0x0E */ PLAYER_AP_BOMB, - /* 0x0F */ PLAYER_AP_POWDER_KEG, - /* 0x10 */ PLAYER_AP_BOMBCHU, - /* 0x11 */ PLAYER_AP_11, - /* 0x12 */ PLAYER_AP_NUT, - /* 0x13 */ PLAYER_AP_PICTO_BOX, - /* 0x14 */ PLAYER_AP_OCARINA, - /* 0x15 */ PLAYER_AP_BOTTLE, - /* 0x16 */ PLAYER_AP_BOTTLE_FISH, - /* 0x17 */ PLAYER_AP_BOTTLE_SPRING_WATER, - /* 0x18 */ PLAYER_AP_BOTTLE_HOT_SPRING_WATER, - /* 0x19 */ PLAYER_AP_BOTTLE_ZORA_EGG, - /* 0x1A */ PLAYER_AP_BOTTLE_DEKU_PRINCESS, - /* 0x1B */ PLAYER_AP_BOTTLE_GOLD_DUST, - /* 0x1C */ PLAYER_AP_BOTTLE_1C, - /* 0x1D */ PLAYER_AP_BOTTLE_SEAHORSE, - /* 0x1E */ PLAYER_AP_BOTTLE_MUSHROOM, - /* 0x1F */ PLAYER_AP_BOTTLE_HYLIAN_LOACH, - /* 0x20 */ PLAYER_AP_BOTTLE_BUG, - /* 0x21 */ PLAYER_AP_BOTTLE_POE, - /* 0x22 */ PLAYER_AP_BOTTLE_BIG_POE, - /* 0x23 */ PLAYER_AP_BOTTLE_POTION_RED, - /* 0x24 */ PLAYER_AP_BOTTLE_POTION_BLUE, - /* 0x25 */ PLAYER_AP_BOTTLE_POTION_GREEN, - /* 0x26 */ PLAYER_AP_BOTTLE_MILK, - /* 0x27 */ PLAYER_AP_BOTTLE_MILK_HALF, - /* 0x28 */ PLAYER_AP_BOTTLE_CHATEAU, - /* 0x29 */ PLAYER_AP_BOTTLE_FAIRY, - /* 0x2A */ PLAYER_AP_MOON_TEAR, - /* 0x2B */ PLAYER_AP_DEED_LAND, - /* 0x2C */ PLAYER_AP_ROOM_KEY, - /* 0x2D */ PLAYER_AP_LETTER_TO_KAFEI, - /* 0x2E */ PLAYER_AP_MAGIC_BEANS, - /* 0x2F */ PLAYER_AP_DEED_SWAMP, - /* 0x30 */ PLAYER_AP_DEED_MOUNTAIN, - /* 0x31 */ PLAYER_AP_DEED_OCEAN, - /* 0x32 */ PLAYER_AP_32, - /* 0x33 */ PLAYER_AP_LETTER_MAMA, - /* 0x34 */ PLAYER_AP_34, - /* 0x35 */ PLAYER_AP_35, - /* 0x36 */ PLAYER_AP_PENDANT_OF_MEMORIES, - /* 0x37 */ PLAYER_AP_37, - /* 0x38 */ PLAYER_AP_38, - /* 0x39 */ PLAYER_AP_39, - /* 0x3A */ PLAYER_AP_MASK_TRUTH, - /* 0x3B */ PLAYER_AP_MASK_KAFEIS_MASK, - /* 0x3C */ PLAYER_AP_MASK_ALL_NIGHT, - /* 0x3D */ PLAYER_AP_MASK_BUNNY, - /* 0x3E */ PLAYER_AP_MASK_KEATON, - /* 0x3F */ PLAYER_AP_MASK_GARO, - /* 0x40 */ PLAYER_AP_MASK_ROMANI, - /* 0x41 */ PLAYER_AP_MASK_CIRCUS_LEADER, - /* 0x42 */ PLAYER_AP_MASK_POSTMAN, - /* 0x43 */ PLAYER_AP_MASK_COUPLE, - /* 0x44 */ PLAYER_AP_MASK_GREAT_FAIRY, - /* 0x45 */ PLAYER_AP_MASK_GIBDO, - /* 0x46 */ PLAYER_AP_MASK_DON_GERO, - /* 0x47 */ PLAYER_AP_MASK_KAMARO, - /* 0x48 */ PLAYER_AP_MASK_CAPTAIN, - /* 0x49 */ PLAYER_AP_MASK_STONE, - /* 0x4A */ PLAYER_AP_MASK_BREMEN, - /* 0x4B */ PLAYER_AP_MASK_BLAST, - /* 0x4C */ PLAYER_AP_MASK_SCENTS, - /* 0x4D */ PLAYER_AP_MASK_GIANT, - /* 0x4E */ PLAYER_AP_MASK_FIERCE_DEITY, - /* 0x4F */ PLAYER_AP_MASK_GORON, - /* 0x50 */ PLAYER_AP_MASK_ZORA, - /* 0x51 */ PLAYER_AP_MASK_DEKU, - /* 0x52 */ PLAYER_AP_LENS, - /* 0x53 */ PLAYER_AP_MAX -} PlayerActionParam; +typedef enum PlayerItemAction { + /* -1 */ PLAYER_IA_MINUS1 = -1, + /* 0x00 */ PLAYER_IA_NONE, + /* 0x01 */ PLAYER_IA_LAST_USED, + /* 0x02 */ PLAYER_IA_FISHING_ROD, + /* 0x03 */ PLAYER_IA_SWORD_KOKIRI, + /* 0x04 */ PLAYER_IA_SWORD_RAZOR, + /* 0x05 */ PLAYER_IA_SWORD_GILDED, + /* 0x06 */ PLAYER_IA_SWORD_GREAT_FAIRY, + /* 0x07 */ PLAYER_IA_STICK, + /* 0x08 */ PLAYER_IA_ZORA_FINS, + /* 0x09 */ PLAYER_IA_BOW, + /* 0x0A */ PLAYER_IA_BOW_FIRE, + /* 0x0B */ PLAYER_IA_BOW_ICE, + /* 0x0C */ PLAYER_IA_BOW_LIGHT, + /* 0x0D */ PLAYER_IA_HOOKSHOT, + /* 0x0E */ PLAYER_IA_BOMB, + /* 0x0F */ PLAYER_IA_POWDER_KEG, + /* 0x10 */ PLAYER_IA_BOMBCHU, + /* 0x11 */ PLAYER_IA_11, + /* 0x12 */ PLAYER_IA_NUT, + /* 0x13 */ PLAYER_IA_PICTO_BOX, + /* 0x14 */ PLAYER_IA_OCARINA, + /* 0x15 */ PLAYER_IA_BOTTLE, + /* 0x16 */ PLAYER_IA_BOTTLE_FISH, + /* 0x17 */ PLAYER_IA_BOTTLE_SPRING_WATER, + /* 0x18 */ PLAYER_IA_BOTTLE_HOT_SPRING_WATER, + /* 0x19 */ PLAYER_IA_BOTTLE_ZORA_EGG, + /* 0x1A */ PLAYER_IA_BOTTLE_DEKU_PRINCESS, + /* 0x1B */ PLAYER_IA_BOTTLE_GOLD_DUST, + /* 0x1C */ PLAYER_IA_BOTTLE_1C, + /* 0x1D */ PLAYER_IA_BOTTLE_SEAHORSE, + /* 0x1E */ PLAYER_IA_BOTTLE_MUSHROOM, + /* 0x1F */ PLAYER_IA_BOTTLE_HYLIAN_LOACH, + /* 0x20 */ PLAYER_IA_BOTTLE_BUG, + /* 0x21 */ PLAYER_IA_BOTTLE_POE, + /* 0x22 */ PLAYER_IA_BOTTLE_BIG_POE, + /* 0x23 */ PLAYER_IA_BOTTLE_POTION_RED, + /* 0x24 */ PLAYER_IA_BOTTLE_POTION_BLUE, + /* 0x25 */ PLAYER_IA_BOTTLE_POTION_GREEN, + /* 0x26 */ PLAYER_IA_BOTTLE_MILK, + /* 0x27 */ PLAYER_IA_BOTTLE_MILK_HALF, + /* 0x28 */ PLAYER_IA_BOTTLE_CHATEAU, + /* 0x29 */ PLAYER_IA_BOTTLE_FAIRY, + /* 0x2A */ PLAYER_IA_MOON_TEAR, + /* 0x2B */ PLAYER_IA_DEED_LAND, + /* 0x2C */ PLAYER_IA_ROOM_KEY, + /* 0x2D */ PLAYER_IA_LETTER_TO_KAFEI, + /* 0x2E */ PLAYER_IA_MAGIC_BEANS, + /* 0x2F */ PLAYER_IA_DEED_SWAMP, + /* 0x30 */ PLAYER_IA_DEED_MOUNTAIN, + /* 0x31 */ PLAYER_IA_DEED_OCEAN, + /* 0x32 */ PLAYER_IA_32, + /* 0x33 */ PLAYER_IA_LETTER_MAMA, + /* 0x34 */ PLAYER_IA_34, + /* 0x35 */ PLAYER_IA_35, + /* 0x36 */ PLAYER_IA_PENDANT_OF_MEMORIES, + /* 0x37 */ PLAYER_IA_37, + /* 0x38 */ PLAYER_IA_38, + /* 0x39 */ PLAYER_IA_39, + /* 0x3A */ PLAYER_IA_MASK_TRUTH, + /* 0x3B */ PLAYER_IA_MASK_KAFEIS_MASK, + /* 0x3C */ PLAYER_IA_MASK_ALL_NIGHT, + /* 0x3D */ PLAYER_IA_MASK_BUNNY, + /* 0x3E */ PLAYER_IA_MASK_KEATON, + /* 0x3F */ PLAYER_IA_MASK_GARO, + /* 0x40 */ PLAYER_IA_MASK_ROMANI, + /* 0x41 */ PLAYER_IA_MASK_CIRCUS_LEADER, + /* 0x42 */ PLAYER_IA_MASK_POSTMAN, + /* 0x43 */ PLAYER_IA_MASK_COUPLE, + /* 0x44 */ PLAYER_IA_MASK_GREAT_FAIRY, + /* 0x45 */ PLAYER_IA_MASK_GIBDO, + /* 0x46 */ PLAYER_IA_MASK_DON_GERO, + /* 0x47 */ PLAYER_IA_MASK_KAMARO, + /* 0x48 */ PLAYER_IA_MASK_CAPTAIN, + /* 0x49 */ PLAYER_IA_MASK_STONE, + /* 0x4A */ PLAYER_IA_MASK_BREMEN, + /* 0x4B */ PLAYER_IA_MASK_BLAST, + /* 0x4C */ PLAYER_IA_MASK_SCENTS, + /* 0x4D */ PLAYER_IA_MASK_GIANT, + /* 0x4E */ PLAYER_IA_MASK_FIERCE_DEITY, + /* 0x4F */ PLAYER_IA_MASK_GORON, + /* 0x50 */ PLAYER_IA_MASK_ZORA, + /* 0x51 */ PLAYER_IA_MASK_DEKU, + /* 0x52 */ PLAYER_IA_LENS, + /* 0x53 */ PLAYER_IA_MAX +} PlayerItemAction; typedef enum PlayerMeleeWeaponAnimation { /* 0 */ PLAYER_MWA_FORWARD_SLASH_1H, // Vertical one-handed slash @@ -814,10 +814,10 @@ typedef struct Player { /* 0x144 */ s8 currentShield; /* 0x145 */ s8 currentBoots; /* 0x146 */ s8 heldItemButton; - /* 0x147 */ s8 itemActionParam; // PlayerActionParam enum + /* 0x147 */ s8 heldItemAction; // PlayerItemAction enum /* 0x148 */ u8 heldItemId; // ItemId enum /* 0x149 */ s8 prevBoots; - /* 0x14A */ s8 heldItemActionParam; // PlayerActionParam enum + /* 0x14A */ s8 itemAction; // PlayerItemAction enum /* 0x14B */ u8 transformation; // PlayerTransformation enum /* 0x14C */ u8 modelGroup; // PlayerModelGroup enum /* 0x14D */ u8 nextModelGroup; @@ -929,7 +929,7 @@ typedef struct Player { /* 0xA80 */ Actor* tatlActor; /* 0xA84 */ s16 tatlTextId; /* 0xA86 */ s8 unk_A86; // actorCutsceneIndex? - /* 0xA87 */ s8 exchangeItemId; // PlayerActionParam enum + /* 0xA87 */ s8 exchangeItemId; // PlayerItemAction enum /* 0xA88 */ Actor* talkActor; /* 0xA8C */ f32 talkActorDistance; /* 0xA90 */ Actor* unk_A90; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index b397e13b6a..4d8fdd1b4c 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1849,10 +1849,10 @@ s32 Actor_ProcessTalkRequest(Actor* actor, GameState* gameState) { // Actor_PickUpExchange? Seems to be called with exchangeItemId -1 if the same actor used Actor_PickUp // This function is also used to toggle the "Speak" action on the A button -s32 func_800B8500(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, PlayerActionParam exchangeItemId) { +s32 func_800B8500(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, PlayerItemAction exchangeItemId) { Player* player = GET_PLAYER(play); - if ((player->actor.flags & ACTOR_FLAG_100) || ((exchangeItemId > PLAYER_AP_NONE) && Player_InCsMode(play)) || + if ((player->actor.flags & ACTOR_FLAG_100) || ((exchangeItemId > PLAYER_IA_NONE) && Player_InCsMode(play)) || (!actor->isTargeted && ((fabsf(actor->playerHeightRel) > fabsf(yRange)) || (actor->xzDistToPlayer > player->talkActorDistance) || (xzRange < actor->xzDistToPlayer)))) { @@ -1867,12 +1867,12 @@ s32 func_800B8500(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, Player return true; } -s32 func_800B85E0(Actor* actor, PlayState* play, f32 radius, PlayerActionParam exchangeItemId) { +s32 func_800B85E0(Actor* actor, PlayState* play, f32 radius, PlayerItemAction exchangeItemId) { return func_800B8500(actor, play, radius, radius, exchangeItemId); } s32 func_800B8614(Actor* actor, PlayState* play, f32 radius) { - return func_800B85E0(actor, play, radius, PLAYER_AP_NONE); + return func_800B85E0(actor, play, radius, PLAYER_IA_NONE); } s32 func_800B863C(Actor* actor, PlayState* play) { @@ -1909,7 +1909,7 @@ s32 Actor_ChangeFocus(Actor* actor1, PlayState* play, Actor* actor2) { return false; } -PlayerActionParam Player_GetExchangeItemId(PlayState* play) { +PlayerItemAction Player_GetExchangeItemId(PlayState* play) { Player* player = GET_PLAYER(play); return player->exchangeItemId; diff --git a/src/code/z_fireobj.c b/src/code/z_fireobj.c index d0b88b3db2..e4f014ffae 100644 --- a/src/code/z_fireobj.c +++ b/src/code/z_fireobj.c @@ -118,7 +118,7 @@ void FireObj_UpdateStateTransitions(PlayState* play, FireObj* fire) { (waterY - fire->position.y > 6500.0f * fire->yScale)) { FireObj_SetState(fire, fire->dynamicSizeStep, FIRE_STATE_3); } - if ((fire->flags & 2) && (player->itemActionParam == PLAYER_AP_STICK)) { + if ((fire->flags & 2) && (player->heldItemAction == PLAYER_IA_STICK)) { Math_Vec3f_Diff(&player->meleeWeaponInfo[0].tip, &fire->position, &dist); if (Math3D_LengthSquared(&dist) < 400.0f) { sp40 = true; diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index aca8c5c55e..38bdc64aa7 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -571,9 +571,9 @@ ItemId func_8012364C(PlayState* play, Player* player, s32 arg2) { u16 sCItemButtons[] = { BTN_CLEFT, BTN_CDOWN, BTN_CRIGHT }; -PlayerActionParam func_80123810(PlayState* play) { +PlayerItemAction func_80123810(PlayState* play) { Player* player = GET_PLAYER(play); - s32 actionParam; + PlayerItemAction itemAction; ItemId itemId; s32 i; @@ -582,7 +582,7 @@ PlayerActionParam func_80123810(PlayState* play) { play->interfaceCtx.unk_222 = 0; play->interfaceCtx.unk_224 = 0; Interface_SetHudVisibility(play->msgCtx.unk_120BC); - return -1; + return PLAYER_IA_MINUS1; } } else { gSaveContext.save.unk_06--; @@ -597,110 +597,110 @@ PlayerActionParam func_80123810(PlayState* play) { play->interfaceCtx.unk_224 = 0; Interface_SetHudVisibility(play->msgCtx.unk_120BC); - if ((itemId >= ITEM_FD) || ((actionParam = play->unk_18794(play, player, itemId)) <= PLAYER_AP_MINUS1)) { + if ((itemId >= ITEM_FD) || ((itemAction = play->unk_18794(play, player, itemId)) <= PLAYER_IA_MINUS1)) { play_sound(NA_SE_SY_ERROR); - return PLAYER_AP_MINUS1; + return PLAYER_IA_MINUS1; } else { s32 pad; player->heldItemButton = i; - return actionParam; + return itemAction; } } } - return PLAYER_AP_NONE; + return PLAYER_IA_NONE; } -// 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 +// Used to map item actions to model groups +u8 sActionModelGroups[PLAYER_IA_MAX] = { + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_NONE + PLAYER_MODELGROUP_13, // PLAYER_IA_LAST_USED + PLAYER_MODELGROUP_STICK, // PLAYER_IA_FISHING_ROD + PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_IA_SWORD_KOKIRI + PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_IA_SWORD_RAZOR + PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_IA_SWORD_GILDED + PLAYER_MODELGROUP_TWO_HAND_SWORD, // PLAYER_IA_SWORD_GREAT_FAIRY + PLAYER_MODELGROUP_STICK, // PLAYER_IA_STICK + PLAYER_MODELGROUP_ZORA_FINS, // PLAYER_IA_ZORA_FINS + PLAYER_MODELGROUP_BOW, // PLAYER_IA_BOW + PLAYER_MODELGROUP_BOW, // PLAYER_IA_BOW_FIRE + PLAYER_MODELGROUP_BOW, // PLAYER_IA_BOW_ICE + PLAYER_MODELGROUP_BOW, // PLAYER_IA_BOW_LIGHT + PLAYER_MODELGROUP_HOOKSHOT, // PLAYER_IA_HOOKSHOT + PLAYER_MODELGROUP_EXPLOSIVES, // PLAYER_IA_BOMB + PLAYER_MODELGROUP_EXPLOSIVES, // PLAYER_IA_POWDER_KEG + PLAYER_MODELGROUP_EXPLOSIVES, // PLAYER_IA_BOMBCHU + PLAYER_MODELGROUP_8, // PLAYER_IA_11 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_NUT + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_PICTO_BOX + PLAYER_MODELGROUP_INSTRUMENT, // PLAYER_IA_OCARINA + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_FISH + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_SPRING_WATER + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_HOT_SPRING_WATER + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_ZORA_EGG + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_DEKU_PRINCESS + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_GOLD_DUST + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_1C + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_SEAHORSE + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_MUSHROOM + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_HYLIAN_LOACH + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_BUG + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_POE + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_BIG_POE + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_POTION_RED + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_POTION_BLUE + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_POTION_GREEN + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_MILK + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_MILK_HALF + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_CHATEAU + PLAYER_MODELGROUP_BOTTLE, // PLAYER_IA_BOTTLE_FAIRY + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MOON_TEAR + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_DEED_LAND + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_ROOM_KEY + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_LETTER_TO_KAFEI + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MAGIC_BEANS + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_DEED_SWAMP + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_DEED_MOUNTAIN + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_DEED_OCEAN + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_32 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_LETTER_MAMA + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_34 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_35 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_PENDANT_OF_MEMORIES + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_37 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_38 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_39 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_TRUTH + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_KAFEIS_MASK + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_ALL_NIGHT + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_BUNNY + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_KEATON + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_GARO + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_ROMANI + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_CIRCUS_LEADER + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_POSTMAN + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_COUPLE + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_GREAT_FAIRY + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_GIBDO + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_DON_GERO + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_KAMARO + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_CAPTAIN + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_STONE + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_BREMEN + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_BLAST + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_SCENTS + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_GIANT + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_FIERCE_DEITY + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_GORON + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_ZORA + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_MASK_DEKU + PLAYER_MODELGROUP_DEFAULT, // PLAYER_IA_LENS }; -PlayerModelGroup Player_ActionToModelGroup(Player* player, PlayerActionParam actionParam) { - PlayerModelGroup modelGroup = sActionModelGroups[actionParam]; +PlayerModelGroup Player_ActionToModelGroup(Player* player, PlayerItemAction itemAction) { + PlayerModelGroup modelGroup = sActionModelGroups[itemAction]; if ((modelGroup == PLAYER_MODELGROUP_ONE_HAND_SWORD) && Player_IsGoronOrDeku(player)) { return PLAYER_MODELGROUP_1; @@ -1172,7 +1172,7 @@ u8 D_801C07AC[] = { void Player_SetModelsForHoldingShield(Player* player) { if (player->stateFlags1 & PLAYER_STATE1_400000) { - if ((player->heldItemActionParam < 0) || (player->heldItemActionParam == player->itemActionParam)) { + if ((player->itemAction <= PLAYER_IA_MINUS1) || (player->itemAction == player->heldItemAction)) { if (!Player_IsHoldingTwoHandedWeapon(player)) { if (!Player_IsGoronOrDeku(player)) { D_801F59E0 = player->transformation * 2; @@ -1187,7 +1187,7 @@ void Player_SetModelsForHoldingShield(Player* player) { player->sheathDLists = &sPlayerDListGroups[player->sheathType][D_801F59E0]; player->modelAnimType = PLAYER_ANIMTYPE_2; - player->heldItemActionParam = -1; + player->itemAction = PLAYER_IA_MINUS1; } } } @@ -1238,8 +1238,8 @@ void Player_SetModelGroup(Player* player, PlayerModelGroup modelGroup) { } void func_80123C58(Player* player) { - player->heldItemActionParam = player->itemActionParam; - Player_SetModelGroup(player, Player_ActionToModelGroup(player, player->itemActionParam)); + player->itemAction = player->heldItemAction; + Player_SetModelGroup(player, Player_ActionToModelGroup(player, player->heldItemAction)); player->unk_AA5 = 0; } @@ -1250,7 +1250,7 @@ void Player_SetEquipmentData(PlayState* play, Player* player) { (player->currentBoots != PLAYER_BOOTS_ZORA_UNDERWATER))) { player->currentBoots = D_801BFF90[player->transformation]; } - Player_SetModelGroup(player, Player_ActionToModelGroup(player, player->itemActionParam)); + Player_SetModelGroup(player, Player_ActionToModelGroup(player, player->heldItemAction)); func_80123140(play, player); if (player->unk_B62 != 0) { player->unk_B62 = 1; @@ -1258,15 +1258,15 @@ void Player_SetEquipmentData(PlayState* play, Player* player) { } } -void Player_UpdateBottleHeld(PlayState* play, Player* player, ItemId itemId, PlayerActionParam actionParam) { +void Player_UpdateBottleHeld(PlayState* play, Player* player, ItemId itemId, PlayerItemAction itemAction) { Inventory_UpdateBottleItem(play, itemId, player->heldItemButton); if (itemId != ITEM_BOTTLE) { player->heldItemId = itemId; - player->itemActionParam = actionParam; + player->heldItemAction = itemAction; } - player->heldItemActionParam = actionParam; + player->itemAction = itemAction; } void func_80123DA4(Player* player) { @@ -1319,7 +1319,7 @@ s32 Player_IsBurningStickInRange(PlayState* play, Vec3f* pos, f32 xzRange, f32 y Vec3f diff; s32 pad; - if ((this->itemActionParam == PLAYER_AP_STICK) && (this->unk_B28 != 0)) { + if ((this->heldItemAction == PLAYER_IA_STICK) && (this->unk_B28 != 0)) { Math_Vec3f_Diff(&this->meleeWeaponInfo[0].tip, pos, &diff); return (SQXZ(diff) <= SQ(xzRange)) && (0.0f <= diff.y) && (diff.y <= yRange); } @@ -1358,19 +1358,19 @@ s32 Player_IsHoldingMirrorShield(PlayState* play) { } s32 Player_IsHoldingHookshot(Player* player) { - return player->itemActionParam == PLAYER_AP_HOOKSHOT; + return player->heldItemAction == PLAYER_IA_HOOKSHOT; } s32 func_801240DC(Player* player) { return Player_IsHoldingHookshot(player) && (player->heldActor == NULL); } -s32 func_80124110(Player* player, PlayerActionParam actionParam) { - s32 temp_v0 = actionParam - PLAYER_AP_FISHING_ROD; +s32 func_80124110(Player* player, PlayerItemAction itemAction) { + s32 temp_v0 = itemAction - PLAYER_IA_FISHING_ROD; if (player->transformation != PLAYER_FORM_GORON) { - if (((actionParam - PLAYER_AP_FISHING_ROD) > (PLAYER_AP_FISHING_ROD - PLAYER_AP_FISHING_ROD)) && - ((actionParam - PLAYER_AP_FISHING_ROD) < (PLAYER_AP_SWORD_GREAT_FAIRY - PLAYER_AP_FISHING_ROD))) { + if (((itemAction - PLAYER_IA_FISHING_ROD) > (PLAYER_IA_FISHING_ROD - PLAYER_IA_FISHING_ROD)) && + ((itemAction - PLAYER_IA_FISHING_ROD) < (PLAYER_IA_SWORD_GREAT_FAIRY - PLAYER_IA_FISHING_ROD))) { return temp_v0; } } @@ -1379,36 +1379,36 @@ s32 func_80124110(Player* player, PlayerActionParam actionParam) { } s32 func_80124148(Player* player) { - return func_80124110(player, player->itemActionParam); + return func_80124110(player, player->heldItemAction); } -s32 Player_ActionToMeleeWeapon(PlayerActionParam actionParam) { - s32 weapon = actionParam - (PLAYER_AP_SWORD_KOKIRI - 1); +s32 Player_ActionToMeleeWeapon(PlayerItemAction itemAction) { + s32 weapon = itemAction - (PLAYER_IA_SWORD_KOKIRI - 1); - if ((weapon > 0) && (weapon <= (PLAYER_AP_ZORA_FINS - (PLAYER_AP_SWORD_KOKIRI - 1)))) { + if ((weapon > 0) && (weapon <= (PLAYER_IA_ZORA_FINS - (PLAYER_IA_SWORD_KOKIRI - 1)))) { return weapon; } return 0; } s32 Player_GetMeleeWeaponHeld(Player* player) { - return Player_ActionToMeleeWeapon(player->itemActionParam); + return Player_ActionToMeleeWeapon(player->heldItemAction); } s32 Player_IsHoldingTwoHandedWeapon(Player* player) { - // Relies on the actionParams for two-handed weapons being contiguous. - if ((player->itemActionParam >= PLAYER_AP_SWORD_GREAT_FAIRY) && (player->itemActionParam <= PLAYER_AP_STICK)) { + // Relies on the itemActions for two-handed weapons being contiguous. + if ((player->heldItemAction >= PLAYER_IA_SWORD_GREAT_FAIRY) && (player->heldItemAction <= PLAYER_IA_STICK)) { return true; } return false; } -s32 Player_ActionToBottle(Player* player, PlayerActionParam actionParam) { - s32 bottle = actionParam - PLAYER_AP_BOTTLE; +s32 Player_ActionToBottle(Player* player, PlayerItemAction itemAction) { + s32 bottle = itemAction - PLAYER_IA_BOTTLE; - // Relies on bottle-related action params to be contiguous - if ((bottle >= (PLAYER_AP_BOTTLE - PLAYER_AP_BOTTLE)) && (bottle <= (PLAYER_AP_BOTTLE_FAIRY - PLAYER_AP_BOTTLE))) { + // Relies on bottle-related item actions to be contiguous + if ((bottle >= (PLAYER_IA_BOTTLE - PLAYER_IA_BOTTLE)) && (bottle <= (PLAYER_IA_BOTTLE_FAIRY - PLAYER_IA_BOTTLE))) { return bottle; } @@ -1416,14 +1416,14 @@ s32 Player_ActionToBottle(Player* player, PlayerActionParam actionParam) { } s32 Player_GetBottleHeld(Player* Player) { - return Player_ActionToBottle(Player, Player->itemActionParam); + return Player_ActionToBottle(Player, Player->heldItemAction); } -s32 Player_ActionToExplosive(Player* player, PlayerActionParam actionParam) { - s32 explosive = actionParam - PLAYER_AP_BOMB; +s32 Player_ActionToExplosive(Player* player, PlayerItemAction itemAction) { + s32 explosive = itemAction - PLAYER_IA_BOMB; - // Relies on explosive-related action params to be contiguous - if ((explosive >= (PLAYER_AP_BOMB - PLAYER_AP_BOMB)) && (explosive <= (PLAYER_AP_BOMBCHU - PLAYER_AP_BOMB))) { + // Relies on explosive-related item actions to be contiguous + if ((explosive >= (PLAYER_IA_BOMB - PLAYER_IA_BOMB)) && (explosive <= (PLAYER_IA_BOMBCHU - PLAYER_IA_BOMB))) { return explosive; } @@ -1431,16 +1431,16 @@ s32 Player_ActionToExplosive(Player* player, PlayerActionParam actionParam) { } s32 Player_GetExplosiveHeld(Player* player) { - return Player_ActionToExplosive(player, player->itemActionParam); + return Player_ActionToExplosive(player, player->heldItemAction); } -s32 Player_ActionToSword(Actor* actor, PlayerActionParam actionParam) { +s32 Player_ActionToSword(Actor* actor, PlayerItemAction itemAction) { s32 sword = 0; //! FAKE: - if ((actionParam == PLAYER_AP_LAST_USED) || - ((sword = actionParam - PLAYER_AP_SWORD_KOKIRI, (sword >= PLAYER_AP_SWORD_KOKIRI - PLAYER_AP_SWORD_KOKIRI)) && - (sword <= PLAYER_AP_SWORD_GREAT_FAIRY - PLAYER_AP_SWORD_KOKIRI))) { + if ((itemAction == PLAYER_IA_LAST_USED) || + ((sword = itemAction - PLAYER_IA_SWORD_KOKIRI, (sword >= PLAYER_IA_SWORD_KOKIRI - PLAYER_IA_SWORD_KOKIRI)) && + (sword <= PLAYER_IA_SWORD_GREAT_FAIRY - PLAYER_IA_SWORD_KOKIRI))) { return sword; } @@ -2249,12 +2249,12 @@ 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 + 3000.0f, // PLAYER_IA_SWORD_KOKIRI + 3000.0f, // PLAYER_IA_SWORD_RAZOR + 4000.0f, // PLAYER_IA_SWORD_GILDED + 5500.0f, // PLAYER_IA_SWORD_GREAT_FAIRY + -1.0f, // PLAYER_IA_STICK + 2500.0f, // PLAYER_IA_ZORA_FINS }; Gfx* D_801C0D94 = object_link_child_DL_017818; 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 5cdc8d1814..0eaa5787f5 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -109,7 +109,7 @@ 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) || + if ((player->itemAction != player->heldItemAction) || (player->actor.flags & ACTOR_FLAG_100) || (player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_4000000))) { this->timer = 0; ArmsHook_DetachHookFromActor(this); 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 0dbfd96943..fb8d464c8b 100644 --- a/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c +++ b/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c @@ -450,7 +450,7 @@ void func_809CEBC0(BgSpdweb* this, PlayState* play) { this->dyna.actor.world.pos.z; } func_809CEE74(this); - } else if ((player->itemActionParam == 7) && (player->unk_B28 != 0)) { + } else if ((player->heldItemAction == PLAYER_IA_STICK) && (player->unk_B28 != 0)) { Math_Vec3f_Diff(&player->meleeWeaponInfo[0].tip, &this->dyna.actor.world.pos, &sp3C); sp38 = Math_SinS(-this->dyna.actor.shape.rot.x); sp34 = Math_CosS(-this->dyna.actor.shape.rot.x); 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 d2bdbf59e6..2f4e4ed039 100644 --- a/src/overlays/actors/ovl_En_Ah/z_en_ah.c +++ b/src/overlays/actors/ovl_En_Ah/z_en_ah.c @@ -554,7 +554,7 @@ void EnAh_Update(Actor* thisx, PlayState* play) { radius = this->collider.dim.radius + 60; height = this->collider.dim.height + 10; - func_8013C964(&this->actor, play, radius, height, PLAYER_AP_NONE, this->unk_2D8 & 7); + func_8013C964(&this->actor, play, radius, height, PLAYER_IA_NONE, this->unk_2D8 & 7); if (!(this->unk_2D8 & 0x10)) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, 4); diff --git a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c index 54013c91a6..d2bdf0ceec 100644 --- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c +++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c @@ -1040,41 +1040,41 @@ void func_80BEE73C(EnAkindonuts* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 pad; s32 params = ENAKINDONUTS_GET_3(&this->actor); - s32 itemActionParam = func_80123810(play); + PlayerItemAction itemAction = func_80123810(play); - if (itemActionParam > PLAYER_AP_NONE) { - if (itemActionParam == PLAYER_AP_DEED_LAND) { + if (itemAction > PLAYER_IA_NONE) { + if (itemAction == PLAYER_IA_DEED_LAND) { player->actor.textId = D_80BF048C[params]; this->unk_33C = player->actor.textId; if (this->unk_33C == 0x15E4) { - player->exchangeItemId = itemActionParam; + player->exchangeItemId = itemAction; this->actionFunc = func_80BEF20C; } else { this->actionFunc = func_80BEF18C; } - } else if (itemActionParam == PLAYER_AP_DEED_SWAMP) { + } else if (itemAction == PLAYER_IA_DEED_SWAMP) { player->actor.textId = D_80BF0494[params]; this->unk_33C = player->actor.textId; if (this->unk_33C == 0x15F9) { - player->exchangeItemId = itemActionParam; + player->exchangeItemId = itemAction; this->actionFunc = func_80BEF20C; } else { this->actionFunc = func_80BEF18C; } - } else if (itemActionParam == PLAYER_AP_DEED_MOUNTAIN) { + } else if (itemAction == PLAYER_IA_DEED_MOUNTAIN) { player->actor.textId = D_80BF049C[params]; this->unk_33C = player->actor.textId; if (this->unk_33C == 0x160C) { - player->exchangeItemId = itemActionParam; + player->exchangeItemId = itemAction; this->actionFunc = func_80BEF20C; } else { this->actionFunc = func_80BEF18C; } - } else if (itemActionParam == PLAYER_AP_DEED_OCEAN) { + } else if (itemAction == PLAYER_IA_DEED_OCEAN) { player->actor.textId = D_80BF04A4[params]; this->unk_33C = player->actor.textId; if (this->unk_33C == 0x1621) { - player->exchangeItemId = itemActionParam; + player->exchangeItemId = itemAction; this->actionFunc = func_80BEF20C; } else { this->actionFunc = func_80BEF18C; @@ -1085,7 +1085,7 @@ void func_80BEE73C(EnAkindonuts* this, PlayState* play) { this->actionFunc = func_80BEF18C; } func_801477B4(play); - } else if (itemActionParam < PLAYER_AP_NONE) { + } else if (itemAction <= PLAYER_IA_MINUS1) { this->unk_33C = D_80BF04AC[params]; func_80151938(play, this->unk_33C); this->actionFunc = func_80BEF18C; 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 5b7a258335..b5ea2f64f7 100644 --- a/src/overlays/actors/ovl_En_Al/z_en_al.c +++ b/src/overlays/actors/ovl_En_Al/z_en_al.c @@ -659,7 +659,7 @@ s32 func_80BDF308(EnAl* this, PlayState* play, ScheduleOutput* scheduleOutput) { break; case 2: - this->unk_4F0 = PLAYER_AP_NONE; + this->unk_4F0 = PLAYER_IA_NONE; this->unk_4EA = 0; func_80BDE27C(this, 2); break; @@ -672,7 +672,7 @@ s32 func_80BDF390(EnAl* this, PlayState* play, ScheduleOutput* scheduleOutput) { this->actor.flags |= ACTOR_FLAG_1; this->actor.targetMode = 0; - this->unk_4F0 = PLAYER_AP_NONE; + this->unk_4F0 = PLAYER_IA_NONE; this->unk_4C2 = 0; this->unk_4D4 = 40.0f; diff --git a/src/overlays/actors/ovl_En_Az/z_en_az.c b/src/overlays/actors/ovl_En_Az/z_en_az.c index 7548c7604c..33a23aae25 100644 --- a/src/overlays/actors/ovl_En_Az/z_en_az.c +++ b/src/overlays/actors/ovl_En_Az/z_en_az.c @@ -1337,7 +1337,7 @@ void func_80A97410(EnAz* this, PlayState* play) { func_80A97114(this, play); this->unk_378 = 2; } else if (func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, - PLAYER_AP_MINUS1)) { + PLAYER_IA_MINUS1)) { this->actor.textId = func_80A973B4(this, play); } } else { diff --git a/src/overlays/actors/ovl_En_Baba/z_en_baba.c b/src/overlays/actors/ovl_En_Baba/z_en_baba.c index bbe12faa3d..0c5d7b799b 100644 --- a/src/overlays/actors/ovl_En_Baba/z_en_baba.c +++ b/src/overlays/actors/ovl_En_Baba/z_en_baba.c @@ -647,7 +647,7 @@ void EnBaba_GaveBlastMask(EnBaba* this, PlayState* play) { EnBaba_HandleConversation(this, play); this->actionFunc = EnBaba_Talk; } else { - func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); } } diff --git a/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c b/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c index 575e7cf462..1b95381460 100644 --- a/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c +++ b/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c @@ -150,7 +150,7 @@ s32 func_809CC270(EnBba01* this, PlayState* play) { Actor_GetScreenPos(play, &this->enHy.actor, &x, &y); //! @bug: Both x and y conditionals are always true, || should be an && if (!this->enHy.waitingOnInit && ((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT))) { - func_800B85E0(&this->enHy.actor, play, 30.0f, PLAYER_AP_MAGIC_BEANS); + func_800B85E0(&this->enHy.actor, play, 30.0f, PLAYER_IA_MAGIC_BEANS); } return true; } diff --git a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c index 5a1e0b5d52..25b59b59be 100644 --- a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c +++ b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c @@ -109,7 +109,7 @@ void func_809CCEE8(EnBji01* this, PlayState* play) { } else { this->moonsTear = (ObjMoonStone*)SubS_FindActor(play, NULL, ACTORCAT_PROP, ACTOR_OBJ_MOON_STONE); } - func_800B8500(&this->actor, play, 60.0f, 10.0f, PLAYER_AP_NONE); + func_800B8500(&this->actor, play, 60.0f, 10.0f, PLAYER_IA_NONE); } } @@ -162,7 +162,7 @@ void func_809CD028(EnBji01* this, PlayState* play) { this->textId = 0x5F1; } func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, - PLAYER_AP_NONE); + PLAYER_IA_NONE); break; case PLAYER_FORM_HUMAN: this->textId = 0x5F7; diff --git a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c index 7331480e17..08070b61d7 100644 --- a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c +++ b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c @@ -143,27 +143,27 @@ void EnBjt_UpdateCollision(EnBjt* this, PlayState* play) { s32 EnBjt_TakeItem(s32 exchangeItem) { switch (exchangeItem) { - case PLAYER_AP_LETTER_TO_KAFEI: + case PLAYER_IA_LETTER_TO_KAFEI: Inventory_DeleteItem(ITEM_LETTER_TO_KAFEI, SLOT(ITEM_LETTER_TO_KAFEI)); break; - case PLAYER_AP_DEED_SWAMP: + case PLAYER_IA_DEED_SWAMP: Inventory_DeleteItem(ITEM_DEED_SWAMP, SLOT(ITEM_DEED_SWAMP)); break; - case PLAYER_AP_DEED_MOUNTAIN: + case PLAYER_IA_DEED_MOUNTAIN: Inventory_DeleteItem(ITEM_DEED_MOUNTAIN, SLOT(ITEM_DEED_MOUNTAIN)); break; - case PLAYER_AP_DEED_OCEAN: + case PLAYER_IA_DEED_OCEAN: Inventory_DeleteItem(ITEM_DEED_OCEAN, SLOT(ITEM_DEED_OCEAN)); break; - case PLAYER_AP_DEED_LAND: + case PLAYER_IA_DEED_LAND: Inventory_DeleteItem(ITEM_DEED_LAND, SLOT(ITEM_DEED_LAND)); break; - case PLAYER_AP_LETTER_MAMA: + case PLAYER_IA_LETTER_MAMA: Inventory_DeleteItem(ITEM_LETTER_MAMA, SLOT(ITEM_LETTER_MAMA)); break; @@ -236,7 +236,7 @@ typedef enum { s32 EnBjt_ChooseBehaviour(Actor* thisx, PlayState* play) { Player* player = GET_PLAYER(play); EnBjt* this = THIS; - s32 itemAP; + PlayerItemAction itemAction; s32 scriptBranch = 0; switch (this->behaviour) { @@ -249,19 +249,20 @@ s32 EnBjt_ChooseBehaviour(Actor* thisx, PlayState* play) { } // Fallthrough case TEXT_STATE_16: - itemAP = func_80123810(play); - if ((itemAP == PLAYER_AP_DEED_LAND) || (itemAP == PLAYER_AP_LETTER_TO_KAFEI) || - (itemAP == PLAYER_AP_DEED_SWAMP) || (itemAP == PLAYER_AP_DEED_MOUNTAIN) || - (itemAP == PLAYER_AP_DEED_OCEAN) || (itemAP == PLAYER_AP_LETTER_MAMA)) { + itemAction = func_80123810(play); + + if ((itemAction == PLAYER_IA_DEED_LAND) || (itemAction == PLAYER_IA_LETTER_TO_KAFEI) || + (itemAction == PLAYER_IA_DEED_SWAMP) || (itemAction == PLAYER_IA_DEED_MOUNTAIN) || + (itemAction == PLAYER_IA_DEED_OCEAN) || (itemAction == PLAYER_IA_LETTER_MAMA)) { EnBjt_ChangeAnim(this, TOILET_HAND_ANIM_WAITING_MORPH); this->playedSfx = false; this->behaviour++; scriptBranch = 1; // Right item - } else if (itemAP < 0) { + } else if (itemAction <= PLAYER_IA_MINUS1) { this->playedSfx = false; this->behaviour++; scriptBranch = 3; // Not showing item - } else if (itemAP != 0) { + } else if (itemAction != PLAYER_IA_NONE) { this->playedSfx = false; this->behaviour++; scriptBranch = 2; // Wrong item @@ -274,9 +275,9 @@ s32 EnBjt_ChooseBehaviour(Actor* thisx, PlayState* play) { break; case TOILET_HAND_BEHAVIOUR_TAKE_ITEM: - if (player->exchangeItemId != PLAYER_AP_NONE) { + if (player->exchangeItemId != PLAYER_IA_NONE) { EnBjt_TakeItem(player->exchangeItemId); - player->exchangeItemId = PLAYER_AP_NONE; + player->exchangeItemId = PLAYER_IA_NONE; } if (EnBjt_Vanish(this)) { this->timer = 60; @@ -445,7 +446,7 @@ void EnBjt_Update(Actor* thisx, PlayState* play) { if (this->scheduleResult != TOILET_HAND_SCH_NONE) { EnBjt_UpdateSkelAnime(this); - func_8013C964(&this->actor, play, 60.0f, 10.0f, PLAYER_AP_NONE, this->stateFlags & 7); + func_8013C964(&this->actor, play, 60.0f, 10.0f, PLAYER_IA_NONE, this->stateFlags & 7); Actor_SetFocus(&this->actor, 26.0f); EnBjt_UpdateCollision(this, play); } diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 9d42da748f..9b1f45a204 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -510,7 +510,7 @@ void func_809C59F0(EnBomBowlMan* this, PlayState* play) { } else { this->actor.textId = 0x716; } - func_800B8500(&this->actor, play, 400.0f, 400.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 400.0f, 400.0f, PLAYER_IA_MINUS1); this->actionFunc = func_809C5AA4; } else { Actor_PickUp(&this->actor, play, GI_BOMBERS_NOTEBOOK, 300.0f, 300.0f); @@ -525,7 +525,7 @@ void func_809C5AA4(EnBomBowlMan* this, PlayState* play) { this->actionFunc = func_809C5598; } } else { - func_800B8500(&this->actor, play, 400.0f, 400.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 400.0f, 400.0f, PLAYER_IA_MINUS1); } } diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/src/overlays/actors/ovl_En_Butte/z_en_butte.c index ce27bc7d67..eb3365b836 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -287,7 +287,8 @@ void func_8091C794(EnButte* this, PlayState* play) { func_8091C0A0(this, &D_8091D324[this->unk_24E]); } - if ((ENBUTTE_GET_1(&this->actor) == ENBUTTE_1) && (player->itemActionParam == 7) && (this->unk_252 <= 0) && + if ((ENBUTTE_GET_1(&this->actor) == ENBUTTE_1) && (player->heldItemAction == PLAYER_IA_STICK) && + (this->unk_252 <= 0) && ((Math3D_XZDistanceSquared(player->actor.world.pos.x, player->actor.world.pos.z, this->actor.home.pos.x, this->actor.home.pos.z) < SQ(120.0f)) || (this->actor.xzDistToPlayer < 60.0f))) { @@ -355,7 +356,7 @@ void func_8091CBB4(EnButte* this, PlayState* play) { distSq = Math3D_XZDistanceSquared(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x, this->actor.home.pos.z); - if ((player->itemActionParam != 7) || !(fabsf(player->actor.speedXZ) < 1.8f) || (this->unk_252 > 0) || + if ((player->heldItemAction != PLAYER_IA_STICK) || !(fabsf(player->actor.speedXZ) < 1.8f) || (this->unk_252 > 0) || !(distSq < SQ(320.0f))) { func_8091C748(this); } else if ((distSq > SQ(240.0f)) && diff --git a/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c b/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c index 81b10b25dc..876914a2a6 100644 --- a/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c +++ b/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c @@ -142,7 +142,7 @@ s32 func_809CB4A0(EnCne01* this, PlayState* play) { Actor_GetScreenPos(play, &this->enHy.actor, &x, &y); //! @bug: Both x and y conditionals are always true, || should be an && if (!this->enHy.waitingOnInit && ((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT))) { - func_800B85E0(&this->enHy.actor, play, 30.0f, PLAYER_AP_MAGIC_BEANS); + func_800B85E0(&this->enHy.actor, play, 30.0f, PLAYER_IA_MAGIC_BEANS); } return true; } 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 bf97a682a5..2f2496f576 100644 --- a/src/overlays/actors/ovl_En_Dai/z_en_dai.c +++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.c @@ -561,7 +561,7 @@ void EnDai_Update(Actor* thisx, PlayState* play) { SkelAnime_Update(&this->skelAnime); func_80B3E834(this); if (!(this->unk_1CE & 0x200)) { - func_8013C964(&this->actor, play, 0.0f, 0.0f, PLAYER_AP_NONE, this->unk_1CE & 7); + func_8013C964(&this->actor, play, 0.0f, 0.0f, PLAYER_IA_NONE, this->unk_1CE & 7); } func_80B3E460(this); } diff --git a/src/overlays/actors/ovl_En_Dno/z_en_dno.c b/src/overlays/actors/ovl_En_Dno/z_en_dno.c index b339a24222..12e048955b 100644 --- a/src/overlays/actors/ovl_En_Dno/z_en_dno.c +++ b/src/overlays/actors/ovl_En_Dno/z_en_dno.c @@ -573,7 +573,7 @@ void func_80A724B8(EnDno* this, PlayState* play) { } void func_80A7256C(EnDno* this, PlayState* play) { - func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_IA_MINUS1); } void func_80A72598(EnDno* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c index 5ed289950d..b504e9a115 100644 --- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c +++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c @@ -354,7 +354,7 @@ void func_80B3D338(EnDnp* this, PlayState* play) { } else { this->actor.textId = 0x971; player->actor.textId = this->actor.textId; - func_800B8500(&this->actor, play, 9999.9f, 9999.9f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 9999.9f, 9999.9f, PLAYER_IA_MINUS1); } } } @@ -461,7 +461,7 @@ void EnDnp_Update(Actor* thisx, PlayState* play) { if ((this->unk_322 & 0x400) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_23_20)) { Actor_PickUp(&this->actor, play, GI_MAX, sp2C, sp28); } - func_8013C964(&this->actor, play, sp2C, sp28, PLAYER_AP_NONE, this->unk_322 & 7); + func_8013C964(&this->actor, play, sp2C, sp28, PLAYER_IA_NONE, this->unk_322 & 7); Actor_SetFocus(&this->actor, 30.0f); func_80B3CC80(this, play); } 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 76421c1790..021b94476d 100644 --- a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c +++ b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c @@ -459,7 +459,7 @@ void EnDnq_Update(Actor* thisx, PlayState* play) { this->unk_394 = this->picto.actor.xzDistToPlayer; func_80A52C6C(this, play); func_8013C964(&this->picto.actor, play, this->unk_390, fabsf(this->picto.actor.playerHeightRel) + 1.0f, - PLAYER_AP_NONE, this->unk_37C & 7); + PLAYER_IA_NONE, this->unk_37C & 7); this->picto.actor.xzDistToPlayer = this->unk_394; Actor_SetFocus(&this->picto.actor, 46.0f); func_80A52604(this, play); 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 eb3de5aece..714235b174 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -550,7 +550,7 @@ void EnDns_Update(Actor* thisx, PlayState* play) { func_8092C934(this); func_8092C86C(this, play); Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, 4); - func_8013C964(&this->actor, play, 80.0f, 40.0f, PLAYER_AP_NONE, this->unk_2C6 & 7); + func_8013C964(&this->actor, play, 80.0f, 40.0f, PLAYER_IA_NONE, this->unk_2C6 & 7); Actor_SetFocus(&this->actor, 34.0f); func_8092C6FC(this, play); func_8092C5C0(this); diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c index 1e5a4d921c..23dc0f3505 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -212,7 +212,7 @@ void EnFsn_HandleSetupResumeInteraction(EnFsn* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play) && this->cutsceneState == ENFSN_CUTSCENESTATE_STOPPED) { Actor_ProcessTalkRequest(&this->actor, &play->state); - func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); if (ENFSN_IS_SHOP(&this->actor)) { this->actor.textId = 0; } @@ -839,7 +839,7 @@ void EnFsn_StartBuying(EnFsn* this, PlayState* play) { this->actionFunc = EnFsn_DeterminePrice; break; case 0x29CF: - player->exchangeItemId = PLAYER_AP_NONE; + player->exchangeItemId = PLAYER_IA_NONE; this->actionFunc = EnFsn_SetupDeterminePrice; break; } @@ -915,12 +915,13 @@ void EnFsn_SetupDeterminePrice(EnFsn* this, PlayState* play) { void EnFsn_DeterminePrice(EnFsn* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 itemActionParam; + PlayerItemAction itemAction; u8 buttonItem; if (Message_GetState(&play->msgCtx) == TEXT_STATE_16) { - itemActionParam = func_80123810(play); - if (itemActionParam > PLAYER_AP_NONE) { + itemAction = func_80123810(play); + + if (itemAction > PLAYER_IA_NONE) { buttonItem = GET_CUR_FORM_BTN_ITEM(player->heldItemButton); this->price = (buttonItem < ITEM_MOON_TEAR) ? gItemPrices[buttonItem] : 0; if (this->price > 0) { @@ -933,7 +934,7 @@ void EnFsn_DeterminePrice(EnFsn* this, PlayState* play) { } this->actor.textId = player->actor.textId; func_801477B4(play); - } else if (itemActionParam < PLAYER_AP_NONE) { + } else if (itemAction <= PLAYER_IA_MINUS1) { if (CURRENT_DAY == 3) { this->actor.textId = 0x29DF; } else { @@ -981,7 +982,7 @@ void EnFsn_MakeOffer(EnFsn* this, PlayState* play) { break; case 1: func_8019F230(); - player->exchangeItemId = PLAYER_AP_NONE; + player->exchangeItemId = PLAYER_IA_NONE; this->actionFunc = EnFsn_SetupDeterminePrice; break; } @@ -996,7 +997,7 @@ void EnFsn_GiveItem(EnFsn* this, PlayState* play) { } this->actor.parent = NULL; if (ENFSN_IS_SHOP(&this->actor) && !this->isSelling) { - Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_AP_BOTTLE); + Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE); } this->actionFunc = EnFsn_SetupResumeInteraction; } else if (this->isSelling == true) { @@ -1037,7 +1038,7 @@ void EnFsn_ResumeInteraction(EnFsn* this, PlayState* play) { this->actionFunc = EnFsn_ConverseBackroom; } } else { - func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); } } 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 4571759757..8a8356740e 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -935,7 +935,7 @@ void func_80963630(EnFu* this, PlayState* play) { player->stateFlags1 &= ~PLAYER_STATE1_20; } else { this->actor.child->freezeTimer = 10; - func_800B85E0(&this->actor, play, 500.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 500.0f, PLAYER_IA_MINUS1); } } diff --git a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c index 5b73682bf6..88d55dc14c 100644 --- a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c +++ b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c @@ -567,7 +567,7 @@ void EnGinkoMan_BankAward2(EnGinkoMan* this, PlayState* play) { EnGinkoMan_SetupIdle(this); } } else { - func_800B85E0(&this->actor, play, 500.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 500.0f, PLAYER_IA_MINUS1); } } 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 db36ebc49b..aaaf0ef3dc 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -1711,7 +1711,7 @@ void EnGm_Update(Actor* thisx, PlayState* play) { func_8094DFF8(this, play); func_8094E2D0(this); func_8094F2E8(this); - func_8013C964(&this->actor, play, this->unk_3B4, 30.0f, PLAYER_AP_NONE, this->unk_3A4 & 7); + func_8013C964(&this->actor, play, this->unk_3B4, 30.0f, PLAYER_IA_NONE, this->unk_3A4 & 7); if ((this->unk_258 != 3) && (this->unk_258 != 5) && (this->unk_258 != 8)) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, 4); 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 662f6e2959..9d772cc289 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -1929,10 +1929,10 @@ void EnGo_Update(Actor* thisx, PlayState* play) { } else { phi_f0 = this->colliderCylinder.dim.radius + 40; } - func_8013C964(&this->actor, play, phi_f0, 20.0f, PLAYER_AP_NONE, this->unk_390 & 7); + func_8013C964(&this->actor, play, phi_f0, 20.0f, PLAYER_IA_NONE, this->unk_390 & 7); } else if ((this->unk_390 & 0x200) && (this->unk_3EC != 0)) { phi_f0 = this->colliderCylinder.dim.radius + 40; - func_8013C964(&this->actor, play, phi_f0, 20.0f, PLAYER_AP_NONE, this->unk_390 & 7); + func_8013C964(&this->actor, play, phi_f0, 20.0f, PLAYER_IA_NONE, this->unk_390 & 7); } if ((ENGO_GET_F(&this->actor) != ENGO_F_8) && (ENGO_GET_F(&this->actor) != ENGO_F_2) && diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index d1e38e9112..93d7e3f88d 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -184,7 +184,7 @@ void func_80997D38(EnGs* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) { if (this->actor.xzDistToPlayer <= D_8099A408[this->actor.params]) { func_8013E8F8(&this->actor, play, D_8099A408[this->actor.params], D_8099A408[this->actor.params], - PLAYER_AP_NONE, 0x2000, 0x2000); + PLAYER_IA_NONE, 0x2000, 0x2000); } } diff --git a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c index 76cd288439..f7eddbe6fe 100644 --- a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c +++ b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c @@ -295,7 +295,7 @@ void func_80BC7440(EnGuruguru* this, PlayState* play) { this->textIdIndex++; this->actor.textId = textIDs[this->textIdIndex]; func_801A3B48(1); - func_800B8500(&this->actor, play, 400.0f, 400.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 400.0f, 400.0f, PLAYER_IA_MINUS1); this->unk268 = 0; SET_WEEKEVENTREG(WEEKEVENTREG_38_40); this->actionFunc = func_80BC7520; @@ -309,7 +309,7 @@ void func_80BC7520(EnGuruguru* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actionFunc = func_80BC7068; } else { - func_800B8500(&this->actor, play, 400.0f, 400.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 400.0f, 400.0f, PLAYER_IA_MINUS1); } } diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/src/overlays/actors/ovl_En_Hs/z_en_hs.c index d2b123306a..2eb1c71a65 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -162,7 +162,7 @@ void func_80953098(EnHs* this, PlayState* play) { this->actionFunc = func_8095345C; this->actor.flags |= ACTOR_FLAG_10000; this->stateFlags |= 0x10; - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } else { this->stateFlags |= 8; if (INV_CONTENT(ITEM_MASK_BUNNY) == ITEM_MASK_BUNNY) { @@ -264,7 +264,7 @@ void func_8095345C(EnHs* this, PlayState* play) { this->actionFunc = func_80953354; this->stateTimer = 40; } else if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_10000)) { - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); this->stateFlags |= 1; } else if ((this->actor.xzDistToPlayer < 120.0f) && Player_IsFacingActor(&this->actor, 0x2000, play)) { func_800B8614(&this->actor, play, 130.0f); 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 8d89464fe7..8f0ae949d9 100644 --- a/src/overlays/actors/ovl_En_Ig/z_en_ig.c +++ b/src/overlays/actors/ovl_En_Ig/z_en_ig.c @@ -950,7 +950,7 @@ void EnIg_Update(Actor* thisx, PlayState* play) { func_80BF1258(this); func_80BF13E4(this); func_80BF15EC(this); - func_8013C964(&this->actor, play, 60.0f, 30.0f, PLAYER_AP_NONE, this->unk_3D0 & 7); + func_8013C964(&this->actor, play, 60.0f, 30.0f, PLAYER_IA_NONE, this->unk_3D0 & 7); Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, 4); func_80BF1354(this, play); diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index 53b490b89a..a51cae5563 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -388,7 +388,7 @@ void func_808F3AD4(EnIn* this, PlayState* play) { this->unk48C = 1; this->actionFunc = func_808F5A94; } else { - func_800B85E0(&this->actor, play, 200.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 200.0f, PLAYER_IA_MINUS1); } } @@ -412,7 +412,7 @@ void func_808F3BD4(EnIn* this, PlayState* play) { this->unk48C = 1; this->actionFunc = func_808F5A94; } else { - func_800B85E0(&this->actor, play, 200.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 200.0f, PLAYER_IA_MINUS1); } } @@ -436,7 +436,7 @@ void func_808F3CD4(EnIn* this, PlayState* play) { this->unk48C = 1; this->actionFunc = func_808F5A94; } else { - func_800B85E0(&this->actor, play, 200.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 200.0f, PLAYER_IA_MINUS1); } } diff --git a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c index 5edfe26370..8a8cb53820 100644 --- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c +++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c @@ -3454,7 +3454,7 @@ void func_80B4AF94(EnInvadepoh* this, PlayState* play) { func_80151BB4(play, 5); func_80B4ADB8(this); } else { - func_800B85E0(&this->actor, play, 2000.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 2000.0f, PLAYER_IA_MINUS1); } } diff --git a/src/overlays/actors/ovl_En_Ja/z_en_ja.c b/src/overlays/actors/ovl_En_Ja/z_en_ja.c index 99edbfe332..9a82f24adf 100644 --- a/src/overlays/actors/ovl_En_Ja/z_en_ja.c +++ b/src/overlays/actors/ovl_En_Ja/z_en_ja.c @@ -385,7 +385,7 @@ void EnJa_Update(Actor* thisx, PlayState* play) { radius = this->collider.dim.radius + 30; height = this->collider.dim.height + 10; - func_8013C964(&this->actor, play, radius, height, PLAYER_AP_NONE, this->unk_340 & 7); + func_8013C964(&this->actor, play, radius, height, PLAYER_IA_NONE, this->unk_340 & 7); if (this->unk_1D8.unk_00 != 2) { Actor_MoveWithGravity(&this->actor); diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.c b/src/overlays/actors/ovl_En_Js/z_en_js.c index e22b6ba733..d36bbb6c33 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -372,34 +372,34 @@ s32 EnJs_GetRemainingMasks(void) { return count; } -void EnJs_TakeMask(s32 actionParams, s32 childType) { +void EnJs_TakeMask(s32 itemActions, s32 childType) { u8* masksGivenOnMoon = gSaveContext.masksGivenOnMoon; s32 temp = 0; if ((childType >= 0) && (childType < 9)) { - actionParams -= PLAYER_AP_MASK_TRUTH; + itemActions -= PLAYER_IA_MASK_TRUTH; childType *= 3; - if (actionParams < 8) { - masksGivenOnMoon[childType] |= 1 << actionParams; - masksGivenOnMoon[temp] |= 1 << actionParams; + if (itemActions < 8) { + masksGivenOnMoon[childType] |= 1 << itemActions; + masksGivenOnMoon[temp] |= 1 << itemActions; return; } - actionParams -= 8; + itemActions -= 8; childType++; temp++; - if (actionParams < 8) { - masksGivenOnMoon[childType] |= 1 << actionParams; - masksGivenOnMoon[temp] |= 1 << actionParams; + if (itemActions < 8) { + masksGivenOnMoon[childType] |= 1 << itemActions; + masksGivenOnMoon[temp] |= 1 << itemActions; return; } - actionParams -= 8; + itemActions -= 8; childType++; temp++; - if (actionParams < 6) { - masksGivenOnMoon[childType] |= 1 << actionParams; - masksGivenOnMoon[temp] |= 1 << actionParams; + if (itemActions < 6) { + masksGivenOnMoon[childType] |= 1 << itemActions; + masksGivenOnMoon[temp] |= 1 << itemActions; } } } @@ -529,34 +529,36 @@ void func_8096971C(EnJs* this, PlayState* play) { } void func_80969748(EnJs* this, PlayState* play) { - s32 itemActionParam; + PlayerItemAction itemAction; Player* player = GET_PLAYER(play); SkelAnime_Update(&this->skelAnime); Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 6, 0x1838, 0x64); this->actor.shape.rot.y = this->actor.world.rot.y; if (Message_GetState(&play->msgCtx) == TEXT_STATE_16) { - itemActionParam = func_80123810(play); - if (itemActionParam != PLAYER_AP_NONE) { + itemAction = func_80123810(play); + + if (itemAction != PLAYER_IA_NONE) { this->actionFunc = func_80969898; } - if (itemActionParam > PLAYER_AP_NONE) { + if (itemAction > PLAYER_IA_NONE) { func_801477B4(play); - if ((itemActionParam >= PLAYER_AP_MASK_TRUTH) && (itemActionParam <= PLAYER_AP_MASK_GIANT)) { - EnJs_TakeMask(itemActionParam, ENJS_GET_TYPE(&this->actor)); - Inventory_UnequipItem(itemActionParam - 4); + if ((itemAction >= PLAYER_IA_MASK_TRUTH) && (itemAction <= PLAYER_IA_MASK_GIANT)) { + EnJs_TakeMask(itemAction, ENJS_GET_TYPE(&this->actor)); + Inventory_UnequipItem(itemAction - 4); if (!func_809692A8(ENJS_GET_TYPE(&this->actor))) { player->actor.textId = 0x2212; } else { player->actor.textId = 0x2213; } - } else if ((itemActionParam >= PLAYER_AP_MASK_FIERCE_DEITY) && (itemActionParam <= PLAYER_AP_MASK_DEKU)) { + } else if ((itemAction >= PLAYER_IA_MASK_FIERCE_DEITY) && (itemAction <= PLAYER_IA_MASK_DEKU)) { player->actor.textId = 0x2211; } else { player->actor.textId = 0x2210; } } - if (itemActionParam <= PLAYER_AP_MINUS1) { + + if (itemAction <= PLAYER_IA_MINUS1) { func_80151938(play, 0x2216); } } @@ -606,7 +608,7 @@ void func_80969898(EnJs* this, PlayState* play) { case 0x2210: case 0x2211: case 0x2212: - player->exchangeItemId = PLAYER_AP_NONE; + player->exchangeItemId = PLAYER_IA_NONE; func_80151938(play, 0xFF); this->actionFunc = func_80969748; break; @@ -675,34 +677,37 @@ void func_80969B5C(EnJs* this, PlayState* play) { } void func_80969C54(EnJs* this, PlayState* play) { - s32 itemActionParam; + PlayerItemAction itemAction; Player* player = GET_PLAYER(play); SkelAnime_Update(&this->skelAnime); Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 6, 0x1838, 0x64); this->actor.shape.rot.y = this->actor.world.rot.y; if (Message_GetState(&play->msgCtx) == TEXT_STATE_16) { - itemActionParam = func_80123810(play); - if (itemActionParam != PLAYER_AP_NONE) { + itemAction = func_80123810(play); + + if (itemAction != PLAYER_IA_NONE) { this->actionFunc = func_80969DA4; } - if (itemActionParam > PLAYER_AP_NONE) { + + if (itemAction > PLAYER_IA_NONE) { func_801477B4(play); - if ((itemActionParam >= PLAYER_AP_MASK_TRUTH) && (itemActionParam <= PLAYER_AP_MASK_GIANT)) { - EnJs_TakeMask(itemActionParam, ENJS_GET_TYPE(&this->actor)); - Inventory_UnequipItem(itemActionParam - 4); + if ((itemAction >= PLAYER_IA_MASK_TRUTH) && (itemAction <= PLAYER_IA_MASK_GIANT)) { + EnJs_TakeMask(itemAction, ENJS_GET_TYPE(&this->actor)); + Inventory_UnequipItem(itemAction - 4); if (!func_809692A8(ENJS_GET_TYPE(&this->actor))) { player->actor.textId = 0x2221; } else { player->actor.textId = 0x2222; } - } else if ((itemActionParam >= PLAYER_AP_MASK_FIERCE_DEITY) && (itemActionParam <= PLAYER_AP_MASK_DEKU)) { + } else if ((itemAction >= PLAYER_IA_MASK_FIERCE_DEITY) && (itemAction <= PLAYER_IA_MASK_DEKU)) { player->actor.textId = 0x2220; } else { player->actor.textId = 0x221D; } } - if (itemActionParam <= PLAYER_AP_MINUS1) { + + if (itemAction <= PLAYER_IA_MINUS1) { func_80151938(play, 0x221E); } } @@ -760,7 +765,7 @@ void func_80969DA4(EnJs* this, PlayState* play) { } break; case 0x2222: - player->exchangeItemId = PLAYER_AP_NONE; + player->exchangeItemId = PLAYER_IA_NONE; func_80151938(play, play->msgCtx.currentTextId + 1); break; case 0x2223: @@ -786,7 +791,7 @@ void func_80969DA4(EnJs* this, PlayState* play) { case 0x221D: case 0x2220: case 0x2221: - player->exchangeItemId = PLAYER_AP_NONE; + player->exchangeItemId = PLAYER_IA_NONE; func_80151938(play, 0xFF); this->actionFunc = func_80969C54; break; @@ -853,7 +858,7 @@ void func_8096A1E8(EnJs* this, PlayState* play) { SET_WEEKEVENTREG(WEEKEVENTREG_84_20); func_809696EC(this, 0); } else { - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } } @@ -865,7 +870,7 @@ void func_8096A2C0(EnJs* this, PlayState* play) { this->actor.parent = NULL; this->actor.flags |= ACTOR_FLAG_10000; this->actionFunc = func_8096A1E8; - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } else { Actor_PickUp(&this->actor, play, GI_MASK_FIERCE_DEITY, 10000.0f, 1000.0f); } 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 865458bfb7..4cd82df43f 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -318,7 +318,7 @@ void EnKakasi_TimeSkipDialogue(EnKakasi* this, PlayState* play) { this->picto.actor.flags &= ~ACTOR_FLAG_10000; this->actionFunc = EnKakasi_RegularDialogue; } else { - func_800B8500(&this->picto.actor, play, 9999.9f, 9999.9f, PLAYER_AP_MINUS1); + func_800B8500(&this->picto.actor, play, 9999.9f, 9999.9f, PLAYER_IA_MINUS1); } } } 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 6c16e2f14a..f188e1df08 100644 --- a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c +++ b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c @@ -518,19 +518,19 @@ void func_80B41A48(EnKgy* this, PlayState* play) { } void func_80B41ACC(EnKgy* this, PlayState* play) { - s32 itemActionParam; + PlayerItemAction itemAction; Player* player = GET_PLAYER(play); SkelAnime_Update(&this->skelAnime); if (Message_GetState(&play->msgCtx) == TEXT_STATE_16) { - itemActionParam = func_80123810(play); - if (itemActionParam != PLAYER_AP_NONE) { + itemAction = func_80123810(play); + if (itemAction != PLAYER_IA_NONE) { this->actionFunc = func_80B41E18; } - if (itemActionParam > PLAYER_AP_NONE) { + if (itemAction > PLAYER_IA_NONE) { func_801477B4(play); - if (itemActionParam == PLAYER_AP_BOTTLE_GOLD_DUST) { + if (itemAction == PLAYER_IA_BOTTLE_GOLD_DUST) { if (this->unk_29C & 0x10) { this->actor.textId = 0xC55; player->actor.textId = 0xC55; @@ -547,7 +547,7 @@ void func_80B41ACC(EnKgy* this, PlayState* play) { player->actor.textId = 0xC47; } this->unk_29C |= 8; - } else if (itemActionParam < PLAYER_AP_NONE) { + } else if (itemAction <= PLAYER_IA_MINUS1) { if (this->unk_29C & 0x10) { this->actor.textId = 0xC57; } else { @@ -586,7 +586,7 @@ void func_80B41CBC(EnKgy* this, PlayState* play) { this->actionFunc = func_80B41E18; func_80B411DC(this, play, 4); } else { - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } } @@ -595,7 +595,7 @@ void func_80B41D64(EnKgy* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actionFunc = func_80B41CBC; this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } else { Actor_PickUp(&this->actor, play, this->unk_2EA, 2000.0f, 1000.0f); } @@ -743,8 +743,8 @@ void func_80B41E18(EnKgy* this, PlayState* play) { case 0xC46: case 0xC55: - Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_AP_BOTTLE); - player->exchangeItemId = PLAYER_AP_NONE; + Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE); + player->exchangeItemId = PLAYER_IA_NONE; this->unk_29C &= ~0x8; play->msgCtx.msgLength = 0; func_80B41368(this, play, 4); @@ -759,7 +759,7 @@ void func_80B41E18(EnKgy* this, PlayState* play) { case 0xC47: func_80B40BC0(this, 1); if (this->unk_29C & 8) { - player->exchangeItemId = PLAYER_AP_NONE; + player->exchangeItemId = PLAYER_IA_NONE; this->unk_29C &= ~8; } func_80B40EBC(this, play, textId); @@ -948,7 +948,7 @@ void func_80B4296C(EnKgy* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_10000; } else { this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_NONE); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_NONE); } } 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 b242aec34d..efe7546625 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c @@ -828,7 +828,7 @@ void EnMa4_EponasSongCs(EnMa4* this, PlayState* play) { Player* player = GET_PLAYER(play); player->stateFlags1 |= PLAYER_STATE1_20; - func_800B85E0(&this->actor, play, 200.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 200.0f, PLAYER_IA_MINUS1); D_80AC0260 = 99; this->hasBow = true; EnMa4_SetupEndEponasSongCs(this); @@ -850,7 +850,7 @@ void EnMa4_EndEponasSongCs(EnMa4* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_10000; EnMa4_SetupDialogueHandler(this); } else { - func_800B85E0(&this->actor, play, 200.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 200.0f, PLAYER_IA_MINUS1); } } diff --git a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c index a4db5dd5a0..c9ba0f34d5 100644 --- a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c +++ b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c @@ -996,7 +996,7 @@ void EnMaYto_PostMilkRunExplainReward(EnMaYto* this, PlayState* play) { EnMaYto_SetupPostMilkRunWaitDialogueEnd(this); } } else { - func_800B85E0(&this->actor, play, 200.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 200.0f, PLAYER_IA_MINUS1); } } diff --git a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c index fcdf968b11..f459a6a416 100644 --- a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c +++ b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c @@ -465,7 +465,7 @@ void EnMinifrog_EndChoir(EnMinifrog* this, PlayState* play) { Message_StartTextbox(play, 0xD7E, &this->actor); // "Let us do it again sometime." this->actionFunc = EnMinifrog_YellowFrogDialog; } else { - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } } @@ -476,7 +476,7 @@ void EnMinifrog_GetFrogHP(EnMinifrog* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = EnMinifrog_EndChoir; this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_NONE); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_NONE); } else { Actor_PickUp(&this->actor, play, GI_HEART_PIECE, 10000.0f, 50.0f); } diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/src/overlays/actors/ovl_En_Mk/z_en_mk.c index 43d5ac3d46..894d73a6fe 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -365,7 +365,7 @@ void func_80959C94(EnMk* this, PlayState* play) { Message_StartTextbox(play, 0xFB3, &this->actor); } else { this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, 350.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 350.0f, 1000.0f, PLAYER_IA_MINUS1); } } diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c index c3b7ac7275..6aac1355db 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -149,7 +149,7 @@ void EnMs_Talk(EnMs* this, PlayState* play) { void EnMs_Sell(EnMs* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actor.textId = 0; - func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_AP_NONE); + func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_IA_NONE); this->actionFunc = EnMs_TalkAfterPurchase; } else { Actor_PickUp(&this->actor, play, GI_MAGIC_BEANS, this->actor.xzDistToPlayer, this->actor.playerHeightRel); @@ -161,7 +161,7 @@ void EnMs_TalkAfterPurchase(EnMs* this, PlayState* play) { func_80151938(play, 0x936); // "You can plant 'em whenever you want [...]" this->actionFunc = EnMs_Talk; } else { - func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_IA_MINUS1); } } 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 d60a19847c..789c96cf07 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -1109,7 +1109,7 @@ void EnOssan_SetupItemPurchased(EnOssan* this, PlayState* play) { this->cutscene = this->lookToShopkeeperCutscene; ActorCutscene_SetIntentToPlay(this->cutscene); } - func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); } } @@ -1132,7 +1132,7 @@ void EnOssan_ContinueShopping(EnOssan* this, PlayState* play) { 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); + func_800B85E0(&this->actor, play, 100.0f, PLAYER_IA_MINUS1); break; case 1: default: @@ -1150,7 +1150,7 @@ void EnOssan_ContinueShopping(EnOssan* this, PlayState* play) { 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); + func_800B85E0(&this->actor, play, 100.0f, PLAYER_IA_MINUS1); } } @@ -1174,7 +1174,7 @@ void EnOssan_ItemPurchased(EnOssan* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { func_80151938(play, 0x642); } else { - func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); } } 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 1313b51d04..928d4e5783 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -606,7 +606,7 @@ void func_80B5CB0C(EnOt* this, PlayState* play) { void func_80B5CBA0(EnOt* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_AP_NONE); + func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_IA_NONE); this->actionFunc = func_80B5CBEC; } @@ -617,7 +617,7 @@ void func_80B5CBEC(EnOt* this, PlayState* play) { } else { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0xE38, 0x38E); this->actor.world.rot.y = this->actor.shape.rot.y; - func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_AP_NONE); + func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_IA_NONE); } } @@ -693,7 +693,7 @@ void func_80B5CEC8(EnOt* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0xE38, 0x38E); if (this->unk_32C & 0x800) { this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_AP_NONE); + func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_IA_NONE); } else { this->actor.flags &= ~ACTOR_FLAG_10000; if ((player->actor.bgCheckFlags & 1) && !func_801242B4(player) && (this->actor.xzDistToPlayer < 130.0f)) { 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 48d691d138..c002b8204c 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -229,7 +229,7 @@ s32 func_8095A978(EnOwl* this, PlayState* play, u16 textId, f32 targetDist, f32 this->actor.textId = textId; if (this->actor.xzDistToPlayer < targetDist) { this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, targetDist, arg4, PLAYER_AP_NONE); + func_800B8500(&this->actor, play, targetDist, arg4, PLAYER_IA_NONE); } return false; @@ -242,7 +242,7 @@ s32 func_8095A9FC(EnOwl* this, PlayState* play, u16 textId) { this->actor.textId = textId; if (this->actor.xzDistToPlayer < 120.0f) { - func_800B8500(&this->actor, play, 350.0f, 1000.0f, PLAYER_AP_NONE); + func_800B8500(&this->actor, play, 350.0f, 1000.0f, PLAYER_IA_NONE); } return false; @@ -505,7 +505,7 @@ void func_8095B574(EnOwl* this, PlayState* play) { this->unk_406 = 2; } else if (this->actor.xzDistToPlayer < 200.0f) { this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, 200.0f, 400.0f, PLAYER_AP_NONE); + func_800B8500(&this->actor, play, 200.0f, 400.0f, PLAYER_IA_NONE); } else { this->actor.flags &= ~ACTOR_FLAG_10000; } @@ -718,11 +718,11 @@ void func_8095BE0C(EnOwl* this, PlayState* play) { this->actionFlags |= 0x40; } else if (this->actor.textId == 0xBF0) { if (this->actor.isTargeted) { - func_800B8500(&this->actor, play, 200.0f, 200.0f, PLAYER_AP_NONE); + func_800B8500(&this->actor, play, 200.0f, 200.0f, PLAYER_IA_NONE); } } else if (this->actor.xzDistToPlayer < 200.0f) { this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, 200.0f, 200.0f, PLAYER_AP_NONE); + func_800B8500(&this->actor, play, 200.0f, 200.0f, PLAYER_IA_NONE); } else { this->actor.flags &= ~ACTOR_FLAG_10000; } 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 4b28d5b997..24fcc34f9f 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c @@ -1378,7 +1378,7 @@ s32 func_80AF94AC(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) { if (scheduleOutput->result == 24) { Flags_UnsetSwitch(play, 0); Flags_UnsetSwitch(play, 1); - this->unk_394 = PLAYER_AP_NONE; + this->unk_394 = PLAYER_IA_NONE; this->unk_368 = 60.0f; func_80AF7E98(this, 9); } @@ -1566,7 +1566,7 @@ s32 func_80AF9BF8(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) { this->actor.flags |= ACTOR_FLAG_1; this->actor.targetMode = 0; - this->unk_394 = PLAYER_AP_NONE; + this->unk_394 = PLAYER_IA_NONE; this->unk_356 = 0; this->unk_368 = 40.0f; diff --git a/src/overlays/actors/ovl_En_Pst/z_en_pst.c b/src/overlays/actors/ovl_En_Pst/z_en_pst.c index 167a51f2bd..c498527462 100644 --- a/src/overlays/actors/ovl_En_Pst/z_en_pst.c +++ b/src/overlays/actors/ovl_En_Pst/z_en_pst.c @@ -194,7 +194,7 @@ s32 EnPst_HandleLetterDay2(EnPst* this) { } s32 EnPst_ChooseBehaviour(Actor* thisx, PlayState* play) { - s32 itemActionParam = 0; + PlayerItemAction itemAction = PLAYER_IA_NONE; s32 scriptBranch = 0; EnPst* this = THIS; @@ -205,17 +205,16 @@ s32 EnPst_ChooseBehaviour(Actor* thisx, PlayState* play) { case TEXT_STATE_5: if (Message_ShouldAdvance(play)) { case TEXT_STATE_16: - itemActionParam = func_80123810(play); + itemAction = func_80123810(play); scriptBranch = 0; - if ((itemActionParam == PLAYER_AP_LETTER_TO_KAFEI) || - (itemActionParam == PLAYER_AP_LETTER_MAMA)) { - this->exchangeItemId = itemActionParam; + if ((itemAction == PLAYER_IA_LETTER_TO_KAFEI) || (itemAction == PLAYER_IA_LETTER_MAMA)) { + this->exchangeItemId = itemAction; this->behaviour++; scriptBranch = 1; - } else if (itemActionParam < PLAYER_AP_NONE) { + } else if (itemAction <= PLAYER_IA_MINUS1) { this->behaviour++; scriptBranch = 3; - } else if (itemActionParam != PLAYER_AP_NONE) { + } else if (itemAction != PLAYER_IA_NONE) { this->behaviour++; scriptBranch = 2; } @@ -224,7 +223,7 @@ s32 EnPst_ChooseBehaviour(Actor* thisx, PlayState* play) { } break; case POSTBOX_BEHAVIOUR_TAKE_ITEM: - if (this->exchangeItemId == PLAYER_AP_LETTER_TO_KAFEI) { + if (this->exchangeItemId == PLAYER_IA_LETTER_TO_KAFEI) { scriptBranch = 1; } break; @@ -253,7 +252,7 @@ s32* EnPst_GetMsgEventScript(EnPst* this, PlayState* play) { return NULL; } } else if (this->stateFlags & 0x20) { - if (this->exchangeItemId == PLAYER_AP_LETTER_MAMA) { + if (this->exchangeItemId == PLAYER_IA_LETTER_MAMA) { return D_80B2C488; } else { return D_80B2C490; @@ -284,10 +283,10 @@ s32 EnPst_CheckTalk(EnPst* this, PlayState* play) { if (this->stateFlags & 7) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->stateFlags &= ~0x30; - if (player->exchangeItemId == PLAYER_AP_LETTER_TO_KAFEI) { + if (player->exchangeItemId == PLAYER_IA_LETTER_TO_KAFEI) { this->stateFlags |= 0x10; this->exchangeItemId = player->exchangeItemId; - } else if (player->exchangeItemId != PLAYER_AP_NONE) { + } else if (player->exchangeItemId != PLAYER_IA_NONE) { this->stateFlags |= 0x20; this->exchangeItemId = player->exchangeItemId; } diff --git a/src/overlays/actors/ovl_En_Rz/z_en_rz.c b/src/overlays/actors/ovl_En_Rz/z_en_rz.c index 888c65ec55..108d880234 100644 --- a/src/overlays/actors/ovl_En_Rz/z_en_rz.c +++ b/src/overlays/actors/ovl_En_Rz/z_en_rz.c @@ -534,7 +534,7 @@ void func_80BFC3F8(EnRz* this, PlayState* play) { } else if (EnRz_CanTalk(this, play)) { if (func_80BFBCEC(this, play) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_77_04) && this->sister != NULL) { this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } else { this->actor.flags &= ~ACTOR_FLAG_10000; func_800B8614(&this->actor, play, 120.0f); 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 345f65bad4..b16153a53d 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c @@ -341,7 +341,7 @@ void func_80ADB544(EnSellnuts* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x7D0, 0); this->actor.world.rot.y = this->actor.shape.rot.y; if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - if (Player_GetExchangeItemId(play) == PLAYER_AP_MOON_TEAR) { + if (Player_GetExchangeItemId(play) == PLAYER_IA_MOON_TEAR) { player->actor.textId = D_80ADD928[this->unk_33A]; this->unk_340 = player->actor.textId; this->actionFunc = func_80ADBAB8; @@ -382,7 +382,7 @@ void func_80ADB544(EnSellnuts* this, PlayState* play) { } else if (((this->actor.xzDistToPlayer < 80.0f) && (((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false)) || this->actor.isTargeted) { - func_800B85E0(&this->actor, play, 80.0f, PLAYER_AP_MOON_TEAR); + func_800B85E0(&this->actor, play, 80.0f, PLAYER_IA_MOON_TEAR); if (player->transformation == PLAYER_FORM_DEKU) { if (gSaveContext.save.day == 3) { this->unk_33A = 2; @@ -417,15 +417,16 @@ void func_80ADB544(EnSellnuts* this, PlayState* play) { void func_80ADB924(EnSellnuts* this, PlayState* play) { Player* player = GET_PLAYER(play); u8 talkState = Message_GetState(&play->msgCtx); - s32 item; + PlayerItemAction itemAction; if (talkState == TEXT_STATE_16) { - item = func_80123810(play); - if (item > PLAYER_AP_NONE) { - if (item == PLAYER_AP_MOON_TEAR) { + itemAction = func_80123810(play); + + if (itemAction > PLAYER_IA_NONE) { + if (itemAction == PLAYER_IA_MOON_TEAR) { player->actor.textId = D_80ADD928[this->unk_33A]; this->unk_340 = player->actor.textId; - player->exchangeItemId = item; + player->exchangeItemId = itemAction; this->actionFunc = func_80ADBAB8; } else { player->actor.textId = D_80ADD920[this->unk_33A]; @@ -433,7 +434,7 @@ void func_80ADB924(EnSellnuts* this, PlayState* play) { this->actionFunc = func_80ADB0D8; } func_801477B4(play); - } else if (item < PLAYER_AP_NONE) { + } else if (itemAction <= PLAYER_IA_MINUS1) { this->unk_340 = D_80ADD920[this->unk_33A]; func_80151938(play, this->unk_340); this->actionFunc = func_80ADB0D8; @@ -491,14 +492,14 @@ void func_80ADBC60(EnSellnuts* this, PlayState* play) { Message_StartTextbox(play, this->unk_340, &this->actor); this->actionFunc = func_80ADB0D8; } else { - func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); this->unk_340 = D_80ADD930[this->unk_33A]; } } void func_80ADBCE4(EnSellnuts* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); this->unk_340 = D_80ADD930[this->unk_33A]; this->actionFunc = func_80ADBC60; } 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 d1098baa69..d606e17f40 100644 --- a/src/overlays/actors/ovl_En_Shn/z_en_shn.c +++ b/src/overlays/actors/ovl_En_Shn/z_en_shn.c @@ -293,10 +293,10 @@ s32 func_80AE68F0(EnShn* this, PlayState* play) { if (this->unk_1D8 & 7) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->unk_1D8 &= ~0x180; - if (player->exchangeItemId == PLAYER_AP_PICTO_BOX) { + if (player->exchangeItemId == PLAYER_IA_PICTO_BOX) { this->unk_1D8 |= 0x80; this->unk_2E4 = player->exchangeItemId; - } else if (player->exchangeItemId != PLAYER_AP_NONE) { + } else if (player->exchangeItemId != PLAYER_IA_NONE) { this->unk_1D8 |= 0x100; this->unk_2E4 = player->exchangeItemId; } @@ -382,7 +382,7 @@ void EnShn_Update(Actor* thisx, PlayState* play) { func_80AE6130(this); func_80AE63A8(this, play); this->unk_2E0 = 0; - func_8013C964(&this->actor, play, 120.0f, 40.0f, PLAYER_AP_NONE, this->unk_1D8 & 7); + func_8013C964(&this->actor, play, 120.0f, 40.0f, PLAYER_IA_NONE, this->unk_1D8 & 7); } s32 EnShn_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { 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 bcf62a4380..2a488e8b7a 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -844,7 +844,7 @@ void EnSob1_ItemPurchased(EnSob1* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { func_80151938(play, 0x647); } else { - func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); } } @@ -1100,7 +1100,7 @@ void EnSob1_SetupItemPurchased(EnSob1* this, PlayState* play) { this->cutscene = this->lookToShopkeeperCutscene; ActorCutscene_SetIntentToPlay(this->cutscene); } - func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); } } @@ -1116,7 +1116,7 @@ void EnSob1_ContinueShopping(EnSob1* this, PlayState* play) { 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); + func_800B85E0(&this->actor, play, 200.0f, PLAYER_IA_MINUS1); } } diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 8e3cc4dac2..5d1bd14714 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -275,7 +275,7 @@ void func_80B67348(EnSth* this, PlayState* play) { } Message_StartTextbox(play, phi_a1, &this->actor); } else { - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } } @@ -286,7 +286,7 @@ void func_80B67458(EnSth* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = func_80B67348; this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); if (CURRENT_DAY == 3) { func_80B670A4(this, 6); } else { @@ -470,7 +470,7 @@ void func_80B67AB4(EnSth* this, PlayState* play) { SET_WEEKEVENTREG(WEEKEVENTREG_34_40); Message_StartTextbox(play, 0x918, &this->actor); } else { - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } } @@ -481,7 +481,7 @@ void func_80B67B50(EnSth* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = func_80B67AB4; this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } else { this->unk_29C &= ~1; SET_WEEKEVENTREG(WEEKEVENTREG_34_08); diff --git a/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c b/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c index 507a03c733..36dd9398e0 100644 --- a/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c +++ b/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c @@ -265,19 +265,20 @@ void EnStoneheishi_SetupCheckGivenItem(EnStoneheishi* this) { } void EnStoneheishi_CheckGivenItem(EnStoneheishi* this, PlayState* play) { - s32 itemActionParam; + PlayerItemAction itemAction; SkelAnime_Update(&this->skelAnime); if (Message_GetState(&play->msgCtx) == TEXT_STATE_16) { - itemActionParam = func_80123810(play); - if (itemActionParam > PLAYER_AP_NONE) { + itemAction = func_80123810(play); + + if (itemAction > PLAYER_IA_NONE) { this->timer = 40; func_801477B4(play); - if ((itemActionParam == PLAYER_AP_BOTTLE_POTION_RED) || (itemActionParam == PLAYER_AP_BOTTLE_POTION_BLUE)) { + if ((itemAction == PLAYER_IA_BOTTLE_POTION_RED) || (itemAction == PLAYER_IA_BOTTLE_POTION_BLUE)) { this->playerGivesBluePotion = false; - if (itemActionParam == PLAYER_AP_BOTTLE_POTION_BLUE) { + if (itemAction == PLAYER_IA_BOTTLE_POTION_BLUE) { this->playerGivesBluePotion = true; } EnStoneheishi_SetupDrinkBottleProcess(this); @@ -290,7 +291,7 @@ void EnStoneheishi_CheckGivenItem(EnStoneheishi* this, PlayState* play) { this->action = EN_STONE_ACTION_1; this->actionFunc = func_80BC9680; } - } else if (itemActionParam < PLAYER_AP_NONE) { + } else if (itemAction <= PLAYER_IA_MINUS1) { func_801477B4(play); func_80151BB4(play, 0x12); func_80BC94B0(this); @@ -327,7 +328,7 @@ void EnStoneheishi_DrinkBottleProcess(EnStoneheishi* this, PlayState* play) { play->msgCtx.msgLength = 0; player->actor.textId = 0; - player->exchangeItemId = PLAYER_AP_NONE; + player->exchangeItemId = PLAYER_IA_NONE; this->bottleDisplay = EN_STONE_BOTTLE_RED_POTION; if (this->playerGivesBluePotion) { @@ -346,7 +347,7 @@ void EnStoneheishi_DrinkBottleProcess(EnStoneheishi* this, PlayState* play) { if ((this->timer < 10) && (this->bottleDisplay != EN_STONE_BOTTLE_EMPTY)) { this->bottleDisplay = EN_STONE_BOTTLE_EMPTY; Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_NP_DRINK); - Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_AP_BOTTLE); + Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE); } } else { this->drinkBottleState++; @@ -397,7 +398,7 @@ void func_80BC9D28(EnStoneheishi* this, PlayState* play) { this->actor.textId = sEnStoneHeishiTextIds[this->textIdIndex]; SET_WEEKEVENTREG(WEEKEVENTREG_41_40); Actor_ProcessTalkRequest(&this->actor, &play->state); - func_800B8500(&this->actor, play, 400.0f, 400.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 400.0f, 400.0f, PLAYER_IA_MINUS1); this->actionFunc = func_80BC9E50; } else if (INV_CONTENT(ITEM_MASK_STONE) == ITEM_MASK_STONE) { Actor_PickUp(&this->actor, play, GI_RUPEE_BLUE, 300.0f, 300.0f); @@ -415,7 +416,7 @@ void func_80BC9E50(EnStoneheishi* this, PlayState* play) { this->action = EN_STONE_ACTION_1; this->actionFunc = func_80BC9680; } else { - func_800B8500(&this->actor, play, 400.0f, 400.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 400.0f, 400.0f, PLAYER_IA_MINUS1); } } 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 a40ea77eea..3234941735 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 @@ -908,7 +908,7 @@ void EnSyatekiMan_Swamp_GiveReward(EnSyatekiMan* this, PlayState* play) { this->shootingGameState = SG_GAME_STATE_NONE; this->actionFunc = EnSyatekiMan_Swamp_Talk; } else { - func_800B85E0(&this->actor, play, 500.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 500.0f, PLAYER_IA_MINUS1); } } @@ -972,7 +972,7 @@ void EnSyatekiMan_Town_GiveReward(EnSyatekiMan* this, PlayState* play) { this->shootingGameState = SG_GAME_STATE_NONE; this->actionFunc = EnSyatekiMan_Town_Talk; } else { - func_800B85E0(&this->actor, play, 500.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 500.0f, PLAYER_IA_MINUS1); } } 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 ff7899dc9b..86de69140a 100644 --- a/src/overlays/actors/ovl_En_Tab/z_en_tab.c +++ b/src/overlays/actors/ovl_En_Tab/z_en_tab.c @@ -551,7 +551,7 @@ void EnTab_Update(Actor* thisx, PlayState* play) { radius = this->collider.dim.radius + this->unk_30C; height = this->collider.dim.height + 10; - func_8013C964(&this->actor, play, radius, height, PLAYER_AP_NONE, this->unk_2FC & 7); + func_8013C964(&this->actor, play, radius, height, PLAYER_IA_NONE, this->unk_2FC & 7); Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, 4); func_80BE0620(this, play); 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 78d864cd2b..a840596342 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 @@ -49,8 +49,8 @@ void EnTalkGibud_TurnTowardsPlayer(EnTalkGibud* this, PlayState* play); s32 EnTalkGibud_MoveToIdealGrabPositionAndRotation(EnTalkGibud* this, PlayState* play); typedef struct { - /* 0x0 */ s32 itemActionParam; - /* 0x4 */ s32 item; + /* 0x0 */ PlayerItemAction itemAction; + /* 0x4 */ ItemId item; /* 0x8 */ s32 amount; /* 0xC */ s16 isBottledItem; } EnTalkGibudRequestedItem; @@ -200,16 +200,16 @@ static DamageTable sDamageTable = { static CollisionCheckInfoInit2 sColChkInfoInit = { 8, 0, 0, 0, MASS_HEAVY }; static EnTalkGibudRequestedItem sRequestedItemTable[] = { - { PLAYER_AP_BOTTLE_POTION_BLUE, ITEM_POTION_BLUE, 1, true }, - { PLAYER_AP_MAGIC_BEANS, ITEM_MAGIC_BEANS, 5, false }, - { PLAYER_AP_BOTTLE_SPRING_WATER, ITEM_SPRING_WATER, 1, true }, - { PLAYER_AP_BOTTLE_FISH, ITEM_FISH, 1, true }, - { PLAYER_AP_BOTTLE_BUG, ITEM_BUG, 1, true }, - { PLAYER_AP_NUT, ITEM_NUT, 10, false }, - { PLAYER_AP_BOMB, ITEM_BOMB, 10, false }, - { PLAYER_AP_BOTTLE_HOT_SPRING_WATER, ITEM_HOT_SPRING_WATER, 1, true }, - { PLAYER_AP_BOTTLE_BIG_POE, ITEM_BIG_POE, 1, true }, - { PLAYER_AP_BOTTLE_MILK, ITEM_MILK_BOTTLE, 1, true }, + { PLAYER_IA_BOTTLE_POTION_BLUE, ITEM_POTION_BLUE, 1, true }, + { PLAYER_IA_MAGIC_BEANS, ITEM_MAGIC_BEANS, 5, false }, + { PLAYER_IA_BOTTLE_SPRING_WATER, ITEM_SPRING_WATER, 1, true }, + { PLAYER_IA_BOTTLE_FISH, ITEM_FISH, 1, true }, + { PLAYER_IA_BOTTLE_BUG, ITEM_BUG, 1, true }, + { PLAYER_IA_NUT, ITEM_NUT, 10, false }, + { PLAYER_IA_BOMB, ITEM_BOMB, 10, false }, + { PLAYER_IA_BOTTLE_HOT_SPRING_WATER, ITEM_HOT_SPRING_WATER, 1, true }, + { PLAYER_IA_BOTTLE_BIG_POE, ITEM_BIG_POE, 1, true }, + { PLAYER_IA_BOTTLE_MILK, ITEM_MILK_BOTTLE, 1, true }, }; static InitChainEntry sInitChain[] = { @@ -242,7 +242,7 @@ void EnTalkGibud_Init(Actor* thisx, PlayState* play) { this->playerStunWaitTimer = 0; this->grabState = EN_TALK_GIBUD_GRAB_START; this->grabWaitTimer = 0; - this->itemActionParam = PLAYER_AP_NONE; + this->itemAction = PLAYER_IA_NONE; this->drawDmgEffTimer = 0; this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE; this->isTalking = false; @@ -703,10 +703,10 @@ void EnTalkGibud_GetNextTextBoxId(EnTalkGibud* this, PlayState* play) { } } -s32 EnTalkGibud_PresentedItemMatchesRequest(EnTalkGibud* this, PlayState* play, s32 presentedItemActionParam) { +s32 EnTalkGibud_PresentedItemMatchesRequest(EnTalkGibud* this, PlayState* play, PlayerItemAction presentedItemAction) { EnTalkGibudRequestedItem* requestedItem = &sRequestedItemTable[this->requestedItemIndex]; - if (requestedItem->itemActionParam == presentedItemActionParam) { + if (requestedItem->itemAction == presentedItemAction) { if (!requestedItem->isBottledItem) { if (AMMO(requestedItem->item) >= requestedItem->amount) { return EN_TALK_GIBUD_REQUESTED_ITEM_MET; @@ -723,15 +723,16 @@ s32 EnTalkGibud_PresentedItemMatchesRequest(EnTalkGibud* this, PlayState* play, void EnTalkGibud_CheckPresentedItem(EnTalkGibud* this, PlayState* play) { Player* player = GET_PLAYER(play); - s32 itemActionParam; + PlayerItemAction itemAction; - if (this->itemActionParam == PLAYER_AP_NONE) { - itemActionParam = func_80123810(play); - if (itemActionParam != PLAYER_AP_NONE) { - this->itemActionParam = itemActionParam; + if (this->itemAction == PLAYER_IA_NONE) { + itemAction = func_80123810(play); + + if (itemAction != PLAYER_IA_NONE) { + this->itemAction = itemAction; } - if (this->itemActionParam > PLAYER_AP_NONE) { - switch (EnTalkGibud_PresentedItemMatchesRequest(this, play, this->itemActionParam)) { + if (this->itemAction > PLAYER_IA_NONE) { + switch (EnTalkGibud_PresentedItemMatchesRequest(this, play, this->itemAction)) { case EN_TALK_GIBUD_REQUESTED_ITEM_MET: player->actor.textId = 0x138A; this->textId = 0x138A; @@ -751,7 +752,7 @@ void EnTalkGibud_CheckPresentedItem(EnTalkGibud* this, PlayState* play) { break; } func_801477B4(play); - } else if (this->itemActionParam < PLAYER_AP_NONE) { + } else if (this->itemAction <= PLAYER_IA_MINUS1) { Message_StartTextbox(play, 0x1389, &this->actor); this->textId = 0x1389; } @@ -787,7 +788,7 @@ void EnTalkGibud_PassiveIdle(EnTalkGibud* this, PlayState* play) { } void EnTalkGibud_SetupTalk(EnTalkGibud* this) { - this->itemActionParam = PLAYER_AP_NONE; + this->itemAction = PLAYER_IA_NONE; this->actionFunc = EnTalkGibud_Talk; } @@ -822,7 +823,7 @@ void EnTalkGibud_Talk(EnTalkGibud* this, PlayState* play) { if (!requestedItem->isBottledItem) { Inventory_ChangeAmmo(requestedItem->item, -requestedItem->amount); } else { - Player_UpdateBottleHeld(play, player, ITEM_BOTTLE, PLAYER_AP_BOTTLE); + Player_UpdateBottleHeld(play, player, ITEM_BOTTLE, PLAYER_IA_BOTTLE); } player->stateFlags1 |= PLAYER_STATE1_20; player->stateFlags1 |= PLAYER_STATE1_20000000; diff --git a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h index 4d11e6c157..d887b1c0d3 100644 --- a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h +++ b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h @@ -19,7 +19,7 @@ typedef struct EnTalkGibud { /* 0x1D8 */ Vec3f limbPos[15]; /* 0x28C */ s32 limbIndex; /* 0x290 */ s32 requestedItemIndex; - /* 0x294 */ s32 itemActionParam; + /* 0x294 */ PlayerItemAction itemAction; /* 0x298 */ s32 switchFlag; /* 0x29C */ f32 drawDmgEffAlpha; /* 0x2A0 */ f32 drawDmgEffScale; diff --git a/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.c b/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.c index d6089e5b58..fec6a2d3ba 100644 --- a/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.c +++ b/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.c @@ -149,7 +149,7 @@ void EnTanron1_Update(Actor* thisx, PlayState* play) { break; } - if ((player->itemActionParam == 7) && (player->unk_B28 != 0)) { + if ((player->heldItemAction == PLAYER_IA_STICK) && (player->unk_B28 != 0)) { this->unk_14C.x = player->meleeWeaponInfo[0].tip.x; this->unk_14C.y = player->meleeWeaponInfo[0].tip.y; this->unk_14C.z = player->meleeWeaponInfo[0].tip.z; diff --git a/src/overlays/actors/ovl_En_Test3/z_en_test3.c b/src/overlays/actors/ovl_En_Test3/z_en_test3.c index a80ddd9971..26cc07dc25 100644 --- a/src/overlays/actors/ovl_En_Test3/z_en_test3.c +++ b/src/overlays/actors/ovl_En_Test3/z_en_test3.c @@ -455,7 +455,7 @@ void EnTest3_Init(Actor* thisx, PlayState* play2) { this->player.unk_A86 = -1; this->player.transformation = PLAYER_FORM_HUMAN; this->player.ageProperties = &sAgeProperties; - this->player.itemActionParam = PLAYER_AP_NONE; + this->player.heldItemAction = PLAYER_IA_NONE; this->player.heldItemId = ITEM_OCARINA; Player_SetModelGroup(&this->player, 3); @@ -1021,7 +1021,7 @@ void func_80A40908(EnTest3* this, PlayState* play) { func_80151BB4(play, 0x19); func_80151BB4(play, 2); } else { - func_800B8500(&this->player.actor, play, 9999.9f, 9999.9f, PLAYER_AP_MINUS1); + func_800B8500(&this->player.actor, play, 9999.9f, 9999.9f, PLAYER_IA_MINUS1); this->unk_D78 = &D_80A41854[6]; this->player.actor.textId = this->unk_D78->textId; this->player.actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8); diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index e86a9393ea..a0b59be8a7 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -486,7 +486,7 @@ s32 func_80AECE60(EnTk* this, PlayState* play) { } if (!(this->unk_3CE & 8) && !(this->unk_2CA & 0x10) && (this->actor.xzDistToPlayer < 100.0f)) { - func_8013E8F8(&this->actor, play, 100.0f, 100.0f, PLAYER_AP_NONE, 0x4000, 0x4000); + func_8013E8F8(&this->actor, play, 100.0f, 100.0f, PLAYER_IA_NONE, 0x4000, 0x4000); } return false; @@ -696,10 +696,10 @@ void func_80AED940(EnTk* this, PlayState* play) { func_80AEDE10(this, play); } else if (!(this->unk_2CA & 0x80)) { if (this->actor.xzDistToPlayer < 100.0f) { - func_8013E8F8(&this->actor, play, 100.0f, 100.0f, PLAYER_AP_NONE, 0x4000, 0x4000); + func_8013E8F8(&this->actor, play, 100.0f, 100.0f, PLAYER_IA_NONE, 0x4000, 0x4000); } } else { - func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_AP_NONE); + func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_IA_NONE); } } 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 063196a2eb..aefa6383fc 100644 --- a/src/overlays/actors/ovl_En_Toto/z_en_toto.c +++ b/src/overlays/actors/ovl_En_Toto/z_en_toto.c @@ -258,7 +258,7 @@ void func_80BA39C8(EnToto* this, PlayState* play) { if (this->unk2B6 != 0) { this->text = D_80BA5044; this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, 9999.9f, 9999.9f, PLAYER_AP_NONE); + func_800B8500(&this->actor, play, 9999.9f, 9999.9f, PLAYER_IA_NONE); } else { this->actor.flags &= ~ACTOR_FLAG_10000; func_800B8614(&this->actor, play, 50.0f); 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 aa8869669d..a8ffe6ea1a 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.c +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.c @@ -349,7 +349,7 @@ void EnTrt_GetMushroom(EnTrt* this, PlayState* play) { this->textId = 0x884; Message_StartTextbox(play, this->textId, &this->actor); SET_WEEKEVENTREG(WEEKEVENTREG_53_08); - Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_AP_BOTTLE); + Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE); break; case 0x888: this->textId = 0x889; @@ -375,7 +375,7 @@ void EnTrt_GetMushroom(EnTrt* this, PlayState* play) { void EnTrt_PayForMushroom(EnTrt* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actor.parent = NULL; - Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_AP_BOTTLE); + Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE); this->actionFunc = EnTrt_SetupItemGiven; } else { Actor_PickUp(&this->actor, play, GI_RUPEE_RED, 300.0f, 300.0f); @@ -479,7 +479,7 @@ void EnTrt_GivenRedPotionForKoume(EnTrt* this, PlayState* play) { ActorCutscene_SetIntentToPlay(this->cutscene); } } - func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); this->actionFunc = EnTrt_ItemGiven; } } @@ -1031,7 +1031,7 @@ void EnTrt_ItemGiven(EnTrt* this, PlayState* play) { } func_80151938(play, this->textId); } else { - func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); } } @@ -1104,7 +1104,7 @@ void EnTrt_SetupItemGiven(EnTrt* this, PlayState* play) { this->cutscene = this->lookToShopkeeperCutscene; ActorCutscene_SetIntentToPlay(this->cutscene); } - func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1); + func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); } } @@ -1127,7 +1127,7 @@ void EnTrt_ContinueShopping(EnTrt* this, PlayState* play) { 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); + func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); break; case 1: default: @@ -1380,7 +1380,7 @@ void EnTrt_OpenEyesThenSetToBlink(EnTrt* this) { void EnTrt_TalkToShopkeeper(EnTrt* this, PlayState* play) { u8 talkState = talkState = Message_GetState(&play->msgCtx); Player* player = GET_PLAYER(play); - s32 itemGiven; + PlayerItemAction itemAction; if (talkState == TEXT_STATE_5) { if (Message_ShouldAdvance(play)) { @@ -1391,16 +1391,16 @@ void EnTrt_TalkToShopkeeper(EnTrt* this, PlayState* play) { } } } else if (talkState == TEXT_STATE_16) { - itemGiven = func_80123810(play); - if (itemGiven > PLAYER_AP_NONE) { - if (itemGiven == PLAYER_AP_BOTTLE_MUSHROOM) { + itemAction = func_80123810(play); + if (itemAction > PLAYER_IA_NONE) { + if (itemAction == PLAYER_IA_BOTTLE_MUSHROOM) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_53_08)) { player->actor.textId = 0x888; } else { player->actor.textId = 0x883; } this->textId = player->actor.textId; - player->exchangeItemId = itemGiven; + player->exchangeItemId = itemAction; this->actionFunc = EnTrt_GetMushroom; } else { if (this->flags & ENTRT_GIVEN_MUSHROOM) { @@ -1412,7 +1412,7 @@ void EnTrt_TalkToShopkeeper(EnTrt* this, PlayState* play) { this->actionFunc = EnTrt_Goodbye; } func_801477B4(play); - } else if (itemGiven < PLAYER_AP_NONE) { + } else if (itemAction <= PLAYER_IA_MINUS1) { if (this->flags & ENTRT_GIVEN_MUSHROOM) { this->textId = 0x88B; } else { diff --git a/src/overlays/actors/ovl_En_Tru/z_en_tru.c b/src/overlays/actors/ovl_En_Tru/z_en_tru.c index 041ce71d56..733ea0c576 100644 --- a/src/overlays/actors/ovl_En_Tru/z_en_tru.c +++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.c @@ -827,7 +827,7 @@ s32 func_80A875AC(Actor* thisx, PlayState* play) { s32 func_80A8777C(Actor* thisx, PlayState* play) { EnTru* this = THIS; s32 ret = 0; - s32 itemActionParam; + PlayerItemAction itemAction; switch (Message_GetState(&play->msgCtx)) { case TEXT_STATE_CHOICE: @@ -837,10 +837,11 @@ s32 func_80A8777C(Actor* thisx, PlayState* play) { } // Fallthrough case TEXT_STATE_16: - itemActionParam = func_80123810(play); - if ((itemActionParam == PLAYER_AP_BOTTLE_POTION_RED) || (itemActionParam == PLAYER_AP_BOTTLE_POTION_BLUE)) { + itemAction = func_80123810(play); + + if ((itemAction == PLAYER_IA_BOTTLE_POTION_RED) || (itemAction == PLAYER_IA_BOTTLE_POTION_BLUE)) { this->unk_34E |= 8; - if (itemActionParam == PLAYER_AP_BOTTLE_POTION_RED) { + if (itemAction == PLAYER_IA_BOTTLE_POTION_RED) { this->unk_390 = 1; } else { this->unk_390 = 2; @@ -848,9 +849,9 @@ s32 func_80A8777C(Actor* thisx, PlayState* play) { this->unk_378 = func_80A87880; this->unk_364 = 0; ret = 1; - } else if (itemActionParam < PLAYER_AP_NONE) { + } else if (itemAction <= PLAYER_IA_MINUS1) { ret = 3; - } else if (itemActionParam != PLAYER_AP_NONE) { + } else if (itemAction != PLAYER_IA_NONE) { ret = 2; } break; @@ -912,7 +913,7 @@ s32 func_80A87880(Actor* thisx, PlayState* play) { Animation_OnFrame(&this->skelAnime, 52.0f)) { if (Animation_OnFrame(&this->skelAnime, 52.0f)) { this->unk_34E &= ~0x400; - Player_UpdateBottleHeld(play, player, ITEM_BOTTLE, PLAYER_AP_BOTTLE); + Player_UpdateBottleHeld(play, player, ITEM_BOTTLE, PLAYER_IA_BOTTLE); } Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOUME_DRINK); } else if (Animation_OnFrame(&this->skelAnime, 90.0f)) { @@ -1150,7 +1151,7 @@ void EnTru_Init(Actor* thisx, PlayState* play) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_16_10)) { EnTru_ChangeAnim(this, KOUME_ANIM_INJURED_HEAD_UP); } else { - this->unk_388 = PLAYER_AP_NONE; + this->unk_388 = PLAYER_IA_NONE; } this->actionFunc = func_80A87FD0; @@ -1176,7 +1177,7 @@ void EnTru_Update(Actor* thisx, PlayState* play) { func_80A86DB8(this); radius = this->collider.dim.worldSphere.radius + 30; - this->unk_388 = !(this->unk_34E & 0x80) ? PLAYER_AP_NONE : PLAYER_AP_NONE; + this->unk_388 = !(this->unk_34E & 0x80) ? PLAYER_IA_NONE : PLAYER_IA_NONE; func_8013C964(&this->actor, play, radius, 20.0f, this->unk_388, this->unk_34E & 7); func_80A8697C(this, play); diff --git a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c index c4572a11ae..a9631d96b3 100644 --- a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c +++ b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c @@ -311,19 +311,20 @@ void func_80AE04C4(EnTsn* this, PlayState* play) { } void func_80AE04FC(EnTsn* this, PlayState* play) { - s32 sp24; + PlayerItemAction itemAction; Player* player = GET_PLAYER(play); if (Message_GetState(&play->msgCtx) == TEXT_STATE_16) { - sp24 = func_80123810(play); - if (sp24 != 0) { + itemAction = func_80123810(play); + + if (itemAction != PLAYER_IA_NONE) { SET_WEEKEVENTREG(WEEKEVENTREG_26_02); } - if (sp24 > 0) { + if (itemAction > PLAYER_IA_NONE) { func_801477B4(play); this->actionFunc = func_80AE0704; - if (sp24 == 19) { + if (itemAction == PLAYER_IA_PICTO_BOX) { if (CHECK_QUEST_ITEM(QUEST_PICTOGRAPH)) { if (Snap_CheckFlag(PICTOGRAPH_PIRATE_GOOD)) { player->actor.textId = 0x107B; @@ -345,7 +346,7 @@ void func_80AE04FC(EnTsn* this, PlayState* play) { return; } - if (sp24 == 13) { + if (itemAction == PLAYER_IA_HOOKSHOT) { player->actor.textId = 0x1075; return; } @@ -355,7 +356,7 @@ void func_80AE04FC(EnTsn* this, PlayState* play) { return; } - if (sp24 < 0) { + if (itemAction <= PLAYER_IA_MINUS1) { func_80151938(play, 0x1078); Animation_MorphToLoop(&this->unk_1D8->skelAnime, &object_tsn_Anim_001198, -10.0f); this->actionFunc = func_80AE0704; 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 4effb0da7a..2310a2eef3 100644 --- a/src/overlays/actors/ovl_En_Yb/z_en_yb.c +++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.c @@ -262,7 +262,7 @@ void EnYb_SetupLeaving(EnYb* this, PlayState* play) { Message_StartTextbox(play, 0x147D, &this->actor); func_80BFA2FC(play); } else { - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } EnYb_EnableProximityMusic(this); } @@ -274,7 +274,7 @@ void EnYb_ReceiveMask(EnYb* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = EnYb_SetupLeaving; this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } else { Actor_PickUp(&this->actor, play, GI_MASK_KAMARO, 10000.0f, 100.0f); } @@ -325,7 +325,7 @@ void EnYb_TeachingDanceFinish(EnYb* this, PlayState* play) { Message_StartTextbox(play, 0x147C, &this->actor); this->actor.flags &= ~ACTOR_FLAG_10000; } else { - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } EnYb_EnableProximityMusic(this); } @@ -340,7 +340,7 @@ void EnYb_TeachingDance(EnYb* this, PlayState* play) { EnYb_FinishTeachingCutscene(this); this->actionFunc = EnYb_TeachingDanceFinish; this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } EnYb_EnableProximityMusic(this); } diff --git a/src/overlays/actors/ovl_En_Zos/z_en_zos.c b/src/overlays/actors/ovl_En_Zos/z_en_zos.c index 2ace515400..ba37c3ffe3 100644 --- a/src/overlays/actors/ovl_En_Zos/z_en_zos.c +++ b/src/overlays/actors/ovl_En_Zos/z_en_zos.c @@ -254,7 +254,7 @@ void func_80BBB2C4(EnZos* this, PlayState* play) { this->actionFunc = func_80BBB8AC; this->actor.flags &= ~ACTOR_FLAG_10000; } else { - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } } @@ -266,7 +266,7 @@ void func_80BBB354(EnZos* this, PlayState* play) { this->actionFunc = func_80BBB2C4; SET_WEEKEVENTREG(WEEKEVENTREG_39_20); this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } else { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_39_20)) { getItemId = GI_RUPEE_PURPLE; @@ -361,17 +361,18 @@ void func_80BBB574(EnZos* this, PlayState* play) { } void func_80BBB718(EnZos* this, PlayState* play) { - s32 sp24; + PlayerItemAction itemAction; Player* player = GET_PLAYER(play); SkelAnime_Update(&this->skelAnime); if (Message_GetState(&play->msgCtx) == TEXT_STATE_16) { - sp24 = func_80123810(play); - if (sp24 > 0) { + itemAction = func_80123810(play); + + if (itemAction > PLAYER_IA_NONE) { func_801477B4(play); - if (sp24 == 25) { + if (itemAction == PLAYER_IA_BOTTLE_ZORA_EGG) { player->actor.textId = 0x1232; EnZos_ChangeAnim(this, EN_ZOS_ANIM_TALK_ARMS_OUT, ANIMMODE_LOOP); this->unk_2B6 |= 8; @@ -385,7 +386,7 @@ void func_80BBB718(EnZos* this, PlayState* play) { this->unk_2B6 |= 4; } this->actionFunc = func_80BBB8AC; - } else if (sp24 < 0) { + } else if (itemAction <= PLAYER_IA_MINUS1) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_39_08)) { func_80151938(play, 0x1241); } else { @@ -525,7 +526,7 @@ void func_80BBBCBC(EnZos* this, PlayState* play) { Message_StartTextbox(play, 0x124D, &this->actor); this->actionFunc = func_80BBB574; } else { - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } } @@ -534,7 +535,7 @@ void func_80BBBD5C(EnZos* this, PlayState* play) { if (!Cutscene_CheckActorAction(play, 0x1F5)) { this->actionFunc = func_80BBBCBC; this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } } 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 2c17a2ae5a..417a6388e9 100644 --- a/src/overlays/actors/ovl_En_Zot/z_en_zot.c +++ b/src/overlays/actors/ovl_En_Zot/z_en_zot.c @@ -516,7 +516,7 @@ void func_80B975F8(EnZot* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actionFunc = func_80B973BC; } else { - func_800B8500(&this->actor, play, 10000.0f, 1000.0f, PLAYER_AP_NONE); + func_800B8500(&this->actor, play, 10000.0f, 1000.0f, PLAYER_IA_NONE); } } @@ -931,7 +931,7 @@ void func_80B9849C(EnZot* this, PlayState* play) { } this->actionFunc = func_80B98728; } else { - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } } @@ -941,22 +941,23 @@ void func_80B9854C(EnZot* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = func_80B9849C; this->actor.flags |= ACTOR_FLAG_10000; - func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } else { Actor_PickUp(&this->actor, play, this->unk_2D4, 10000.0f, 50.0f); } } void func_80B985EC(EnZot* this, PlayState* play) { - s32 itemActionParam; + PlayerItemAction itemAction; Player* player = GET_PLAYER(play); func_80B98348(this, play); if (Message_GetState(&play->msgCtx) == TEXT_STATE_16) { - itemActionParam = func_80123810(play); - if (itemActionParam > PLAYER_AP_NONE) { + itemAction = func_80123810(play); + + if (itemAction > PLAYER_IA_NONE) { func_801477B4(play); - if ((itemActionParam == PLAYER_AP_PICTO_BOX) && CHECK_QUEST_ITEM(QUEST_PICTOGRAPH) && + if ((itemAction == PLAYER_IA_PICTO_BOX) && CHECK_QUEST_ITEM(QUEST_PICTOGRAPH) && Snap_CheckFlag(PICTOGRAPH_LULU_HEAD)) { if (Snap_CheckFlag(PICTOGRAPH_LULU_RIGHT_ARM) && Snap_CheckFlag(PICTOGRAPH_LULU_LEFT_ARM)) { player->actor.textId = 0x12AE; @@ -968,7 +969,7 @@ void func_80B985EC(EnZot* this, PlayState* play) { player->actor.textId = 0x12AB; } this->actionFunc = func_80B98728; - } else if (itemActionParam < PLAYER_AP_NONE) { + } else if (itemAction <= PLAYER_IA_MINUS1) { func_80151938(play, 0x12AB); this->actionFunc = func_80B98728; } diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index a191286275..35f37d5d8a 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -546,7 +546,7 @@ void func_80937FC8(ObjBean* this, PlayState* play) { this->unk_1E8(this); if (Actor_ProcessTalkRequest(&this->dyna.actor, &play->state)) { - if (Player_GetExchangeItemId(play) == PLAYER_AP_MAGIC_BEANS) { + if (Player_GetExchangeItemId(play) == PLAYER_IA_MAGIC_BEANS) { func_809383B4(this); Flags_SetSwitch(play, OBJBEAN_GET_3F80(&this->dyna.actor, 0)); } diff --git a/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c b/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c index ee5dac6309..4708062da4 100644 --- a/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c +++ b/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c @@ -529,7 +529,7 @@ s32 func_80B30480(ObjSpidertent* this, PlayState* play, Vec3f* arg2) { Vec3f sp58; f32 sp54; - if (player->itemActionParam == 7) { + if (player->heldItemAction == PLAYER_IA_STICK) { if (player->unk_B28 > 0) { for (i = 0; i < ARRAY_COUNT(this->colliderElements); i++) { triNorm = &this->collider.elements[i].dim; diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index e73892e892..96716d107a 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -196,7 +196,7 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { if (this->flameCollider.info.acHitInfo->toucher.dmgFlags & 0x820) { interaction = OBJ_SYOKUDAI_INTERACTION_ARROW_FA; } - } else if (player->itemActionParam == PLAYER_AP_STICK) { + } else if (player->heldItemAction == PLAYER_IA_STICK) { Vec3f stickTipSeparationVec; Math_Vec3f_Diff(&player->meleeWeaponInfo[0].tip, &thisx->world.pos, &stickTipSeparationVec); diff --git a/tools/namefixer.py b/tools/namefixer.py index b3d08434dc..226295393a 100755 --- a/tools/namefixer.py +++ b/tools/namefixer.py @@ -5,10 +5,7 @@ import argparse # all occurrences of keys will be replaced by associated value simpleReplace = { - # "Math_Rand_":"Rand_", - # "ACTORTYPE":"ACTORCAT", - # "DistToLink":"DistToPlayer", - # "HitItem":"HitInfo", + "PLAYER_AP_": "PLAYER_IA_", } # all occurrences of keys will be replaced by associated value, @@ -729,6 +726,8 @@ wordReplace = { "player->swordAnimation": "player->meleeWeaponAnimation", "player->swordState": "player->meleeWeaponState", "player->swordInfo": "player->meleeWeaponInfo", + "player->itemActionParam": "player->heldItemAction", + "player->heldItemActionParam": "player->itemAction", "player->unk_A9C": "player->secretRumbleCharge", "player->unk_AA0": "player->closestSecretDistSq", "player->unk_B68": "player->fallStartHeight", @@ -797,21 +796,21 @@ wordReplace = { "ICHAIN_F32_DIV1000(minVelocityY,": "ICHAIN_F32_DIV1000(terminalVelocity,", "ICHAIN_F32(minVelocityY,": "ICHAIN_F32(terminalVelocity,", - "EXCH_ITEM_MINUS1": "PLAYER_AP_MINUS1", - "EXCH_ITEM_NONE": "PLAYER_AP_NONE", - "EXCH_ITEM_PICTO_BOX": "PLAYER_AP_PICTO_BOX", - "EXCH_ITEM_1E": "PLAYER_AP_BOTTLE_MUSHROOM", - "EXCH_ITEM_MOON_TEAR": "PLAYER_AP_MOON_TEAR", - "EXCH_ITEM_DEED_LAND": "PLAYER_AP_DEED_LAND", - "EXCH_ITEM_ROOM_KEY": "PLAYER_AP_ROOM_KEY", - "EXCH_ITEM_LETTER_TO_KAFEI": "PLAYER_AP_LETTER_TO_KAFEI", - "EXCH_ITEM_2E": "PLAYER_AP_MAGIC_BEANS", - "EXCH_ITEM_DEED_SWAMP": "PLAYER_AP_DEED_SWAMP", - "EXCH_ITEM_DEED_MOUNTAIN": "PLAYER_AP_DEED_MOUNTAIN", - "EXCH_ITEM_DEED_OCEAN": "PLAYER_AP_DEED_OCEAN", - "EXCH_ITEM_LETTER_MAMA": "PLAYER_AP_LETTER_MAMA", + "EXCH_ITEM_MINUS1": "PLAYER_IA_MINUS1", + "EXCH_ITEM_NONE": "PLAYER_IA_NONE", + "EXCH_ITEM_PICTO_BOX": "PLAYER_IA_PICTO_BOX", + "EXCH_ITEM_1E": "PLAYER_IA_BOTTLE_MUSHROOM", + "EXCH_ITEM_MOON_TEAR": "PLAYER_IA_MOON_TEAR", + "EXCH_ITEM_DEED_LAND": "PLAYER_IA_DEED_LAND", + "EXCH_ITEM_ROOM_KEY": "PLAYER_IA_ROOM_KEY", + "EXCH_ITEM_LETTER_TO_KAFEI": "PLAYER_IA_LETTER_TO_KAFEI", + "EXCH_ITEM_2E": "PLAYER_IA_MAGIC_BEANS", + "EXCH_ITEM_DEED_SWAMP": "PLAYER_IA_DEED_SWAMP", + "EXCH_ITEM_DEED_MOUNTAIN": "PLAYER_IA_DEED_MOUNTAIN", + "EXCH_ITEM_DEED_OCEAN": "PLAYER_IA_DEED_OCEAN", + "EXCH_ITEM_LETTER_MAMA": "PLAYER_IA_LETTER_MAMA", "ITEM_FISHING_POLE": "ITEM_FISHING_ROD", - "PLAYER_AP_FISHING_POLE": "PLAYER_AP_FISHING_ROD", + "PLAYER_AP_FISHING_POLE": "PLAYER_IA_FISHING_ROD", # Example of custom behaviour: # "PLAYER": ("GET_PLAYER(play)", {"ignore": (-1, '"PLAYER"')}), # ignore "PLAYER" in sSoundBankNames