diff --git a/Jenkinsfile b/Jenkinsfile index 29c3721b2..a627ead7c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -99,7 +99,7 @@ pipeline { branch 'master' } agent{ - label 'master' + label 'zeldaret_website' } steps { unstash 'reports' diff --git a/assets/xml/objects/gameplay_keep.xml b/assets/xml/objects/gameplay_keep.xml index ca0aaeb3c..2e65fb73d 100644 --- a/assets/xml/objects/gameplay_keep.xml +++ b/assets/xml/objects/gameplay_keep.xml @@ -12,7 +12,7 @@ - + @@ -20,8 +20,8 @@ - - + + @@ -30,7 +30,7 @@ - + @@ -38,11 +38,14 @@ - + + - + + + @@ -881,14 +884,17 @@ - - - - - - - - + + + + + + + + + + + @@ -1116,26 +1122,29 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1214,18 +1223,21 @@ - + - - - - - + + + + + + + + @@ -1442,25 +1454,28 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -1479,7 +1494,7 @@ - + diff --git a/assets/xml/objects/object_boss01.xml b/assets/xml/objects/object_boss01.xml index 89cc97a7e..08730f034 100644 --- a/assets/xml/objects/object_boss01.xml +++ b/assets/xml/objects/object_boss01.xml @@ -1,189 +1,232 @@  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_boss_hakugin.xml b/assets/xml/objects/object_boss_hakugin.xml index 3444dc041..ba04a3071 100644 --- a/assets/xml/objects/object_boss_hakugin.xml +++ b/assets/xml/objects/object_boss_hakugin.xml @@ -1,82 +1,106 @@  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_bsmask.xml b/assets/xml/objects/object_bsmask.xml index ea94aa89e..0e7a349cb 100644 --- a/assets/xml/objects/object_bsmask.xml +++ b/assets/xml/objects/object_bsmask.xml @@ -18,7 +18,7 @@ - + diff --git a/assets/xml/objects/object_dkjail_obj.xml b/assets/xml/objects/object_dkjail_obj.xml index 219181c6d..ada181475 100644 --- a/assets/xml/objects/object_dkjail_obj.xml +++ b/assets/xml/objects/object_dkjail_obj.xml @@ -1,6 +1,6 @@  - + diff --git a/assets/xml/objects/object_dno.xml b/assets/xml/objects/object_dno.xml index e1528989c..e5b3323dc 100644 --- a/assets/xml/objects/object_dno.xml +++ b/assets/xml/objects/object_dno.xml @@ -1,94 +1,106 @@  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_dnq.xml b/assets/xml/objects/object_dnq.xml index 63f27a6f8..4a21dbfef 100644 --- a/assets/xml/objects/object_dnq.xml +++ b/assets/xml/objects/object_dnq.xml @@ -1,88 +1,100 @@  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_harfgibud.xml b/assets/xml/objects/object_harfgibud.xml index 61e1fc457..99578e996 100644 --- a/assets/xml/objects/object_harfgibud.xml +++ b/assets/xml/objects/object_harfgibud.xml @@ -1,128 +1,131 @@  + - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_link_boy.xml b/assets/xml/objects/object_link_boy.xml index 68ec00737..2fe50d9bc 100644 --- a/assets/xml/objects/object_link_boy.xml +++ b/assets/xml/objects/object_link_boy.xml @@ -2,42 +2,45 @@ - - + + - + - - - - - - - - - + + + + + + + + + + - + - - - - - - - + + + + + + + + - - - - + + + + + - + @@ -46,36 +49,38 @@ - + - - + + - + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_link_child.xml b/assets/xml/objects/object_link_child.xml index 5ad903048..23d3cf09c 100644 --- a/assets/xml/objects/object_link_child.xml +++ b/assets/xml/objects/object_link_child.xml @@ -1,25 +1,28 @@  - - - - - - - + + + + + + + - - - - - - + + + + + + + + + - - - + + + @@ -29,37 +32,44 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + @@ -67,49 +77,51 @@ - + + - + - + - + - - - - + + + + - + - + + - - - + + + - + - - - + + + @@ -122,35 +134,60 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_link_goron.xml b/assets/xml/objects/object_link_goron.xml index 39686b4f7..48eef4dd9 100644 --- a/assets/xml/objects/object_link_goron.xml +++ b/assets/xml/objects/object_link_goron.xml @@ -1,8 +1,13 @@  - + + + + + - + + @@ -17,26 +22,28 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -45,9 +52,9 @@ - + - + @@ -59,7 +66,7 @@ - + @@ -76,33 +83,36 @@ - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_link_nuts.xml b/assets/xml/objects/object_link_nuts.xml index eb072c940..a00c44db4 100644 --- a/assets/xml/objects/object_link_nuts.xml +++ b/assets/xml/objects/object_link_nuts.xml @@ -1,23 +1,24 @@  - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -53,27 +54,28 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_link_zora.xml b/assets/xml/objects/object_link_zora.xml index 9a973c56a..5833293b8 100644 --- a/assets/xml/objects/object_link_zora.xml +++ b/assets/xml/objects/object_link_zora.xml @@ -1,8 +1,22 @@  - + + + + + + + + + + + + + + - + + @@ -15,24 +29,26 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -48,13 +64,13 @@ - - + + - + @@ -68,29 +84,31 @@ + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_nb.xml b/assets/xml/objects/object_nb.xml index 511fddd6c..7ac63e118 100644 --- a/assets/xml/objects/object_nb.xml +++ b/assets/xml/objects/object_nb.xml @@ -1,46 +1,58 @@  + - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_ob.xml b/assets/xml/objects/object_ob.xml index d2390fc39..aa95db9bc 100644 --- a/assets/xml/objects/object_ob.xml +++ b/assets/xml/objects/object_ob.xml @@ -3,7 +3,7 @@ - + @@ -18,16 +18,16 @@ - - + + - - - + + + diff --git a/assets/xml/objects/object_osn.xml b/assets/xml/objects/object_osn.xml index dbcdb8473..d6109c717 100644 --- a/assets/xml/objects/object_osn.xml +++ b/assets/xml/objects/object_osn.xml @@ -1,117 +1,139 @@  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_rz.xml b/assets/xml/objects/object_rz.xml index d8740403a..9bf8961a9 100644 --- a/assets/xml/objects/object_rz.xml +++ b/assets/xml/objects/object_rz.xml @@ -1,13 +1,13 @@  - - - - - - - - + + + + + + + + diff --git a/assets/xml/objects/object_zog.xml b/assets/xml/objects/object_zog.xml index 1ede14ad2..8d9e6ebdb 100644 --- a/assets/xml/objects/object_zog.xml +++ b/assets/xml/objects/object_zog.xml @@ -16,7 +16,7 @@ - + diff --git a/docs/STYLE.md b/docs/STYLE.md index 4ac0525db..0cf1d051b 100644 --- a/docs/STYLE.md +++ b/docs/STYLE.md @@ -122,7 +122,7 @@ Floats usually need an `f` on the end to match, or IDO will use doubles. Our flo bar(); ``` -**Exception**: After `Actor_MarkForDeath` or sometimes setting the action function, if it makes sense to do so (this expresses the finality a bit better). +**Exception**: After `Actor_Kill` or sometimes setting the action function, if it makes sense to do so (this expresses the finality a bit better). ## Macros and enums diff --git a/docs/tutorial/advanced_control_flow.md b/docs/tutorial/advanced_control_flow.md index 3ad2a9d4f..96ba7a43d 100644 --- a/docs/tutorial/advanced_control_flow.md +++ b/docs/tutorial/advanced_control_flow.md @@ -26,7 +26,7 @@ void func_809527F8(EnMs* this, PlayState* play); void func_809529AC(EnMs* this, PlayState* play); void func_80952A1C(EnMs* this, PlayState* play); -const ActorInit En_Ms_InitVars = { +ActorInit En_Ms_InitVars = { ACTOR_EN_MS, ACTORCAT_NPC, FLAGS, diff --git a/docs/tutorial/beginning_decomp.md b/docs/tutorial/beginning_decomp.md index eadfa9adc..591f12a2b 100644 --- a/docs/tutorial/beginning_decomp.md +++ b/docs/tutorial/beginning_decomp.md @@ -27,7 +27,7 @@ void EnRecepgirl_Draw(Actor* thisx, PlayState* play); // --------------- 4 --------------- #if 0 -const ActorInit En_Recepgirl_InitVars = { +ActorInit En_Recepgirl_InitVars = { ACTOR_EN_RECEPGIRL, ACTORCAT_NPC, FLAGS, @@ -122,8 +122,6 @@ typedef struct EnRecepgirl { /* 0x02AC */ char unk_2AC[0x8]; } EnRecepgirl; // size = 0x2B4 -extern const ActorInit En_Recepgirl_InitVars; - #endif // Z_EN_RECEPGIRL_H ``` @@ -337,7 +335,7 @@ For now, we do not want to consider the data that mips2c has kindly imported for ```C #if 0 -const ActorInit En_Recepgirl_InitVars = { +ActorInit En_Recepgirl_InitVars = { ACTOR_EN_RECEPGIRL, ACTORCAT_NPC, FLAGS, diff --git a/docs/tutorial/data.md b/docs/tutorial/data.md index 0a19113e4..6884ebb12 100644 --- a/docs/tutorial/data.md +++ b/docs/tutorial/data.md @@ -43,7 +43,7 @@ Once we have decompiled enough things to know what the data is, we can import it ```C #if 0 -const ActorInit En_Recepgirl_InitVars = { +ActorInit En_Recepgirl_InitVars = { ACTOR_EN_RECEPGIRL, ACTORCAT_NPC, FLAGS, @@ -99,7 +99,7 @@ endseg Next remove all the externs, and uncomment their corresponding commented data: ```C -const ActorInit En_Recepgirl_InitVars = { +ActorInit En_Recepgirl_InitVars = { ACTOR_EN_RECEPGIRL, ACTORCAT_NPC, FLAGS, @@ -139,7 +139,7 @@ As we'd expect, of course: we didn't fulfil our promise that they were defined e For actors which have yet to be decompiled, this is mitigated by use of the file `undefined_syms.txt`, which feeds the linker the raw addresses to use as the symbol definitions. However, we want to replace these segmented addresses with proper object symbols whenever possible. In `En_Recepgirl_InitVars`, we can see that this actor uses the object `OBJECT_BG`: ```c -const ActorInit En_Recepgirl_InitVars = { +ActorInit En_Recepgirl_InitVars = { ACTOR_EN_RECEPGIRL, ACTORCAT_NPC, FLAGS, diff --git a/docs/tutorial/documenting.md b/docs/tutorial/documenting.md index 2e98e1efd..68c90ef66 100644 --- a/docs/tutorial/documenting.md +++ b/docs/tutorial/documenting.md @@ -48,7 +48,7 @@ void func_80C1019C(EnRecepgirl* this, PlayState* play); void func_80C10290(EnRecepgirl* this); void func_80C102D4(EnRecepgirl* this, PlayState* play); -const ActorInit En_Recepgirl_InitVars = { +ActorInit En_Recepgirl_InitVars = { ACTOR_EN_RECEPGIRL, ACTORCAT_NPC, FLAGS, @@ -316,7 +316,7 @@ So it is used as an index into the array `D_80C106B0`, and the element with that As we discussed last time, `D_80C106B0` is an array of [segmented pointers](data.md#segmented-pointers). Since they are in segment `6`, they are in the actor's object file. Which object? The InitVars tell us: namely, ```C -const ActorInit En_Recepgirl_InitVars = { +ActorInit En_Recepgirl_InitVars = { ACTOR_EN_RECEPGIRL, ACTORCAT_NPC, FLAGS, diff --git a/include/PR/gbi.h b/include/PR/gbi.h index 632ca3caf..5cfe31785 100644 --- a/include/PR/gbi.h +++ b/include/PR/gbi.h @@ -2599,11 +2599,11 @@ _DW({ \ gsSPLoadUcodeEx((uc_start), (uc_dstart), SP_UCODE_DATA_SIZE) #define gSPLoadUcodeL(pkt, ucode) \ - gSPLoadUcode((pkt), OS_K0_TO_PHYSICAL(&##ucode##TextStart), \ - OS_K0_TO_PHYSICAL(&##ucode##DataStart)) + gSPLoadUcode((pkt), OS_K0_TO_PHYSICAL(&ucode##TextStart), \ + OS_K0_TO_PHYSICAL(&ucode##DataStart)) #define gsSPLoadUcodeL(ucode) \ - gsSPLoadUcode(OS_K0_TO_PHYSICAL(&##ucode##TextStart), \ - OS_K0_TO_PHYSICAL(&##ucode##DataStart)) + gsSPLoadUcode(OS_K0_TO_PHYSICAL(&ucode##TextStart), \ + OS_K0_TO_PHYSICAL(&ucode##DataStart)) #endif #ifdef F3DEX_GBI_2 diff --git a/include/color.h b/include/color.h index b0b4d2cb0..d0cdb62f5 100644 --- a/include/color.h +++ b/include/color.h @@ -51,4 +51,6 @@ typedef union { u16 rgba; } Color_RGBA16; +#define RGBA8(r, g, b, a) ((((r) & 0xFF) << 24) | (((g) & 0xFF) << 16) | (((b) & 0xFF) << 8) | (((a) & 0xFF) << 0)) + #endif diff --git a/include/functions.h b/include/functions.h index b833b5b72..bc865e3e1 100644 --- a/include/functions.h +++ b/include/functions.h @@ -164,7 +164,7 @@ f64 func_80086CEC(f64 param_1); s32 func_80086CF8(f32 param_1); s32 func_80086D08(f64 param_1); // void func_80086D18(void); -// void func_80086D24(void); +f64 func_80086D24(f64); s32 func_80086D30(f32 param_1); s32 func_80086D40(f64 param_1); // void func_80086D50(void); @@ -619,7 +619,7 @@ f32 func_800B64FC(PlayState* play, f32 arg1, Vec3f* arg2, s32* arg3); void* func_800B6584(PlayState* play, s16 id, void* arg2, size_t size); void* func_800B6608(PlayState* play, s16 id); void* func_800B6680(PlayState* play, s16 id); -void Actor_MarkForDeath(Actor* actor); +void Actor_Kill(Actor* actor); void Actor_SetWorldToHome(Actor* actor); void Actor_SetFocus(Actor* actor, f32 height); void Actor_SetWorldRotToShape(Actor* actor); @@ -1263,7 +1263,7 @@ void SoundSource_InitAll(PlayState* play); void SoundSource_UpdateAll(PlayState* play); void SoundSource_PlaySfxAtFixedWorldPos(PlayState* play, Vec3f* worldPos, u32 duration, u16 sfxId); void SoundSource_PlaySfxEachFrameAtFixedWorldPos(PlayState* play, Vec3f* worldPos, u32 duration, u16 sfxId); -u16 ElfMessage_GetFirstCycleHint(PlayState* play); +u16 QuestHint_GetTatlTextId(PlayState* play); u16 Text_GetFaceReaction(PlayState* play, u32 reactionSet); void EnvFlags_UnsetAll(PlayState* play); @@ -1556,7 +1556,7 @@ void func_80106644(PlayState* play, s16 arg1, s16 arg2, s16 arg3); // void func_8010683C(void); // void func_801068B4(void); // void func_801068D8(void); -// void func_801068FC(void); +void* func_801068FC(PlayState* play, void* arg1, size_t size); // void func_80106BEC(void); // void func_80106D08(void); // void func_80106D5C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7); @@ -1569,7 +1569,7 @@ void func_80108AF8(PlayState* play); s32 func_801090B0(s32 arg0); s32 func_80109124(s16 arg0); // void func_801091F0(void); -// void func_80109428(void); +void func_80109428(PlayState* play); // void func_801094A0(void); // void func_801094C8(void); // void func_801094F8(void); @@ -1675,7 +1675,7 @@ void Map_Destroy(PlayState* play); // void func_8010BEBC(void); // void func_8010BEF0(void); // void func_8010BF24(void); -s32 func_8010BF58(Actor* actor, PlayState* play, s32* param_3, UNK_PTR param_4, s32* param_5); +s32 func_8010BF58(Actor* actor, PlayState* play, void* param_3, UNK_PTR param_4, s32* param_5); void Nmi_Init(void); void Nmi_SetPrenmiStart(void); // s32 Nmi_GetPrenmiHasStarted(void); @@ -1712,13 +1712,13 @@ void Interface_StartTimer(s16 timerId, s16 seconds); void Interface_StartPostmanTimer(s16 seconds, s16 bunnyHoodState); void func_8010EE74(PlayState* play, s32 day); void Interface_SetHudVisibility(u16 hudVisibility); -// void func_80110038(void); +void func_80110038(PlayState* play); // void func_80111CB4(void); // void func_801129E4(void); void func_80112AFC(PlayState* play); void Interface_LoadItemIconImpl(PlayState* play, u8 btn); void Interface_LoadItemIcon(PlayState* play, u8 btn); -// void func_80112C0C(void); +void func_80112C0C(PlayState* play, u16 flag); u8 Item_Give(PlayState* play, u8 item); u8 Item_CheckObtainability(u8 item); void Inventory_DeleteItem(s16 item, s16 slot); @@ -1800,15 +1800,15 @@ s32 func_80123448(PlayState* play); s32 Player_IsGoronOrDeku(Player* player); s32 func_801234D4(PlayState* play); s32 func_80123590(PlayState* play, Actor* actor); -s32 func_8012364C(PlayState* play, Player* player, s32 arg2); +ItemId func_8012364C(PlayState* play, Player* player, s32 arg2); s32 func_80123810(PlayState* play); -s32 Player_ActionToModelGroup(Player* player, s32 actionParam); -void func_801239AC(Player* player); -void Player_SetModels(Player* player, s32 modelGroup); -void Player_SetModelGroup(Player* player, s32 modelGroup); +PlayerModelGroup Player_ActionToModelGroup(Player* player, PlayerActionParam actionParam); +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 func_80123D50(PlayState* play, Player* player, s32 itemId, s32 actionParam); +void func_80123D50(PlayState* play, Player* player, ItemId itemId, PlayerActionParam actionParam); void func_80123DA4(Player* player); void func_80123DC0(Player* player); void func_80123E90(PlayState* play, Actor* actor); @@ -1821,21 +1821,21 @@ 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, s32 actionParam); +s32 func_80124110(Player* player, PlayerActionParam actionParam); s32 func_80124148(Player* player); -s32 Player_ActionToMeleeWeapon(s32 actionParam); +s32 Player_ActionToMeleeWeapon(PlayerActionParam actionParam); s32 Player_GetMeleeWeaponHeld(Player* player); s32 Player_IsHoldingTwoHandedWeapon(Player* player); -s32 Player_ActionToBottle(Player* player, s32 actionParam); +s32 Player_ActionToBottle(Player* player, PlayerActionParam actionParam); s32 Player_GetBottleHeld(Player* Player); -s32 Player_ActionToExplosive(Player* player, s32 actionParam); +s32 Player_ActionToExplosive(Player* player, PlayerActionParam actionParam); s32 Player_GetExplosiveHeld(Player* player); -s32 func_80124278(Actor* actor, s32 actionParam); +s32 Player_ActionToSword(Actor* actor, PlayerActionParam actionParam); s32 func_801242B4(Player* player); s32 Player_GetEnvTimerType(PlayState* play); void func_80124420(Player* player); void func_80124618(struct_80124618 arg0[], f32 curFrame, Vec3f* arg2); -void func_801246F4(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, s32 tunic, s32 boots, s32 face, OverrideLimbDrawFlex overrideLimbDraw, PostLimbDrawFlex postLimbDraw, Actor* actor); +void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, PlayerTransformation playerForm, s32 boots, s32 face, OverrideLimbDrawFlex overrideLimbDraw, PostLimbDrawFlex postLimbDraw, Actor* actor); void func_80125318(Vec3f* arg0, Vec3s* arg1); void Player_DrawZoraShield(PlayState* play, Player* player); void func_80125500(PlayState* play, Player* player, s32 limbIndex, Vec3f* pos, Vec3s* rot); @@ -2168,7 +2168,7 @@ void func_80140E80(void* param_1); // void func_80140EA0(void); // void func_80140EAC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); // void func_80141008(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10); -// void func_8014116C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); +void func_8014116C(Gfx** gfxP, u16* arg1, u16* arg2, s32 width, s32 height, s32 arg5); // void func_801411B4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10); // void func_80141200(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); // void func_8014151C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); @@ -2393,7 +2393,7 @@ s32 func_8016A02C(GameState* thisx, Actor* actor, s16* yaw); s32 Play_IsUnderwater(PlayState* this, Vec3f* pos); s32 Play_IsDebugCamEnabled(void); void Play_AssignPlayerActorCsIdsFromScene(GameState* thisx, s32 startActorCsId); -void func_8016A268(GameState* gameState, s16 arg1, u8 arg2, u8 arg3, u8 arg4, u8 arg5); +void Play_FillScreen(GameState* gameState, s16 fillScreenOn, u8 red, u8 green, u8 blue, u8 alpha); void Play_Init(GameState* gameState); // void func_8016AC10(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10); // void func_8016AE1C(void); @@ -2589,8 +2589,8 @@ s32 func_80178A94(s32 param_1, s32 param_2); // void func_80178C80(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); // void func_80178D7C(void); // void func_80178DAC(void); -// void func_80178E3C(void); -// void func_80178E7C(void); +void func_80178E3C(u8*, s32, s32, s32); +void func_80178E7C(uintptr_t arg0, void* arg1, size_t size); // void Check_WriteRGBA16Pixel(u16* buffer, u32 x, u32 y, u32 value); // void Check_WriteI4Pixel(u16* buffer, u32 x, u32 y, u32 value); // void Check_DrawI4Texture(u16* buffer, u32 x, u32 y, u32 width, u32 height, u8* texture); diff --git a/include/initvars.h b/include/initvars.h index 4de39757c..50668a14c 100644 --- a/include/initvars.h +++ b/include/initvars.h @@ -34,582 +34,6 @@ extern EffectSsInit Effect_Ss_Ice_Smoke_InitVars; extern EffectSsInit Effect_En_Ice_Block_InitVars; extern EffectSsInit Effect_Ss_Sbn_InitVars; -extern ActorInit Player_InitVars; -extern ActorInit Arms_Hook_InitVars; -extern ActorInit Arrow_Fire_InitVars; -extern ActorInit Arrow_Ice_InitVars; -extern ActorInit Arrow_Light_InitVars; -extern ActorInit Bg_Astr_Bombwall_InitVars; -extern ActorInit Bg_Botihasira_InitVars; -extern ActorInit Bg_Breakwall_InitVars; -extern ActorInit Bg_Crace_Movebg_InitVars; -extern ActorInit Bg_Ctower_Gear_InitVars; -extern ActorInit Bg_Ctower_Rot_InitVars; -extern ActorInit Bg_Danpei_Movebg_InitVars; -extern ActorInit Bg_Dblue_Balance_InitVars; -extern ActorInit Bg_Dblue_Elevator_InitVars; -extern ActorInit Bg_Dblue_Movebg_InitVars; -extern ActorInit Bg_Dblue_Waterfall_InitVars; -extern ActorInit Bg_Dkjail_Ivy_InitVars; -extern ActorInit Bg_Dy_Yoseizo_InitVars; -extern ActorInit Bg_F40_Block_InitVars; -extern ActorInit Bg_F40_Flift_InitVars; -extern ActorInit Bg_F40_Switch_InitVars; -extern ActorInit Bg_F40_Swlift_InitVars; -extern ActorInit Bg_Fire_Wall_InitVars; -extern ActorInit Bg_Fu_Kaiten_InitVars; -extern ActorInit Bg_Fu_Mizu_InitVars; -extern ActorInit Bg_Goron_Oyu_InitVars; -extern ActorInit Bg_Haka_Bombwall_InitVars; -extern ActorInit Bg_Haka_Curtain_InitVars; -extern ActorInit Bg_Haka_Tomb_InitVars; -extern ActorInit Bg_Hakugin_Bombwall_InitVars; -extern ActorInit Bg_Hakugin_Elvpole_InitVars; -extern ActorInit Bg_Hakugin_Post_InitVars; -extern ActorInit Bg_Hakugin_Switch_InitVars; -extern ActorInit Bg_Icefloe_InitVars; -extern ActorInit Bg_Icicle_InitVars; -extern ActorInit Bg_Ikana_Block_InitVars; -extern ActorInit Bg_Ikana_Bombwall_InitVars; -extern ActorInit Bg_Ikana_Dharma_InitVars; -extern ActorInit Bg_Ikana_Mirror_InitVars; -extern ActorInit Bg_Ikana_Ray_InitVars; -extern ActorInit Bg_Ikana_Rotaryroom_InitVars; -extern ActorInit Bg_Ikana_Shutter_InitVars; -extern ActorInit Bg_Ikninside_InitVars; -extern ActorInit Bg_Iknin_Susceil_InitVars; -extern ActorInit Bg_Iknv_Doukutu_InitVars; -extern ActorInit Bg_Iknv_Obj_InitVars; -extern ActorInit Bg_Ingate_InitVars; -extern ActorInit Bg_Inibs_Movebg_InitVars; -extern ActorInit Bg_Keikoku_Saku_InitVars; -extern ActorInit Bg_Keikoku_Spr_InitVars; -extern ActorInit Bg_Kin2_Bombwall_InitVars; -extern ActorInit Bg_Kin2_Fence_InitVars; -extern ActorInit Bg_Kin2_Picture_InitVars; -extern ActorInit Bg_Kin2_Shelf_InitVars; -extern ActorInit Bg_Ladder_InitVars; -extern ActorInit Bg_Last_Bwall_InitVars; -extern ActorInit Bg_Lbfshot_InitVars; -extern ActorInit Bg_Lotus_InitVars; -extern ActorInit Bg_Market_Step_InitVars; -extern ActorInit Bg_Mbar_Chair_InitVars; -extern ActorInit Bg_Numa_Hana_InitVars; -extern ActorInit Bg_Open_Shutter_InitVars; -extern ActorInit Bg_Open_Spot_InitVars; -extern ActorInit Bg_Sinkai_Kabe_InitVars; -extern ActorInit Bg_Spdweb_InitVars; -extern ActorInit Bg_Spout_Fire_InitVars; -extern ActorInit Bg_Tobira01_InitVars; -extern ActorInit Bg_Umajump_InitVars; -extern ActorInit Boss_01_InitVars; -extern ActorInit Boss_02_InitVars; -extern ActorInit Boss_03_InitVars; -extern ActorInit Boss_04_InitVars; -extern ActorInit Boss_05_InitVars; -extern ActorInit Boss_06_InitVars; -extern ActorInit Boss_07_InitVars; -extern ActorInit Boss_Hakugin_InitVars; -extern ActorInit Demo_Effect_InitVars; -extern ActorInit Demo_Getitem_InitVars; -extern ActorInit Demo_Kankyo_InitVars; -extern ActorInit Demo_Moonend_InitVars; -extern ActorInit Demo_Shd_InitVars; -extern ActorInit Demo_Syoten_InitVars; -extern ActorInit Demo_Tre_Lgt_InitVars; -extern ActorInit Dm_Ah_InitVars; -extern ActorInit Dm_Al_InitVars; -extern ActorInit Dm_An_InitVars; -extern ActorInit Dm_Bal_InitVars; -extern ActorInit Dm_Char00_InitVars; -extern ActorInit Dm_Char01_InitVars; -extern ActorInit Dm_Char02_InitVars; -extern ActorInit Dm_Char03_InitVars; -extern ActorInit Dm_Char04_InitVars; -extern ActorInit Dm_Char05_InitVars; -extern ActorInit Dm_Char06_InitVars; -extern ActorInit Dm_Char07_InitVars; -extern ActorInit Dm_Char08_InitVars; -extern ActorInit Dm_Char09_InitVars; -extern ActorInit Dm_Gm_InitVars; -extern ActorInit Dm_Hina_InitVars; -extern ActorInit Dm_Nb_InitVars; -extern ActorInit Dm_Opstage_InitVars; -extern ActorInit Dm_Ravine_InitVars; -extern ActorInit Dm_Sa_InitVars; -extern ActorInit Dm_Statue_InitVars; -extern ActorInit Dm_Stk_InitVars; -extern ActorInit Dm_Tag_InitVars; -extern ActorInit Dm_Tsg_InitVars; -extern ActorInit Dm_Zl_InitVars; -extern ActorInit Door_Ana_InitVars; -extern ActorInit Door_Shutter_InitVars; -extern ActorInit Door_Spiral_InitVars; -extern ActorInit Door_Warp1_InitVars; -extern ActorInit Eff_Change_InitVars; -extern ActorInit Eff_Dust_InitVars; -extern ActorInit Eff_Kamejima_Wave_InitVars; -extern ActorInit Eff_Lastday_InitVars; -extern ActorInit Eff_Stk_InitVars; -extern ActorInit Eff_Zoraband_InitVars; -extern ActorInit Elf_Msg_InitVars; -extern ActorInit Elf_Msg2_InitVars; -extern ActorInit Elf_Msg3_InitVars; -extern ActorInit Elf_Msg4_InitVars; -extern ActorInit Elf_Msg5_InitVars; -extern ActorInit Elf_Msg6_InitVars; -extern ActorInit En_Ah_InitVars; -extern ActorInit En_Akindonuts_InitVars; -extern ActorInit En_Al_InitVars; -extern ActorInit En_Am_InitVars; -extern ActorInit En_An_InitVars; -extern ActorInit En_And_InitVars; -extern ActorInit En_Ani_InitVars; -extern ActorInit En_Aob_01_InitVars; -extern ActorInit En_Arrow_InitVars; -extern ActorInit En_Attack_Niw_InitVars; -extern ActorInit En_Az_InitVars; -extern ActorInit En_Baba_InitVars; -extern ActorInit En_Baguo_InitVars; -extern ActorInit En_Baisen_InitVars; -extern ActorInit En_Bal_InitVars; -extern ActorInit En_Bat_InitVars; -extern ActorInit En_Bb_InitVars; -extern ActorInit En_Bba_01_InitVars; -extern ActorInit En_Bbfall_InitVars; -extern ActorInit En_Bee_InitVars; -extern ActorInit En_Bh_InitVars; -extern ActorInit En_Bigokuta_InitVars; -extern ActorInit En_Bigpamet_InitVars; -extern ActorInit En_Bigpo_InitVars; -extern ActorInit En_Bigslime_InitVars; -extern ActorInit En_Bji_01_InitVars; -extern ActorInit En_Bjt_InitVars; -extern ActorInit En_Boj_01_InitVars; -extern ActorInit En_Boj_02_InitVars; -extern ActorInit En_Boj_03_InitVars; -extern ActorInit En_Boj_04_InitVars; -extern ActorInit En_Boj_05_InitVars; -extern ActorInit En_Bom_InitVars; -extern ActorInit En_Bombal_InitVars; -extern ActorInit En_Bombers_InitVars; -extern ActorInit En_Bombers2_InitVars; -extern ActorInit En_Bombf_InitVars; -extern ActorInit En_Bomjima_InitVars; -extern ActorInit En_Bomjimb_InitVars; -extern ActorInit En_Bom_Bowl_Man_InitVars; -extern ActorInit En_Bom_Chu_InitVars; -extern ActorInit En_Boom_InitVars; -extern ActorInit En_Box_InitVars; -extern ActorInit En_Bsb_InitVars; -extern ActorInit En_Bu_InitVars; -extern ActorInit En_Bubble_InitVars; -extern ActorInit En_Butte_InitVars; -extern ActorInit En_Cha_InitVars; -extern ActorInit En_Clear_Tag_InitVars; -extern ActorInit En_Cne_01_InitVars; -extern ActorInit En_Col_Man_InitVars; -extern ActorInit En_Cow_InitVars; -extern ActorInit En_Crow_InitVars; -extern ActorInit En_Dai_InitVars; -extern ActorInit En_Daiku_InitVars; -extern ActorInit En_Daiku2_InitVars; -extern ActorInit En_Death_InitVars; -extern ActorInit En_Dekubaba_InitVars; -extern ActorInit En_Dekunuts_InitVars; -extern ActorInit En_Demo_heishi_InitVars; -extern ActorInit En_Dg_InitVars; -extern ActorInit En_Dinofos_InitVars; -extern ActorInit En_Dnb_InitVars; -extern ActorInit En_Dnh_InitVars; -extern ActorInit En_Dnk_InitVars; -extern ActorInit En_Dno_InitVars; -extern ActorInit En_Dnp_InitVars; -extern ActorInit En_Dnq_InitVars; -extern ActorInit En_Dns_InitVars; -extern ActorInit En_Dodongo_InitVars; -extern ActorInit En_Door_InitVars; -extern ActorInit En_Door_Etc_InitVars; -extern ActorInit En_Dragon_InitVars; -extern ActorInit En_Drs_InitVars; -extern ActorInit En_Ds2n_InitVars; -extern ActorInit En_Dt_InitVars; -extern ActorInit En_Dy_Extra_InitVars; -extern ActorInit En_Egblock_InitVars; -extern ActorInit En_Egol_InitVars; -extern ActorInit En_Elf_InitVars; -extern ActorInit En_Elfbub_InitVars; -extern ActorInit En_Elfgrp_InitVars; -extern ActorInit En_Elforg_InitVars; -extern ActorInit En_Encount1_InitVars; -extern ActorInit En_Encount2_InitVars; -extern ActorInit En_Encount3_InitVars; -extern ActorInit En_Encount4_InitVars; -extern ActorInit En_Ending_Hero_InitVars; -extern ActorInit En_Ending_Hero2_InitVars; -extern ActorInit En_Ending_Hero3_InitVars; -extern ActorInit En_Ending_Hero4_InitVars; -extern ActorInit En_Ending_Hero5_InitVars; -extern ActorInit En_Ending_Hero6_InitVars; -extern ActorInit En_Estone_InitVars; -extern ActorInit En_Fall_InitVars; -extern ActorInit En_Fall2_InitVars; -extern ActorInit En_Famos_InitVars; -extern ActorInit En_Fg_InitVars; -extern ActorInit En_Firefly_InitVars; -extern ActorInit En_Firefly2_InitVars; -extern ActorInit En_Fire_Rock_InitVars; -extern ActorInit En_Fish_InitVars; -extern ActorInit En_Fishing_InitVars; -extern ActorInit En_Fish2_InitVars; -extern ActorInit En_Floormas_InitVars; -extern ActorInit En_Fr_InitVars; -extern ActorInit En_Fsn_InitVars; -extern ActorInit En_Fu_InitVars; -extern ActorInit En_Fu_Kago_InitVars; -extern ActorInit En_Fu_Mato_InitVars; -extern ActorInit En_Fz_InitVars; -extern ActorInit En_Gakufu_InitVars; -extern ActorInit En_Gamelupy_InitVars; -extern ActorInit En_Gb2_InitVars; -extern ActorInit En_Ge1_InitVars; -extern ActorInit En_Ge2_InitVars; -extern ActorInit En_Ge3_InitVars; -extern ActorInit En_Geg_InitVars; -extern ActorInit En_Gg_InitVars; -extern ActorInit En_Gg2_InitVars; -extern ActorInit En_Giant_InitVars; -extern ActorInit En_Ginko_Man_InitVars; -extern ActorInit En_GirlA_InitVars; -extern ActorInit En_Gk_InitVars; -extern ActorInit En_Gm_InitVars; -extern ActorInit En_Go_InitVars; -extern ActorInit En_Goroiwa_InitVars; -extern ActorInit En_Grasshopper_InitVars; -extern ActorInit En_Gs_InitVars; -extern ActorInit En_Guard_Nuts_InitVars; -extern ActorInit En_Guruguru_InitVars; -extern ActorInit En_Hakurock_InitVars; -extern ActorInit En_Hanabi_InitVars; -extern ActorInit En_Hata_InitVars; -extern ActorInit En_Heishi_InitVars; -extern ActorInit En_Hg_InitVars; -extern ActorInit En_Hgo_InitVars; -extern ActorInit En_Hidden_Nuts_InitVars; -extern ActorInit En_Hint_Skb_InitVars; -extern ActorInit En_Hit_Tag_InitVars; -extern ActorInit En_Holl_InitVars; -extern ActorInit En_Honotrap_InitVars; -extern ActorInit En_Horse_InitVars; -extern ActorInit En_Horse_Game_Check_InitVars; -extern ActorInit En_Horse_Link_Child_InitVars; -extern ActorInit En_Hs_InitVars; -extern ActorInit En_Hs2_InitVars; -extern ActorInit En_Ig_InitVars; -extern ActorInit En_Ik_InitVars; -extern ActorInit En_In_InitVars; -extern ActorInit En_Insect_InitVars; -extern ActorInit En_Invadepoh_InitVars; -extern ActorInit En_Invadepoh_Demo_InitVars; -extern ActorInit En_Invisible_Ruppe_InitVars; -extern ActorInit En_Ishi_InitVars; -extern ActorInit En_Item00_InitVars; -extern ActorInit En_Ja_InitVars; -extern ActorInit En_Jc_Mato_InitVars; -extern ActorInit En_Jg_InitVars; -extern ActorInit En_Jgame_Tsn_InitVars; -extern ActorInit En_Js_InitVars; -extern ActorInit En_Jso_InitVars; -extern ActorInit En_Jso2_InitVars; -extern ActorInit En_Kaizoku_InitVars; -extern ActorInit En_Kakasi_InitVars; -extern ActorInit En_Kame_InitVars; -extern ActorInit En_Kanban_InitVars; -extern ActorInit En_Karebaba_InitVars; -extern ActorInit En_Kbt_InitVars; -extern ActorInit En_Kendo_Js_InitVars; -extern ActorInit En_Kgy_InitVars; -extern ActorInit En_Kitan_InitVars; -extern ActorInit En_Knight_InitVars; -extern ActorInit En_Kujiya_InitVars; -extern ActorInit En_Kusa_InitVars; -extern ActorInit En_Kusa2_InitVars; -extern ActorInit En_Lift_Nuts_InitVars; -extern ActorInit En_Light_InitVars; -extern ActorInit En_Look_Nuts_InitVars; -extern ActorInit En_Ma4_InitVars; -extern ActorInit En_Mag_InitVars; -extern ActorInit En_Maruta_InitVars; -extern ActorInit En_Ma_Yto_InitVars; -extern ActorInit En_Ma_Yts_InitVars; -extern ActorInit En_Minideath_InitVars; -extern ActorInit En_Minifrog_InitVars; -extern ActorInit En_Minislime_InitVars; -extern ActorInit En_Mk_InitVars; -extern ActorInit En_Mkk_InitVars; -extern ActorInit En_Mm_InitVars; -extern ActorInit En_Mm2_InitVars; -extern ActorInit En_Mm3_InitVars; -extern ActorInit En_Mnk_InitVars; -extern ActorInit En_Ms_InitVars; -extern ActorInit En_Mt_tag_InitVars; -extern ActorInit En_Mushi2_InitVars; -extern ActorInit En_Muto_InitVars; -extern ActorInit En_M_Fire1_InitVars; -extern ActorInit En_M_Thunder_InitVars; -extern ActorInit En_Nb_InitVars; -extern ActorInit En_Neo_Reeba_InitVars; -extern ActorInit En_Nimotsu_InitVars; -extern ActorInit En_Niw_InitVars; -extern ActorInit En_Nnh_InitVars; -extern ActorInit En_Nutsball_InitVars; -extern ActorInit En_Nwc_InitVars; -extern ActorInit En_Okarina_Effect_InitVars; -extern ActorInit En_Okarina_Tag_InitVars; -extern ActorInit En_Okuta_InitVars; -extern ActorInit En_Onpuman_InitVars; -extern ActorInit En_Osk_InitVars; -extern ActorInit En_Osn_InitVars; -extern ActorInit En_Ossan_InitVars; -extern ActorInit En_Ot_InitVars; -extern ActorInit En_Owl_InitVars; -extern ActorInit En_Pamera_InitVars; -extern ActorInit En_Pametfrog_InitVars; -extern ActorInit En_Paper_InitVars; -extern ActorInit En_Part_InitVars; -extern ActorInit En_Peehat_InitVars; -extern ActorInit En_Pm_InitVars; -extern ActorInit En_Poh_InitVars; -extern ActorInit En_Po_Composer_InitVars; -extern ActorInit En_Po_Fusen_InitVars; -extern ActorInit En_Po_Sisters_InitVars; -extern ActorInit En_Pp_InitVars; -extern ActorInit En_Pr_InitVars; -extern ActorInit En_Pr2_InitVars; -extern ActorInit En_Prz_InitVars; -extern ActorInit En_Pst_InitVars; -extern ActorInit En_Racedog_InitVars; -extern ActorInit En_Raf_InitVars; -extern ActorInit En_Railgibud_InitVars; -extern ActorInit En_Rail_Skb_InitVars; -extern ActorInit En_Rat_InitVars; -extern ActorInit En_Rd_InitVars; -extern ActorInit En_Recepgirl_InitVars; -extern ActorInit En_Rg_InitVars; -extern ActorInit En_River_Sound_InitVars; -extern ActorInit En_Rr_InitVars; -extern ActorInit En_Rsn_InitVars; -extern ActorInit En_Ru_InitVars; -extern ActorInit En_Ruppecrow_InitVars; -extern ActorInit En_Rz_InitVars; -extern ActorInit En_Sb_InitVars; -extern ActorInit En_Scopecoin_InitVars; -extern ActorInit En_Scopecrow_InitVars; -extern ActorInit En_Scopenuts_InitVars; -extern ActorInit En_Sc_Ruppe_InitVars; -extern ActorInit En_Sda_InitVars; -extern ActorInit En_Sekihi_InitVars; -extern ActorInit En_Sellnuts_InitVars; -extern ActorInit En_Shn_InitVars; -extern ActorInit En_Si_InitVars; -extern ActorInit En_Skb_InitVars; -extern ActorInit En_Slime_InitVars; -extern ActorInit En_Snowman_InitVars; -extern ActorInit En_Snowwd_InitVars; -extern ActorInit En_Sob1_InitVars; -extern ActorInit En_Ssh_InitVars; -extern ActorInit En_St_InitVars; -extern ActorInit En_Sth_InitVars; -extern ActorInit En_Sth2_InitVars; -extern ActorInit En_Stone_heishi_InitVars; -extern ActorInit En_Stop_heishi_InitVars; -extern ActorInit En_Stream_InitVars; -extern ActorInit En_Suttari_InitVars; -extern ActorInit En_Sw_InitVars; -extern ActorInit En_Syateki_Crow_InitVars; -extern ActorInit En_Syateki_Dekunuts_InitVars; -extern ActorInit En_Syateki_Man_InitVars; -extern ActorInit En_Syateki_Okuta_InitVars; -extern ActorInit En_Syateki_Wf_InitVars; -extern ActorInit En_S_Goro_InitVars; -extern ActorInit En_Tab_InitVars; -extern ActorInit En_Tag_Obj_InitVars; -extern ActorInit En_Takaraya_InitVars; -extern ActorInit En_Talk_InitVars; -extern ActorInit En_Talk_Gibud_InitVars; -extern ActorInit En_Tanron1_InitVars; -extern ActorInit En_Tanron2_InitVars; -extern ActorInit En_Tanron3_InitVars; -extern ActorInit En_Tanron4_InitVars; -extern ActorInit En_Tanron5_InitVars; -extern ActorInit En_Tanron6_InitVars; -extern ActorInit En_Test_InitVars; -extern ActorInit En_Test2_InitVars; -extern ActorInit En_Test3_InitVars; -extern ActorInit En_Test4_InitVars; -extern ActorInit En_Test5_InitVars; -extern ActorInit En_Test6_InitVars; -extern ActorInit En_Test7_InitVars; -extern ActorInit En_Tg_InitVars; -extern ActorInit En_Thiefbird_InitVars; -extern ActorInit En_Time_Tag_InitVars; -extern ActorInit En_Tite_InitVars; -extern ActorInit En_Tk_InitVars; -extern ActorInit En_Torch_InitVars; -extern ActorInit En_Torch2_InitVars; -extern ActorInit En_Toto_InitVars; -extern ActorInit En_Trt_InitVars; -extern ActorInit En_Trt2_InitVars; -extern ActorInit En_Tru_InitVars; -extern ActorInit En_Tru_Mt_InitVars; -extern ActorInit En_Tsn_InitVars; -extern ActorInit En_Tubo_Trap_InitVars; -extern ActorInit En_Twig_InitVars; -extern ActorInit En_Viewer_InitVars; -extern ActorInit En_Vm_InitVars; -extern ActorInit En_Wallmas_InitVars; -extern ActorInit En_Warp_tag_InitVars; -extern ActorInit En_Warp_Uzu_InitVars; -extern ActorInit En_Water_Effect_InitVars; -extern ActorInit En_Wdhand_InitVars; -extern ActorInit En_Weather_Tag_InitVars; -extern ActorInit En_Wf_InitVars; -extern ActorInit En_Wiz_InitVars; -extern ActorInit En_Wiz_Brock_InitVars; -extern ActorInit En_Wiz_Fire_InitVars; -extern ActorInit En_Wood02_InitVars; -extern ActorInit En_Yb_InitVars; -extern ActorInit En_Zl1_InitVars; -extern ActorInit En_Zl4_InitVars; -extern ActorInit En_Zo_InitVars; -extern ActorInit En_Zob_InitVars; -extern ActorInit En_Zod_InitVars; -extern ActorInit En_Zog_InitVars; -extern ActorInit En_Zoraegg_InitVars; -extern ActorInit En_Zos_InitVars; -extern ActorInit En_Zot_InitVars; -extern ActorInit En_Zov_InitVars; -extern ActorInit En_Zow_InitVars; -extern ActorInit Item_B_Heart_InitVars; -extern ActorInit Item_Etcetera_InitVars; -extern ActorInit Item_Inbox_InitVars; -extern ActorInit Mir_Ray_InitVars; -extern ActorInit Mir_Ray2_InitVars; -extern ActorInit Mir_Ray3_InitVars; -extern ActorInit Object_Kankyo_InitVars; -extern ActorInit Obj_Aqua_InitVars; -extern ActorInit Obj_Armos_InitVars; -extern ActorInit Obj_Bean_InitVars; -extern ActorInit Obj_Bell_InitVars; -extern ActorInit Obj_Bigicicle_InitVars; -extern ActorInit Obj_Blockstop_InitVars; -extern ActorInit Obj_Boat_InitVars; -extern ActorInit Obj_Bombiwa_InitVars; -extern ActorInit Obj_Boyo_InitVars; -extern ActorInit Obj_Chan_InitVars; -extern ActorInit Obj_Chikuwa_InitVars; -extern ActorInit Obj_Comb_InitVars; -extern ActorInit Obj_Danpeilift_InitVars; -extern ActorInit Obj_Demo_InitVars; -extern ActorInit Obj_Dhouse_InitVars; -extern ActorInit Obj_Dinner_InitVars; -extern ActorInit Obj_Dora_InitVars; -extern ActorInit Obj_Dowsing_InitVars; -extern ActorInit Obj_Driftice_InitVars; -extern ActorInit Obj_Ending_InitVars; -extern ActorInit Obj_Entotu_InitVars; -extern ActorInit Obj_Etcetera_InitVars; -extern ActorInit Obj_Fireshield_InitVars; -extern ActorInit Obj_Flowerpot_InitVars; -extern ActorInit Obj_Funen_InitVars; -extern ActorInit Obj_Ghaka_InitVars; -extern ActorInit Obj_Grass_InitVars; -extern ActorInit Obj_Grass_Carry_InitVars; -extern ActorInit Obj_Grass_Unit_InitVars; -extern ActorInit Obj_Hakaisi_InitVars; -extern ActorInit Obj_Hamishi_InitVars; -extern ActorInit Obj_Hana_InitVars; -extern ActorInit Obj_Hariko_InitVars; -extern ActorInit Obj_Hgdoor_InitVars; -extern ActorInit Obj_Hsblock_InitVars; -extern ActorInit Obj_HsStump_InitVars; -extern ActorInit Obj_Hugebombiwa_InitVars; -extern ActorInit Obj_Hunsui_InitVars; -extern ActorInit Obj_Iceblock_InitVars; -extern ActorInit Obj_Ice_Poly_InitVars; -extern ActorInit Obj_Jgame_Light_InitVars; -extern ActorInit Obj_Jg_Gakki_InitVars; -extern ActorInit Obj_Kendo_Kanban_InitVars; -extern ActorInit Obj_Kepn_Koya_InitVars; -extern ActorInit Obj_Kibako_InitVars; -extern ActorInit Obj_Kibako2_InitVars; -extern ActorInit Obj_Kinoko_InitVars; -extern ActorInit Obj_Kzsaku_InitVars; -extern ActorInit Obj_Lift_InitVars; -extern ActorInit Obj_Lightblock_InitVars; -extern ActorInit Obj_Lightswitch_InitVars; -extern ActorInit Obj_Lupygamelift_InitVars; -extern ActorInit Obj_Makekinsuta_InitVars; -extern ActorInit Obj_Makeoshihiki_InitVars; -extern ActorInit Obj_Milk_Bin_InitVars; -extern ActorInit Obj_Mine_InitVars; -extern ActorInit Obj_Moon_Stone_InitVars; -extern ActorInit Obj_Mure_InitVars; -extern ActorInit Obj_Mure2_InitVars; -extern ActorInit Obj_Mure3_InitVars; -extern ActorInit Obj_Mu_Pict_InitVars; -extern ActorInit Obj_Nozoki_InitVars; -extern ActorInit Obj_Ocarinalift_InitVars; -extern ActorInit Obj_Oshihiki_InitVars; -extern ActorInit Obj_Purify_InitVars; -extern ActorInit Obj_Pzlblock_InitVars; -extern ActorInit Obj_Raillift_InitVars; -extern ActorInit Obj_Roomtimer_InitVars; -extern ActorInit Obj_Rotlift_InitVars; -extern ActorInit Obj_Shutter_InitVars; -extern ActorInit Obj_Skateblock_InitVars; -extern ActorInit Obj_Smork_InitVars; -extern ActorInit Obj_Snowball_InitVars; -extern ActorInit Obj_Snowball2_InitVars; -extern ActorInit Obj_Sound_InitVars; -extern ActorInit Obj_Spidertent_InitVars; -extern ActorInit Obj_Spinyroll_InitVars; -extern ActorInit Obj_Switch_InitVars; -extern ActorInit Obj_Swprize_InitVars; -extern ActorInit Obj_Syokudai_InitVars; -extern ActorInit Obj_Takaraya_Wall_InitVars; -extern ActorInit Obj_Taru_InitVars; -extern ActorInit Obj_Toge_InitVars; -extern ActorInit Obj_Tokeidai_InitVars; -extern ActorInit Obj_Tokei_Step_InitVars; -extern ActorInit Obj_Tokei_Tobira_InitVars; -extern ActorInit Obj_Tokei_Turret_InitVars; -extern ActorInit Obj_Toudai_InitVars; -extern ActorInit Obj_Tree_InitVars; -extern ActorInit Obj_Tsubo_InitVars; -extern ActorInit Obj_Um_InitVars; -extern ActorInit Obj_Usiyane_InitVars; -extern ActorInit Obj_Visiblock_InitVars; -extern ActorInit Obj_Vspinyroll_InitVars; -extern ActorInit Obj_Warpstone_InitVars; -extern ActorInit Obj_Wind_InitVars; -extern ActorInit Obj_Wturn_InitVars; -extern ActorInit Obj_Y2lift_InitVars; -extern ActorInit Obj_Y2shutter_InitVars; -extern ActorInit Obj_Yado_InitVars; -extern ActorInit Obj_Yasi_InitVars; -extern ActorInit Oceff_Spot_InitVars; -extern ActorInit Oceff_Storm_InitVars; -extern ActorInit Oceff_Wipe_InitVars; -extern ActorInit Oceff_Wipe2_InitVars; -extern ActorInit Oceff_Wipe3_InitVars; -extern ActorInit Oceff_Wipe4_InitVars; -extern ActorInit Oceff_Wipe5_InitVars; -extern ActorInit Oceff_Wipe6_InitVars; -extern ActorInit Oceff_Wipe7_InitVars; -extern ActorInit Shot_Sun_InitVars; -extern ActorInit TG_Sw_InitVars; - extern TransitionInit TransitionFade_InitVars; extern TransitionInit TransitionTriforce_InitVars; extern TransitionInit TransitionWipe1_InitVars; diff --git a/include/regs.h b/include/regs.h index ab31e6d25..9fa5f736a 100644 --- a/include/regs.h +++ b/include/regs.h @@ -46,13 +46,20 @@ #define R_ENABLE_ARENA_DBG SREG(0) // Same as OoT #define R_RUN_SPEED_LIMIT REG(45) #define R_UPDATE_RATE SREG(30) -#define R_PAUSE_MENU_MODE SREG(94) +#define R_PAUSE_BG_PRERENDER_STATE SREG(94) +#define R_PLAY_FILL_SCREEN_ON MREG(64) +#define R_PLAY_FILL_SCREEN_R MREG(65) +#define R_PLAY_FILL_SCREEN_G MREG(66) +#define R_PLAY_FILL_SCREEN_B MREG(67) +#define R_PLAY_FILL_SCREEN_ALPHA MREG(68) #define R_PAUSE_WORLD_MAP_YAW YREG(24) #define R_PAUSE_WORLD_MAP_Y_OFFSET YREG(25) #define R_PAUSE_WORLD_MAP_DEPTH YREG(26) #define R_PAUSE_DBG_QUEST_CURSOR_ON YREG(69) #define R_PAUSE_DBG_QUEST_CURSOR_X YREG(70) #define R_PAUSE_DBG_QUEST_CURSOR_Y YREG(71) +#define R_C_UP_ICON_X YREG(88) +#define R_C_UP_ICON_Y YREG(89) #define R_MAGIC_FILL_COLOR(i) ZREG(0 + i) #define R_C_BTN_COLOR(i) ZREG(39 + i) #define R_B_BTN_COLOR(i) ZREG(43 + i) @@ -81,6 +88,7 @@ #define R_MOON_CRASH_TIMER_Y XREG(80) #define R_MOON_CRASH_TIMER_X XREG(81) #define R_PAUSE_OWLWARP_ALPHA XREG(87) +#define R_STORY_FILL_SCREEN_ALPHA XREG(91) #define R_REVERSE_FLOOR_INDEX XREG(94) #define R_MINIMAP_DISABLED XREG(95) #define R_B_LABEL_DD WREG(0) diff --git a/include/segment_symbols.h b/include/segment_symbols.h index 1339c879c..ccb5488d1 100644 --- a/include/segment_symbols.h +++ b/include/segment_symbols.h @@ -53,7 +53,9 @@ DECLARE_ROM_SEGMENT(map_grand_static) DECLARE_ROM_SEGMENT(item_name_static) DECLARE_ROM_SEGMENT(map_name_static) DECLARE_ROM_SEGMENT(icon_item_static_test) +DECLARE_ROM_SEGMENT(icon_item_static_old) DECLARE_ROM_SEGMENT(icon_item_24_static_test) +DECLARE_ROM_SEGMENT(icon_item_24_static_old) DECLARE_ROM_SEGMENT(schedule_dma_static_test) DECLARE_ROM_SEGMENT(schedule_static) DECLARE_ROM_SEGMENT(story_static) @@ -76,147 +78,16 @@ DECLARE_OVERLAY_SEGMENT(daytelop) DECLARE_OVERLAY_SEGMENT(kaleido_scope) DECLARE_OVERLAY_SEGMENT(player_actor) -DECLARE_OVERLAY_SEGMENT(En_Test) -DECLARE_OVERLAY_SEGMENT(En_GirlA) -DECLARE_OVERLAY_SEGMENT(En_Part) -DECLARE_OVERLAY_SEGMENT(En_Light) -DECLARE_OVERLAY_SEGMENT(En_Door) -DECLARE_OVERLAY_SEGMENT(En_Box) -DECLARE_OVERLAY_SEGMENT(En_Pametfrog) -DECLARE_OVERLAY_SEGMENT(En_Okuta) -DECLARE_OVERLAY_SEGMENT(En_Bom) -DECLARE_OVERLAY_SEGMENT(En_Wallmas) -DECLARE_OVERLAY_SEGMENT(En_Dodongo) -DECLARE_OVERLAY_SEGMENT(En_Firefly) -DECLARE_OVERLAY_SEGMENT(En_Horse) -DECLARE_OVERLAY_SEGMENT(En_Arrow) -DECLARE_OVERLAY_SEGMENT(En_Elf) -DECLARE_OVERLAY_SEGMENT(En_Niw) -DECLARE_OVERLAY_SEGMENT(En_Tite) -DECLARE_OVERLAY_SEGMENT(En_Peehat) -DECLARE_OVERLAY_SEGMENT(En_Holl) -DECLARE_OVERLAY_SEGMENT(En_Dinofos) -DECLARE_OVERLAY_SEGMENT(En_Hata) -DECLARE_OVERLAY_SEGMENT(En_Zl1) -DECLARE_OVERLAY_SEGMENT(En_Viewer) -DECLARE_OVERLAY_SEGMENT(En_Bubble) -DECLARE_OVERLAY_SEGMENT(Door_Shutter) -DECLARE_OVERLAY_SEGMENT(En_Boom) -DECLARE_OVERLAY_SEGMENT(En_Torch2) -DECLARE_OVERLAY_SEGMENT(En_Minifrog) -DECLARE_OVERLAY_SEGMENT(En_St) -DECLARE_OVERLAY_SEGMENT(Obj_Wturn) -DECLARE_OVERLAY_SEGMENT(En_River_Sound) -DECLARE_OVERLAY_SEGMENT(En_Ossan) -DECLARE_OVERLAY_SEGMENT(En_Famos) -DECLARE_OVERLAY_SEGMENT(En_Bombf) -DECLARE_OVERLAY_SEGMENT(En_Am) -DECLARE_OVERLAY_SEGMENT(En_Dekubaba) -DECLARE_OVERLAY_SEGMENT(En_M_Fire1) -DECLARE_OVERLAY_SEGMENT(En_M_Thunder) -DECLARE_OVERLAY_SEGMENT(Bg_Breakwall) -DECLARE_OVERLAY_SEGMENT(Door_Warp1) -DECLARE_OVERLAY_SEGMENT(Obj_Syokudai) -DECLARE_OVERLAY_SEGMENT(Item_B_Heart) -DECLARE_OVERLAY_SEGMENT(En_Dekunuts) -DECLARE_OVERLAY_SEGMENT(En_Bbfall) -DECLARE_OVERLAY_SEGMENT(Arms_Hook) -DECLARE_OVERLAY_SEGMENT(En_Bb) -DECLARE_OVERLAY_SEGMENT(Bg_Keikoku_Spr) -DECLARE_OVERLAY_SEGMENT(En_Wood02) -DECLARE_OVERLAY_SEGMENT(En_Death) -DECLARE_OVERLAY_SEGMENT(En_Minideath) -DECLARE_OVERLAY_SEGMENT(En_Vm) -DECLARE_OVERLAY_SEGMENT(Demo_Effect) -DECLARE_OVERLAY_SEGMENT(Demo_Kankyo) -DECLARE_OVERLAY_SEGMENT(En_Floormas) -DECLARE_OVERLAY_SEGMENT(En_Rd) -DECLARE_OVERLAY_SEGMENT(Bg_F40_Flift) -DECLARE_OVERLAY_SEGMENT(Obj_Mure) -DECLARE_OVERLAY_SEGMENT(En_Sw) -DECLARE_OVERLAY_SEGMENT(Object_Kankyo) -DECLARE_OVERLAY_SEGMENT(En_Horse_Link_Child) -DECLARE_OVERLAY_SEGMENT(Door_Ana) -DECLARE_OVERLAY_SEGMENT(En_Encount1) -DECLARE_OVERLAY_SEGMENT(Demo_Tre_Lgt) -DECLARE_OVERLAY_SEGMENT(En_Encount2) -DECLARE_OVERLAY_SEGMENT(En_Fire_Rock) -DECLARE_OVERLAY_SEGMENT(Bg_Ctower_Rot) -DECLARE_OVERLAY_SEGMENT(Mir_Ray) -DECLARE_OVERLAY_SEGMENT(En_Sb) -DECLARE_OVERLAY_SEGMENT(En_Bigslime) -DECLARE_OVERLAY_SEGMENT(En_Karebaba) -DECLARE_OVERLAY_SEGMENT(En_In) -DECLARE_OVERLAY_SEGMENT(En_Bom_Chu) -DECLARE_OVERLAY_SEGMENT(En_Horse_Game_Check) -DECLARE_OVERLAY_SEGMENT(En_Rr) -DECLARE_OVERLAY_SEGMENT(En_Fr) -DECLARE_OVERLAY_SEGMENT(En_Fishing) -DECLARE_OVERLAY_SEGMENT(Obj_Oshihiki) -DECLARE_OVERLAY_SEGMENT(Eff_Dust) -DECLARE_OVERLAY_SEGMENT(Bg_Umajump) -DECLARE_OVERLAY_SEGMENT(En_Insect) -DECLARE_OVERLAY_SEGMENT(En_Butte) -DECLARE_OVERLAY_SEGMENT(En_Fish) -DECLARE_OVERLAY_SEGMENT(Item_Etcetera) -DECLARE_OVERLAY_SEGMENT(Arrow_Fire) -DECLARE_OVERLAY_SEGMENT(Arrow_Ice) -DECLARE_OVERLAY_SEGMENT(Arrow_Light) -DECLARE_OVERLAY_SEGMENT(Obj_Kibako) -DECLARE_OVERLAY_SEGMENT(Obj_Tsubo) -DECLARE_OVERLAY_SEGMENT(En_Ik) -DECLARE_OVERLAY_SEGMENT(Demo_Shd) -DECLARE_OVERLAY_SEGMENT(En_Dns) -DECLARE_OVERLAY_SEGMENT(Elf_Msg) -DECLARE_OVERLAY_SEGMENT(En_Honotrap) -DECLARE_OVERLAY_SEGMENT(En_Tubo_Trap) -DECLARE_OVERLAY_SEGMENT(Obj_Ice_Poly) -DECLARE_OVERLAY_SEGMENT(En_Fz) -DECLARE_OVERLAY_SEGMENT(En_Kusa) -DECLARE_OVERLAY_SEGMENT(Obj_Bean) -DECLARE_OVERLAY_SEGMENT(Obj_Bombiwa) -DECLARE_OVERLAY_SEGMENT(Obj_Switch) -DECLARE_OVERLAY_SEGMENT(Obj_Lift) -DECLARE_OVERLAY_SEGMENT(Obj_Hsblock) -DECLARE_OVERLAY_SEGMENT(En_Okarina_Tag) -DECLARE_OVERLAY_SEGMENT(En_Goroiwa) -DECLARE_OVERLAY_SEGMENT(En_Daiku) -DECLARE_OVERLAY_SEGMENT(En_Nwc) -DECLARE_OVERLAY_SEGMENT(Item_Inbox) -DECLARE_OVERLAY_SEGMENT(En_Ge1) -DECLARE_OVERLAY_SEGMENT(Obj_Blockstop) -DECLARE_OVERLAY_SEGMENT(En_Sda) -DECLARE_OVERLAY_SEGMENT(En_Clear_Tag) -DECLARE_OVERLAY_SEGMENT(En_Gm) -DECLARE_OVERLAY_SEGMENT(En_Ms) -DECLARE_OVERLAY_SEGMENT(En_Hs) -DECLARE_OVERLAY_SEGMENT(Bg_Ingate) -DECLARE_OVERLAY_SEGMENT(En_Kanban) -DECLARE_OVERLAY_SEGMENT(En_Attack_Niw) -DECLARE_OVERLAY_SEGMENT(En_Mk) -DECLARE_OVERLAY_SEGMENT(En_Owl) -DECLARE_OVERLAY_SEGMENT(En_Ishi) -DECLARE_OVERLAY_SEGMENT(Obj_Hana) -DECLARE_OVERLAY_SEGMENT(Obj_Lightswitch) -DECLARE_OVERLAY_SEGMENT(Obj_Mure2) -DECLARE_OVERLAY_SEGMENT(En_Fu) -DECLARE_OVERLAY_SEGMENT(En_Stream) -DECLARE_OVERLAY_SEGMENT(En_Mm) -DECLARE_OVERLAY_SEGMENT(En_Weather_Tag) -DECLARE_OVERLAY_SEGMENT(En_Ani) -DECLARE_OVERLAY_SEGMENT(En_Js) -DECLARE_OVERLAY_SEGMENT(En_Okarina_Effect) -DECLARE_OVERLAY_SEGMENT(En_Mag) -DECLARE_OVERLAY_SEGMENT(Elf_Msg2) -DECLARE_OVERLAY_SEGMENT(Bg_F40_Swlift) -DECLARE_OVERLAY_SEGMENT(En_Kakasi) -DECLARE_OVERLAY_SEGMENT(Obj_Makeoshihiki) -DECLARE_OVERLAY_SEGMENT(Oceff_Spot) -DECLARE_OVERLAY_SEGMENT(En_Torch) -DECLARE_OVERLAY_SEGMENT(Shot_Sun) -DECLARE_OVERLAY_SEGMENT(Obj_Roomtimer) -DECLARE_OVERLAY_SEGMENT(En_Ssh) -DECLARE_OVERLAY_SEGMENT(Oceff_Wipe) +#define DEFINE_ACTOR(name, _enumValue, _allocType, _debugName) DECLARE_OVERLAY_SEGMENT(name) +#define DEFINE_ACTOR_INTERNAL(_name, _enumValue, _allocType, _debugName) +#define DEFINE_ACTOR_UNSET(_enumValue) + +#include "tables/actor_table.h" + +#undef DEFINE_ACTOR +#undef DEFINE_ACTOR_INTERNAL +#undef DEFINE_ACTOR_UNSET + DECLARE_OVERLAY_SEGMENT(Effect_Ss_Dust) DECLARE_OVERLAY_SEGMENT(Effect_Ss_Kirakira) DECLARE_OVERLAY_SEGMENT(Effect_Ss_Bomb2) @@ -246,446 +117,14 @@ DECLARE_OVERLAY_SEGMENT(Effect_Ss_Extra) DECLARE_OVERLAY_SEGMENT(Effect_Ss_Dead_Db) DECLARE_OVERLAY_SEGMENT(Effect_Ss_Dead_Dd) DECLARE_OVERLAY_SEGMENT(Effect_Ss_Dead_Ds) -DECLARE_OVERLAY_SEGMENT(Oceff_Storm) -DECLARE_OVERLAY_SEGMENT(Obj_Demo) -DECLARE_OVERLAY_SEGMENT(En_Minislime) -DECLARE_OVERLAY_SEGMENT(En_Nutsball) -DECLARE_OVERLAY_SEGMENT(Oceff_Wipe2) -DECLARE_OVERLAY_SEGMENT(Oceff_Wipe3) -DECLARE_OVERLAY_SEGMENT(En_Dg) -DECLARE_OVERLAY_SEGMENT(En_Si) -DECLARE_OVERLAY_SEGMENT(Obj_Comb) -DECLARE_OVERLAY_SEGMENT(Obj_Kibako2) -DECLARE_OVERLAY_SEGMENT(En_Hs2) -DECLARE_OVERLAY_SEGMENT(Obj_Mure3) -DECLARE_OVERLAY_SEGMENT(En_Tg) -DECLARE_OVERLAY_SEGMENT(En_Wf) -DECLARE_OVERLAY_SEGMENT(En_Skb) -DECLARE_OVERLAY_SEGMENT(En_Gs) -DECLARE_OVERLAY_SEGMENT(Obj_Sound) -DECLARE_OVERLAY_SEGMENT(En_Crow) -DECLARE_OVERLAY_SEGMENT(En_Cow) -DECLARE_OVERLAY_SEGMENT(Oceff_Wipe4) -DECLARE_OVERLAY_SEGMENT(En_Zo) DECLARE_OVERLAY_SEGMENT(Effect_Ss_Ice_Smoke) -DECLARE_OVERLAY_SEGMENT(Obj_Makekinsuta) -DECLARE_OVERLAY_SEGMENT(En_Ge3) -DECLARE_OVERLAY_SEGMENT(Obj_Hamishi) -DECLARE_OVERLAY_SEGMENT(En_Zl4) -DECLARE_OVERLAY_SEGMENT(En_Mm2) -DECLARE_OVERLAY_SEGMENT(Door_Spiral) -DECLARE_OVERLAY_SEGMENT(Obj_Pzlblock) -DECLARE_OVERLAY_SEGMENT(Obj_Toge) -DECLARE_OVERLAY_SEGMENT(Obj_Armos) -DECLARE_OVERLAY_SEGMENT(Obj_Boyo) -DECLARE_OVERLAY_SEGMENT(En_Grasshopper) -DECLARE_OVERLAY_SEGMENT(Obj_Grass) -DECLARE_OVERLAY_SEGMENT(Obj_Grass_Carry) -DECLARE_OVERLAY_SEGMENT(Obj_Grass_Unit) -DECLARE_OVERLAY_SEGMENT(Bg_Fire_Wall) -DECLARE_OVERLAY_SEGMENT(En_Bu) -DECLARE_OVERLAY_SEGMENT(En_Encount3) -DECLARE_OVERLAY_SEGMENT(En_Jso) -DECLARE_OVERLAY_SEGMENT(Obj_Chikuwa) -DECLARE_OVERLAY_SEGMENT(En_Knight) -DECLARE_OVERLAY_SEGMENT(En_Warp_tag) -DECLARE_OVERLAY_SEGMENT(En_Aob_01) -DECLARE_OVERLAY_SEGMENT(En_Boj_01) -DECLARE_OVERLAY_SEGMENT(En_Boj_02) -DECLARE_OVERLAY_SEGMENT(En_Boj_03) -DECLARE_OVERLAY_SEGMENT(En_Encount4) -DECLARE_OVERLAY_SEGMENT(En_Bom_Bowl_Man) -DECLARE_OVERLAY_SEGMENT(En_Syateki_Man) -DECLARE_OVERLAY_SEGMENT(Bg_Icicle) -DECLARE_OVERLAY_SEGMENT(En_Syateki_Crow) -DECLARE_OVERLAY_SEGMENT(En_Boj_04) -DECLARE_OVERLAY_SEGMENT(En_Cne_01) -DECLARE_OVERLAY_SEGMENT(En_Bba_01) -DECLARE_OVERLAY_SEGMENT(En_Bji_01) -DECLARE_OVERLAY_SEGMENT(Bg_Spdweb) -DECLARE_OVERLAY_SEGMENT(En_Mt_tag) -DECLARE_OVERLAY_SEGMENT(Boss_01) -DECLARE_OVERLAY_SEGMENT(Boss_02) -DECLARE_OVERLAY_SEGMENT(Boss_03) -DECLARE_OVERLAY_SEGMENT(Boss_04) -DECLARE_OVERLAY_SEGMENT(Boss_05) -DECLARE_OVERLAY_SEGMENT(Boss_06) -DECLARE_OVERLAY_SEGMENT(Boss_07) -DECLARE_OVERLAY_SEGMENT(Bg_Dy_Yoseizo) -DECLARE_OVERLAY_SEGMENT(En_Boj_05) -DECLARE_OVERLAY_SEGMENT(En_Sob1) -DECLARE_OVERLAY_SEGMENT(En_Go) -DECLARE_OVERLAY_SEGMENT(En_Raf) -DECLARE_OVERLAY_SEGMENT(Obj_Funen) -DECLARE_OVERLAY_SEGMENT(Obj_Raillift) -DECLARE_OVERLAY_SEGMENT(Bg_Numa_Hana) -DECLARE_OVERLAY_SEGMENT(Obj_Flowerpot) -DECLARE_OVERLAY_SEGMENT(Obj_Spinyroll) -DECLARE_OVERLAY_SEGMENT(Dm_Hina) -DECLARE_OVERLAY_SEGMENT(En_Syateki_Wf) -DECLARE_OVERLAY_SEGMENT(Obj_Skateblock) DECLARE_OVERLAY_SEGMENT(Effect_En_Ice_Block) -DECLARE_OVERLAY_SEGMENT(Obj_Iceblock) -DECLARE_OVERLAY_SEGMENT(En_Bigpamet) -DECLARE_OVERLAY_SEGMENT(Bg_Dblue_Movebg) -DECLARE_OVERLAY_SEGMENT(En_Syateki_Dekunuts) -DECLARE_OVERLAY_SEGMENT(Elf_Msg3) -DECLARE_OVERLAY_SEGMENT(En_Fg) -DECLARE_OVERLAY_SEGMENT(Dm_Ravine) -DECLARE_OVERLAY_SEGMENT(Dm_Sa) -DECLARE_OVERLAY_SEGMENT(En_Slime) -DECLARE_OVERLAY_SEGMENT(En_Pr) -DECLARE_OVERLAY_SEGMENT(Obj_Toudai) -DECLARE_OVERLAY_SEGMENT(Obj_Entotu) -DECLARE_OVERLAY_SEGMENT(Obj_Bell) -DECLARE_OVERLAY_SEGMENT(En_Syateki_Okuta) -DECLARE_OVERLAY_SEGMENT(Obj_Shutter) -DECLARE_OVERLAY_SEGMENT(Dm_Zl) -DECLARE_OVERLAY_SEGMENT(En_Ru) -DECLARE_OVERLAY_SEGMENT(En_Elfgrp) -DECLARE_OVERLAY_SEGMENT(Dm_Tsg) -DECLARE_OVERLAY_SEGMENT(En_Baguo) -DECLARE_OVERLAY_SEGMENT(Obj_Vspinyroll) -DECLARE_OVERLAY_SEGMENT(Obj_Smork) -DECLARE_OVERLAY_SEGMENT(En_Test2) -DECLARE_OVERLAY_SEGMENT(En_Test3) -DECLARE_OVERLAY_SEGMENT(En_Test4) -DECLARE_OVERLAY_SEGMENT(En_Bat) -DECLARE_OVERLAY_SEGMENT(En_Sekihi) -DECLARE_OVERLAY_SEGMENT(En_Wiz) -DECLARE_OVERLAY_SEGMENT(En_Wiz_Brock) -DECLARE_OVERLAY_SEGMENT(En_Wiz_Fire) -DECLARE_OVERLAY_SEGMENT(Eff_Change) -DECLARE_OVERLAY_SEGMENT(Dm_Statue) -DECLARE_OVERLAY_SEGMENT(Obj_Fireshield) -DECLARE_OVERLAY_SEGMENT(Bg_Ladder) -DECLARE_OVERLAY_SEGMENT(En_Mkk) -DECLARE_OVERLAY_SEGMENT(Demo_Getitem) -DECLARE_OVERLAY_SEGMENT(En_Dnb) -DECLARE_OVERLAY_SEGMENT(En_Dnh) -DECLARE_OVERLAY_SEGMENT(En_Dnk) -DECLARE_OVERLAY_SEGMENT(En_Dnq) -DECLARE_OVERLAY_SEGMENT(Bg_Keikoku_Saku) -DECLARE_OVERLAY_SEGMENT(Obj_Hugebombiwa) -DECLARE_OVERLAY_SEGMENT(En_Firefly2) -DECLARE_OVERLAY_SEGMENT(En_Rat) -DECLARE_OVERLAY_SEGMENT(En_Water_Effect) -DECLARE_OVERLAY_SEGMENT(En_Kusa2) -DECLARE_OVERLAY_SEGMENT(Bg_Spout_Fire) -DECLARE_OVERLAY_SEGMENT(En_Dy_Extra) -DECLARE_OVERLAY_SEGMENT(En_Bal) -DECLARE_OVERLAY_SEGMENT(En_Ginko_Man) -DECLARE_OVERLAY_SEGMENT(En_Warp_Uzu) -DECLARE_OVERLAY_SEGMENT(Obj_Driftice) -DECLARE_OVERLAY_SEGMENT(En_Look_Nuts) -DECLARE_OVERLAY_SEGMENT(En_Mushi2) -DECLARE_OVERLAY_SEGMENT(En_Fall) -DECLARE_OVERLAY_SEGMENT(En_Mm3) -DECLARE_OVERLAY_SEGMENT(Bg_Crace_Movebg) -DECLARE_OVERLAY_SEGMENT(En_Dno) -DECLARE_OVERLAY_SEGMENT(En_Pr2) -DECLARE_OVERLAY_SEGMENT(En_Prz) -DECLARE_OVERLAY_SEGMENT(En_Jso2) -DECLARE_OVERLAY_SEGMENT(Obj_Etcetera) -DECLARE_OVERLAY_SEGMENT(En_Egol) -DECLARE_OVERLAY_SEGMENT(Obj_Mine) -DECLARE_OVERLAY_SEGMENT(Obj_Purify) -DECLARE_OVERLAY_SEGMENT(En_Tru) -DECLARE_OVERLAY_SEGMENT(En_Trt) -DECLARE_OVERLAY_SEGMENT(En_Test5) -DECLARE_OVERLAY_SEGMENT(En_Test6) -DECLARE_OVERLAY_SEGMENT(En_Az) -DECLARE_OVERLAY_SEGMENT(En_Estone) -DECLARE_OVERLAY_SEGMENT(Bg_Hakugin_Post) -DECLARE_OVERLAY_SEGMENT(Dm_Opstage) -DECLARE_OVERLAY_SEGMENT(Dm_Stk) -DECLARE_OVERLAY_SEGMENT(Dm_Char00) -DECLARE_OVERLAY_SEGMENT(Dm_Char01) -DECLARE_OVERLAY_SEGMENT(Dm_Char02) -DECLARE_OVERLAY_SEGMENT(Dm_Char03) -DECLARE_OVERLAY_SEGMENT(Dm_Char04) -DECLARE_OVERLAY_SEGMENT(Dm_Char05) -DECLARE_OVERLAY_SEGMENT(Dm_Char06) -DECLARE_OVERLAY_SEGMENT(Dm_Char07) -DECLARE_OVERLAY_SEGMENT(Dm_Char08) -DECLARE_OVERLAY_SEGMENT(Dm_Char09) -DECLARE_OVERLAY_SEGMENT(Obj_Tokeidai) -DECLARE_OVERLAY_SEGMENT(En_Mnk) -DECLARE_OVERLAY_SEGMENT(En_Egblock) -DECLARE_OVERLAY_SEGMENT(En_Guard_Nuts) -DECLARE_OVERLAY_SEGMENT(Bg_Hakugin_Bombwall) -DECLARE_OVERLAY_SEGMENT(Obj_Tokei_Tobira) -DECLARE_OVERLAY_SEGMENT(Bg_Hakugin_Elvpole) -DECLARE_OVERLAY_SEGMENT(En_Ma4) -DECLARE_OVERLAY_SEGMENT(En_Twig) -DECLARE_OVERLAY_SEGMENT(En_Po_Fusen) -DECLARE_OVERLAY_SEGMENT(En_Door_Etc) -DECLARE_OVERLAY_SEGMENT(En_Bigokuta) -DECLARE_OVERLAY_SEGMENT(Bg_Icefloe) DECLARE_OVERLAY_SEGMENT(fbdemo_triforce) DECLARE_OVERLAY_SEGMENT(fbdemo_wipe1) DECLARE_OVERLAY_SEGMENT(fbdemo_wipe3) DECLARE_OVERLAY_SEGMENT(fbdemo_wipe4) DECLARE_OVERLAY_SEGMENT(fbdemo_wipe5) DECLARE_OVERLAY_SEGMENT(Effect_Ss_Sbn) -DECLARE_OVERLAY_SEGMENT(Obj_Ocarinalift) -DECLARE_OVERLAY_SEGMENT(En_Time_Tag) -DECLARE_OVERLAY_SEGMENT(Bg_Open_Shutter) -DECLARE_OVERLAY_SEGMENT(Bg_Open_Spot) -DECLARE_OVERLAY_SEGMENT(Bg_Fu_Kaiten) -DECLARE_OVERLAY_SEGMENT(Obj_Aqua) -DECLARE_OVERLAY_SEGMENT(En_Elforg) -DECLARE_OVERLAY_SEGMENT(En_Elfbub) -DECLARE_OVERLAY_SEGMENT(En_Fu_Mato) -DECLARE_OVERLAY_SEGMENT(En_Fu_Kago) -DECLARE_OVERLAY_SEGMENT(En_Osn) -DECLARE_OVERLAY_SEGMENT(Bg_Ctower_Gear) -DECLARE_OVERLAY_SEGMENT(En_Trt2) -DECLARE_OVERLAY_SEGMENT(Obj_Tokei_Step) -DECLARE_OVERLAY_SEGMENT(Bg_Lotus) -DECLARE_OVERLAY_SEGMENT(En_Kame) -DECLARE_OVERLAY_SEGMENT(Obj_Takaraya_Wall) -DECLARE_OVERLAY_SEGMENT(Bg_Fu_Mizu) -DECLARE_OVERLAY_SEGMENT(En_Sellnuts) -DECLARE_OVERLAY_SEGMENT(Bg_Dkjail_Ivy) -DECLARE_OVERLAY_SEGMENT(Obj_Visiblock) -DECLARE_OVERLAY_SEGMENT(En_Takaraya) -DECLARE_OVERLAY_SEGMENT(En_Tsn) -DECLARE_OVERLAY_SEGMENT(En_Ds2n) -DECLARE_OVERLAY_SEGMENT(En_Fsn) -DECLARE_OVERLAY_SEGMENT(En_Shn) -DECLARE_OVERLAY_SEGMENT(En_Stop_heishi) -DECLARE_OVERLAY_SEGMENT(Obj_Bigicicle) -DECLARE_OVERLAY_SEGMENT(En_Lift_Nuts) -DECLARE_OVERLAY_SEGMENT(En_Tk) -DECLARE_OVERLAY_SEGMENT(Bg_Market_Step) -DECLARE_OVERLAY_SEGMENT(Obj_Lupygamelift) -DECLARE_OVERLAY_SEGMENT(En_Test7) -DECLARE_OVERLAY_SEGMENT(Obj_Lightblock) -DECLARE_OVERLAY_SEGMENT(Mir_Ray2) -DECLARE_OVERLAY_SEGMENT(En_Wdhand) -DECLARE_OVERLAY_SEGMENT(En_Gamelupy) -DECLARE_OVERLAY_SEGMENT(Bg_Danpei_Movebg) -DECLARE_OVERLAY_SEGMENT(En_Snowwd) -DECLARE_OVERLAY_SEGMENT(En_Pm) -DECLARE_OVERLAY_SEGMENT(En_Gakufu) -DECLARE_OVERLAY_SEGMENT(Elf_Msg4) -DECLARE_OVERLAY_SEGMENT(Elf_Msg5) -DECLARE_OVERLAY_SEGMENT(En_Col_Man) -DECLARE_OVERLAY_SEGMENT(En_Talk_Gibud) -DECLARE_OVERLAY_SEGMENT(En_Giant) -DECLARE_OVERLAY_SEGMENT(Obj_Snowball) -DECLARE_OVERLAY_SEGMENT(Boss_Hakugin) -DECLARE_OVERLAY_SEGMENT(En_Gb2) -DECLARE_OVERLAY_SEGMENT(En_Onpuman) -DECLARE_OVERLAY_SEGMENT(Bg_Tobira01) -DECLARE_OVERLAY_SEGMENT(En_Tag_Obj) -DECLARE_OVERLAY_SEGMENT(Obj_Dhouse) -DECLARE_OVERLAY_SEGMENT(Obj_Hakaisi) -DECLARE_OVERLAY_SEGMENT(Bg_Hakugin_Switch) -DECLARE_OVERLAY_SEGMENT(En_Snowman) -DECLARE_OVERLAY_SEGMENT(TG_Sw) -DECLARE_OVERLAY_SEGMENT(En_Po_Sisters) -DECLARE_OVERLAY_SEGMENT(En_Pp) -DECLARE_OVERLAY_SEGMENT(En_Hakurock) -DECLARE_OVERLAY_SEGMENT(En_Hanabi) -DECLARE_OVERLAY_SEGMENT(Obj_Dowsing) -DECLARE_OVERLAY_SEGMENT(Obj_Wind) -DECLARE_OVERLAY_SEGMENT(En_Racedog) -DECLARE_OVERLAY_SEGMENT(En_Kendo_Js) -DECLARE_OVERLAY_SEGMENT(Bg_Botihasira) -DECLARE_OVERLAY_SEGMENT(En_Fish2) -DECLARE_OVERLAY_SEGMENT(En_Pst) -DECLARE_OVERLAY_SEGMENT(En_Poh) -DECLARE_OVERLAY_SEGMENT(Obj_Spidertent) -DECLARE_OVERLAY_SEGMENT(En_Zoraegg) -DECLARE_OVERLAY_SEGMENT(En_Kbt) -DECLARE_OVERLAY_SEGMENT(En_Gg) -DECLARE_OVERLAY_SEGMENT(En_Maruta) -DECLARE_OVERLAY_SEGMENT(Obj_Snowball2) -DECLARE_OVERLAY_SEGMENT(En_Gg2) -DECLARE_OVERLAY_SEGMENT(Obj_Ghaka) -DECLARE_OVERLAY_SEGMENT(En_Dnp) -DECLARE_OVERLAY_SEGMENT(En_Dai) -DECLARE_OVERLAY_SEGMENT(Bg_Goron_Oyu) -DECLARE_OVERLAY_SEGMENT(En_Kgy) -DECLARE_OVERLAY_SEGMENT(En_Invadepoh) -DECLARE_OVERLAY_SEGMENT(En_Gk) -DECLARE_OVERLAY_SEGMENT(En_An) -DECLARE_OVERLAY_SEGMENT(En_Bee) -DECLARE_OVERLAY_SEGMENT(En_Ot) -DECLARE_OVERLAY_SEGMENT(En_Dragon) -DECLARE_OVERLAY_SEGMENT(Obj_Dora) -DECLARE_OVERLAY_SEGMENT(En_Bigpo) -DECLARE_OVERLAY_SEGMENT(Obj_Kendo_Kanban) -DECLARE_OVERLAY_SEGMENT(Obj_Hariko) -DECLARE_OVERLAY_SEGMENT(En_Sth) -DECLARE_OVERLAY_SEGMENT(Bg_Sinkai_Kabe) -DECLARE_OVERLAY_SEGMENT(Bg_Haka_Curtain) -DECLARE_OVERLAY_SEGMENT(Bg_Kin2_Bombwall) -DECLARE_OVERLAY_SEGMENT(Bg_Kin2_Fence) -DECLARE_OVERLAY_SEGMENT(Bg_Kin2_Picture) -DECLARE_OVERLAY_SEGMENT(Bg_Kin2_Shelf) -DECLARE_OVERLAY_SEGMENT(En_Rail_Skb) -DECLARE_OVERLAY_SEGMENT(En_Jg) -DECLARE_OVERLAY_SEGMENT(En_Tru_Mt) -DECLARE_OVERLAY_SEGMENT(Obj_Um) -DECLARE_OVERLAY_SEGMENT(En_Neo_Reeba) -DECLARE_OVERLAY_SEGMENT(Bg_Mbar_Chair) -DECLARE_OVERLAY_SEGMENT(Bg_Ikana_Block) -DECLARE_OVERLAY_SEGMENT(Bg_Ikana_Mirror) -DECLARE_OVERLAY_SEGMENT(Bg_Ikana_Rotaryroom) -DECLARE_OVERLAY_SEGMENT(Bg_Dblue_Balance) -DECLARE_OVERLAY_SEGMENT(Bg_Dblue_Waterfall) -DECLARE_OVERLAY_SEGMENT(En_Kaizoku) -DECLARE_OVERLAY_SEGMENT(En_Ge2) -DECLARE_OVERLAY_SEGMENT(En_Ma_Yts) -DECLARE_OVERLAY_SEGMENT(En_Ma_Yto) -DECLARE_OVERLAY_SEGMENT(Obj_Tokei_Turret) -DECLARE_OVERLAY_SEGMENT(Bg_Dblue_Elevator) -DECLARE_OVERLAY_SEGMENT(Obj_Warpstone) -DECLARE_OVERLAY_SEGMENT(En_Zog) -DECLARE_OVERLAY_SEGMENT(Obj_Rotlift) -DECLARE_OVERLAY_SEGMENT(Obj_Jg_Gakki) -DECLARE_OVERLAY_SEGMENT(Bg_Inibs_Movebg) -DECLARE_OVERLAY_SEGMENT(En_Zot) -DECLARE_OVERLAY_SEGMENT(Obj_Tree) -DECLARE_OVERLAY_SEGMENT(Obj_Y2lift) -DECLARE_OVERLAY_SEGMENT(Obj_Y2shutter) -DECLARE_OVERLAY_SEGMENT(Obj_Boat) -DECLARE_OVERLAY_SEGMENT(Obj_Taru) -DECLARE_OVERLAY_SEGMENT(Obj_Hunsui) -DECLARE_OVERLAY_SEGMENT(En_Jc_Mato) -DECLARE_OVERLAY_SEGMENT(Mir_Ray3) -DECLARE_OVERLAY_SEGMENT(En_Zob) -DECLARE_OVERLAY_SEGMENT(Elf_Msg6) -DECLARE_OVERLAY_SEGMENT(Obj_Nozoki) -DECLARE_OVERLAY_SEGMENT(En_Toto) -DECLARE_OVERLAY_SEGMENT(En_Railgibud) -DECLARE_OVERLAY_SEGMENT(En_Baba) -DECLARE_OVERLAY_SEGMENT(En_Suttari) -DECLARE_OVERLAY_SEGMENT(En_Zod) -DECLARE_OVERLAY_SEGMENT(En_Kujiya) -DECLARE_OVERLAY_SEGMENT(En_Geg) -DECLARE_OVERLAY_SEGMENT(Obj_Kinoko) -DECLARE_OVERLAY_SEGMENT(Obj_Yasi) -DECLARE_OVERLAY_SEGMENT(En_Tanron1) -DECLARE_OVERLAY_SEGMENT(En_Tanron2) -DECLARE_OVERLAY_SEGMENT(En_Tanron3) -DECLARE_OVERLAY_SEGMENT(Obj_Chan) -DECLARE_OVERLAY_SEGMENT(En_Zos) -DECLARE_OVERLAY_SEGMENT(En_S_Goro) -DECLARE_OVERLAY_SEGMENT(En_Nb) -DECLARE_OVERLAY_SEGMENT(En_Ja) -DECLARE_OVERLAY_SEGMENT(Bg_F40_Block) -DECLARE_OVERLAY_SEGMENT(Bg_F40_Switch) -DECLARE_OVERLAY_SEGMENT(En_Po_Composer) -DECLARE_OVERLAY_SEGMENT(En_Guruguru) -DECLARE_OVERLAY_SEGMENT(Oceff_Wipe5) -DECLARE_OVERLAY_SEGMENT(En_Stone_heishi) -DECLARE_OVERLAY_SEGMENT(Oceff_Wipe6) -DECLARE_OVERLAY_SEGMENT(En_Scopenuts) -DECLARE_OVERLAY_SEGMENT(En_Scopecrow) -DECLARE_OVERLAY_SEGMENT(Oceff_Wipe7) -DECLARE_OVERLAY_SEGMENT(Eff_Kamejima_Wave) -DECLARE_OVERLAY_SEGMENT(En_Hg) -DECLARE_OVERLAY_SEGMENT(En_Hgo) -DECLARE_OVERLAY_SEGMENT(En_Zov) -DECLARE_OVERLAY_SEGMENT(En_Ah) -DECLARE_OVERLAY_SEGMENT(Obj_Hgdoor) -DECLARE_OVERLAY_SEGMENT(Bg_Ikana_Bombwall) -DECLARE_OVERLAY_SEGMENT(Bg_Ikana_Ray) -DECLARE_OVERLAY_SEGMENT(Bg_Ikana_Shutter) -DECLARE_OVERLAY_SEGMENT(Bg_Haka_Bombwall) -DECLARE_OVERLAY_SEGMENT(Bg_Haka_Tomb) -DECLARE_OVERLAY_SEGMENT(En_Sc_Ruppe) -DECLARE_OVERLAY_SEGMENT(Bg_Iknv_Doukutu) -DECLARE_OVERLAY_SEGMENT(Bg_Iknv_Obj) -DECLARE_OVERLAY_SEGMENT(En_Pamera) -DECLARE_OVERLAY_SEGMENT(Obj_HsStump) -DECLARE_OVERLAY_SEGMENT(En_Hidden_Nuts) -DECLARE_OVERLAY_SEGMENT(En_Zow) -DECLARE_OVERLAY_SEGMENT(En_Talk) -DECLARE_OVERLAY_SEGMENT(En_Al) -DECLARE_OVERLAY_SEGMENT(En_Tab) -DECLARE_OVERLAY_SEGMENT(En_Nimotsu) -DECLARE_OVERLAY_SEGMENT(En_Hit_Tag) -DECLARE_OVERLAY_SEGMENT(En_Ruppecrow) -DECLARE_OVERLAY_SEGMENT(En_Tanron4) -DECLARE_OVERLAY_SEGMENT(En_Tanron5) -DECLARE_OVERLAY_SEGMENT(En_Tanron6) -DECLARE_OVERLAY_SEGMENT(En_Daiku2) -DECLARE_OVERLAY_SEGMENT(En_Muto) -DECLARE_OVERLAY_SEGMENT(En_Baisen) -DECLARE_OVERLAY_SEGMENT(En_Heishi) -DECLARE_OVERLAY_SEGMENT(En_Demo_heishi) -DECLARE_OVERLAY_SEGMENT(En_Dt) -DECLARE_OVERLAY_SEGMENT(En_Cha) -DECLARE_OVERLAY_SEGMENT(Obj_Dinner) -DECLARE_OVERLAY_SEGMENT(Eff_Lastday) -DECLARE_OVERLAY_SEGMENT(Bg_Ikana_Dharma) -DECLARE_OVERLAY_SEGMENT(En_Akindonuts) -DECLARE_OVERLAY_SEGMENT(Eff_Stk) -DECLARE_OVERLAY_SEGMENT(En_Ig) -DECLARE_OVERLAY_SEGMENT(En_Rg) -DECLARE_OVERLAY_SEGMENT(En_Osk) -DECLARE_OVERLAY_SEGMENT(En_Sth2) -DECLARE_OVERLAY_SEGMENT(En_Yb) -DECLARE_OVERLAY_SEGMENT(En_Rz) -DECLARE_OVERLAY_SEGMENT(En_Scopecoin) -DECLARE_OVERLAY_SEGMENT(En_Bjt) -DECLARE_OVERLAY_SEGMENT(En_Bomjima) -DECLARE_OVERLAY_SEGMENT(En_Bomjimb) -DECLARE_OVERLAY_SEGMENT(En_Bombers) -DECLARE_OVERLAY_SEGMENT(En_Bombers2) -DECLARE_OVERLAY_SEGMENT(En_Bombal) -DECLARE_OVERLAY_SEGMENT(Obj_Moon_Stone) -DECLARE_OVERLAY_SEGMENT(Obj_Mu_Pict) -DECLARE_OVERLAY_SEGMENT(Bg_Ikninside) -DECLARE_OVERLAY_SEGMENT(Eff_Zoraband) -DECLARE_OVERLAY_SEGMENT(Obj_Kepn_Koya) -DECLARE_OVERLAY_SEGMENT(Obj_Usiyane) -DECLARE_OVERLAY_SEGMENT(En_Nnh) -DECLARE_OVERLAY_SEGMENT(Obj_Kzsaku) -DECLARE_OVERLAY_SEGMENT(Obj_Milk_Bin) -DECLARE_OVERLAY_SEGMENT(En_Kitan) -DECLARE_OVERLAY_SEGMENT(Bg_Astr_Bombwall) -DECLARE_OVERLAY_SEGMENT(Bg_Iknin_Susceil) -DECLARE_OVERLAY_SEGMENT(En_Bsb) -DECLARE_OVERLAY_SEGMENT(En_Recepgirl) -DECLARE_OVERLAY_SEGMENT(En_Thiefbird) -DECLARE_OVERLAY_SEGMENT(En_Jgame_Tsn) -DECLARE_OVERLAY_SEGMENT(Obj_Jgame_Light) -DECLARE_OVERLAY_SEGMENT(Obj_Yado) -DECLARE_OVERLAY_SEGMENT(Demo_Syoten) -DECLARE_OVERLAY_SEGMENT(Demo_Moonend) -DECLARE_OVERLAY_SEGMENT(Bg_Lbfshot) -DECLARE_OVERLAY_SEGMENT(Bg_Last_Bwall) -DECLARE_OVERLAY_SEGMENT(En_And) -DECLARE_OVERLAY_SEGMENT(En_Invadepoh_Demo) -DECLARE_OVERLAY_SEGMENT(Obj_Danpeilift) -DECLARE_OVERLAY_SEGMENT(En_Fall2) -DECLARE_OVERLAY_SEGMENT(Dm_Al) -DECLARE_OVERLAY_SEGMENT(Dm_An) -DECLARE_OVERLAY_SEGMENT(Dm_Ah) -DECLARE_OVERLAY_SEGMENT(Dm_Nb) -DECLARE_OVERLAY_SEGMENT(En_Drs) -DECLARE_OVERLAY_SEGMENT(En_Ending_Hero) -DECLARE_OVERLAY_SEGMENT(Dm_Bal) -DECLARE_OVERLAY_SEGMENT(En_Paper) -DECLARE_OVERLAY_SEGMENT(En_Hint_Skb) -DECLARE_OVERLAY_SEGMENT(Dm_Tag) -DECLARE_OVERLAY_SEGMENT(En_Bh) -DECLARE_OVERLAY_SEGMENT(En_Ending_Hero2) -DECLARE_OVERLAY_SEGMENT(En_Ending_Hero3) -DECLARE_OVERLAY_SEGMENT(En_Ending_Hero4) -DECLARE_OVERLAY_SEGMENT(En_Ending_Hero5) -DECLARE_OVERLAY_SEGMENT(En_Ending_Hero6) -DECLARE_OVERLAY_SEGMENT(Dm_Gm) -DECLARE_OVERLAY_SEGMENT(Obj_Swprize) -DECLARE_OVERLAY_SEGMENT(En_Invisible_Ruppe) -DECLARE_OVERLAY_SEGMENT(Obj_Ending) -DECLARE_OVERLAY_SEGMENT(En_Rsn) DECLARE_ROM_SEGMENT(gameplay_keep) DECLARE_ROM_SEGMENT(gameplay_field_keep) diff --git a/include/tables/actor_table.h b/include/tables/actor_table.h new file mode 100644 index 000000000..9019e2b80 --- /dev/null +++ b/include/tables/actor_table.h @@ -0,0 +1,703 @@ +/** + * Actor Table + * + * DEFINE_ACTOR should be used for normal actors + * - Argument 0: Name of the actor overlay segment in the spec (without the ovl_ part) + * - Argument 1: Enum value for this actor + * - Argument 2: Allocation type (normal, permanent or absolute) + * - Argument 3: Actor name, as a string (used for debug prints) + * + * DEFINE_ACTOR_INTERNAL should be used for actors that aren't an overlay, with the same arguments as DEFINE_ACTOR + * + * DEFINE_ACTOR_UNSET is needed to define empty entries from the original game + */ +/* 0x000 */ DEFINE_ACTOR_INTERNAL(Player, ACTOR_PLAYER, ALLOCTYPE_NORMAL, "Player") +/* 0x001 */ DEFINE_ACTOR(En_Test, ACTOR_EN_TEST, ALLOCTYPE_NORMAL, "En_Test") +/* 0x002 */ DEFINE_ACTOR(En_GirlA, ACTOR_EN_GIRLA, ALLOCTYPE_NORMAL, "En_GirlA") +/* 0x003 */ DEFINE_ACTOR(En_Part, ACTOR_EN_PART, ALLOCTYPE_NORMAL, "En_Part") +/* 0x004 */ DEFINE_ACTOR(En_Light, ACTOR_EN_LIGHT, ALLOCTYPE_NORMAL, "En_Light") +/* 0x005 */ DEFINE_ACTOR(En_Door, ACTOR_EN_DOOR, ALLOCTYPE_PERMANENT, "En_Door") +/* 0x006 */ DEFINE_ACTOR(En_Box, ACTOR_EN_BOX, ALLOCTYPE_NORMAL, "En_Box") +/* 0x007 */ DEFINE_ACTOR(En_Pametfrog, ACTOR_EN_PAMETFROG, ALLOCTYPE_NORMAL, "En_Pametfrog") +/* 0x008 */ DEFINE_ACTOR(En_Okuta, ACTOR_EN_OKUTA, ALLOCTYPE_NORMAL, "En_Okuta") +/* 0x009 */ DEFINE_ACTOR(En_Bom, ACTOR_EN_BOM, ALLOCTYPE_PERMANENT, "En_Bom") +/* 0x00A */ DEFINE_ACTOR(En_Wallmas, ACTOR_EN_WALLMAS, ALLOCTYPE_NORMAL, "En_Wallmas") +/* 0x00B */ DEFINE_ACTOR(En_Dodongo, ACTOR_EN_DODONGO, ALLOCTYPE_NORMAL, "En_Dodongo") +/* 0x00C */ DEFINE_ACTOR(En_Firefly, ACTOR_EN_FIREFLY, ALLOCTYPE_NORMAL, "En_Firefly") +/* 0x00D */ DEFINE_ACTOR(En_Horse, ACTOR_EN_HORSE, ALLOCTYPE_NORMAL, "En_Horse") +/* 0x00E */ DEFINE_ACTOR_INTERNAL(En_Item00, ACTOR_EN_ITEM00, ALLOCTYPE_NORMAL, "En_Item00") +/* 0x00F */ DEFINE_ACTOR(En_Arrow, ACTOR_EN_ARROW, ALLOCTYPE_PERMANENT, "En_Arrow") +/* 0x010 */ DEFINE_ACTOR(En_Elf, ACTOR_EN_ELF, ALLOCTYPE_NORMAL, "En_Elf") +/* 0x011 */ DEFINE_ACTOR(En_Niw, ACTOR_EN_NIW, ALLOCTYPE_NORMAL, "En_Niw") +/* 0x012 */ DEFINE_ACTOR(En_Tite, ACTOR_EN_TITE, ALLOCTYPE_NORMAL, "En_Tite") +/* 0x013 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_13) +/* 0x014 */ DEFINE_ACTOR(En_Peehat, ACTOR_EN_PEEHAT, ALLOCTYPE_NORMAL, "En_Peehat") +/* 0x015 */ DEFINE_ACTOR(En_Butte, ACTOR_EN_BUTTE, ALLOCTYPE_NORMAL, "En_Butte") +/* 0x016 */ DEFINE_ACTOR(En_Insect, ACTOR_EN_INSECT, ALLOCTYPE_NORMAL, "En_Insect") +/* 0x017 */ DEFINE_ACTOR(En_Fish, ACTOR_EN_FISH, ALLOCTYPE_NORMAL, "En_Fish") +/* 0x018 */ DEFINE_ACTOR(En_Holl, ACTOR_EN_HOLL, ALLOCTYPE_PERMANENT, "En_Holl") +/* 0x019 */ DEFINE_ACTOR(En_Dinofos, ACTOR_EN_DINOFOS, ALLOCTYPE_NORMAL, "En_Dinofos") +/* 0x01A */ DEFINE_ACTOR(En_Hata, ACTOR_EN_HATA, ALLOCTYPE_NORMAL, "En_Hata") +/* 0x01B */ DEFINE_ACTOR(En_Zl1, ACTOR_EN_ZL1, ALLOCTYPE_NORMAL, "En_Zl1") +/* 0x01C */ DEFINE_ACTOR(En_Viewer, ACTOR_EN_VIEWER, ALLOCTYPE_NORMAL, "En_Viewer") +/* 0x01D */ DEFINE_ACTOR(En_Bubble, ACTOR_EN_BUBBLE, ALLOCTYPE_NORMAL, "En_Bubble") +/* 0x01E */ DEFINE_ACTOR(Door_Shutter, ACTOR_DOOR_SHUTTER, ALLOCTYPE_PERMANENT, "Door_Shutter") +/* 0x01F */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_1F) +/* 0x020 */ DEFINE_ACTOR(En_Boom, ACTOR_EN_BOOM, ALLOCTYPE_PERMANENT, "En_Boom") +/* 0x021 */ DEFINE_ACTOR(En_Torch2, ACTOR_EN_TORCH2, ALLOCTYPE_NORMAL, "En_Torch2") +/* 0x022 */ DEFINE_ACTOR(En_Minifrog, ACTOR_EN_MINIFROG, ALLOCTYPE_NORMAL, "En_Minifrog") +/* 0x023 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_23) +/* 0x024 */ DEFINE_ACTOR(En_St, ACTOR_EN_ST, ALLOCTYPE_NORMAL, "En_St") +/* 0x025 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_25) +/* 0x026 */ DEFINE_ACTOR_INTERNAL(En_A_Obj, ACTOR_EN_A_OBJ, ALLOCTYPE_NORMAL, "En_A_Obj") +/* 0x027 */ DEFINE_ACTOR(Obj_Wturn, ACTOR_OBJ_WTURN, ALLOCTYPE_NORMAL, "Obj_Wturn") +/* 0x028 */ DEFINE_ACTOR(En_River_Sound, ACTOR_EN_RIVER_SOUND, ALLOCTYPE_NORMAL, "En_River_Sound") +/* 0x029 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_29) +/* 0x02A */ DEFINE_ACTOR(En_Ossan, ACTOR_EN_OSSAN, ALLOCTYPE_NORMAL, "En_Ossan") +/* 0x02B */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_2B) +/* 0x02C */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_2C) +/* 0x02D */ DEFINE_ACTOR(En_Famos, ACTOR_EN_FAMOS, ALLOCTYPE_NORMAL, "En_Famos") +/* 0x02E */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_2E) +/* 0x02F */ DEFINE_ACTOR(En_Bombf, ACTOR_EN_BOMBF, ALLOCTYPE_NORMAL, "En_Bombf") +/* 0x030 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_30) +/* 0x031 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_31) +/* 0x032 */ DEFINE_ACTOR(En_Am, ACTOR_EN_AM, ALLOCTYPE_NORMAL, "En_Am") +/* 0x033 */ DEFINE_ACTOR(En_Dekubaba, ACTOR_EN_DEKUBABA, ALLOCTYPE_NORMAL, "En_Dekubaba") +/* 0x034 */ DEFINE_ACTOR(En_M_Fire1, ACTOR_EN_M_FIRE1, ALLOCTYPE_PERMANENT, "En_M_Fire1") +/* 0x035 */ DEFINE_ACTOR(En_M_Thunder, ACTOR_EN_M_THUNDER, ALLOCTYPE_PERMANENT, "En_M_Thunder") +/* 0x036 */ DEFINE_ACTOR(Bg_Breakwall, ACTOR_BG_BREAKWALL, ALLOCTYPE_NORMAL, "Bg_Breakwall") +/* 0x037 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_37) +/* 0x038 */ DEFINE_ACTOR(Door_Warp1, ACTOR_DOOR_WARP1, ALLOCTYPE_NORMAL, "Door_Warp1") +/* 0x039 */ DEFINE_ACTOR(Obj_Syokudai, ACTOR_OBJ_SYOKUDAI, ALLOCTYPE_NORMAL, "Obj_Syokudai") +/* 0x03A */ DEFINE_ACTOR(Item_B_Heart, ACTOR_ITEM_B_HEART, ALLOCTYPE_NORMAL, "Item_B_Heart") +/* 0x03B */ DEFINE_ACTOR(En_Dekunuts, ACTOR_EN_DEKUNUTS, ALLOCTYPE_NORMAL, "En_Dekunuts") +/* 0x03C */ DEFINE_ACTOR(En_Bbfall, ACTOR_EN_BBFALL, ALLOCTYPE_NORMAL, "En_Bbfall") +/* 0x03D */ DEFINE_ACTOR(Arms_Hook, ACTOR_ARMS_HOOK, ALLOCTYPE_PERMANENT, "Arms_Hook") +/* 0x03E */ DEFINE_ACTOR(En_Bb, ACTOR_EN_BB, ALLOCTYPE_NORMAL, "En_Bb") +/* 0x03F */ DEFINE_ACTOR(Bg_Keikoku_Spr, ACTOR_BG_KEIKOKU_SPR, ALLOCTYPE_NORMAL, "Bg_Keikoku_Spr") +/* 0x040 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_40) +/* 0x041 */ DEFINE_ACTOR(En_Wood02, ACTOR_EN_WOOD02, ALLOCTYPE_NORMAL, "En_Wood02") +/* 0x042 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_42) +/* 0x043 */ DEFINE_ACTOR(En_Death, ACTOR_EN_DEATH, ALLOCTYPE_NORMAL, "En_Death") +/* 0x044 */ DEFINE_ACTOR(En_Minideath, ACTOR_EN_MINIDEATH, ALLOCTYPE_NORMAL, "En_Minideath") +/* 0x045 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_45) +/* 0x046 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_46) +/* 0x047 */ DEFINE_ACTOR(En_Vm, ACTOR_EN_VM, ALLOCTYPE_NORMAL, "En_Vm") +/* 0x048 */ DEFINE_ACTOR(Demo_Effect, ACTOR_DEMO_EFFECT, ALLOCTYPE_NORMAL, "Demo_Effect") +/* 0x049 */ DEFINE_ACTOR(Demo_Kankyo, ACTOR_DEMO_KANKYO, ALLOCTYPE_NORMAL, "Demo_Kankyo") +/* 0x04A */ DEFINE_ACTOR(En_Floormas, ACTOR_EN_FLOORMAS, ALLOCTYPE_NORMAL, "En_Floormas") +/* 0x04B */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_4B) +/* 0x04C */ DEFINE_ACTOR(En_Rd, ACTOR_EN_RD, ALLOCTYPE_NORMAL, "En_Rd") +/* 0x04D */ DEFINE_ACTOR(Bg_F40_Flift, ACTOR_BG_F40_FLIFT, ALLOCTYPE_NORMAL, "Bg_F40_Flift") +/* 0x04E */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_4E) +/* 0x04F */ DEFINE_ACTOR(Obj_Mure, ACTOR_OBJ_MURE, ALLOCTYPE_NORMAL, "Obj_Mure") +/* 0x050 */ DEFINE_ACTOR(En_Sw, ACTOR_EN_SW, ALLOCTYPE_NORMAL, "En_Sw") +/* 0x051 */ DEFINE_ACTOR(Object_Kankyo, ACTOR_OBJECT_KANKYO, ALLOCTYPE_NORMAL, "Object_Kankyo") +/* 0x052 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_52) +/* 0x053 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_53) +/* 0x054 */ DEFINE_ACTOR(En_Horse_Link_Child, ACTOR_EN_HORSE_LINK_CHILD, ALLOCTYPE_NORMAL, "En_Horse_Link_Child") +/* 0x055 */ DEFINE_ACTOR(Door_Ana, ACTOR_DOOR_ANA, ALLOCTYPE_NORMAL, "Door_Ana") +/* 0x056 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_56) +/* 0x057 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_57) +/* 0x058 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_58) +/* 0x059 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_59) +/* 0x05A */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_5A) +/* 0x05B */ DEFINE_ACTOR(En_Encount1, ACTOR_EN_ENCOUNT1, ALLOCTYPE_NORMAL, "En_Encount1") +/* 0x05C */ DEFINE_ACTOR(Demo_Tre_Lgt, ACTOR_DEMO_TRE_LGT, ALLOCTYPE_NORMAL, "Demo_Tre_Lgt") +/* 0x05D */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_5D) +/* 0x05E */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_5E) +/* 0x05F */ DEFINE_ACTOR(En_Encount2, ACTOR_EN_ENCOUNT2, ALLOCTYPE_NORMAL, "En_Encount2") +/* 0x060 */ DEFINE_ACTOR(En_Fire_Rock, ACTOR_EN_FIRE_ROCK, ALLOCTYPE_NORMAL, "En_Fire_Rock") +/* 0x061 */ DEFINE_ACTOR(Bg_Ctower_Rot, ACTOR_BG_CTOWER_ROT, ALLOCTYPE_NORMAL, "Bg_Ctower_Rot") +/* 0x062 */ DEFINE_ACTOR(Mir_Ray, ACTOR_MIR_RAY, ALLOCTYPE_NORMAL, "Mir_Ray") +/* 0x063 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_63) +/* 0x064 */ DEFINE_ACTOR(En_Sb, ACTOR_EN_SB, ALLOCTYPE_NORMAL, "En_Sb") +/* 0x065 */ DEFINE_ACTOR(En_Bigslime, ACTOR_EN_BIGSLIME, ALLOCTYPE_NORMAL, "En_Bigslime") +/* 0x066 */ DEFINE_ACTOR(En_Karebaba, ACTOR_EN_KAREBABA, ALLOCTYPE_NORMAL, "En_Karebaba") +/* 0x067 */ DEFINE_ACTOR(En_In, ACTOR_EN_IN, ALLOCTYPE_NORMAL, "En_In") +/* 0x068 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_68) +/* 0x069 */ DEFINE_ACTOR(En_Ru, ACTOR_EN_RU, ALLOCTYPE_NORMAL, "En_Ru") +/* 0x06A */ DEFINE_ACTOR(En_Bom_Chu, ACTOR_EN_BOM_CHU, ALLOCTYPE_PERMANENT, "En_Bom_Chu") +/* 0x06B */ DEFINE_ACTOR(En_Horse_Game_Check, ACTOR_EN_HORSE_GAME_CHECK, ALLOCTYPE_NORMAL, "En_Horse_Game_Check") +/* 0x06C */ DEFINE_ACTOR(En_Rr, ACTOR_EN_RR, ALLOCTYPE_NORMAL, "En_Rr") +/* 0x06D */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_6D) +/* 0x06E */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_6E) +/* 0x06F */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_6F) +/* 0x070 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_70) +/* 0x071 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_71) +/* 0x072 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_72) +/* 0x073 */ DEFINE_ACTOR(En_Fr, ACTOR_EN_FR, ALLOCTYPE_NORMAL, "En_Fr") +/* 0x074 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_74) +/* 0x075 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_75) +/* 0x076 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_76) +/* 0x077 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_77) +/* 0x078 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_78) +/* 0x079 */ DEFINE_ACTOR(En_Fishing, ACTOR_EN_FISHING, ALLOCTYPE_NORMAL, "En_Fishing") +/* 0x07A */ DEFINE_ACTOR(Obj_Oshihiki, ACTOR_OBJ_OSHIHIKI, ALLOCTYPE_NORMAL, "Obj_Oshihiki") +/* 0x07B */ DEFINE_ACTOR(Eff_Dust, ACTOR_EFF_DUST, ALLOCTYPE_NORMAL, "Eff_Dust") +/* 0x07C */ DEFINE_ACTOR(Bg_Umajump, ACTOR_BG_UMAJUMP, ALLOCTYPE_NORMAL, "Bg_Umajump") +/* 0x07D */ DEFINE_ACTOR(Arrow_Fire, ACTOR_ARROW_FIRE, ALLOCTYPE_ABSOLUTE, "Arrow_Fire") +/* 0x07E */ DEFINE_ACTOR(Arrow_Ice, ACTOR_ARROW_ICE, ALLOCTYPE_ABSOLUTE, "Arrow_Ice") +/* 0x07F */ DEFINE_ACTOR(Arrow_Light, ACTOR_ARROW_LIGHT, ALLOCTYPE_ABSOLUTE, "Arrow_Light") +/* 0x080 */ DEFINE_ACTOR(Item_Etcetera, ACTOR_ITEM_ETCETERA, ALLOCTYPE_NORMAL, "Item_Etcetera") +/* 0x081 */ DEFINE_ACTOR(Obj_Kibako, ACTOR_OBJ_KIBAKO, ALLOCTYPE_NORMAL, "Obj_Kibako") +/* 0x082 */ DEFINE_ACTOR(Obj_Tsubo, ACTOR_OBJ_TSUBO, ALLOCTYPE_NORMAL, "Obj_Tsubo") +/* 0x083 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_83) +/* 0x084 */ DEFINE_ACTOR(En_Ik, ACTOR_EN_IK, ALLOCTYPE_NORMAL, "En_Ik") +/* 0x085 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_85) +/* 0x086 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_86) +/* 0x087 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_87) +/* 0x088 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_88) +/* 0x089 */ DEFINE_ACTOR(Demo_Shd, ACTOR_DEMO_SHD, ALLOCTYPE_NORMAL, "Demo_Shd") +/* 0x08A */ DEFINE_ACTOR(En_Dns, ACTOR_EN_DNS, ALLOCTYPE_NORMAL, "En_Dns") +/* 0x08B */ DEFINE_ACTOR(Elf_Msg, ACTOR_ELF_MSG, ALLOCTYPE_NORMAL, "Elf_Msg") +/* 0x08C */ DEFINE_ACTOR(En_Honotrap, ACTOR_EN_HONOTRAP, ALLOCTYPE_NORMAL, "En_Honotrap") +/* 0x08D */ DEFINE_ACTOR(En_Tubo_Trap, ACTOR_EN_TUBO_TRAP, ALLOCTYPE_NORMAL, "En_Tubo_Trap") +/* 0x08E */ DEFINE_ACTOR(Obj_Ice_Poly, ACTOR_OBJ_ICE_POLY, ALLOCTYPE_NORMAL, "Obj_Ice_Poly") +/* 0x08F */ DEFINE_ACTOR(En_Fz, ACTOR_EN_FZ, ALLOCTYPE_NORMAL, "En_Fz") +/* 0x090 */ DEFINE_ACTOR(En_Kusa, ACTOR_EN_KUSA, ALLOCTYPE_NORMAL, "En_Kusa") +/* 0x091 */ DEFINE_ACTOR(Obj_Bean, ACTOR_OBJ_BEAN, ALLOCTYPE_NORMAL, "Obj_Bean") +/* 0x092 */ DEFINE_ACTOR(Obj_Bombiwa, ACTOR_OBJ_BOMBIWA, ALLOCTYPE_NORMAL, "Obj_Bombiwa") +/* 0x093 */ DEFINE_ACTOR(Obj_Switch, ACTOR_OBJ_SWITCH, ALLOCTYPE_NORMAL, "Obj_Switch") +/* 0x094 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_94) +/* 0x095 */ DEFINE_ACTOR(Obj_Lift, ACTOR_OBJ_LIFT, ALLOCTYPE_NORMAL, "Obj_Lift") +/* 0x096 */ DEFINE_ACTOR(Obj_Hsblock, ACTOR_OBJ_HSBLOCK, ALLOCTYPE_NORMAL, "Obj_Hsblock") +/* 0x097 */ DEFINE_ACTOR(En_Okarina_Tag, ACTOR_EN_OKARINA_TAG, ALLOCTYPE_NORMAL, "En_Okarina_Tag") +/* 0x098 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_98) +/* 0x099 */ DEFINE_ACTOR(En_Goroiwa, ACTOR_EN_GOROIWA, ALLOCTYPE_NORMAL, "En_Goroiwa") +/* 0x09A */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_9A) +/* 0x09B */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_9B) +/* 0x09C */ DEFINE_ACTOR(En_Daiku, ACTOR_EN_DAIKU, ALLOCTYPE_NORMAL, "En_Daiku") +/* 0x09D */ DEFINE_ACTOR(En_Nwc, ACTOR_EN_NWC, ALLOCTYPE_NORMAL, "En_Nwc") +/* 0x09E */ DEFINE_ACTOR(Item_Inbox, ACTOR_ITEM_INBOX, ALLOCTYPE_NORMAL, "Item_Inbox") +/* 0x09F */ DEFINE_ACTOR(En_Ge1, ACTOR_EN_GE1, ALLOCTYPE_NORMAL, "En_Ge1") +/* 0x0A0 */ DEFINE_ACTOR(Obj_Blockstop, ACTOR_OBJ_BLOCKSTOP, ALLOCTYPE_NORMAL, "Obj_Blockstop") +/* 0x0A1 */ DEFINE_ACTOR(En_Sda, ACTOR_EN_SDA, ALLOCTYPE_NORMAL, "En_Sda") +/* 0x0A2 */ DEFINE_ACTOR(En_Clear_Tag, ACTOR_EN_CLEAR_TAG, ALLOCTYPE_NORMAL, "En_Clear_Tag") +/* 0x0A3 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_A3) +/* 0x0A4 */ DEFINE_ACTOR(En_Gm, ACTOR_EN_GM, ALLOCTYPE_NORMAL, "En_Gm") +/* 0x0A5 */ DEFINE_ACTOR(En_Ms, ACTOR_EN_MS, ALLOCTYPE_NORMAL, "En_Ms") +/* 0x0A6 */ DEFINE_ACTOR(En_Hs, ACTOR_EN_HS, ALLOCTYPE_NORMAL, "En_Hs") +/* 0x0A7 */ DEFINE_ACTOR(Bg_Ingate, ACTOR_BG_INGATE, ALLOCTYPE_NORMAL, "Bg_Ingate") +/* 0x0A8 */ DEFINE_ACTOR(En_Kanban, ACTOR_EN_KANBAN, ALLOCTYPE_NORMAL, "En_Kanban") +/* 0x0A9 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_A9) +/* 0x0AA */ DEFINE_ACTOR(En_Attack_Niw, ACTOR_EN_ATTACK_NIW, ALLOCTYPE_NORMAL, "En_Attack_Niw") +/* 0x0AB */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_AB) +/* 0x0AC */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_AC) +/* 0x0AD */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_AD) +/* 0x0AE */ DEFINE_ACTOR(En_Mk, ACTOR_EN_MK, ALLOCTYPE_NORMAL, "En_Mk") +/* 0x0AF */ DEFINE_ACTOR(En_Owl, ACTOR_EN_OWL, ALLOCTYPE_NORMAL, "En_Owl") +/* 0x0B0 */ DEFINE_ACTOR(En_Ishi, ACTOR_EN_ISHI, ALLOCTYPE_NORMAL, "En_Ishi") +/* 0x0B1 */ DEFINE_ACTOR(Obj_Hana, ACTOR_OBJ_HANA, ALLOCTYPE_NORMAL, "Obj_Hana") +/* 0x0B2 */ DEFINE_ACTOR(Obj_Lightswitch, ACTOR_OBJ_LIGHTSWITCH, ALLOCTYPE_NORMAL, "Obj_Lightswitch") +/* 0x0B3 */ DEFINE_ACTOR(Obj_Mure2, ACTOR_OBJ_MURE2, ALLOCTYPE_NORMAL, "Obj_Mure2") +/* 0x0B4 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_B4) +/* 0x0B5 */ DEFINE_ACTOR(En_Fu, ACTOR_EN_FU, ALLOCTYPE_NORMAL, "En_Fu") +/* 0x0B6 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_B6) +/* 0x0B7 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_B7) +/* 0x0B8 */ DEFINE_ACTOR(En_Stream, ACTOR_EN_STREAM, ALLOCTYPE_NORMAL, "En_Stream") +/* 0x0B9 */ DEFINE_ACTOR(En_Mm, ACTOR_EN_MM, ALLOCTYPE_NORMAL, "En_Mm") +/* 0x0BA */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_BA) +/* 0x0BB */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_BB) +/* 0x0BC */ DEFINE_ACTOR(En_Weather_Tag, ACTOR_EN_WEATHER_TAG, ALLOCTYPE_NORMAL, "En_Weather_Tag") +/* 0x0BD */ DEFINE_ACTOR(En_Ani, ACTOR_EN_ANI, ALLOCTYPE_NORMAL, "En_Ani") +/* 0x0BE */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_BE) +/* 0x0BF */ DEFINE_ACTOR(En_Js, ACTOR_EN_JS, ALLOCTYPE_NORMAL, "En_Js") +/* 0x0C0 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_C0) +/* 0x0C1 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_C1) +/* 0x0C2 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_C2) +/* 0x0C3 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_C3) +/* 0x0C4 */ DEFINE_ACTOR(En_Okarina_Effect, ACTOR_EN_OKARINA_EFFECT, ALLOCTYPE_NORMAL, "En_Okarina_Effect") +/* 0x0C5 */ DEFINE_ACTOR(En_Mag, ACTOR_EN_MAG, ALLOCTYPE_NORMAL, "En_Mag") +/* 0x0C6 */ DEFINE_ACTOR(Elf_Msg2, ACTOR_ELF_MSG2, ALLOCTYPE_NORMAL, "Elf_Msg2") +/* 0x0C7 */ DEFINE_ACTOR(Bg_F40_Swlift, ACTOR_BG_F40_SWLIFT, ALLOCTYPE_NORMAL, "Bg_F40_Swlift") +/* 0x0C8 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_C8) +/* 0x0C9 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_C9) +/* 0x0CA */ DEFINE_ACTOR(En_Kakasi, ACTOR_EN_KAKASI, ALLOCTYPE_NORMAL, "En_Kakasi") +/* 0x0CB */ DEFINE_ACTOR(Obj_Makeoshihiki, ACTOR_OBJ_MAKEOSHIHIKI, ALLOCTYPE_NORMAL, "Obj_Makeoshihiki") +/* 0x0CC */ DEFINE_ACTOR(Oceff_Spot, ACTOR_OCEFF_SPOT, ALLOCTYPE_ABSOLUTE, "Oceff_Spot") +/* 0x0CD */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_CD) +/* 0x0CE */ DEFINE_ACTOR(En_Torch, ACTOR_EN_TORCH, ALLOCTYPE_NORMAL, "En_Torch") +/* 0x0CF */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_CF) +/* 0x0D0 */ DEFINE_ACTOR(Shot_Sun, ACTOR_SHOT_SUN, ALLOCTYPE_NORMAL, "Shot_Sun") +/* 0x0D1 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_D1) +/* 0x0D2 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_D2) +/* 0x0D3 */ DEFINE_ACTOR(Obj_Roomtimer, ACTOR_OBJ_ROOMTIMER, ALLOCTYPE_NORMAL, "Obj_Roomtimer") +/* 0x0D4 */ DEFINE_ACTOR(En_Ssh, ACTOR_EN_SSH, ALLOCTYPE_NORMAL, "En_Ssh") +/* 0x0D5 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_D5) +/* 0x0D6 */ DEFINE_ACTOR(Oceff_Wipe, ACTOR_OCEFF_WIPE, ALLOCTYPE_ABSOLUTE, "Oceff_Wipe") +/* 0x0D7 */ DEFINE_ACTOR(Oceff_Storm, ACTOR_OCEFF_STORM, ALLOCTYPE_ABSOLUTE, "Oceff_Storm") +/* 0x0D8 */ DEFINE_ACTOR(Obj_Demo, ACTOR_OBJ_DEMO, ALLOCTYPE_NORMAL, "Obj_Demo") +/* 0x0D9 */ DEFINE_ACTOR(En_Minislime, ACTOR_EN_MINISLIME, ALLOCTYPE_NORMAL, "En_Minislime") +/* 0x0DA */ DEFINE_ACTOR(En_Nutsball, ACTOR_EN_NUTSBALL, ALLOCTYPE_NORMAL, "En_Nutsball") +/* 0x0DB */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_DB) +/* 0x0DC */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_DC) +/* 0x0DD */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_DD) +/* 0x0DE */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_DE) +/* 0x0DF */ DEFINE_ACTOR(Oceff_Wipe2, ACTOR_OCEFF_WIPE2, ALLOCTYPE_ABSOLUTE, "Oceff_Wipe2") +/* 0x0E0 */ DEFINE_ACTOR(Oceff_Wipe3, ACTOR_OCEFF_WIPE3, ALLOCTYPE_ABSOLUTE, "Oceff_Wipe3") +/* 0x0E1 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_E1) +/* 0x0E2 */ DEFINE_ACTOR(En_Dg, ACTOR_EN_DG, ALLOCTYPE_NORMAL, "En_Dg") +/* 0x0E3 */ DEFINE_ACTOR(En_Si, ACTOR_EN_SI, ALLOCTYPE_NORMAL, "En_Si") +/* 0x0E4 */ DEFINE_ACTOR(Obj_Comb, ACTOR_OBJ_COMB, ALLOCTYPE_NORMAL, "Obj_Comb") +/* 0x0E5 */ DEFINE_ACTOR(Obj_Kibako2, ACTOR_OBJ_KIBAKO2, ALLOCTYPE_NORMAL, "Obj_Kibako2") +/* 0x0E6 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_E6) +/* 0x0E7 */ DEFINE_ACTOR(En_Hs2, ACTOR_EN_HS2, ALLOCTYPE_NORMAL, "En_Hs2") +/* 0x0E8 */ DEFINE_ACTOR(Obj_Mure3, ACTOR_OBJ_MURE3, ALLOCTYPE_NORMAL, "Obj_Mure3") +/* 0x0E9 */ DEFINE_ACTOR(En_Tg, ACTOR_EN_TG, ALLOCTYPE_NORMAL, "En_Tg") +/* 0x0EA */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_EA) +/* 0x0EB */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_EB) +/* 0x0EC */ DEFINE_ACTOR(En_Wf, ACTOR_EN_WF, ALLOCTYPE_NORMAL, "En_Wf") +/* 0x0ED */ DEFINE_ACTOR(En_Skb, ACTOR_EN_SKB, ALLOCTYPE_NORMAL, "En_Skb") +/* 0x0EE */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_EE) +/* 0x0EF */ DEFINE_ACTOR(En_Gs, ACTOR_EN_GS, ALLOCTYPE_NORMAL, "En_Gs") +/* 0x0F0 */ DEFINE_ACTOR(Obj_Sound, ACTOR_OBJ_SOUND, ALLOCTYPE_NORMAL, "Obj_Sound") +/* 0x0F1 */ DEFINE_ACTOR(En_Crow, ACTOR_EN_CROW, ALLOCTYPE_NORMAL, "En_Crow") +/* 0x0F2 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_F2) +/* 0x0F3 */ DEFINE_ACTOR(En_Cow, ACTOR_EN_COW, ALLOCTYPE_NORMAL, "En_Cow") +/* 0x0F4 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_F4) +/* 0x0F5 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_F5) +/* 0x0F6 */ DEFINE_ACTOR(Oceff_Wipe4, ACTOR_OCEFF_WIPE4, ALLOCTYPE_ABSOLUTE, "Oceff_Wipe4") +/* 0x0F7 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_F7) +/* 0x0F8 */ DEFINE_ACTOR(En_Zo, ACTOR_EN_ZO, ALLOCTYPE_NORMAL, "En_Zo") +/* 0x0F9 */ DEFINE_ACTOR(Obj_Makekinsuta, ACTOR_OBJ_MAKEKINSUTA, ALLOCTYPE_NORMAL, "Obj_Makekinsuta") +/* 0x0FA */ DEFINE_ACTOR(En_Ge3, ACTOR_EN_GE3, ALLOCTYPE_NORMAL, "En_Ge3") +/* 0x0FB */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_FB) +/* 0x0FC */ DEFINE_ACTOR(Obj_Hamishi, ACTOR_OBJ_HAMISHI, ALLOCTYPE_NORMAL, "Obj_Hamishi") +/* 0x0FD */ DEFINE_ACTOR(En_Zl4, ACTOR_EN_ZL4, ALLOCTYPE_NORMAL, "En_Zl4") +/* 0x0FE */ DEFINE_ACTOR(En_Mm2, ACTOR_EN_MM2, ALLOCTYPE_NORMAL, "En_Mm2") +/* 0x0FF */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_FF) +/* 0x100 */ DEFINE_ACTOR(Door_Spiral, ACTOR_DOOR_SPIRAL, ALLOCTYPE_PERMANENT, "Door_Spiral") +/* 0x101 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_101) +/* 0x102 */ DEFINE_ACTOR(Obj_Pzlblock, ACTOR_OBJ_PZLBLOCK, ALLOCTYPE_NORMAL, "Obj_Pzlblock") +/* 0x103 */ DEFINE_ACTOR(Obj_Toge, ACTOR_OBJ_TOGE, ALLOCTYPE_NORMAL, "Obj_Toge") +/* 0x104 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_104) +/* 0x105 */ DEFINE_ACTOR(Obj_Armos, ACTOR_OBJ_ARMOS, ALLOCTYPE_NORMAL, "Obj_Armos") +/* 0x106 */ DEFINE_ACTOR(Obj_Boyo, ACTOR_OBJ_BOYO, ALLOCTYPE_NORMAL, "Obj_Boyo") +/* 0x107 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_107) +/* 0x108 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_108) +/* 0x109 */ DEFINE_ACTOR(En_Grasshopper, ACTOR_EN_GRASSHOPPER, ALLOCTYPE_NORMAL, "En_Grasshopper") +/* 0x10A */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_10A) +/* 0x10B */ DEFINE_ACTOR(Obj_Grass, ACTOR_OBJ_GRASS, ALLOCTYPE_NORMAL, "Obj_Grass") +/* 0x10C */ DEFINE_ACTOR(Obj_Grass_Carry, ACTOR_OBJ_GRASS_CARRY, ALLOCTYPE_NORMAL, "Obj_Grass_Carry") +/* 0x10D */ DEFINE_ACTOR(Obj_Grass_Unit, ACTOR_OBJ_GRASS_UNIT, ALLOCTYPE_NORMAL, "Obj_Grass_Unit") +/* 0x10E */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_10E) +/* 0x10F */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_10F) +/* 0x110 */ DEFINE_ACTOR(Bg_Fire_Wall, ACTOR_BG_FIRE_WALL, ALLOCTYPE_NORMAL, "Bg_Fire_Wall") +/* 0x111 */ DEFINE_ACTOR(En_Bu, ACTOR_EN_BU, ALLOCTYPE_NORMAL, "En_Bu") +/* 0x112 */ DEFINE_ACTOR(En_Encount3, ACTOR_EN_ENCOUNT3, ALLOCTYPE_NORMAL, "En_Encount3") +/* 0x113 */ DEFINE_ACTOR(En_Jso, ACTOR_EN_JSO, ALLOCTYPE_NORMAL, "En_Jso") +/* 0x114 */ DEFINE_ACTOR(Obj_Chikuwa, ACTOR_OBJ_CHIKUWA, ALLOCTYPE_NORMAL, "Obj_Chikuwa") +/* 0x115 */ DEFINE_ACTOR(En_Knight, ACTOR_EN_KNIGHT, ALLOCTYPE_NORMAL, "En_Knight") +/* 0x116 */ DEFINE_ACTOR(En_Warp_tag, ACTOR_EN_WARP_TAG, ALLOCTYPE_NORMAL, "En_Warp_tag") +/* 0x117 */ DEFINE_ACTOR(En_Aob_01, ACTOR_EN_AOB_01, ALLOCTYPE_NORMAL, "En_Aob_01") +/* 0x118 */ DEFINE_ACTOR(En_Boj_01, ACTOR_EN_BOJ_01, ALLOCTYPE_NORMAL, "En_Boj_01") +/* 0x119 */ DEFINE_ACTOR(En_Boj_02, ACTOR_EN_BOJ_02, ALLOCTYPE_NORMAL, "En_Boj_02") +/* 0x11A */ DEFINE_ACTOR(En_Boj_03, ACTOR_EN_BOJ_03, ALLOCTYPE_NORMAL, "En_Boj_03") +/* 0x11B */ DEFINE_ACTOR(En_Encount4, ACTOR_EN_ENCOUNT4, ALLOCTYPE_NORMAL, "En_Encount4") +/* 0x11C */ DEFINE_ACTOR(En_Bom_Bowl_Man, ACTOR_EN_BOM_BOWL_MAN, ALLOCTYPE_NORMAL, "En_Bom_Bowl_Man") +/* 0x11D */ DEFINE_ACTOR(En_Syateki_Man, ACTOR_EN_SYATEKI_MAN, ALLOCTYPE_NORMAL, "En_Syateki_Man") +/* 0x11E */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_11E) +/* 0x11F */ DEFINE_ACTOR(Bg_Icicle, ACTOR_BG_ICICLE, ALLOCTYPE_NORMAL, "Bg_Icicle") +/* 0x120 */ DEFINE_ACTOR(En_Syateki_Crow, ACTOR_EN_SYATEKI_CROW, ALLOCTYPE_NORMAL, "En_Syateki_Crow") +/* 0x121 */ DEFINE_ACTOR(En_Boj_04, ACTOR_EN_BOJ_04, ALLOCTYPE_NORMAL, "En_Boj_04") +/* 0x122 */ DEFINE_ACTOR(En_Cne_01, ACTOR_EN_CNE_01, ALLOCTYPE_NORMAL, "En_Cne_01") +/* 0x123 */ DEFINE_ACTOR(En_Bba_01, ACTOR_EN_BBA_01, ALLOCTYPE_NORMAL, "En_Bba_01") +/* 0x124 */ DEFINE_ACTOR(En_Bji_01, ACTOR_EN_BJI_01, ALLOCTYPE_NORMAL, "En_Bji_01") +/* 0x125 */ DEFINE_ACTOR(Bg_Spdweb, ACTOR_BG_SPDWEB, ALLOCTYPE_NORMAL, "Bg_Spdweb") +/* 0x126 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_126) +/* 0x127 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_127) +/* 0x128 */ DEFINE_ACTOR(En_Mt_tag, ACTOR_EN_MT_TAG, ALLOCTYPE_NORMAL, "En_Mt_tag") +/* 0x129 */ DEFINE_ACTOR(Boss_01, ACTOR_BOSS_01, ALLOCTYPE_NORMAL, "Boss_01") +/* 0x12A */ DEFINE_ACTOR(Boss_02, ACTOR_BOSS_02, ALLOCTYPE_NORMAL, "Boss_02") +/* 0x12B */ DEFINE_ACTOR(Boss_03, ACTOR_BOSS_03, ALLOCTYPE_NORMAL, "Boss_03") +/* 0x12C */ DEFINE_ACTOR(Boss_04, ACTOR_BOSS_04, ALLOCTYPE_NORMAL, "Boss_04") +/* 0x12D */ DEFINE_ACTOR(Boss_05, ACTOR_BOSS_05, ALLOCTYPE_NORMAL, "Boss_05") +/* 0x12E */ DEFINE_ACTOR(Boss_06, ACTOR_BOSS_06, ALLOCTYPE_NORMAL, "Boss_06") +/* 0x12F */ DEFINE_ACTOR(Boss_07, ACTOR_BOSS_07, ALLOCTYPE_NORMAL, "Boss_07") +/* 0x130 */ DEFINE_ACTOR(Bg_Dy_Yoseizo, ACTOR_BG_DY_YOSEIZO, ALLOCTYPE_NORMAL, "Bg_Dy_Yoseizo") +/* 0x131 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_131) +/* 0x132 */ DEFINE_ACTOR(En_Boj_05, ACTOR_EN_BOJ_05, ALLOCTYPE_NORMAL, "En_Boj_05") +/* 0x133 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_133) +/* 0x134 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_134) +/* 0x135 */ DEFINE_ACTOR(En_Sob1, ACTOR_EN_SOB1, ALLOCTYPE_NORMAL, "En_Sob1") +/* 0x136 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_136) +/* 0x137 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_137) +/* 0x138 */ DEFINE_ACTOR(En_Go, ACTOR_EN_GO, ALLOCTYPE_NORMAL, "En_Go") +/* 0x139 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_139) +/* 0x13A */ DEFINE_ACTOR(En_Raf, ACTOR_EN_RAF, ALLOCTYPE_NORMAL, "En_Raf") +/* 0x13B */ DEFINE_ACTOR(Obj_Funen, ACTOR_OBJ_FUNEN, ALLOCTYPE_NORMAL, "Obj_Funen") +/* 0x13C */ DEFINE_ACTOR(Obj_Raillift, ACTOR_OBJ_RAILLIFT, ALLOCTYPE_NORMAL, "Obj_Raillift") +/* 0x13D */ DEFINE_ACTOR(Bg_Numa_Hana, ACTOR_BG_NUMA_HANA, ALLOCTYPE_NORMAL, "Bg_Numa_Hana") +/* 0x13E */ DEFINE_ACTOR(Obj_Flowerpot, ACTOR_OBJ_FLOWERPOT, ALLOCTYPE_NORMAL, "Obj_Flowerpot") +/* 0x13F */ DEFINE_ACTOR(Obj_Spinyroll, ACTOR_OBJ_SPINYROLL, ALLOCTYPE_NORMAL, "Obj_Spinyroll") +/* 0x140 */ DEFINE_ACTOR(Dm_Hina, ACTOR_DM_HINA, ALLOCTYPE_NORMAL, "Dm_Hina") +/* 0x141 */ DEFINE_ACTOR(En_Syateki_Wf, ACTOR_EN_SYATEKI_WF, ALLOCTYPE_NORMAL, "En_Syateki_Wf") +/* 0x142 */ DEFINE_ACTOR(Obj_Skateblock, ACTOR_OBJ_SKATEBLOCK, ALLOCTYPE_NORMAL, "Obj_Skateblock") +/* 0x143 */ DEFINE_ACTOR(Obj_Iceblock, ACTOR_OBJ_ICEBLOCK, ALLOCTYPE_NORMAL, "Obj_Iceblock") +/* 0x144 */ DEFINE_ACTOR(En_Bigpamet, ACTOR_EN_BIGPAMET, ALLOCTYPE_NORMAL, "En_Bigpamet") +/* 0x145 */ DEFINE_ACTOR(En_Syateki_Dekunuts, ACTOR_EN_SYATEKI_DEKUNUTS, ALLOCTYPE_NORMAL, "En_Syateki_Dekunuts") +/* 0x146 */ DEFINE_ACTOR(Elf_Msg3, ACTOR_ELF_MSG3, ALLOCTYPE_NORMAL, "Elf_Msg3") +/* 0x147 */ DEFINE_ACTOR(En_Fg, ACTOR_EN_FG, ALLOCTYPE_NORMAL, "En_Fg") +/* 0x148 */ DEFINE_ACTOR(Dm_Ravine, ACTOR_DM_RAVINE, ALLOCTYPE_NORMAL, "Dm_Ravine") +/* 0x149 */ DEFINE_ACTOR(Dm_Sa, ACTOR_DM_SA, ALLOCTYPE_NORMAL, "Dm_Sa") +/* 0x14A */ DEFINE_ACTOR(En_Slime, ACTOR_EN_SLIME, ALLOCTYPE_NORMAL, "En_Slime") +/* 0x14B */ DEFINE_ACTOR(En_Pr, ACTOR_EN_PR, ALLOCTYPE_NORMAL, "En_Pr") +/* 0x14C */ DEFINE_ACTOR(Obj_Toudai, ACTOR_OBJ_TOUDAI, ALLOCTYPE_NORMAL, "Obj_Toudai") +/* 0x14D */ DEFINE_ACTOR(Obj_Entotu, ACTOR_OBJ_ENTOTU, ALLOCTYPE_NORMAL, "Obj_Entotu") +/* 0x14E */ DEFINE_ACTOR(Obj_Bell, ACTOR_OBJ_BELL, ALLOCTYPE_NORMAL, "Obj_Bell") +/* 0x14F */ DEFINE_ACTOR(En_Syateki_Okuta, ACTOR_EN_SYATEKI_OKUTA, ALLOCTYPE_NORMAL, "En_Syateki_Okuta") +/* 0x150 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_150) +/* 0x151 */ DEFINE_ACTOR(Obj_Shutter, ACTOR_OBJ_SHUTTER, ALLOCTYPE_NORMAL, "Obj_Shutter") +/* 0x152 */ DEFINE_ACTOR(Dm_Zl, ACTOR_DM_ZL, ALLOCTYPE_NORMAL, "Dm_Zl") +/* 0x153 */ DEFINE_ACTOR(En_Elfgrp, ACTOR_EN_ELFGRP, ALLOCTYPE_NORMAL, "En_Elfgrp") +/* 0x154 */ DEFINE_ACTOR(Dm_Tsg, ACTOR_DM_TSG, ALLOCTYPE_NORMAL, "Dm_Tsg") +/* 0x155 */ DEFINE_ACTOR(En_Baguo, ACTOR_EN_BAGUO, ALLOCTYPE_NORMAL, "En_Baguo") +/* 0x156 */ DEFINE_ACTOR(Obj_Vspinyroll, ACTOR_OBJ_VSPINYROLL, ALLOCTYPE_NORMAL, "Obj_Vspinyroll") +/* 0x157 */ DEFINE_ACTOR(Obj_Smork, ACTOR_OBJ_SMORK, ALLOCTYPE_NORMAL, "Obj_Smork") +/* 0x158 */ DEFINE_ACTOR(En_Test2, ACTOR_EN_TEST2, ALLOCTYPE_NORMAL, "En_Test2") +/* 0x159 */ DEFINE_ACTOR(En_Test3, ACTOR_EN_TEST3, ALLOCTYPE_NORMAL, "En_Test3") +/* 0x15A */ DEFINE_ACTOR(En_Test4, ACTOR_EN_TEST4, ALLOCTYPE_NORMAL, "En_Test4") +/* 0x15B */ DEFINE_ACTOR(En_Bat, ACTOR_EN_BAT, ALLOCTYPE_NORMAL, "En_Bat") +/* 0x15C */ DEFINE_ACTOR(En_Sekihi, ACTOR_EN_SEKIHI, ALLOCTYPE_NORMAL, "En_Sekihi") +/* 0x15D */ DEFINE_ACTOR(En_Wiz, ACTOR_EN_WIZ, ALLOCTYPE_NORMAL, "En_Wiz") +/* 0x15E */ DEFINE_ACTOR(En_Wiz_Brock, ACTOR_EN_WIZ_BROCK, ALLOCTYPE_NORMAL, "En_Wiz_Brock") +/* 0x15F */ DEFINE_ACTOR(En_Wiz_Fire, ACTOR_EN_WIZ_FIRE, ALLOCTYPE_NORMAL, "En_Wiz_Fire") +/* 0x160 */ DEFINE_ACTOR(Eff_Change, ACTOR_EFF_CHANGE, ALLOCTYPE_NORMAL, "Eff_Change") +/* 0x161 */ DEFINE_ACTOR(Dm_Statue, ACTOR_DM_STATUE, ALLOCTYPE_NORMAL, "Dm_Statue") +/* 0x162 */ DEFINE_ACTOR(Obj_Fireshield, ACTOR_OBJ_FIRESHIELD, ALLOCTYPE_NORMAL, "Obj_Fireshield") +/* 0x163 */ DEFINE_ACTOR(Bg_Ladder, ACTOR_BG_LADDER, ALLOCTYPE_NORMAL, "Bg_Ladder") +/* 0x164 */ DEFINE_ACTOR(En_Mkk, ACTOR_EN_MKK, ALLOCTYPE_NORMAL, "En_Mkk") +/* 0x165 */ DEFINE_ACTOR(Demo_Getitem, ACTOR_DEMO_GETITEM, ALLOCTYPE_NORMAL, "Demo_Getitem") +/* 0x166 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_166) +/* 0x167 */ DEFINE_ACTOR(En_Dnb, ACTOR_EN_DNB, ALLOCTYPE_NORMAL, "En_Dnb") +/* 0x168 */ DEFINE_ACTOR(En_Dnh, ACTOR_EN_DNH, ALLOCTYPE_NORMAL, "En_Dnh") +/* 0x169 */ DEFINE_ACTOR(En_Dnk, ACTOR_EN_DNK, ALLOCTYPE_NORMAL, "En_Dnk") +/* 0x16A */ DEFINE_ACTOR(En_Dnq, ACTOR_EN_DNQ, ALLOCTYPE_NORMAL, "En_Dnq") +/* 0x16B */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_16B) +/* 0x16C */ DEFINE_ACTOR(Bg_Keikoku_Saku, ACTOR_BG_KEIKOKU_SAKU, ALLOCTYPE_NORMAL, "Bg_Keikoku_Saku") +/* 0x16D */ DEFINE_ACTOR(Obj_Hugebombiwa, ACTOR_OBJ_HUGEBOMBIWA, ALLOCTYPE_NORMAL, "Obj_Hugebombiwa") +/* 0x16E */ DEFINE_ACTOR(En_Firefly2, ACTOR_EN_FIREFLY2, ALLOCTYPE_NORMAL, "En_Firefly2") +/* 0x16F */ DEFINE_ACTOR(En_Rat, ACTOR_EN_RAT, ALLOCTYPE_NORMAL, "En_Rat") +/* 0x170 */ DEFINE_ACTOR(En_Water_Effect, ACTOR_EN_WATER_EFFECT, ALLOCTYPE_NORMAL, "En_Water_Effect") +/* 0x171 */ DEFINE_ACTOR(En_Kusa2, ACTOR_EN_KUSA2, ALLOCTYPE_NORMAL, "En_Kusa2") +/* 0x172 */ DEFINE_ACTOR(Bg_Spout_Fire, ACTOR_BG_SPOUT_FIRE, ALLOCTYPE_NORMAL, "Bg_Spout_Fire") +/* 0x173 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_173) +/* 0x174 */ DEFINE_ACTOR(Bg_Dblue_Movebg, ACTOR_BG_DBLUE_MOVEBG, ALLOCTYPE_NORMAL, "Bg_Dblue_Movebg") +/* 0x175 */ DEFINE_ACTOR(En_Dy_Extra, ACTOR_EN_DY_EXTRA, ALLOCTYPE_NORMAL, "En_Dy_Extra") +/* 0x176 */ DEFINE_ACTOR(En_Bal, ACTOR_EN_BAL, ALLOCTYPE_NORMAL, "En_Bal") +/* 0x177 */ DEFINE_ACTOR(En_Ginko_Man, ACTOR_EN_GINKO_MAN, ALLOCTYPE_NORMAL, "En_Ginko_Man") +/* 0x178 */ DEFINE_ACTOR(En_Warp_Uzu, ACTOR_EN_WARP_UZU, ALLOCTYPE_NORMAL, "En_Warp_Uzu") +/* 0x179 */ DEFINE_ACTOR(Obj_Driftice, ACTOR_OBJ_DRIFTICE, ALLOCTYPE_NORMAL, "Obj_Driftice") +/* 0x17A */ DEFINE_ACTOR(En_Look_Nuts, ACTOR_EN_LOOK_NUTS, ALLOCTYPE_NORMAL, "En_Look_Nuts") +/* 0x17B */ DEFINE_ACTOR(En_Mushi2, ACTOR_EN_MUSHI2, ALLOCTYPE_NORMAL, "En_Mushi2") +/* 0x17C */ DEFINE_ACTOR(En_Fall, ACTOR_EN_FALL, ALLOCTYPE_NORMAL, "En_Fall") +/* 0x17D */ DEFINE_ACTOR(En_Mm3, ACTOR_EN_MM3, ALLOCTYPE_NORMAL, "En_Mm3") +/* 0x17E */ DEFINE_ACTOR(Bg_Crace_Movebg, ACTOR_BG_CRACE_MOVEBG, ALLOCTYPE_NORMAL, "Bg_Crace_Movebg") +/* 0x17F */ DEFINE_ACTOR(En_Dno, ACTOR_EN_DNO, ALLOCTYPE_NORMAL, "En_Dno") +/* 0x180 */ DEFINE_ACTOR(En_Pr2, ACTOR_EN_PR2, ALLOCTYPE_NORMAL, "En_Pr2") +/* 0x181 */ DEFINE_ACTOR(En_Prz, ACTOR_EN_PRZ, ALLOCTYPE_NORMAL, "En_Prz") +/* 0x182 */ DEFINE_ACTOR(En_Jso2, ACTOR_EN_JSO2, ALLOCTYPE_NORMAL, "En_Jso2") +/* 0x183 */ DEFINE_ACTOR(Obj_Etcetera, ACTOR_OBJ_ETCETERA, ALLOCTYPE_NORMAL, "Obj_Etcetera") +/* 0x184 */ DEFINE_ACTOR(En_Egol, ACTOR_EN_EGOL, ALLOCTYPE_NORMAL, "En_Egol") +/* 0x185 */ DEFINE_ACTOR(Obj_Mine, ACTOR_OBJ_MINE, ALLOCTYPE_NORMAL, "Obj_Mine") +/* 0x186 */ DEFINE_ACTOR(Obj_Purify, ACTOR_OBJ_PURIFY, ALLOCTYPE_NORMAL, "Obj_Purify") +/* 0x187 */ DEFINE_ACTOR(En_Tru, ACTOR_EN_TRU, ALLOCTYPE_NORMAL, "En_Tru") +/* 0x188 */ DEFINE_ACTOR(En_Trt, ACTOR_EN_TRT, ALLOCTYPE_NORMAL, "En_Trt") +/* 0x189 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_189) +/* 0x18A */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_18A) +/* 0x18B */ DEFINE_ACTOR(En_Test5, ACTOR_EN_TEST5, ALLOCTYPE_NORMAL, "En_Test5") +/* 0x18C */ DEFINE_ACTOR(En_Test6, ACTOR_EN_TEST6, ALLOCTYPE_NORMAL, "En_Test6") +/* 0x18D */ DEFINE_ACTOR(En_Az, ACTOR_EN_AZ, ALLOCTYPE_NORMAL, "En_Az") +/* 0x18E */ DEFINE_ACTOR(En_Estone, ACTOR_EN_ESTONE, ALLOCTYPE_NORMAL, "En_Estone") +/* 0x18F */ DEFINE_ACTOR(Bg_Hakugin_Post, ACTOR_BG_HAKUGIN_POST, ALLOCTYPE_NORMAL, "Bg_Hakugin_Post") +/* 0x190 */ DEFINE_ACTOR(Dm_Opstage, ACTOR_DM_OPSTAGE, ALLOCTYPE_NORMAL, "Dm_Opstage") +/* 0x191 */ DEFINE_ACTOR(Dm_Stk, ACTOR_DM_STK, ALLOCTYPE_NORMAL, "Dm_Stk") +/* 0x192 */ DEFINE_ACTOR(Dm_Char00, ACTOR_DM_CHAR00, ALLOCTYPE_NORMAL, "Dm_Char00") +/* 0x193 */ DEFINE_ACTOR(Dm_Char01, ACTOR_DM_CHAR01, ALLOCTYPE_NORMAL, "Dm_Char01") +/* 0x194 */ DEFINE_ACTOR(Dm_Char02, ACTOR_DM_CHAR02, ALLOCTYPE_NORMAL, "Dm_Char02") +/* 0x195 */ DEFINE_ACTOR(Dm_Char03, ACTOR_DM_CHAR03, ALLOCTYPE_NORMAL, "Dm_Char03") +/* 0x196 */ DEFINE_ACTOR(Dm_Char04, ACTOR_DM_CHAR04, ALLOCTYPE_NORMAL, "Dm_Char04") +/* 0x197 */ DEFINE_ACTOR(Dm_Char05, ACTOR_DM_CHAR05, ALLOCTYPE_NORMAL, "Dm_Char05") +/* 0x198 */ DEFINE_ACTOR(Dm_Char06, ACTOR_DM_CHAR06, ALLOCTYPE_NORMAL, "Dm_Char06") +/* 0x199 */ DEFINE_ACTOR(Dm_Char07, ACTOR_DM_CHAR07, ALLOCTYPE_NORMAL, "Dm_Char07") +/* 0x19A */ DEFINE_ACTOR(Dm_Char08, ACTOR_DM_CHAR08, ALLOCTYPE_NORMAL, "Dm_Char08") +/* 0x19B */ DEFINE_ACTOR(Dm_Char09, ACTOR_DM_CHAR09, ALLOCTYPE_NORMAL, "Dm_Char09") +/* 0x19C */ DEFINE_ACTOR(Obj_Tokeidai, ACTOR_OBJ_TOKEIDAI, ALLOCTYPE_NORMAL, "Obj_Tokeidai") +/* 0x19D */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_19D) +/* 0x19E */ DEFINE_ACTOR(En_Mnk, ACTOR_EN_MNK, ALLOCTYPE_NORMAL, "En_Mnk") +/* 0x19F */ DEFINE_ACTOR(En_Egblock, ACTOR_EN_EGBLOCK, ALLOCTYPE_NORMAL, "En_Egblock") +/* 0x1A0 */ DEFINE_ACTOR(En_Guard_Nuts, ACTOR_EN_GUARD_NUTS, ALLOCTYPE_NORMAL, "En_Guard_Nuts") +/* 0x1A1 */ DEFINE_ACTOR(Bg_Hakugin_Bombwall, ACTOR_BG_HAKUGIN_BOMBWALL, ALLOCTYPE_NORMAL, "Bg_Hakugin_Bombwall") +/* 0x1A2 */ DEFINE_ACTOR(Obj_Tokei_Tobira, ACTOR_OBJ_TOKEI_TOBIRA, ALLOCTYPE_NORMAL, "Obj_Tokei_Tobira") +/* 0x1A3 */ DEFINE_ACTOR(Bg_Hakugin_Elvpole, ACTOR_BG_HAKUGIN_ELVPOLE, ALLOCTYPE_NORMAL, "Bg_Hakugin_Elvpole") +/* 0x1A4 */ DEFINE_ACTOR(En_Ma4, ACTOR_EN_MA4, ALLOCTYPE_NORMAL, "En_Ma4") +/* 0x1A5 */ DEFINE_ACTOR(En_Twig, ACTOR_EN_TWIG, ALLOCTYPE_NORMAL, "En_Twig") +/* 0x1A6 */ DEFINE_ACTOR(En_Po_Fusen, ACTOR_EN_PO_FUSEN, ALLOCTYPE_NORMAL, "En_Po_Fusen") +/* 0x1A7 */ DEFINE_ACTOR(En_Door_Etc, ACTOR_EN_DOOR_ETC, ALLOCTYPE_NORMAL, "En_Door_Etc") +/* 0x1A8 */ DEFINE_ACTOR(En_Bigokuta, ACTOR_EN_BIGOKUTA, ALLOCTYPE_NORMAL, "En_Bigokuta") +/* 0x1A9 */ DEFINE_ACTOR(Bg_Icefloe, ACTOR_BG_ICEFLOE, ALLOCTYPE_NORMAL, "Bg_Icefloe") +/* 0x1AA */ DEFINE_ACTOR(Obj_Ocarinalift, ACTOR_OBJ_OCARINALIFT, ALLOCTYPE_NORMAL, "Obj_Ocarinalift") +/* 0x1AB */ DEFINE_ACTOR(En_Time_Tag, ACTOR_EN_TIME_TAG, ALLOCTYPE_NORMAL, "En_Time_Tag") +/* 0x1AC */ DEFINE_ACTOR(Bg_Open_Shutter, ACTOR_BG_OPEN_SHUTTER, ALLOCTYPE_NORMAL, "Bg_Open_Shutter") +/* 0x1AD */ DEFINE_ACTOR(Bg_Open_Spot, ACTOR_BG_OPEN_SPOT, ALLOCTYPE_NORMAL, "Bg_Open_Spot") +/* 0x1AE */ DEFINE_ACTOR(Bg_Fu_Kaiten, ACTOR_BG_FU_KAITEN, ALLOCTYPE_NORMAL, "Bg_Fu_Kaiten") +/* 0x1AF */ DEFINE_ACTOR(Obj_Aqua, ACTOR_OBJ_AQUA, ALLOCTYPE_NORMAL, "Obj_Aqua") +/* 0x1B0 */ DEFINE_ACTOR(En_Elforg, ACTOR_EN_ELFORG, ALLOCTYPE_NORMAL, "En_Elforg") +/* 0x1B1 */ DEFINE_ACTOR(En_Elfbub, ACTOR_EN_ELFBUB, ALLOCTYPE_NORMAL, "En_Elfbub") +/* 0x1B2 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_1B2) +/* 0x1B3 */ DEFINE_ACTOR(En_Fu_Mato, ACTOR_EN_FU_MATO, ALLOCTYPE_NORMAL, "En_Fu_Mato") +/* 0x1B4 */ DEFINE_ACTOR(En_Fu_Kago, ACTOR_EN_FU_KAGO, ALLOCTYPE_NORMAL, "En_Fu_Kago") +/* 0x1B5 */ DEFINE_ACTOR(En_Osn, ACTOR_EN_OSN, ALLOCTYPE_NORMAL, "En_Osn") +/* 0x1B6 */ DEFINE_ACTOR(Bg_Ctower_Gear, ACTOR_BG_CTOWER_GEAR, ALLOCTYPE_NORMAL, "Bg_Ctower_Gear") +/* 0x1B7 */ DEFINE_ACTOR(En_Trt2, ACTOR_EN_TRT2, ALLOCTYPE_NORMAL, "En_Trt2") +/* 0x1B8 */ DEFINE_ACTOR(Obj_Tokei_Step, ACTOR_OBJ_TOKEI_STEP, ALLOCTYPE_NORMAL, "Obj_Tokei_Step") +/* 0x1B9 */ DEFINE_ACTOR(Bg_Lotus, ACTOR_BG_LOTUS, ALLOCTYPE_NORMAL, "Bg_Lotus") +/* 0x1BA */ DEFINE_ACTOR(En_Kame, ACTOR_EN_KAME, ALLOCTYPE_NORMAL, "En_Kame") +/* 0x1BB */ DEFINE_ACTOR(Obj_Takaraya_Wall, ACTOR_OBJ_TAKARAYA_WALL, ALLOCTYPE_NORMAL, "Obj_Takaraya_Wall") +/* 0x1BC */ DEFINE_ACTOR(Bg_Fu_Mizu, ACTOR_BG_FU_MIZU, ALLOCTYPE_NORMAL, "Bg_Fu_Mizu") +/* 0x1BD */ DEFINE_ACTOR(En_Sellnuts, ACTOR_EN_SELLNUTS, ALLOCTYPE_NORMAL, "En_Sellnuts") +/* 0x1BE */ DEFINE_ACTOR(Bg_Dkjail_Ivy, ACTOR_BG_DKJAIL_IVY, ALLOCTYPE_NORMAL, "Bg_Dkjail_Ivy") +/* 0x1BF */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_1BF) +/* 0x1C0 */ DEFINE_ACTOR(Obj_Visiblock, ACTOR_OBJ_VISIBLOCK, ALLOCTYPE_NORMAL, "Obj_Visiblock") +/* 0x1C1 */ DEFINE_ACTOR(En_Takaraya, ACTOR_EN_TAKARAYA, ALLOCTYPE_NORMAL, "En_Takaraya") +/* 0x1C2 */ DEFINE_ACTOR(En_Tsn, ACTOR_EN_TSN, ALLOCTYPE_NORMAL, "En_Tsn") +/* 0x1C3 */ DEFINE_ACTOR(En_Ds2n, ACTOR_EN_DS2N, ALLOCTYPE_NORMAL, "En_Ds2n") +/* 0x1C4 */ DEFINE_ACTOR(En_Fsn, ACTOR_EN_FSN, ALLOCTYPE_NORMAL, "En_Fsn") +/* 0x1C5 */ DEFINE_ACTOR(En_Shn, ACTOR_EN_SHN, ALLOCTYPE_NORMAL, "En_Shn") +/* 0x1C6 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_1C6) +/* 0x1C7 */ DEFINE_ACTOR(En_Stop_heishi, ACTOR_EN_STOP_HEISHI, ALLOCTYPE_NORMAL, "En_Stop_heishi") +/* 0x1C8 */ DEFINE_ACTOR(Obj_Bigicicle, ACTOR_OBJ_BIGICICLE, ALLOCTYPE_NORMAL, "Obj_Bigicicle") +/* 0x1C9 */ DEFINE_ACTOR(En_Lift_Nuts, ACTOR_EN_LIFT_NUTS, ALLOCTYPE_NORMAL, "En_Lift_Nuts") +/* 0x1CA */ DEFINE_ACTOR(En_Tk, ACTOR_EN_TK, ALLOCTYPE_NORMAL, "En_Tk") +/* 0x1CB */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_1CB) +/* 0x1CC */ DEFINE_ACTOR(Bg_Market_Step, ACTOR_BG_MARKET_STEP, ALLOCTYPE_NORMAL, "Bg_Market_Step") +/* 0x1CD */ DEFINE_ACTOR(Obj_Lupygamelift, ACTOR_OBJ_LUPYGAMELIFT, ALLOCTYPE_NORMAL, "Obj_Lupygamelift") +/* 0x1CE */ DEFINE_ACTOR(En_Test7, ACTOR_EN_TEST7, ALLOCTYPE_NORMAL, "En_Test7") +/* 0x1CF */ DEFINE_ACTOR(Obj_Lightblock, ACTOR_OBJ_LIGHTBLOCK, ALLOCTYPE_NORMAL, "Obj_Lightblock") +/* 0x1D0 */ DEFINE_ACTOR(Mir_Ray2, ACTOR_MIR_RAY2, ALLOCTYPE_NORMAL, "Mir_Ray2") +/* 0x1D1 */ DEFINE_ACTOR(En_Wdhand, ACTOR_EN_WDHAND, ALLOCTYPE_NORMAL, "En_Wdhand") +/* 0x1D2 */ DEFINE_ACTOR(En_Gamelupy, ACTOR_EN_GAMELUPY, ALLOCTYPE_NORMAL, "En_Gamelupy") +/* 0x1D3 */ DEFINE_ACTOR(Bg_Danpei_Movebg, ACTOR_BG_DANPEI_MOVEBG, ALLOCTYPE_NORMAL, "Bg_Danpei_Movebg") +/* 0x1D4 */ DEFINE_ACTOR(En_Snowwd, ACTOR_EN_SNOWWD, ALLOCTYPE_NORMAL, "En_Snowwd") +/* 0x1D5 */ DEFINE_ACTOR(En_Pm, ACTOR_EN_PM, ALLOCTYPE_NORMAL, "En_Pm") +/* 0x1D6 */ DEFINE_ACTOR(En_Gakufu, ACTOR_EN_GAKUFU, ALLOCTYPE_NORMAL, "En_Gakufu") +/* 0x1D7 */ DEFINE_ACTOR(Elf_Msg4, ACTOR_ELF_MSG4, ALLOCTYPE_NORMAL, "Elf_Msg4") +/* 0x1D8 */ DEFINE_ACTOR(Elf_Msg5, ACTOR_ELF_MSG5, ALLOCTYPE_NORMAL, "Elf_Msg5") +/* 0x1D9 */ DEFINE_ACTOR(En_Col_Man, ACTOR_EN_COL_MAN, ALLOCTYPE_NORMAL, "En_Col_Man") +/* 0x1DA */ DEFINE_ACTOR(En_Talk_Gibud, ACTOR_EN_TALK_GIBUD, ALLOCTYPE_NORMAL, "En_Talk_Gibud") +/* 0x1DB */ DEFINE_ACTOR(En_Giant, ACTOR_EN_GIANT, ALLOCTYPE_NORMAL, "En_Giant") +/* 0x1DC */ DEFINE_ACTOR(Obj_Snowball, ACTOR_OBJ_SNOWBALL, ALLOCTYPE_NORMAL, "Obj_Snowball") +/* 0x1DD */ DEFINE_ACTOR(Boss_Hakugin, ACTOR_BOSS_HAKUGIN, ALLOCTYPE_NORMAL, "Boss_Hakugin") +/* 0x1DE */ DEFINE_ACTOR(En_Gb2, ACTOR_EN_GB2, ALLOCTYPE_NORMAL, "En_Gb2") +/* 0x1DF */ DEFINE_ACTOR(En_Onpuman, ACTOR_EN_ONPUMAN, ALLOCTYPE_NORMAL, "En_Onpuman") +/* 0x1E0 */ DEFINE_ACTOR(Bg_Tobira01, ACTOR_BG_TOBIRA01, ALLOCTYPE_NORMAL, "Bg_Tobira01") +/* 0x1E1 */ DEFINE_ACTOR(En_Tag_Obj, ACTOR_EN_TAG_OBJ, ALLOCTYPE_NORMAL, "En_Tag_Obj") +/* 0x1E2 */ DEFINE_ACTOR(Obj_Dhouse, ACTOR_OBJ_DHOUSE, ALLOCTYPE_NORMAL, "Obj_Dhouse") +/* 0x1E3 */ DEFINE_ACTOR(Obj_Hakaisi, ACTOR_OBJ_HAKAISI, ALLOCTYPE_NORMAL, "Obj_Hakaisi") +/* 0x1E4 */ DEFINE_ACTOR(Bg_Hakugin_Switch, ACTOR_BG_HAKUGIN_SWITCH, ALLOCTYPE_NORMAL, "Bg_Hakugin_Switch") +/* 0x1E5 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_1E5) +/* 0x1E6 */ DEFINE_ACTOR(En_Snowman, ACTOR_EN_SNOWMAN, ALLOCTYPE_NORMAL, "En_Snowman") +/* 0x1E7 */ DEFINE_ACTOR(TG_Sw, ACTOR_TG_SW, ALLOCTYPE_NORMAL, "TG_Sw") +/* 0x1E8 */ DEFINE_ACTOR(En_Po_Sisters, ACTOR_EN_PO_SISTERS, ALLOCTYPE_NORMAL, "En_Po_Sisters") +/* 0x1E9 */ DEFINE_ACTOR(En_Pp, ACTOR_EN_PP, ALLOCTYPE_NORMAL, "En_Pp") +/* 0x1EA */ DEFINE_ACTOR(En_Hakurock, ACTOR_EN_HAKUROCK, ALLOCTYPE_NORMAL, "En_Hakurock") +/* 0x1EB */ DEFINE_ACTOR(En_Hanabi, ACTOR_EN_HANABI, ALLOCTYPE_NORMAL, "En_Hanabi") +/* 0x1EC */ DEFINE_ACTOR(Obj_Dowsing, ACTOR_OBJ_DOWSING, ALLOCTYPE_NORMAL, "Obj_Dowsing") +/* 0x1ED */ DEFINE_ACTOR(Obj_Wind, ACTOR_OBJ_WIND, ALLOCTYPE_NORMAL, "Obj_Wind") +/* 0x1EE */ DEFINE_ACTOR(En_Racedog, ACTOR_EN_RACEDOG, ALLOCTYPE_NORMAL, "En_Racedog") +/* 0x1EF */ DEFINE_ACTOR(En_Kendo_Js, ACTOR_EN_KENDO_JS, ALLOCTYPE_NORMAL, "En_Kendo_Js") +/* 0x1F0 */ DEFINE_ACTOR(Bg_Botihasira, ACTOR_BG_BOTIHASIRA, ALLOCTYPE_NORMAL, "Bg_Botihasira") +/* 0x1F1 */ DEFINE_ACTOR(En_Fish2, ACTOR_EN_FISH2, ALLOCTYPE_NORMAL, "En_Fish2") +/* 0x1F2 */ DEFINE_ACTOR(En_Pst, ACTOR_EN_PST, ALLOCTYPE_NORMAL, "En_Pst") +/* 0x1F3 */ DEFINE_ACTOR(En_Poh, ACTOR_EN_POH, ALLOCTYPE_NORMAL, "En_Poh") +/* 0x1F4 */ DEFINE_ACTOR(Obj_Spidertent, ACTOR_OBJ_SPIDERTENT, ALLOCTYPE_NORMAL, "Obj_Spidertent") +/* 0x1F5 */ DEFINE_ACTOR(En_Zoraegg, ACTOR_EN_ZORAEGG, ALLOCTYPE_NORMAL, "En_Zoraegg") +/* 0x1F6 */ DEFINE_ACTOR(En_Kbt, ACTOR_EN_KBT, ALLOCTYPE_NORMAL, "En_Kbt") +/* 0x1F7 */ DEFINE_ACTOR(En_Gg, ACTOR_EN_GG, ALLOCTYPE_NORMAL, "En_Gg") +/* 0x1F8 */ DEFINE_ACTOR(En_Maruta, ACTOR_EN_MARUTA, ALLOCTYPE_NORMAL, "En_Maruta") +/* 0x1F9 */ DEFINE_ACTOR(Obj_Snowball2, ACTOR_OBJ_SNOWBALL2, ALLOCTYPE_NORMAL, "Obj_Snowball2") +/* 0x1FA */ DEFINE_ACTOR(En_Gg2, ACTOR_EN_GG2, ALLOCTYPE_NORMAL, "En_Gg2") +/* 0x1FB */ DEFINE_ACTOR(Obj_Ghaka, ACTOR_OBJ_GHAKA, ALLOCTYPE_NORMAL, "Obj_Ghaka") +/* 0x1FC */ DEFINE_ACTOR(En_Dnp, ACTOR_EN_DNP, ALLOCTYPE_NORMAL, "En_Dnp") +/* 0x1FD */ DEFINE_ACTOR(En_Dai, ACTOR_EN_DAI, ALLOCTYPE_NORMAL, "En_Dai") +/* 0x1FE */ DEFINE_ACTOR(Bg_Goron_Oyu, ACTOR_BG_GORON_OYU, ALLOCTYPE_NORMAL, "Bg_Goron_Oyu") +/* 0x1FF */ DEFINE_ACTOR(En_Kgy, ACTOR_EN_KGY, ALLOCTYPE_NORMAL, "En_Kgy") +/* 0x200 */ DEFINE_ACTOR(En_Invadepoh, ACTOR_EN_INVADEPOH, ALLOCTYPE_NORMAL, "En_Invadepoh") +/* 0x201 */ DEFINE_ACTOR(En_Gk, ACTOR_EN_GK, ALLOCTYPE_NORMAL, "En_Gk") +/* 0x202 */ DEFINE_ACTOR(En_An, ACTOR_EN_AN, ALLOCTYPE_NORMAL, "En_An") +/* 0x203 */ DEFINE_ACTOR_UNSET(ACTOR_UNSET_203) +/* 0x204 */ DEFINE_ACTOR(En_Bee, ACTOR_EN_BEE, ALLOCTYPE_NORMAL, "En_Bee") +/* 0x205 */ DEFINE_ACTOR(En_Ot, ACTOR_EN_OT, ALLOCTYPE_NORMAL, "En_Ot") +/* 0x206 */ DEFINE_ACTOR(En_Dragon, ACTOR_EN_DRAGON, ALLOCTYPE_NORMAL, "En_Dragon") +/* 0x207 */ DEFINE_ACTOR(Obj_Dora, ACTOR_OBJ_DORA, ALLOCTYPE_NORMAL, "Obj_Dora") +/* 0x208 */ DEFINE_ACTOR(En_Bigpo, ACTOR_EN_BIGPO, ALLOCTYPE_NORMAL, "En_Bigpo") +/* 0x209 */ DEFINE_ACTOR(Obj_Kendo_Kanban, ACTOR_OBJ_KENDO_KANBAN, ALLOCTYPE_NORMAL, "Obj_Kendo_Kanban") +/* 0x20A */ DEFINE_ACTOR(Obj_Hariko, ACTOR_OBJ_HARIKO, ALLOCTYPE_NORMAL, "Obj_Hariko") +/* 0x20B */ DEFINE_ACTOR(En_Sth, ACTOR_EN_STH, ALLOCTYPE_NORMAL, "En_Sth") +/* 0x20C */ DEFINE_ACTOR(Bg_Sinkai_Kabe, ACTOR_BG_SINKAI_KABE, ALLOCTYPE_NORMAL, "Bg_Sinkai_Kabe") +/* 0x20D */ DEFINE_ACTOR(Bg_Haka_Curtain, ACTOR_BG_HAKA_CURTAIN, ALLOCTYPE_NORMAL, "Bg_Haka_Curtain") +/* 0x20E */ DEFINE_ACTOR(Bg_Kin2_Bombwall, ACTOR_BG_KIN2_BOMBWALL, ALLOCTYPE_NORMAL, "Bg_Kin2_Bombwall") +/* 0x20F */ DEFINE_ACTOR(Bg_Kin2_Fence, ACTOR_BG_KIN2_FENCE, ALLOCTYPE_NORMAL, "Bg_Kin2_Fence") +/* 0x210 */ DEFINE_ACTOR(Bg_Kin2_Picture, ACTOR_BG_KIN2_PICTURE, ALLOCTYPE_NORMAL, "Bg_Kin2_Picture") +/* 0x211 */ DEFINE_ACTOR(Bg_Kin2_Shelf, ACTOR_BG_KIN2_SHELF, ALLOCTYPE_NORMAL, "Bg_Kin2_Shelf") +/* 0x212 */ DEFINE_ACTOR(En_Rail_Skb, ACTOR_EN_RAIL_SKB, ALLOCTYPE_NORMAL, "En_Rail_Skb") +/* 0x213 */ DEFINE_ACTOR(En_Jg, ACTOR_EN_JG, ALLOCTYPE_NORMAL, "En_Jg") +/* 0x214 */ DEFINE_ACTOR(En_Tru_Mt, ACTOR_EN_TRU_MT, ALLOCTYPE_NORMAL, "En_Tru_Mt") +/* 0x215 */ DEFINE_ACTOR(Obj_Um, ACTOR_OBJ_UM, ALLOCTYPE_NORMAL, "Obj_Um") +/* 0x216 */ DEFINE_ACTOR(En_Neo_Reeba, ACTOR_EN_NEO_REEBA, ALLOCTYPE_NORMAL, "En_Neo_Reeba") +/* 0x217 */ DEFINE_ACTOR(Bg_Mbar_Chair, ACTOR_BG_MBAR_CHAIR, ALLOCTYPE_NORMAL, "Bg_Mbar_Chair") +/* 0x218 */ DEFINE_ACTOR(Bg_Ikana_Block, ACTOR_BG_IKANA_BLOCK, ALLOCTYPE_NORMAL, "Bg_Ikana_Block") +/* 0x219 */ DEFINE_ACTOR(Bg_Ikana_Mirror, ACTOR_BG_IKANA_MIRROR, ALLOCTYPE_NORMAL, "Bg_Ikana_Mirror") +/* 0x21A */ DEFINE_ACTOR(Bg_Ikana_Rotaryroom, ACTOR_BG_IKANA_ROTARYROOM, ALLOCTYPE_NORMAL, "Bg_Ikana_Rotaryroom") +/* 0x21B */ DEFINE_ACTOR(Bg_Dblue_Balance, ACTOR_BG_DBLUE_BALANCE, ALLOCTYPE_NORMAL, "Bg_Dblue_Balance") +/* 0x21C */ DEFINE_ACTOR(Bg_Dblue_Waterfall, ACTOR_BG_DBLUE_WATERFALL, ALLOCTYPE_NORMAL, "Bg_Dblue_Waterfall") +/* 0x21D */ DEFINE_ACTOR(En_Kaizoku, ACTOR_EN_KAIZOKU, ALLOCTYPE_NORMAL, "En_Kaizoku") +/* 0x21E */ DEFINE_ACTOR(En_Ge2, ACTOR_EN_GE2, ALLOCTYPE_NORMAL, "En_Ge2") +/* 0x21F */ DEFINE_ACTOR(En_Ma_Yts, ACTOR_EN_MA_YTS, ALLOCTYPE_NORMAL, "En_Ma_Yts") +/* 0x220 */ DEFINE_ACTOR(En_Ma_Yto, ACTOR_EN_MA_YTO, ALLOCTYPE_NORMAL, "En_Ma_Yto") +/* 0x221 */ DEFINE_ACTOR(Obj_Tokei_Turret, ACTOR_OBJ_TOKEI_TURRET, ALLOCTYPE_NORMAL, "Obj_Tokei_Turret") +/* 0x222 */ DEFINE_ACTOR(Bg_Dblue_Elevator, ACTOR_BG_DBLUE_ELEVATOR, ALLOCTYPE_NORMAL, "Bg_Dblue_Elevator") +/* 0x223 */ DEFINE_ACTOR(Obj_Warpstone, ACTOR_OBJ_WARPSTONE, ALLOCTYPE_NORMAL, "Obj_Warpstone") +/* 0x224 */ DEFINE_ACTOR(En_Zog, ACTOR_EN_ZOG, ALLOCTYPE_NORMAL, "En_Zog") +/* 0x225 */ DEFINE_ACTOR(Obj_Rotlift, ACTOR_OBJ_ROTLIFT, ALLOCTYPE_NORMAL, "Obj_Rotlift") +/* 0x226 */ DEFINE_ACTOR(Obj_Jg_Gakki, ACTOR_OBJ_JG_GAKKI, ALLOCTYPE_NORMAL, "Obj_Jg_Gakki") +/* 0x227 */ DEFINE_ACTOR(Bg_Inibs_Movebg, ACTOR_BG_INIBS_MOVEBG, ALLOCTYPE_NORMAL, "Bg_Inibs_Movebg") +/* 0x228 */ DEFINE_ACTOR(En_Zot, ACTOR_EN_ZOT, ALLOCTYPE_NORMAL, "En_Zot") +/* 0x229 */ DEFINE_ACTOR(Obj_Tree, ACTOR_OBJ_TREE, ALLOCTYPE_NORMAL, "Obj_Tree") +/* 0x22A */ DEFINE_ACTOR(Obj_Y2lift, ACTOR_OBJ_Y2LIFT, ALLOCTYPE_NORMAL, "Obj_Y2lift") +/* 0x22B */ DEFINE_ACTOR(Obj_Y2shutter, ACTOR_OBJ_Y2SHUTTER, ALLOCTYPE_NORMAL, "Obj_Y2shutter") +/* 0x22C */ DEFINE_ACTOR(Obj_Boat, ACTOR_OBJ_BOAT, ALLOCTYPE_NORMAL, "Obj_Boat") +/* 0x22D */ DEFINE_ACTOR(Obj_Taru, ACTOR_OBJ_TARU, ALLOCTYPE_NORMAL, "Obj_Taru") +/* 0x22E */ DEFINE_ACTOR(Obj_Hunsui, ACTOR_OBJ_HUNSUI, ALLOCTYPE_NORMAL, "Obj_Hunsui") +/* 0x22F */ DEFINE_ACTOR(En_Jc_Mato, ACTOR_EN_JC_MATO, ALLOCTYPE_NORMAL, "En_Jc_Mato") +/* 0x230 */ DEFINE_ACTOR(Mir_Ray3, ACTOR_MIR_RAY3, ALLOCTYPE_NORMAL, "Mir_Ray3") +/* 0x231 */ DEFINE_ACTOR(En_Zob, ACTOR_EN_ZOB, ALLOCTYPE_NORMAL, "En_Zob") +/* 0x232 */ DEFINE_ACTOR(Elf_Msg6, ACTOR_ELF_MSG6, ALLOCTYPE_NORMAL, "Elf_Msg6") +/* 0x233 */ DEFINE_ACTOR(Obj_Nozoki, ACTOR_OBJ_NOZOKI, ALLOCTYPE_NORMAL, "Obj_Nozoki") +/* 0x234 */ DEFINE_ACTOR(En_Toto, ACTOR_EN_TOTO, ALLOCTYPE_NORMAL, "En_Toto") +/* 0x235 */ DEFINE_ACTOR(En_Railgibud, ACTOR_EN_RAILGIBUD, ALLOCTYPE_NORMAL, "En_Railgibud") +/* 0x236 */ DEFINE_ACTOR(En_Baba, ACTOR_EN_BABA, ALLOCTYPE_NORMAL, "En_Baba") +/* 0x237 */ DEFINE_ACTOR(En_Suttari, ACTOR_EN_SUTTARI, ALLOCTYPE_NORMAL, "En_Suttari") +/* 0x238 */ DEFINE_ACTOR(En_Zod, ACTOR_EN_ZOD, ALLOCTYPE_NORMAL, "En_Zod") +/* 0x239 */ DEFINE_ACTOR(En_Kujiya, ACTOR_EN_KUJIYA, ALLOCTYPE_NORMAL, "En_Kujiya") +/* 0x23A */ DEFINE_ACTOR(En_Geg, ACTOR_EN_GEG, ALLOCTYPE_NORMAL, "En_Geg") +/* 0x23B */ DEFINE_ACTOR(Obj_Kinoko, ACTOR_OBJ_KINOKO, ALLOCTYPE_NORMAL, "Obj_Kinoko") +/* 0x23C */ DEFINE_ACTOR(Obj_Yasi, ACTOR_OBJ_YASI, ALLOCTYPE_NORMAL, "Obj_Yasi") +/* 0x23D */ DEFINE_ACTOR(En_Tanron1, ACTOR_EN_TANRON1, ALLOCTYPE_NORMAL, "En_Tanron1") +/* 0x23E */ DEFINE_ACTOR(En_Tanron2, ACTOR_EN_TANRON2, ALLOCTYPE_NORMAL, "En_Tanron2") +/* 0x23F */ DEFINE_ACTOR(En_Tanron3, ACTOR_EN_TANRON3, ALLOCTYPE_NORMAL, "En_Tanron3") +/* 0x240 */ DEFINE_ACTOR(Obj_Chan, ACTOR_OBJ_CHAN, ALLOCTYPE_NORMAL, "Obj_Chan") +/* 0x241 */ DEFINE_ACTOR(En_Zos, ACTOR_EN_ZOS, ALLOCTYPE_NORMAL, "En_Zos") +/* 0x242 */ DEFINE_ACTOR(En_S_Goro, ACTOR_EN_S_GORO, ALLOCTYPE_NORMAL, "En_S_Goro") +/* 0x243 */ DEFINE_ACTOR(En_Nb, ACTOR_EN_NB, ALLOCTYPE_NORMAL, "En_Nb") +/* 0x244 */ DEFINE_ACTOR(En_Ja, ACTOR_EN_JA, ALLOCTYPE_NORMAL, "En_Ja") +/* 0x245 */ DEFINE_ACTOR(Bg_F40_Block, ACTOR_BG_F40_BLOCK, ALLOCTYPE_NORMAL, "Bg_F40_Block") +/* 0x246 */ DEFINE_ACTOR(Bg_F40_Switch, ACTOR_BG_F40_SWITCH, ALLOCTYPE_NORMAL, "Bg_F40_Switch") +/* 0x247 */ DEFINE_ACTOR(En_Po_Composer, ACTOR_EN_PO_COMPOSER, ALLOCTYPE_NORMAL, "En_Po_Composer") +/* 0x248 */ DEFINE_ACTOR(En_Guruguru, ACTOR_EN_GURUGURU, ALLOCTYPE_NORMAL, "En_Guruguru") +/* 0x249 */ DEFINE_ACTOR(Oceff_Wipe5, ACTOR_OCEFF_WIPE5, ALLOCTYPE_ABSOLUTE, "Oceff_Wipe5") +/* 0x24A */ DEFINE_ACTOR(En_Stone_heishi, ACTOR_EN_STONE_HEISHI, ALLOCTYPE_NORMAL, "En_Stone_heishi") +/* 0x24B */ DEFINE_ACTOR(Oceff_Wipe6, ACTOR_OCEFF_WIPE6, ALLOCTYPE_ABSOLUTE, "Oceff_Wipe6") +/* 0x24C */ DEFINE_ACTOR(En_Scopenuts, ACTOR_EN_SCOPENUTS, ALLOCTYPE_NORMAL, "En_Scopenuts") +/* 0x24D */ DEFINE_ACTOR(En_Scopecrow, ACTOR_EN_SCOPECROW, ALLOCTYPE_NORMAL, "En_Scopecrow") +/* 0x24E */ DEFINE_ACTOR(Oceff_Wipe7, ACTOR_OCEFF_WIPE7, ALLOCTYPE_ABSOLUTE, "Oceff_Wipe7") +/* 0x24F */ DEFINE_ACTOR(Eff_Kamejima_Wave, ACTOR_EFF_KAMEJIMA_WAVE, ALLOCTYPE_NORMAL, "Eff_Kamejima_Wave") +/* 0x250 */ DEFINE_ACTOR(En_Hg, ACTOR_EN_HG, ALLOCTYPE_NORMAL, "En_Hg") +/* 0x251 */ DEFINE_ACTOR(En_Hgo, ACTOR_EN_HGO, ALLOCTYPE_NORMAL, "En_Hgo") +/* 0x252 */ DEFINE_ACTOR(En_Zov, ACTOR_EN_ZOV, ALLOCTYPE_NORMAL, "En_Zov") +/* 0x253 */ DEFINE_ACTOR(En_Ah, ACTOR_EN_AH, ALLOCTYPE_NORMAL, "En_Ah") +/* 0x254 */ DEFINE_ACTOR(Obj_Hgdoor, ACTOR_OBJ_HGDOOR, ALLOCTYPE_NORMAL, "Obj_Hgdoor") +/* 0x255 */ DEFINE_ACTOR(Bg_Ikana_Bombwall, ACTOR_BG_IKANA_BOMBWALL, ALLOCTYPE_NORMAL, "Bg_Ikana_Bombwall") +/* 0x256 */ DEFINE_ACTOR(Bg_Ikana_Ray, ACTOR_BG_IKANA_RAY, ALLOCTYPE_NORMAL, "Bg_Ikana_Ray") +/* 0x257 */ DEFINE_ACTOR(Bg_Ikana_Shutter, ACTOR_BG_IKANA_SHUTTER, ALLOCTYPE_NORMAL, "Bg_Ikana_Shutter") +/* 0x258 */ DEFINE_ACTOR(Bg_Haka_Bombwall, ACTOR_BG_HAKA_BOMBWALL, ALLOCTYPE_NORMAL, "Bg_Haka_Bombwall") +/* 0x259 */ DEFINE_ACTOR(Bg_Haka_Tomb, ACTOR_BG_HAKA_TOMB, ALLOCTYPE_NORMAL, "Bg_Haka_Tomb") +/* 0x25A */ DEFINE_ACTOR(En_Sc_Ruppe, ACTOR_EN_SC_RUPPE, ALLOCTYPE_NORMAL, "En_Sc_Ruppe") +/* 0x25B */ DEFINE_ACTOR(Bg_Iknv_Doukutu, ACTOR_BG_IKNV_DOUKUTU, ALLOCTYPE_NORMAL, "Bg_Iknv_Doukutu") +/* 0x25C */ DEFINE_ACTOR(Bg_Iknv_Obj, ACTOR_BG_IKNV_OBJ, ALLOCTYPE_NORMAL, "Bg_Iknv_Obj") +/* 0x25D */ DEFINE_ACTOR(En_Pamera, ACTOR_EN_PAMERA, ALLOCTYPE_NORMAL, "En_Pamera") +/* 0x25E */ DEFINE_ACTOR(Obj_HsStump, ACTOR_OBJ_HSSTUMP, ALLOCTYPE_NORMAL, "Obj_HsStump") +/* 0x25F */ DEFINE_ACTOR(En_Hidden_Nuts, ACTOR_EN_HIDDEN_NUTS, ALLOCTYPE_NORMAL, "En_Hidden_Nuts") +/* 0x260 */ DEFINE_ACTOR(En_Zow, ACTOR_EN_ZOW, ALLOCTYPE_NORMAL, "En_Zow") +/* 0x261 */ DEFINE_ACTOR(En_Talk, ACTOR_EN_TALK, ALLOCTYPE_NORMAL, "En_Talk") +/* 0x262 */ DEFINE_ACTOR(En_Al, ACTOR_EN_AL, ALLOCTYPE_NORMAL, "En_Al") +/* 0x263 */ DEFINE_ACTOR(En_Tab, ACTOR_EN_TAB, ALLOCTYPE_NORMAL, "En_Tab") +/* 0x264 */ DEFINE_ACTOR(En_Nimotsu, ACTOR_EN_NIMOTSU, ALLOCTYPE_NORMAL, "En_Nimotsu") +/* 0x265 */ DEFINE_ACTOR(En_Hit_Tag, ACTOR_EN_HIT_TAG, ALLOCTYPE_NORMAL, "En_Hit_Tag") +/* 0x266 */ DEFINE_ACTOR(En_Ruppecrow, ACTOR_EN_RUPPECROW, ALLOCTYPE_NORMAL, "En_Ruppecrow") +/* 0x267 */ DEFINE_ACTOR(En_Tanron4, ACTOR_EN_TANRON4, ALLOCTYPE_NORMAL, "En_Tanron4") +/* 0x268 */ DEFINE_ACTOR(En_Tanron5, ACTOR_EN_TANRON5, ALLOCTYPE_NORMAL, "En_Tanron5") +/* 0x269 */ DEFINE_ACTOR(En_Tanron6, ACTOR_EN_TANRON6, ALLOCTYPE_NORMAL, "En_Tanron6") +/* 0x26A */ DEFINE_ACTOR(En_Daiku2, ACTOR_EN_DAIKU2, ALLOCTYPE_NORMAL, "En_Daiku2") +/* 0x26B */ DEFINE_ACTOR(En_Muto, ACTOR_EN_MUTO, ALLOCTYPE_NORMAL, "En_Muto") +/* 0x26C */ DEFINE_ACTOR(En_Baisen, ACTOR_EN_BAISEN, ALLOCTYPE_NORMAL, "En_Baisen") +/* 0x26D */ DEFINE_ACTOR(En_Heishi, ACTOR_EN_HEISHI, ALLOCTYPE_NORMAL, "En_Heishi") +/* 0x26E */ DEFINE_ACTOR(En_Demo_heishi, ACTOR_EN_DEMO_HEISHI, ALLOCTYPE_NORMAL, "En_Demo_heishi") +/* 0x26F */ DEFINE_ACTOR(En_Dt, ACTOR_EN_DT, ALLOCTYPE_NORMAL, "En_Dt") +/* 0x270 */ DEFINE_ACTOR(En_Cha, ACTOR_EN_CHA, ALLOCTYPE_NORMAL, "En_Cha") +/* 0x271 */ DEFINE_ACTOR(Obj_Dinner, ACTOR_OBJ_DINNER, ALLOCTYPE_NORMAL, "Obj_Dinner") +/* 0x272 */ DEFINE_ACTOR(Eff_Lastday, ACTOR_EFF_LASTDAY, ALLOCTYPE_NORMAL, "Eff_Lastday") +/* 0x273 */ DEFINE_ACTOR(Bg_Ikana_Dharma, ACTOR_BG_IKANA_DHARMA, ALLOCTYPE_NORMAL, "Bg_Ikana_Dharma") +/* 0x274 */ DEFINE_ACTOR(En_Akindonuts, ACTOR_EN_AKINDONUTS, ALLOCTYPE_NORMAL, "En_Akindonuts") +/* 0x275 */ DEFINE_ACTOR(Eff_Stk, ACTOR_EFF_STK, ALLOCTYPE_NORMAL, "Eff_Stk") +/* 0x276 */ DEFINE_ACTOR(En_Ig, ACTOR_EN_IG, ALLOCTYPE_NORMAL, "En_Ig") +/* 0x277 */ DEFINE_ACTOR(En_Rg, ACTOR_EN_RG, ALLOCTYPE_NORMAL, "En_Rg") +/* 0x278 */ DEFINE_ACTOR(En_Osk, ACTOR_EN_OSK, ALLOCTYPE_NORMAL, "En_Osk") +/* 0x279 */ DEFINE_ACTOR(En_Sth2, ACTOR_EN_STH2, ALLOCTYPE_NORMAL, "En_Sth2") +/* 0x27A */ DEFINE_ACTOR(En_Yb, ACTOR_EN_YB, ALLOCTYPE_NORMAL, "En_Yb") +/* 0x27B */ DEFINE_ACTOR(En_Rz, ACTOR_EN_RZ, ALLOCTYPE_NORMAL, "En_Rz") +/* 0x27C */ DEFINE_ACTOR(En_Scopecoin, ACTOR_EN_SCOPECOIN, ALLOCTYPE_NORMAL, "En_Scopecoin") +/* 0x27D */ DEFINE_ACTOR(En_Bjt, ACTOR_EN_BJT, ALLOCTYPE_NORMAL, "En_Bjt") +/* 0x27E */ DEFINE_ACTOR(En_Bomjima, ACTOR_EN_BOMJIMA, ALLOCTYPE_NORMAL, "En_Bomjima") +/* 0x27F */ DEFINE_ACTOR(En_Bomjimb, ACTOR_EN_BOMJIMB, ALLOCTYPE_NORMAL, "En_Bomjimb") +/* 0x280 */ DEFINE_ACTOR(En_Bombers, ACTOR_EN_BOMBERS, ALLOCTYPE_NORMAL, "En_Bombers") +/* 0x281 */ DEFINE_ACTOR(En_Bombers2, ACTOR_EN_BOMBERS2, ALLOCTYPE_NORMAL, "En_Bombers2") +/* 0x282 */ DEFINE_ACTOR(En_Bombal, ACTOR_EN_BOMBAL, ALLOCTYPE_NORMAL, "En_Bombal") +/* 0x283 */ DEFINE_ACTOR(Obj_Moon_Stone, ACTOR_OBJ_MOON_STONE, ALLOCTYPE_NORMAL, "Obj_Moon_Stone") +/* 0x284 */ DEFINE_ACTOR(Obj_Mu_Pict, ACTOR_OBJ_MU_PICT, ALLOCTYPE_NORMAL, "Obj_Mu_Pict") +/* 0x285 */ DEFINE_ACTOR(Bg_Ikninside, ACTOR_BG_IKNINSIDE, ALLOCTYPE_NORMAL, "Bg_Ikninside") +/* 0x286 */ DEFINE_ACTOR(Eff_Zoraband, ACTOR_EFF_ZORABAND, ALLOCTYPE_NORMAL, "Eff_Zoraband") +/* 0x287 */ DEFINE_ACTOR(Obj_Kepn_Koya, ACTOR_OBJ_KEPN_KOYA, ALLOCTYPE_NORMAL, "Obj_Kepn_Koya") +/* 0x288 */ DEFINE_ACTOR(Obj_Usiyane, ACTOR_OBJ_USIYANE, ALLOCTYPE_NORMAL, "Obj_Usiyane") +/* 0x289 */ DEFINE_ACTOR(En_Nnh, ACTOR_EN_NNH, ALLOCTYPE_NORMAL, "En_Nnh") +/* 0x28A */ DEFINE_ACTOR(Obj_Kzsaku, ACTOR_OBJ_KZSAKU, ALLOCTYPE_NORMAL, "Obj_Kzsaku") +/* 0x28B */ DEFINE_ACTOR(Obj_Milk_Bin, ACTOR_OBJ_MILK_BIN, ALLOCTYPE_NORMAL, "Obj_Milk_Bin") +/* 0x28C */ DEFINE_ACTOR(En_Kitan, ACTOR_EN_KITAN, ALLOCTYPE_NORMAL, "En_Kitan") +/* 0x28D */ DEFINE_ACTOR(Bg_Astr_Bombwall, ACTOR_BG_ASTR_BOMBWALL, ALLOCTYPE_NORMAL, "Bg_Astr_Bombwall") +/* 0x28E */ DEFINE_ACTOR(Bg_Iknin_Susceil, ACTOR_BG_IKNIN_SUSCEIL, ALLOCTYPE_NORMAL, "Bg_Iknin_Susceil") +/* 0x28F */ DEFINE_ACTOR(En_Bsb, ACTOR_EN_BSB, ALLOCTYPE_NORMAL, "En_Bsb") +/* 0x290 */ DEFINE_ACTOR(En_Recepgirl, ACTOR_EN_RECEPGIRL, ALLOCTYPE_NORMAL, "En_Recepgirl") +/* 0x291 */ DEFINE_ACTOR(En_Thiefbird, ACTOR_EN_THIEFBIRD, ALLOCTYPE_NORMAL, "En_Thiefbird") +/* 0x292 */ DEFINE_ACTOR(En_Jgame_Tsn, ACTOR_EN_JGAME_TSN, ALLOCTYPE_NORMAL, "En_Jgame_Tsn") +/* 0x293 */ DEFINE_ACTOR(Obj_Jgame_Light, ACTOR_OBJ_JGAME_LIGHT, ALLOCTYPE_NORMAL, "Obj_Jgame_Light") +/* 0x294 */ DEFINE_ACTOR(Obj_Yado, ACTOR_OBJ_YADO, ALLOCTYPE_NORMAL, "Obj_Yado") +/* 0x295 */ DEFINE_ACTOR(Demo_Syoten, ACTOR_DEMO_SYOTEN, ALLOCTYPE_NORMAL, "Demo_Syoten") +/* 0x296 */ DEFINE_ACTOR(Demo_Moonend, ACTOR_DEMO_MOONEND, ALLOCTYPE_NORMAL, "Demo_Moonend") +/* 0x297 */ DEFINE_ACTOR(Bg_Lbfshot, ACTOR_BG_LBFSHOT, ALLOCTYPE_NORMAL, "Bg_Lbfshot") +/* 0x298 */ DEFINE_ACTOR(Bg_Last_Bwall, ACTOR_BG_LAST_BWALL, ALLOCTYPE_NORMAL, "Bg_Last_Bwall") +/* 0x299 */ DEFINE_ACTOR(En_And, ACTOR_EN_AND, ALLOCTYPE_NORMAL, "En_And") +/* 0x29A */ DEFINE_ACTOR(En_Invadepoh_Demo, ACTOR_EN_INVADEPOH_DEMO, ALLOCTYPE_NORMAL, "En_Invadepoh_Demo") +/* 0x29B */ DEFINE_ACTOR(Obj_Danpeilift, ACTOR_OBJ_DANPEILIFT, ALLOCTYPE_NORMAL, "Obj_Danpeilift") +/* 0x29C */ DEFINE_ACTOR(En_Fall2, ACTOR_EN_FALL2, ALLOCTYPE_NORMAL, "En_Fall2") +/* 0x29D */ DEFINE_ACTOR(Dm_Al, ACTOR_DM_AL, ALLOCTYPE_NORMAL, "Dm_Al") +/* 0x29E */ DEFINE_ACTOR(Dm_An, ACTOR_DM_AN, ALLOCTYPE_NORMAL, "Dm_An") +/* 0x29F */ DEFINE_ACTOR(Dm_Ah, ACTOR_DM_AH, ALLOCTYPE_NORMAL, "Dm_Ah") +/* 0x2A0 */ DEFINE_ACTOR(Dm_Nb, ACTOR_DM_NB, ALLOCTYPE_NORMAL, "Dm_Nb") +/* 0x2A1 */ DEFINE_ACTOR(En_Drs, ACTOR_EN_DRS, ALLOCTYPE_NORMAL, "En_Drs") +/* 0x2A2 */ DEFINE_ACTOR(En_Ending_Hero, ACTOR_EN_ENDING_HERO, ALLOCTYPE_NORMAL, "En_Ending_Hero") +/* 0x2A3 */ DEFINE_ACTOR(Dm_Bal, ACTOR_DM_BAL, ALLOCTYPE_NORMAL, "Dm_Bal") +/* 0x2A4 */ DEFINE_ACTOR(En_Paper, ACTOR_EN_PAPER, ALLOCTYPE_NORMAL, "En_Paper") +/* 0x2A5 */ DEFINE_ACTOR(En_Hint_Skb, ACTOR_EN_HINT_SKB, ALLOCTYPE_NORMAL, "En_Hint_Skb") +/* 0x2A6 */ DEFINE_ACTOR(Dm_Tag, ACTOR_DM_TAG, ALLOCTYPE_NORMAL, "Dm_Tag") +/* 0x2A7 */ DEFINE_ACTOR(En_Bh, ACTOR_EN_BH, ALLOCTYPE_NORMAL, "En_Bh") +/* 0x2A8 */ DEFINE_ACTOR(En_Ending_Hero2, ACTOR_EN_ENDING_HERO2, ALLOCTYPE_NORMAL, "En_Ending_Hero2") +/* 0x2A9 */ DEFINE_ACTOR(En_Ending_Hero3, ACTOR_EN_ENDING_HERO3, ALLOCTYPE_NORMAL, "En_Ending_Hero3") +/* 0x2AA */ DEFINE_ACTOR(En_Ending_Hero4, ACTOR_EN_ENDING_HERO4, ALLOCTYPE_NORMAL, "En_Ending_Hero4") +/* 0x2AB */ DEFINE_ACTOR(En_Ending_Hero5, ACTOR_EN_ENDING_HERO5, ALLOCTYPE_NORMAL, "En_Ending_Hero5") +/* 0x2AC */ DEFINE_ACTOR(En_Ending_Hero6, ACTOR_EN_ENDING_HERO6, ALLOCTYPE_NORMAL, "En_Ending_Hero6") +/* 0x2AD */ DEFINE_ACTOR(Dm_Gm, ACTOR_DM_GM, ALLOCTYPE_NORMAL, "Dm_Gm") +/* 0x2AE */ DEFINE_ACTOR(Obj_Swprize, ACTOR_OBJ_SWPRIZE, ALLOCTYPE_NORMAL, "Obj_Swprize") +/* 0x2AF */ DEFINE_ACTOR(En_Invisible_Ruppe, ACTOR_EN_INVISIBLE_RUPPE, ALLOCTYPE_NORMAL, "En_Invisible_Ruppe") +/* 0x2B0 */ DEFINE_ACTOR(Obj_Ending, ACTOR_OBJ_ENDING, ALLOCTYPE_NORMAL, "Obj_Ending") +/* 0x2B1 */ DEFINE_ACTOR(En_Rsn, ACTOR_EN_RSN, ALLOCTYPE_NORMAL, "En_Rsn") diff --git a/include/ultra64.h b/include/ultra64.h index 6ffb26ff6..ad2bc2463 100644 --- a/include/ultra64.h +++ b/include/ultra64.h @@ -14,6 +14,7 @@ #include "ultra64/rdp.h" #include "ultra64/rsp.h" #include "ultra64/r4300.h" +#include "ultra64/ucode.h" #include "ultra64/vi.h" #endif diff --git a/include/ultra64/ucode.h b/include/ultra64/ucode.h new file mode 100644 index 000000000..8a1d89037 --- /dev/null +++ b/include/ultra64/ucode.h @@ -0,0 +1,31 @@ +#ifndef ULTRA64_UCODE_H +#define ULTRA64_UCODE_H + +#include "PR/ultratypes.h" + +#define SP_DRAM_STACK_SIZE8 0x400 +#define SP_DRAM_STACK_SIZE64 (SP_DRAM_STACK_SIZE8 >> 3) + +#define SP_UCODE_SIZE 0x1000 + +#define SP_UCODE_DATA_SIZE 0x800 + +extern u64 rspbootTextStart[]; +extern u64 rspbootTextEnd[]; + +extern u64 aspMainTextStart[]; +extern u64 aspMainTextEnd[]; +extern u64 aspMainDataStart[]; +extern u64 aspMainDataEnd[]; + +extern u64 gspF3DZEX2_NoN_PosLight_fifoTextStart[]; +extern u64 gspF3DZEX2_NoN_PosLight_fifoTextEnd[]; +extern u64 gspF3DZEX2_NoN_PosLight_fifoDataStart[]; +extern u64 gspF3DZEX2_NoN_PosLight_fifoDataEnd[]; + +extern u64 gspS2DEX2_fifoTextStart[]; +extern u64 gspS2DEX2_fifoTextEnd[]; +extern u64 gspS2DEX2_fifoDataStart[]; +extern u64 gspS2DEX2_fifoDataEnd[]; + +#endif diff --git a/include/variables.h b/include/variables.h index 5b40e1161..a3278c481 100644 --- a/include/variables.h +++ b/include/variables.h @@ -1,5 +1,5 @@ -#ifndef _VARIABLES_H_ -#define _VARIABLES_H_ +#ifndef VARIABLES_H +#define VARIABLES_H #include "z64.h" #include "segment_symbols.h" @@ -358,7 +358,6 @@ extern u16 viRetrace; extern DmaEntry dmadata[1568]; // extern UNK_TYPE1 D_80186028; extern u64 aspMainTextStart[]; -extern ActorInit En_A_Obj_InitVars; extern ColliderCylinderInit enAObjCylinderInit; extern InitChainEntry enAObjInitVar; extern Gfx* enAObjDisplayLists[2]; @@ -412,7 +411,6 @@ extern EffectSsOverlay gParticleOverlayTable[39]; extern f32 actorMovementScale; extern TargetRangeParams gTargetRanges[]; extern s16 D_801AED48[8]; -// extern UNK_TYPE4 D_801AED58; extern Color_RGBA8 actorDefaultHitColor; // extern UNK_TYPE1 D_801AED8C; // extern UNK_TYPE4 D_801AED98; @@ -773,141 +771,12 @@ extern UNK_PTR D_801BF5C0; // extern UNK_TYPE1 D_801BFD94; // extern UNK_TYPE2 D_801BFD98; -// extern UNK_TYPE1 D_801BFDD0; -// extern UNK_TYPE1 D_801BFE00; -// extern UNK_TYPE1 D_801BFE14; -// extern UNK_TYPE2 D_801BFF34; -// extern UNK_TYPE1 D_801BFF90; -extern u8 gPlayerModelTypes[][5]; -// extern UNK_TYPE1 D_801BFFFC; -// extern UNK_TYPE1 D_801C0024; -// extern UNK_TYPE1 D_801C0034; -// extern UNK_TYPE1 D_801C005C; -// extern UNK_TYPE1 D_801C0084; -// extern UNK_TYPE1 D_801C00AC; -// extern UNK_TYPE1 D_801C00BC; -// extern UNK_TYPE1 D_801C00D4; -// extern UNK_TYPE1 D_801C00EC; -// extern UNK_TYPE1 D_801C0114; -// extern UNK_TYPE1 D_801C013C; -// extern UNK_TYPE1 D_801C0164; -// extern UNK_TYPE1 D_801C018C; -// extern UNK_TYPE1 D_801C01A4; -// extern UNK_TYPE1 D_801C01CC; -// extern UNK_TYPE1 D_801C01F4; -// extern UNK_TYPE1 D_801C021C; -// extern UNK_TYPE1 D_801C0244; -// extern UNK_TYPE1 D_801C026C; -// extern UNK_TYPE1 D_801C0294; -// extern UNK_TYPE1 D_801C02A8; -// extern UNK_TYPE1 D_801C02BC; -// extern UNK_TYPE1 D_801C02D0; -// extern UNK_TYPE1 D_801C02E4; -// extern UNK_TYPE1 D_801C0340; -// extern UNK_TYPE1 D_801C0368; -// extern UNK_TYPE1 D_801C03A0; -// extern UNK_TYPE1 D_801C03C0; -// extern UNK_TYPE1 D_801C03E0; -// extern UNK_TYPE1 D_801C0410; -// extern UNK_TYPE1 D_801C0428; -// extern UNK_TYPE1 D_801C0460; -// extern UNK_TYPE1 D_801C0490; -// extern UNK_TYPE1 D_801C0510; -// extern UNK_TYPE1 D_801C0538; -// extern UNK_TYPE1 D_801C0560; -// extern UNK_TYPE1 D_801C0580; -// extern UNK_TYPE1 D_801C05A8; -// extern UNK_TYPE1 D_801C05C8; -// extern UNK_TYPE1 D_801C05D8; -// extern UNK_TYPE1 D_801C05F0; -// extern UNK_TYPE1 D_801C0608; -// extern UNK_TYPE1 D_801C0628; -// extern UNK_TYPE1 D_801C0678; -// extern UNK_TYPE1 D_801C0698; -// extern UNK_TYPE1 D_801C06B8; -// extern UNK_TYPE1 D_801C06E0; -// extern UNK_TYPE1 D_801C06F8; -// extern UNK_TYPE1 D_801C0718; -// extern UNK_TYPE1 D_801C0730; -// extern UNK_TYPE1 D_801C0740; -// extern UNK_TYPE1 D_801C0750; -// extern UNK_TYPE1 D_801C0778; -// extern UNK_TYPE1 D_801C0784; -// extern UNK_TYPE1 D_801C07AC; -// extern UNK_TYPE1 D_801C07C0; -// extern UNK_TYPE1 D_801C07F0; -// extern UNK_TYPE1 D_801C0820; -// extern UNK_TYPE1 D_801C0838; -extern Gfx D_801C0850[]; -// extern UNK_TYPE1 D_801C0860; -extern UNK_PTR D_801C0870; -// extern UNK_TYPE1 D_801C0890; -// extern UNK_TYPE1 D_801C08A0; -// extern UNK_TYPE1 D_801C08C0; -// extern UNK_TYPE1 D_801C08FC; -// extern UNK_TYPE1 D_801C0910; -// extern UNK_TYPE1 D_801C0924; -// extern UNK_TYPE1 D_801C0938; -// extern UNK_TYPE1 D_801C094C; -// extern UNK_TYPE4 D_801C0958; -extern UNK_PTR D_801C095C; -// extern UNK_TYPE1 D_801C0964; -// extern UNK_TYPE1 D_801C096C; -// extern UNK_TYPE1 D_801C0970; -// extern UNK_TYPE4 D_801C0994; -// extern UNK_TYPE1 D_801C09B8; -// extern UNK_TYPE1 D_801C09DC; -// extern UNK_TYPE1 D_801C0A00; -// extern UNK_TYPE1 D_801C0A24; -// extern UNK_TYPE1 D_801C0A48; -// extern UNK_TYPE1 D_801C0A6C; -// extern UNK_TYPE1 D_801C0A90; -// extern UNK_TYPE1 D_801C0AB4; -// extern UNK_TYPE1 D_801C0ABC; -// extern UNK_TYPE1 D_801C0AC4; -// extern UNK_TYPE1 D_801C0ADC; -extern UNK_PTR D_801C0AF4; -extern UNK_PTR D_801C0AFC; -extern UNK_PTR D_801C0B04; -extern UNK_PTR D_801C0B0C; -// extern UNK_TYPE1 D_801C0B14; -// extern UNK_TYPE1 D_801C0B1C; -// extern UNK_TYPE1 D_801C0B20; -// extern UNK_TYPE1 D_801C0B90; -// extern UNK_TYPE4 D_801C0BA8; -// extern UNK_TYPE1 D_801C0BB4; -// extern UNK_TYPE1 D_801C0BC0; -// extern UNK_TYPE1 D_801C0BD0; -// extern UNK_TYPE4 D_801C0BE0; -// extern UNK_TYPE4 D_801C0BEC; -// extern UNK_TYPE1 D_801C0BF8; -// extern UNK_TYPE1 D_801C0BFC; -// extern UNK_TYPE1 D_801C0C00; -// extern UNK_TYPE4 D_801C0C0C; -// extern UNK_TYPE1 D_801C0C30; -// extern UNK_TYPE1 D_801C0C54; -// extern UNK_TYPE1 D_801C0CA8; -// extern UNK_TYPE4 D_801C0CE8; -// extern UNK_TYPE1 D_801C0D24; -// extern UNK_TYPE1 D_801C0D60; -// extern UNK_TYPE1 D_801C0D6C; -// extern UNK_TYPE1 D_801C0D78; -// extern UNK_TYPE4 D_801C0D94; -// extern UNK_TYPE4 D_801C0D98; -// extern UNK_TYPE4 D_801C0D9C; -// extern UNK_TYPE4 D_801C0DA0; -// extern UNK_TYPE1 D_801C0DA8; -// extern UNK_TYPE1 D_801C0DD8; -// extern UNK_TYPE1 D_801C0DE4; -// extern UNK_TYPE4 D_801C0DF0; -// extern UNK_TYPE1 D_801C0E04; -// extern UNK_TYPE4 D_801C0E2C; -// extern UNK_TYPE4 D_801C0E40; -// extern UNK_TYPE1 D_801C0E7C; -// extern UNK_TYPE1 D_801C0E94; -// extern UNK_TYPE1 D_801C0EA0; -// extern UNK_TYPE1 D_801C0EAC; -// extern UNK_TYPE1 D_801C0EB8; +extern FlexSkeletonHeader* gPlayerSkeletons[PLAYER_FORM_MAX]; +extern PlayerModelIndices gPlayerModelTypes[]; +extern struct_80124618 D_801C03A0[]; +extern struct_80124618 D_801C0490[]; +extern Gfx gCullBackDList[]; +extern Gfx gCullFrontDList[]; extern Gfx sSetupDL[438]; extern Gfx sFillSetupDL[12]; @@ -928,7 +797,7 @@ extern TexturePtr gItemIcons[]; extern u8 gItemSlots[]; extern s16 gItemPrices[]; extern u16 gSceneIdsPerRegion[11][27]; -extern u32 D_801C2410[]; +extern u8 gPlayerFormItemRestrictions[PLAYER_FORM_MAX][114]; extern s16 gPlayerFormObjectIndices[8]; extern RomFile gObjectTable[643]; extern SceneTableEntry gSceneTable[]; @@ -957,7 +826,7 @@ extern struct_801C5F44 D_801C5F44[]; // D_801C5F44 // extern UNK_TYPE2 D_801C6A8C; // extern UNK_TYPE2 D_801C6A90; // extern UNK_TYPE2 D_801C6A94; -// extern UNK_TYPE1 D_801C6A98; +extern u8 D_801C6A98[5][5]; // extern UNK_TYPE1 D_801C6AB8; // extern UNK_TYPE1 D_801C6B28; // extern UNK_TYPE1 D_801CED40; @@ -2750,18 +2619,7 @@ extern s16 D_801F4E7A; // extern UNK_TYPE1 D_801F57B4; // extern UNK_TYPE1 D_801F5834; // extern NmiBuff* gNMIBuffer; -// extern UNK_TYPE1 sPostmanTimerInput; -// extern UNK_TYPE1 D_801F58B0; -// extern UNK_TYPE1 D_801F59AC; -// extern UNK_TYPE1 D_801F59B0; -// extern UNK_TYPE1 D_801F59C8; -// extern UNK_TYPE1 D_801F59D0; -// extern UNK_TYPE1 D_801F59DC; -// extern UNK_TYPE1 D_801F59E0; -// extern UNK_TYPE1 D_801F59E4; -// extern UNK_TYPE1 D_801F59E8; -// extern UNK_TYPE1 D_801F59F4; -// extern UNK_TYPE1 D_801F59F8; + // extern UNK_TYPE1 sSkyboxDrawMatrix; // extern UNK_TYPE1 D_801F6AF0; // extern UNK_TYPE1 D_801F6AF2; diff --git a/include/z64.h b/include/z64.h index da1f88323..4b2f45bbf 100644 --- a/include/z64.h +++ b/include/z64.h @@ -386,10 +386,10 @@ typedef struct { /* 0x000 */ View view; /* 0x168 */ u8* iconItemSegment; /* 0x16C */ u8* iconItem24Segment; - /* 0x170 */ u8* unk_170; - /* 0x174 */ u8* unk_174; - /* 0x178 */ u8* unk_178; - /* 0x17C */ u8* unk_17C; + /* 0x170 */ u8* iconItemAltSegment; + /* 0x174 */ u8* iconItemLangSegment; + /* 0x178 */ u8* nameSegment; + /* 0x17C */ u8* iconItemVtxSegment; /* 0x180 */ Vtx* itemPageVtx; /* 0x184 */ Vtx* mapPageVtx; /* 0x188 */ Vtx* questPageVtx; @@ -402,24 +402,24 @@ typedef struct { /* 0x1A4 */ Vtx* unk_1A4; /* 0x1A8 */ Vtx* cursorVtx; /* 0x1AC */ OcarinaStaff* ocarinaStaff; - /* 0x1B0 */ DmaRequest unk_1B0; + /* 0x1B0 */ UNK_TYPE1 unk_1B0[0x20]; /* 0x1D0 */ OSMesgQueue loadQueue; /* 0x1E8 */ OSMesg loadMsg; /* 0x1EC */ u16 state; /* 0x1EE */ u16 debugEditor; /* 0x1F0 */ u8 bombersNotebookOpen; /* 0x1F4 */ Vec3f eye; - /* 0x200 */ u16 unk_200; - /* 0x202 */ u16 mode; + /* 0x200 */ u16 mainState; + /* 0x202 */ u16 nextPageMode; // (2 * prev pageIndex) + (scroll left ? 1 : 0) /* 0x204 */ u16 pageIndex; - /* 0x206 */ u16 unk_206; - /* 0x208 */ u16 unk_208; + /* 0x206 */ u16 switchPageTimer; + /* 0x208 */ u16 savePromptState; /* 0x20C */ f32 unk_20C; - /* 0x210 */ f32 unk_210; - /* 0x214 */ f32 unk_214; - /* 0x218 */ f32 unk_218; - /* 0x21C */ f32 unk_21C; - /* 0x220 */ f32 unk_220; + /* 0x210 */ f32 itemPageRoll; // rotation (-z) of the item page into the screen + /* 0x214 */ f32 mapPageRoll; // rotation (+x) of the map page into the screen + /* 0x218 */ f32 questPageRoll; // rotation (+z) of the quest page into the screen + /* 0x21C */ f32 maskPageRoll; // rotation (-z) of the mask page into the screen + /* 0x220 */ f32 roll; /* 0x224 */ u16 alpha; /* 0x226 */ s16 offsetY; /* 0x228 */ UNK_TYPE1 unk_228[0x8]; @@ -431,7 +431,7 @@ typedef struct { /* 0x256 */ s16 unk_256; // Uses DungeonItem enum /* 0x258 */ s16 cursorSpecialPos; /* 0x25A */ s16 pageSwitchTimer; - /* 0x25C */ u16 unk_25C; + /* 0x25C */ u16 namedItem; /* 0x25E */ u16 cursorItem[5]; /* 0x268 */ u16 cursorSlot[5]; /* 0x272 */ u16 equipTargetItem; @@ -440,7 +440,7 @@ typedef struct { /* 0x278 */ s16 equipAnimX; /* 0x27A */ s16 equipAnimY; /* 0x27C */ s16 equipAnimAlpha; - /* 0x27E */ s16 unk_27E; + /* 0x27E */ s16 infoPanelOffsetY; /* 0x280 */ u16 unk_280; /* 0x282 */ u16 nameColorSet; /* 0x284 */ s16 cursorColorSet; @@ -454,9 +454,9 @@ typedef struct { /* 0x29E */ s16 promptAlpha; /* 0x2A0 */ s16 ocarinaSongIndex; /* 0x2A2 */ u8 worldMapPoints[20]; - /* 0x2B6 */ u8 unk_2B6; - /* 0x2B7 */ u8 unk_2B7; - /* 0x2B8 */ u8 unk_2B8; + /* 0x2B6 */ u8 unk_2B6; // unused red? + /* 0x2B7 */ u8 unk_2B7; // unused green? + /* 0x2B8 */ u8 unk_2B8; // unused blue? /* 0x2B9 */ u8 itemDescriptionOn; // helpful description of item given through a message box /* 0x2BA */ s16 equipAnimScale; // scale of item icon while moving being equipped to c-button /* 0x2BC */ s16 equipAnimShrinkRate; // rate the scale is shrinking for the item icon while moving being equipped to c-button @@ -555,8 +555,8 @@ typedef struct { /* 0x318 */ u8 pictographBox; /* 0x319 */ u8 all; // "another"; enables all item restrictions } restrictions; // size = 0xC - /* 0x31A */ u8 unk_31A; - /* 0x31B */ u8 unk_31B; + /* 0x31A */ u8 storyState; + /* 0x31B */ u8 storyType; /* 0x31C */ u8 unk_31C; /* 0x320 */ OSMesgQueue unk_320; /* 0x338 */ OSMesg unk_338; @@ -724,7 +724,7 @@ typedef struct { #define TRANS_TRIGGER_START 20 // start transition (exiting an area) #define TRANS_TRIGGER_END -20 // transition is ending (arriving in a new area) -typedef enum { +typedef enum TransitionMode { /* 0 */ TRANS_MODE_OFF, /* 1 */ TRANS_MODE_01, /* 2 */ TRANS_MODE_02, @@ -745,7 +745,7 @@ typedef enum { /* 17 */ TRANS_MODE_17 } TransitionMode; -typedef enum { +typedef enum TransitionType { /* 0 */ TRANS_TYPE_00, /* 1 */ TRANS_TYPE_01, /* 2 */ TRANS_TYPE_02, @@ -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, Actor* actor); - /* 0x18794 */ s32 (*unk_18794)(struct PlayState* play, Player* player, s32 arg2, s32 arg3); + /* 0x18794 */ s32 (*unk_18794)(struct PlayState* play, Player* player, s32 itemId, s32 arg3); /* 0x18798 */ s32 (*setPlayerTalkAnim)(struct PlayState* play, void* talkAnim, s32 arg2); /* 0x1879C */ s16 playerActorCsIds[10]; /* 0x187B0 */ MtxF viewProjectionMtxF; @@ -1067,7 +1067,7 @@ struct PlayState { /* 0x1885C */ EntranceEntry* setupEntranceList; /* 0x18860 */ u16* setupExitList; /* 0x18864 */ Path* setupPathList; - /* 0x18868 */ void* unk_18868; + /* 0x18868 */ void* naviQuestHints; // leftover from OoT, system which processes this is removed /* 0x1886C */ AnimatedMaterial* sceneMaterialAnims; /* 0x18870 */ void* specialEffects; /* 0x18874 */ u8 skyboxId; @@ -1089,7 +1089,7 @@ struct PlayState { /* 0x18B9C */ char unk_18B9C[0x2B8]; /* 0x18E54 */ SceneTableEntry* loadedScene; /* 0x18E58 */ char unk_18E58[0x10]; - /* 0x18E68 */ s32 unk_18E68; + /* 0x18E68 */ void* unk_18E68; /* 0x18E6C */ char unk_18E6C[0x3EC]; }; // size = 0x19258 diff --git a/include/z64actor.h b/include/z64actor.h index f1c33783a..9a6515ae8 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -422,699 +422,19 @@ typedef enum { /* 32 */ ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_LARGE } ActorDrawDamageEffectType; -typedef enum { - /* 0x000 */ ACTOR_PLAYER, - /* 0x001 */ ACTOR_EN_TEST, - /* 0x002 */ ACTOR_EN_GIRLA, - /* 0x003 */ ACTOR_EN_PART, - /* 0x004 */ ACTOR_EN_LIGHT, - /* 0x005 */ ACTOR_EN_DOOR, - /* 0x006 */ ACTOR_EN_BOX, - /* 0x007 */ ACTOR_EN_PAMETFROG, - /* 0x008 */ ACTOR_EN_OKUTA, - /* 0x009 */ ACTOR_EN_BOM, - /* 0x00A */ ACTOR_EN_WALLMAS, - /* 0x00B */ ACTOR_EN_DODONGO, - /* 0x00C */ ACTOR_EN_FIREFLY, - /* 0x00D */ ACTOR_EN_HORSE, - /* 0x00E */ ACTOR_EN_ITEM00, - /* 0x00F */ ACTOR_EN_ARROW, - /* 0x010 */ ACTOR_EN_ELF, - /* 0x011 */ ACTOR_EN_NIW, - /* 0x012 */ ACTOR_EN_TITE, - /* 0x013 */ ACTOR_UNSET_13, - /* 0x014 */ ACTOR_EN_PEEHAT, - /* 0x015 */ ACTOR_EN_BUTTE, - /* 0x016 */ ACTOR_EN_INSECT, - /* 0x017 */ ACTOR_EN_FISH, - /* 0x018 */ ACTOR_EN_HOLL, - /* 0x019 */ ACTOR_EN_DINOFOS, - /* 0x01A */ ACTOR_EN_HATA, - /* 0x01B */ ACTOR_EN_ZL1, - /* 0x01C */ ACTOR_EN_VIEWER, - /* 0x01D */ ACTOR_EN_BUBBLE, - /* 0x01E */ ACTOR_DOOR_SHUTTER, - /* 0x01F */ ACTOR_UNSET_1F, - /* 0x020 */ ACTOR_EN_BOOM, - /* 0x021 */ ACTOR_EN_TORCH2, - /* 0x022 */ ACTOR_EN_MINIFROG, - /* 0x023 */ ACTOR_UNSET_23, - /* 0x024 */ ACTOR_EN_ST, - /* 0x025 */ ACTOR_UNSET_25, - /* 0x026 */ ACTOR_EN_A_OBJ, - /* 0x027 */ ACTOR_OBJ_WTURN, - /* 0x028 */ ACTOR_EN_RIVER_SOUND, - /* 0x029 */ ACTOR_UNSET_29, - /* 0x02A */ ACTOR_EN_OSSAN, - /* 0x02B */ ACTOR_UNSET_2B, - /* 0x02C */ ACTOR_UNSET_2C, - /* 0x02D */ ACTOR_EN_FAMOS, - /* 0x02E */ ACTOR_UNSET_2E, - /* 0x02F */ ACTOR_EN_BOMBF, - /* 0x030 */ ACTOR_UNSET_30, - /* 0x031 */ ACTOR_UNSET_31, - /* 0x032 */ ACTOR_EN_AM, - /* 0x033 */ ACTOR_EN_DEKUBABA, - /* 0x034 */ ACTOR_EN_M_FIRE1, - /* 0x035 */ ACTOR_EN_M_THUNDER, - /* 0x036 */ ACTOR_BG_BREAKWALL, - /* 0x037 */ ACTOR_UNSET_37, - /* 0x038 */ ACTOR_DOOR_WARP1, - /* 0x039 */ ACTOR_OBJ_SYOKUDAI, - /* 0x03A */ ACTOR_ITEM_B_HEART, - /* 0x03B */ ACTOR_EN_DEKUNUTS, - /* 0x03C */ ACTOR_EN_BBFALL, - /* 0x03D */ ACTOR_ARMS_HOOK, - /* 0x03E */ ACTOR_EN_BB, - /* 0x03F */ ACTOR_BG_KEIKOKU_SPR, - /* 0x040 */ ACTOR_UNSET_40, - /* 0x041 */ ACTOR_EN_WOOD02, - /* 0x042 */ ACTOR_UNSET_42, - /* 0x043 */ ACTOR_EN_DEATH, - /* 0x044 */ ACTOR_EN_MINIDEATH, - /* 0x045 */ ACTOR_UNSET_45, - /* 0x046 */ ACTOR_UNSET_46, - /* 0x047 */ ACTOR_EN_VM, - /* 0x048 */ ACTOR_DEMO_EFFECT, - /* 0x049 */ ACTOR_DEMO_KANKYO, - /* 0x04A */ ACTOR_EN_FLOORMAS, - /* 0x04B */ ACTOR_UNSET_4B, - /* 0x04C */ ACTOR_EN_RD, - /* 0x04D */ ACTOR_BG_F40_FLIFT, - /* 0x04E */ ACTOR_UNSET_4E, - /* 0x04F */ ACTOR_OBJ_MURE, - /* 0x050 */ ACTOR_EN_SW, - /* 0x051 */ ACTOR_OBJECT_KANKYO, - /* 0x052 */ ACTOR_UNSET_52, - /* 0x053 */ ACTOR_UNSET_53, - /* 0x054 */ ACTOR_EN_HORSE_LINK_CHILD, - /* 0x055 */ ACTOR_DOOR_ANA, - /* 0x056 */ ACTOR_UNSET_56, - /* 0x057 */ ACTOR_UNSET_57, - /* 0x058 */ ACTOR_UNSET_58, - /* 0x059 */ ACTOR_UNSET_59, - /* 0x05A */ ACTOR_UNSET_5A, - /* 0x05B */ ACTOR_EN_ENCOUNT1, - /* 0x05C */ ACTOR_DEMO_TRE_LGT, - /* 0x05D */ ACTOR_UNSET_5D, - /* 0x05E */ ACTOR_UNSET_5E, - /* 0x05F */ ACTOR_EN_ENCOUNT2, - /* 0x060 */ ACTOR_EN_FIRE_ROCK, - /* 0x061 */ ACTOR_BG_CTOWER_ROT, - /* 0x062 */ ACTOR_MIR_RAY, - /* 0x063 */ ACTOR_UNSET_63, - /* 0x064 */ ACTOR_EN_SB, - /* 0x065 */ ACTOR_EN_BIGSLIME, - /* 0x066 */ ACTOR_EN_KAREBABA, - /* 0x067 */ ACTOR_EN_IN, - /* 0x068 */ ACTOR_UNSET_68, - /* 0x069 */ ACTOR_EN_RU, - /* 0x06A */ ACTOR_EN_BOM_CHU, - /* 0x06B */ ACTOR_EN_HORSE_GAME_CHECK, - /* 0x06C */ ACTOR_EN_RR, - /* 0x06D */ ACTOR_UNSET_6D, - /* 0x06E */ ACTOR_UNSET_6E, - /* 0x06F */ ACTOR_UNSET_6F, - /* 0x070 */ ACTOR_UNSET_70, - /* 0x071 */ ACTOR_UNSET_71, - /* 0x072 */ ACTOR_UNSET_72, - /* 0x073 */ ACTOR_EN_FR, - /* 0x074 */ ACTOR_UNSET_74, - /* 0x075 */ ACTOR_UNSET_75, - /* 0x076 */ ACTOR_UNSET_76, - /* 0x077 */ ACTOR_UNSET_77, - /* 0x078 */ ACTOR_UNSET_78, - /* 0x079 */ ACTOR_EN_FISHING, - /* 0x07A */ ACTOR_OBJ_OSHIHIKI, - /* 0x07B */ ACTOR_EFF_DUST, - /* 0x07C */ ACTOR_BG_UMAJUMP, - /* 0x07D */ ACTOR_ARROW_FIRE, - /* 0x07E */ ACTOR_ARROW_ICE, - /* 0x07F */ ACTOR_ARROW_LIGHT, - /* 0x080 */ ACTOR_ITEM_ETCETERA, - /* 0x081 */ ACTOR_OBJ_KIBAKO, - /* 0x082 */ ACTOR_OBJ_TSUBO, - /* 0x083 */ ACTOR_UNSET_83, - /* 0x084 */ ACTOR_EN_IK, - /* 0x085 */ ACTOR_UNSET_85, - /* 0x086 */ ACTOR_UNSET_86, - /* 0x087 */ ACTOR_UNSET_87, - /* 0x088 */ ACTOR_UNSET_88, - /* 0x089 */ ACTOR_DEMO_SHD, - /* 0x08A */ ACTOR_EN_DNS, - /* 0x08B */ ACTOR_ELF_MSG, - /* 0x08C */ ACTOR_EN_HONOTRAP, - /* 0x08D */ ACTOR_EN_TUBO_TRAP, - /* 0x08E */ ACTOR_OBJ_ICE_POLY, - /* 0x08F */ ACTOR_EN_FZ, - /* 0x090 */ ACTOR_EN_KUSA, - /* 0x091 */ ACTOR_OBJ_BEAN, - /* 0x092 */ ACTOR_OBJ_BOMBIWA, - /* 0x093 */ ACTOR_OBJ_SWITCH, - /* 0x094 */ ACTOR_UNSET_94, - /* 0x095 */ ACTOR_OBJ_LIFT, - /* 0x096 */ ACTOR_OBJ_HSBLOCK, - /* 0x097 */ ACTOR_EN_OKARINA_TAG, - /* 0x098 */ ACTOR_UNSET_98, - /* 0x099 */ ACTOR_EN_GOROIWA, - /* 0x09A */ ACTOR_UNSET_9A, - /* 0x09B */ ACTOR_UNSET_9B, - /* 0x09C */ ACTOR_EN_DAIKU, - /* 0x09D */ ACTOR_EN_NWC, - /* 0x09E */ ACTOR_ITEM_INBOX, - /* 0x09F */ ACTOR_EN_GE1, - /* 0x0A0 */ ACTOR_OBJ_BLOCKSTOP, - /* 0x0A1 */ ACTOR_EN_SDA, - /* 0x0A2 */ ACTOR_EN_CLEAR_TAG, - /* 0x0A3 */ ACTOR_UNSET_A3, - /* 0x0A4 */ ACTOR_EN_GM, - /* 0x0A5 */ ACTOR_EN_MS, - /* 0x0A6 */ ACTOR_EN_HS, - /* 0x0A7 */ ACTOR_BG_INGATE, - /* 0x0A8 */ ACTOR_EN_KANBAN, - /* 0x0A9 */ ACTOR_UNSET_A9, - /* 0x0AA */ ACTOR_EN_ATTACK_NIW, - /* 0x0AB */ ACTOR_UNSET_AB, - /* 0x0AC */ ACTOR_UNSET_AC, - /* 0x0AD */ ACTOR_UNSET_AD, - /* 0x0AE */ ACTOR_EN_MK, - /* 0x0AF */ ACTOR_EN_OWL, - /* 0x0B0 */ ACTOR_EN_ISHI, - /* 0x0B1 */ ACTOR_OBJ_HANA, - /* 0x0B2 */ ACTOR_OBJ_LIGHTSWITCH, - /* 0x0B3 */ ACTOR_OBJ_MURE2, - /* 0x0B4 */ ACTOR_UNSET_B4, - /* 0x0B5 */ ACTOR_EN_FU, - /* 0x0B6 */ ACTOR_UNSET_B6, - /* 0x0B7 */ ACTOR_UNSET_B7, - /* 0x0B8 */ ACTOR_EN_STREAM, - /* 0x0B9 */ ACTOR_EN_MM, - /* 0x0BA */ ACTOR_UNSET_BA, - /* 0x0BB */ ACTOR_UNSET_BB, - /* 0x0BC */ ACTOR_EN_WEATHER_TAG, - /* 0x0BD */ ACTOR_EN_ANI, - /* 0x0BE */ ACTOR_UNSET_BE, - /* 0x0BF */ ACTOR_EN_JS, - /* 0x0C0 */ ACTOR_UNSET_C0, - /* 0x0C1 */ ACTOR_UNSET_C1, - /* 0x0C2 */ ACTOR_UNSET_C2, - /* 0x0C3 */ ACTOR_UNSET_C3, - /* 0x0C4 */ ACTOR_EN_OKARINA_EFFECT, - /* 0x0C5 */ ACTOR_EN_MAG, - /* 0x0C6 */ ACTOR_ELF_MSG2, - /* 0x0C7 */ ACTOR_BG_F40_SWLIFT, - /* 0x0C8 */ ACTOR_UNSET_C8, - /* 0x0C9 */ ACTOR_UNSET_C9, - /* 0x0CA */ ACTOR_EN_KAKASI, - /* 0x0CB */ ACTOR_OBJ_MAKEOSHIHIKI, - /* 0x0CC */ ACTOR_OCEFF_SPOT, - /* 0x0CD */ ACTOR_UNSET_CD, - /* 0x0CE */ ACTOR_EN_TORCH, - /* 0x0CF */ ACTOR_UNSET_CF, - /* 0x0D0 */ ACTOR_SHOT_SUN, - /* 0x0D1 */ ACTOR_UNSET_D1, - /* 0x0D2 */ ACTOR_UNSET_D2, - /* 0x0D3 */ ACTOR_OBJ_ROOMTIMER, - /* 0x0D4 */ ACTOR_EN_SSH, - /* 0x0D5 */ ACTOR_UNSET_D5, - /* 0x0D6 */ ACTOR_OCEFF_WIPE, - /* 0x0D7 */ ACTOR_OCEFF_STORM, - /* 0x0D8 */ ACTOR_OBJ_DEMO, - /* 0x0D9 */ ACTOR_EN_MINISLIME, - /* 0x0DA */ ACTOR_EN_NUTSBALL, - /* 0x0DB */ ACTOR_UNSET_DB, - /* 0x0DC */ ACTOR_UNSET_DC, - /* 0x0DD */ ACTOR_UNSET_DD, - /* 0x0DE */ ACTOR_UNSET_DE, - /* 0x0DF */ ACTOR_OCEFF_WIPE2, - /* 0x0E0 */ ACTOR_OCEFF_WIPE3, - /* 0x0E1 */ ACTOR_UNSET_E1, - /* 0x0E2 */ ACTOR_EN_DG, - /* 0x0E3 */ ACTOR_EN_SI, - /* 0x0E4 */ ACTOR_OBJ_COMB, - /* 0x0E5 */ ACTOR_OBJ_KIBAKO2, - /* 0x0E6 */ ACTOR_UNSET_E6, - /* 0x0E7 */ ACTOR_EN_HS2, - /* 0x0E8 */ ACTOR_OBJ_MURE3, - /* 0x0E9 */ ACTOR_EN_TG, - /* 0x0EA */ ACTOR_UNSET_EA, - /* 0x0EB */ ACTOR_UNSET_EB, - /* 0x0EC */ ACTOR_EN_WF, - /* 0x0ED */ ACTOR_EN_SKB, - /* 0x0EE */ ACTOR_UNSET_EE, - /* 0x0EF */ ACTOR_EN_GS, - /* 0x0F0 */ ACTOR_OBJ_SOUND, - /* 0x0F1 */ ACTOR_EN_CROW, - /* 0x0F2 */ ACTOR_UNSET_F2, - /* 0x0F3 */ ACTOR_EN_COW, - /* 0x0F4 */ ACTOR_UNSET_F4, - /* 0x0F5 */ ACTOR_UNSET_F5, - /* 0x0F6 */ ACTOR_OCEFF_WIPE4, - /* 0x0F7 */ ACTOR_UNSET_F7, - /* 0x0F8 */ ACTOR_EN_ZO, - /* 0x0F9 */ ACTOR_OBJ_MAKEKINSUTA, - /* 0x0FA */ ACTOR_EN_GE3, - /* 0x0FB */ ACTOR_UNSET_FB, - /* 0x0FC */ ACTOR_OBJ_HAMISHI, - /* 0x0FD */ ACTOR_EN_ZL4, - /* 0x0FE */ ACTOR_EN_MM2, - /* 0x0FF */ ACTOR_UNSET_FF, - /* 0x100 */ ACTOR_DOOR_SPIRAL, - /* 0x101 */ ACTOR_UNSET_101, - /* 0x102 */ ACTOR_OBJ_PZLBLOCK, - /* 0x103 */ ACTOR_OBJ_TOGE, - /* 0x104 */ ACTOR_UNSET_104, - /* 0x105 */ ACTOR_OBJ_ARMOS, - /* 0x106 */ ACTOR_OBJ_BOYO, - /* 0x107 */ ACTOR_UNSET_107, - /* 0x108 */ ACTOR_UNSET_108, - /* 0x109 */ ACTOR_EN_GRASSHOPPER, - /* 0x10A */ ACTOR_UNSET_10A, - /* 0x10B */ ACTOR_OBJ_GRASS, - /* 0x10C */ ACTOR_OBJ_GRASS_CARRY, - /* 0x10D */ ACTOR_OBJ_GRASS_UNIT, - /* 0x10E */ ACTOR_UNSET_10E, - /* 0x10F */ ACTOR_UNSET_10F, - /* 0x110 */ ACTOR_BG_FIRE_WALL, - /* 0x111 */ ACTOR_EN_BU, - /* 0x112 */ ACTOR_EN_ENCOUNT3, - /* 0x113 */ ACTOR_EN_JSO, - /* 0x114 */ ACTOR_OBJ_CHIKUWA, - /* 0x115 */ ACTOR_EN_KNIGHT, - /* 0x116 */ ACTOR_EN_WARP_TAG, - /* 0x117 */ ACTOR_EN_AOB_01, - /* 0x118 */ ACTOR_EN_BOJ_01, - /* 0x119 */ ACTOR_EN_BOJ_02, - /* 0x11A */ ACTOR_EN_BOJ_03, - /* 0x11B */ ACTOR_EN_ENCOUNT4, - /* 0x11C */ ACTOR_EN_BOM_BOWL_MAN, - /* 0x11D */ ACTOR_EN_SYATEKI_MAN, - /* 0x11E */ ACTOR_UNSET_11E, - /* 0x11F */ ACTOR_BG_ICICLE, - /* 0x120 */ ACTOR_EN_SYATEKI_CROW, - /* 0x121 */ ACTOR_EN_BOJ_04, - /* 0x122 */ ACTOR_EN_CNE_01, - /* 0x123 */ ACTOR_EN_BBA_01, - /* 0x124 */ ACTOR_EN_BJI_01, - /* 0x125 */ ACTOR_BG_SPDWEB, - /* 0x126 */ ACTOR_UNSET_126, - /* 0x127 */ ACTOR_UNSET_127, - /* 0x128 */ ACTOR_EN_MT_TAG, - /* 0x129 */ ACTOR_BOSS_01, - /* 0x12A */ ACTOR_BOSS_02, - /* 0x12B */ ACTOR_BOSS_03, - /* 0x12C */ ACTOR_BOSS_04, - /* 0x12D */ ACTOR_BOSS_05, - /* 0x12E */ ACTOR_BOSS_06, - /* 0x12F */ ACTOR_BOSS_07, - /* 0x130 */ ACTOR_BG_DY_YOSEIZO, - /* 0x131 */ ACTOR_UNSET_131, - /* 0x132 */ ACTOR_EN_BOJ_05, - /* 0x133 */ ACTOR_UNSET_133, - /* 0x134 */ ACTOR_UNSET_134, - /* 0x135 */ ACTOR_EN_SOB1, - /* 0x136 */ ACTOR_UNSET_136, - /* 0x137 */ ACTOR_UNSET_137, - /* 0x138 */ ACTOR_EN_GO, - /* 0x139 */ ACTOR_UNSET_139, - /* 0x13A */ ACTOR_EN_RAF, - /* 0x13B */ ACTOR_OBJ_FUNEN, - /* 0x13C */ ACTOR_OBJ_RAILLIFT, - /* 0x13D */ ACTOR_BG_NUMA_HANA, - /* 0x13E */ ACTOR_OBJ_FLOWERPOT, - /* 0x13F */ ACTOR_OBJ_SPINYROLL, - /* 0x140 */ ACTOR_DM_HINA, - /* 0x141 */ ACTOR_EN_SYATEKI_WF, - /* 0x142 */ ACTOR_OBJ_SKATEBLOCK, - /* 0x143 */ ACTOR_OBJ_ICEBLOCK, - /* 0x144 */ ACTOR_EN_BIGPAMET, - /* 0x145 */ ACTOR_EN_SYATEKI_DEKUNUTS, - /* 0x146 */ ACTOR_ELF_MSG3, - /* 0x147 */ ACTOR_EN_FG, - /* 0x148 */ ACTOR_DM_RAVINE, - /* 0x149 */ ACTOR_DM_SA, - /* 0x14A */ ACTOR_EN_SLIME, - /* 0x14B */ ACTOR_EN_PR, - /* 0x14C */ ACTOR_OBJ_TOUDAI, - /* 0x14D */ ACTOR_OBJ_ENTOTU, - /* 0x14E */ ACTOR_OBJ_BELL, - /* 0x14F */ ACTOR_EN_SYATEKI_OKUTA, - /* 0x150 */ ACTOR_UNSET_150, - /* 0x151 */ ACTOR_OBJ_SHUTTER, - /* 0x152 */ ACTOR_DM_ZL, - /* 0x153 */ ACTOR_EN_ELFGRP, - /* 0x154 */ ACTOR_DM_TSG, - /* 0x155 */ ACTOR_EN_BAGUO, - /* 0x156 */ ACTOR_OBJ_VSPINYROLL, - /* 0x157 */ ACTOR_OBJ_SMORK, - /* 0x158 */ ACTOR_EN_TEST2, - /* 0x159 */ ACTOR_EN_TEST3, - /* 0x15A */ ACTOR_EN_TEST4, - /* 0x15B */ ACTOR_EN_BAT, - /* 0x15C */ ACTOR_EN_SEKIHI, - /* 0x15D */ ACTOR_EN_WIZ, - /* 0x15E */ ACTOR_EN_WIZ_BROCK, - /* 0x15F */ ACTOR_EN_WIZ_FIRE, - /* 0x160 */ ACTOR_EFF_CHANGE, - /* 0x161 */ ACTOR_DM_STATUE, - /* 0x162 */ ACTOR_OBJ_FIRESHIELD, - /* 0x163 */ ACTOR_BG_LADDER, - /* 0x164 */ ACTOR_EN_MKK, - /* 0x165 */ ACTOR_DEMO_GETITEM, - /* 0x166 */ ACTOR_UNSET_166, - /* 0x167 */ ACTOR_EN_DNB, - /* 0x168 */ ACTOR_EN_DNH, - /* 0x169 */ ACTOR_EN_DNK, - /* 0x16A */ ACTOR_EN_DNQ, - /* 0x16B */ ACTOR_UNSET_16B, - /* 0x16C */ ACTOR_BG_KEIKOKU_SAKU, - /* 0x16D */ ACTOR_OBJ_HUGEBOMBIWA, - /* 0x16E */ ACTOR_EN_FIREFLY2, - /* 0x16F */ ACTOR_EN_RAT, - /* 0x170 */ ACTOR_EN_WATER_EFFECT, - /* 0x171 */ ACTOR_EN_KUSA2, - /* 0x172 */ ACTOR_BG_SPOUT_FIRE, - /* 0x173 */ ACTOR_UNSET_173, - /* 0x174 */ ACTOR_BG_DBLUE_MOVEBG, - /* 0x175 */ ACTOR_EN_DY_EXTRA, - /* 0x176 */ ACTOR_EN_BAL, - /* 0x177 */ ACTOR_EN_GINKO_MAN, - /* 0x178 */ ACTOR_EN_WARP_UZU, - /* 0x179 */ ACTOR_OBJ_DRIFTICE, - /* 0x17A */ ACTOR_EN_LOOK_NUTS, - /* 0x17B */ ACTOR_EN_MUSHI2, - /* 0x17C */ ACTOR_EN_FALL, - /* 0x17D */ ACTOR_EN_MM3, - /* 0x17E */ ACTOR_BG_CRACE_MOVEBG, - /* 0x17F */ ACTOR_EN_DNO, - /* 0x180 */ ACTOR_EN_PR2, - /* 0x181 */ ACTOR_EN_PRZ, - /* 0x182 */ ACTOR_EN_JSO2, - /* 0x183 */ ACTOR_OBJ_ETCETERA, - /* 0x184 */ ACTOR_EN_EGOL, - /* 0x185 */ ACTOR_OBJ_MINE, - /* 0x186 */ ACTOR_OBJ_PURIFY, - /* 0x187 */ ACTOR_EN_TRU, - /* 0x188 */ ACTOR_EN_TRT, - /* 0x189 */ ACTOR_UNSET_189, - /* 0x18A */ ACTOR_UNSET_18A, - /* 0x18B */ ACTOR_EN_TEST5, - /* 0x18C */ ACTOR_EN_TEST6, - /* 0x18D */ ACTOR_EN_AZ, - /* 0x18E */ ACTOR_EN_ESTONE, - /* 0x18F */ ACTOR_BG_HAKUGIN_POST, - /* 0x190 */ ACTOR_DM_OPSTAGE, - /* 0x191 */ ACTOR_DM_STK, - /* 0x192 */ ACTOR_DM_CHAR00, - /* 0x193 */ ACTOR_DM_CHAR01, - /* 0x194 */ ACTOR_DM_CHAR02, - /* 0x195 */ ACTOR_DM_CHAR03, - /* 0x196 */ ACTOR_DM_CHAR04, - /* 0x197 */ ACTOR_DM_CHAR05, - /* 0x198 */ ACTOR_DM_CHAR06, - /* 0x199 */ ACTOR_DM_CHAR07, - /* 0x19A */ ACTOR_DM_CHAR08, - /* 0x19B */ ACTOR_DM_CHAR09, - /* 0x19C */ ACTOR_OBJ_TOKEIDAI, - /* 0x19D */ ACTOR_UNSET_19D, - /* 0x19E */ ACTOR_EN_MNK, - /* 0x19F */ ACTOR_EN_EGBLOCK, - /* 0x1A0 */ ACTOR_EN_GUARD_NUTS, - /* 0x1A1 */ ACTOR_BG_HAKUGIN_BOMBWALL, - /* 0x1A2 */ ACTOR_OBJ_TOKEI_TOBIRA, - /* 0x1A3 */ ACTOR_BG_HAKUGIN_ELVPOLE, - /* 0x1A4 */ ACTOR_EN_MA4, - /* 0x1A5 */ ACTOR_EN_TWIG, - /* 0x1A6 */ ACTOR_EN_PO_FUSEN, - /* 0x1A7 */ ACTOR_EN_DOOR_ETC, - /* 0x1A8 */ ACTOR_EN_BIGOKUTA, - /* 0x1A9 */ ACTOR_BG_ICEFLOE, - /* 0x1AA */ ACTOR_OBJ_OCARINALIFT, - /* 0x1AB */ ACTOR_EN_TIME_TAG, - /* 0x1AC */ ACTOR_BG_OPEN_SHUTTER, - /* 0x1AD */ ACTOR_BG_OPEN_SPOT, - /* 0x1AE */ ACTOR_BG_FU_KAITEN, - /* 0x1AF */ ACTOR_OBJ_AQUA, - /* 0x1B0 */ ACTOR_EN_ELFORG, - /* 0x1B1 */ ACTOR_EN_ELFBUB, - /* 0x1B2 */ ACTOR_UNSET_1B2, - /* 0x1B3 */ ACTOR_EN_FU_MATO, - /* 0x1B4 */ ACTOR_EN_FU_KAGO, - /* 0x1B5 */ ACTOR_EN_OSN, - /* 0x1B6 */ ACTOR_BG_CTOWER_GEAR, - /* 0x1B7 */ ACTOR_EN_TRT2, - /* 0x1B8 */ ACTOR_OBJ_TOKEI_STEP, - /* 0x1B9 */ ACTOR_BG_LOTUS, - /* 0x1BA */ ACTOR_EN_KAME, - /* 0x1BB */ ACTOR_OBJ_TAKARAYA_WALL, - /* 0x1BC */ ACTOR_BG_FU_MIZU, - /* 0x1BD */ ACTOR_EN_SELLNUTS, - /* 0x1BE */ ACTOR_BG_DKJAIL_IVY, - /* 0x1BF */ ACTOR_UNSET_1BF, - /* 0x1C0 */ ACTOR_OBJ_VISIBLOCK, - /* 0x1C1 */ ACTOR_EN_TAKARAYA, - /* 0x1C2 */ ACTOR_EN_TSN, - /* 0x1C3 */ ACTOR_EN_DS2N, - /* 0x1C4 */ ACTOR_EN_FSN, - /* 0x1C5 */ ACTOR_EN_SHN, - /* 0x1C6 */ ACTOR_UNSET_1C6, - /* 0x1C7 */ ACTOR_EN_STOP_HEISHI, - /* 0x1C8 */ ACTOR_OBJ_BIGICICLE, - /* 0x1C9 */ ACTOR_EN_LIFT_NUTS, - /* 0x1CA */ ACTOR_EN_TK, - /* 0x1CB */ ACTOR_UNSET_1CB, - /* 0x1CC */ ACTOR_BG_MARKET_STEP, - /* 0x1CD */ ACTOR_OBJ_LUPYGAMELIFT, - /* 0x1CE */ ACTOR_EN_TEST7, - /* 0x1CF */ ACTOR_OBJ_LIGHTBLOCK, - /* 0x1D0 */ ACTOR_MIR_RAY2, - /* 0x1D1 */ ACTOR_EN_WDHAND, - /* 0x1D2 */ ACTOR_EN_GAMELUPY, - /* 0x1D3 */ ACTOR_BG_DANPEI_MOVEBG, - /* 0x1D4 */ ACTOR_EN_SNOWWD, - /* 0x1D5 */ ACTOR_EN_PM, - /* 0x1D6 */ ACTOR_EN_GAKUFU, - /* 0x1D7 */ ACTOR_ELF_MSG4, - /* 0x1D8 */ ACTOR_ELF_MSG5, - /* 0x1D9 */ ACTOR_EN_COL_MAN, - /* 0x1DA */ ACTOR_EN_TALK_GIBUD, - /* 0x1DB */ ACTOR_EN_GIANT, - /* 0x1DC */ ACTOR_OBJ_SNOWBALL, - /* 0x1DD */ ACTOR_BOSS_HAKUGIN, - /* 0x1DE */ ACTOR_EN_GB2, - /* 0x1DF */ ACTOR_EN_ONPUMAN, - /* 0x1E0 */ ACTOR_BG_TOBIRA01, - /* 0x1E1 */ ACTOR_EN_TAG_OBJ, - /* 0x1E2 */ ACTOR_OBJ_DHOUSE, - /* 0x1E3 */ ACTOR_OBJ_HAKAISI, - /* 0x1E4 */ ACTOR_BG_HAKUGIN_SWITCH, - /* 0x1E5 */ ACTOR_UNSET_1E5, - /* 0x1E6 */ ACTOR_EN_SNOWMAN, - /* 0x1E7 */ ACTOR_TG_SW, - /* 0x1E8 */ ACTOR_EN_PO_SISTERS, - /* 0x1E9 */ ACTOR_EN_PP, - /* 0x1EA */ ACTOR_EN_HAKUROCK, - /* 0x1EB */ ACTOR_EN_HANABI, - /* 0x1EC */ ACTOR_OBJ_DOWSING, - /* 0x1ED */ ACTOR_OBJ_WIND, - /* 0x1EE */ ACTOR_EN_RACEDOG, - /* 0x1EF */ ACTOR_EN_KENDO_JS, - /* 0x1F0 */ ACTOR_BG_BOTIHASIRA, - /* 0x1F1 */ ACTOR_EN_FISH2, - /* 0x1F2 */ ACTOR_EN_PST, - /* 0x1F3 */ ACTOR_EN_POH, - /* 0x1F4 */ ACTOR_OBJ_SPIDERTENT, - /* 0x1F5 */ ACTOR_EN_ZORAEGG, - /* 0x1F6 */ ACTOR_EN_KBT, - /* 0x1F7 */ ACTOR_EN_GG, - /* 0x1F8 */ ACTOR_EN_MARUTA, - /* 0x1F9 */ ACTOR_OBJ_SNOWBALL2, - /* 0x1FA */ ACTOR_EN_GG2, - /* 0x1FB */ ACTOR_OBJ_GHAKA, - /* 0x1FC */ ACTOR_EN_DNP, - /* 0x1FD */ ACTOR_EN_DAI, - /* 0x1FE */ ACTOR_BG_GORON_OYU, - /* 0x1FF */ ACTOR_EN_KGY, - /* 0x200 */ ACTOR_EN_INVADEPOH, - /* 0x201 */ ACTOR_EN_GK, - /* 0x202 */ ACTOR_EN_AN, - /* 0x203 */ ACTOR_UNSET_203, - /* 0x204 */ ACTOR_EN_BEE, - /* 0x205 */ ACTOR_EN_OT, - /* 0x206 */ ACTOR_EN_DRAGON, - /* 0x207 */ ACTOR_OBJ_DORA, - /* 0x208 */ ACTOR_EN_BIGPO, - /* 0x209 */ ACTOR_OBJ_KENDO_KANBAN, - /* 0x20A */ ACTOR_OBJ_HARIKO, - /* 0x20B */ ACTOR_EN_STH, - /* 0x20C */ ACTOR_BG_SINKAI_KABE, - /* 0x20D */ ACTOR_BG_HAKA_CURTAIN, - /* 0x20E */ ACTOR_BG_KIN2_BOMBWALL, - /* 0x20F */ ACTOR_BG_KIN2_FENCE, - /* 0x210 */ ACTOR_BG_KIN2_PICTURE, - /* 0x211 */ ACTOR_BG_KIN2_SHELF, - /* 0x212 */ ACTOR_EN_RAIL_SKB, - /* 0x213 */ ACTOR_EN_JG, - /* 0x214 */ ACTOR_EN_TRU_MT, - /* 0x215 */ ACTOR_OBJ_UM, - /* 0x216 */ ACTOR_EN_NEO_REEBA, - /* 0x217 */ ACTOR_BG_MBAR_CHAIR, - /* 0x218 */ ACTOR_BG_IKANA_BLOCK, - /* 0x219 */ ACTOR_BG_IKANA_MIRROR, - /* 0x21A */ ACTOR_BG_IKANA_ROTARYROOM, - /* 0x21B */ ACTOR_BG_DBLUE_BALANCE, - /* 0x21C */ ACTOR_BG_DBLUE_WATERFALL, - /* 0x21D */ ACTOR_EN_KAIZOKU, - /* 0x21E */ ACTOR_EN_GE2, - /* 0x21F */ ACTOR_EN_MA_YTS, - /* 0x220 */ ACTOR_EN_MA_YTO, - /* 0x221 */ ACTOR_OBJ_TOKEI_TURRET, - /* 0x222 */ ACTOR_BG_DBLUE_ELEVATOR, - /* 0x223 */ ACTOR_OBJ_WARPSTONE, - /* 0x224 */ ACTOR_EN_ZOG, - /* 0x225 */ ACTOR_OBJ_ROTLIFT, - /* 0x226 */ ACTOR_OBJ_JG_GAKKI, - /* 0x227 */ ACTOR_BG_INIBS_MOVEBG, - /* 0x228 */ ACTOR_EN_ZOT, - /* 0x229 */ ACTOR_OBJ_TREE, - /* 0x22A */ ACTOR_OBJ_Y2LIFT, - /* 0x22B */ ACTOR_OBJ_Y2SHUTTER, - /* 0x22C */ ACTOR_OBJ_BOAT, - /* 0x22D */ ACTOR_OBJ_TARU, - /* 0x22E */ ACTOR_OBJ_HUNSUI, - /* 0x22F */ ACTOR_EN_JC_MATO, - /* 0x230 */ ACTOR_MIR_RAY3, - /* 0x231 */ ACTOR_EN_ZOB, - /* 0x232 */ ACTOR_ELF_MSG6, - /* 0x233 */ ACTOR_OBJ_NOZOKI, - /* 0x234 */ ACTOR_EN_TOTO, - /* 0x235 */ ACTOR_EN_RAILGIBUD, - /* 0x236 */ ACTOR_EN_BABA, - /* 0x237 */ ACTOR_EN_SUTTARI, - /* 0x238 */ ACTOR_EN_ZOD, - /* 0x239 */ ACTOR_EN_KUJIYA, - /* 0x23A */ ACTOR_EN_GEG, - /* 0x23B */ ACTOR_OBJ_KINOKO, - /* 0x23C */ ACTOR_OBJ_YASI, - /* 0x23D */ ACTOR_EN_TANRON1, - /* 0x23E */ ACTOR_EN_TANRON2, - /* 0x23F */ ACTOR_EN_TANRON3, - /* 0x240 */ ACTOR_OBJ_CHAN, - /* 0x241 */ ACTOR_EN_ZOS, - /* 0x242 */ ACTOR_EN_S_GORO, - /* 0x243 */ ACTOR_EN_NB, - /* 0x244 */ ACTOR_EN_JA, - /* 0x245 */ ACTOR_BG_F40_BLOCK, - /* 0x246 */ ACTOR_BG_F40_SWITCH, - /* 0x247 */ ACTOR_EN_PO_COMPOSER, - /* 0x248 */ ACTOR_EN_GURUGURU, - /* 0x249 */ ACTOR_OCEFF_WIPE5, - /* 0x24A */ ACTOR_EN_STONE_HEISHI, - /* 0x24B */ ACTOR_OCEFF_WIPE6, - /* 0x24C */ ACTOR_EN_SCOPENUTS, - /* 0x24D */ ACTOR_EN_SCOPECROW, - /* 0x24E */ ACTOR_OCEFF_WIPE7, - /* 0x24F */ ACTOR_EFF_KAMEJIMA_WAVE, - /* 0x250 */ ACTOR_EN_HG, - /* 0x251 */ ACTOR_EN_HGO, - /* 0x252 */ ACTOR_EN_ZOV, - /* 0x253 */ ACTOR_EN_AH, - /* 0x254 */ ACTOR_OBJ_HGDOOR, - /* 0x255 */ ACTOR_BG_IKANA_BOMBWALL, - /* 0x256 */ ACTOR_BG_IKANA_RAY, - /* 0x257 */ ACTOR_BG_IKANA_SHUTTER, - /* 0x258 */ ACTOR_BG_HAKA_BOMBWALL, - /* 0x259 */ ACTOR_BG_HAKA_TOMB, - /* 0x25A */ ACTOR_EN_SC_RUPPE, - /* 0x25B */ ACTOR_BG_IKNV_DOUKUTU, - /* 0x25C */ ACTOR_BG_IKNV_OBJ, - /* 0x25D */ ACTOR_EN_PAMERA, - /* 0x25E */ ACTOR_OBJ_HSSTUMP, - /* 0x25F */ ACTOR_EN_HIDDEN_NUTS, - /* 0x260 */ ACTOR_EN_ZOW, - /* 0x261 */ ACTOR_EN_TALK, - /* 0x262 */ ACTOR_EN_AL, - /* 0x263 */ ACTOR_EN_TAB, - /* 0x264 */ ACTOR_EN_NIMOTSU, - /* 0x265 */ ACTOR_EN_HIT_TAG, - /* 0x266 */ ACTOR_EN_RUPPECROW, - /* 0x267 */ ACTOR_EN_TANRON4, - /* 0x268 */ ACTOR_EN_TANRON5, - /* 0x269 */ ACTOR_EN_TANRON6, - /* 0x26A */ ACTOR_EN_DAIKU2, - /* 0x26B */ ACTOR_EN_MUTO, - /* 0x26C */ ACTOR_EN_BAISEN, - /* 0x26D */ ACTOR_EN_HEISHI, - /* 0x26E */ ACTOR_EN_DEMO_HEISHI, - /* 0x26F */ ACTOR_EN_DT, - /* 0x270 */ ACTOR_EN_CHA, - /* 0x271 */ ACTOR_OBJ_DINNER, - /* 0x272 */ ACTOR_EFF_LASTDAY, - /* 0x273 */ ACTOR_BG_IKANA_DHARMA, - /* 0x274 */ ACTOR_EN_AKINDONUTS, - /* 0x275 */ ACTOR_EFF_STK, - /* 0x276 */ ACTOR_EN_IG, - /* 0x277 */ ACTOR_EN_RG, - /* 0x278 */ ACTOR_EN_OSK, - /* 0x279 */ ACTOR_EN_STH2, - /* 0x27A */ ACTOR_EN_YB, - /* 0x27B */ ACTOR_EN_RZ, - /* 0x27C */ ACTOR_EN_SCOPECOIN, - /* 0x27D */ ACTOR_EN_BJT, - /* 0x27E */ ACTOR_EN_BOMJIMA, - /* 0x27F */ ACTOR_EN_BOMJIMB, - /* 0x280 */ ACTOR_EN_BOMBERS, - /* 0x281 */ ACTOR_EN_BOMBERS2, - /* 0x282 */ ACTOR_EN_BOMBAL, - /* 0x283 */ ACTOR_OBJ_MOON_STONE, - /* 0x284 */ ACTOR_OBJ_MU_PICT, - /* 0x285 */ ACTOR_BG_IKNINSIDE, - /* 0x286 */ ACTOR_EFF_ZORABAND, - /* 0x287 */ ACTOR_OBJ_KEPN_KOYA, - /* 0x288 */ ACTOR_OBJ_USIYANE, - /* 0x289 */ ACTOR_EN_NNH, - /* 0x28A */ ACTOR_OBJ_KZSAKU, - /* 0x28B */ ACTOR_OBJ_MILK_BIN, - /* 0x28C */ ACTOR_EN_KITAN, - /* 0x28D */ ACTOR_BG_ASTR_BOMBWALL, - /* 0x28E */ ACTOR_BG_IKNIN_SUSCEIL, - /* 0x28F */ ACTOR_EN_BSB, - /* 0x290 */ ACTOR_EN_RECEPGIRL, - /* 0x291 */ ACTOR_EN_THIEFBIRD, - /* 0x292 */ ACTOR_EN_JGAME_TSN, - /* 0x293 */ ACTOR_OBJ_JGAME_LIGHT, - /* 0x294 */ ACTOR_OBJ_YADO, - /* 0x295 */ ACTOR_DEMO_SYOTEN, - /* 0x296 */ ACTOR_DEMO_MOONEND, - /* 0x297 */ ACTOR_BG_LBFSHOT, - /* 0x298 */ ACTOR_BG_LAST_BWALL, - /* 0x299 */ ACTOR_EN_AND, - /* 0x29A */ ACTOR_EN_INVADEPOH_DEMO, - /* 0x29B */ ACTOR_OBJ_DANPEILIFT, - /* 0x29C */ ACTOR_EN_FALL2, - /* 0x29D */ ACTOR_DM_AL, - /* 0x29E */ ACTOR_DM_AN, - /* 0x29F */ ACTOR_DM_AH, - /* 0x2A0 */ ACTOR_DM_NB, - /* 0x2A1 */ ACTOR_EN_DRS, - /* 0x2A2 */ ACTOR_EN_ENDING_HERO, - /* 0x2A3 */ ACTOR_DM_BAL, - /* 0x2A4 */ ACTOR_EN_PAPER, - /* 0x2A5 */ ACTOR_EN_HINT_SKB, - /* 0x2A6 */ ACTOR_DM_TAG, - /* 0x2A7 */ ACTOR_EN_BH, - /* 0x2A8 */ ACTOR_EN_ENDING_HERO2, - /* 0x2A9 */ ACTOR_EN_ENDING_HERO3, - /* 0x2AA */ ACTOR_EN_ENDING_HERO4, - /* 0x2AB */ ACTOR_EN_ENDING_HERO5, - /* 0x2AC */ ACTOR_EN_ENDING_HERO6, - /* 0x2AD */ ACTOR_DM_GM, - /* 0x2AE */ ACTOR_OBJ_SWPRIZE, - /* 0x2AF */ ACTOR_EN_INVISIBLE_RUPPE, - /* 0x2B0 */ ACTOR_OBJ_ENDING, - /* 0x2B1 */ ACTOR_EN_RSN, + +#define DEFINE_ACTOR(_name, enumValue, _allocType, _debugName) enumValue, +#define DEFINE_ACTOR_INTERNAL(_name, enumValue, _allocType, _debugName) enumValue, +#define DEFINE_ACTOR_UNSET(enumValue) enumValue, + +typedef enum ActorId { + #include "tables/actor_table.h" /* 0x2B2 */ ACTOR_ID_MAX // originally "ACTOR_DLF_MAX" -} ActorID; +} ActorId; + +#undef DEFINE_ACTOR +#undef DEFINE_ACTOR_INTERNAL +#undef DEFINE_ACTOR_UNSET typedef enum { /* 0 */ DOORLOCK_NORMAL, diff --git a/include/z64message.h b/include/z64message.h index 590074339..7d4723e7b 100644 --- a/include/z64message.h +++ b/include/z64message.h @@ -160,7 +160,8 @@ typedef struct MessageContext { /* 0x120A4 */ s16 unk120A4[6]; /* 0x120B0 */ u8 unk120B0; /* 0x120B1 */ u8 unk120B1; - /* 0x120B2 */ u8 unk120B2[0xC]; + /* 0x120B2 */ u8 unk120B2[0xA]; + /* 0x120BC */ u16 unk_120BC; /* 0x120BE */ s16 unk120BE; /* 0x120C0 */ s16 unk120C0; /* 0x120C2 */ s16 unk120C2; diff --git a/include/z64object.h b/include/z64object.h index 306f84ebd..e800e9138 100644 --- a/include/z64object.h +++ b/include/z64object.h @@ -1,5 +1,5 @@ -#ifndef _Z64OBJECT_H_ -#define _Z64OBJECT_H_ +#ifndef Z64OBJECT_H +#define Z64OBJECT_H #define OBJECT_SPACE_SIZE_DEFAULT 1413120 #define OBJECT_SPACE_SIZE_CLOCK_TOWN 1566720 diff --git a/include/z64player.h b/include/z64player.h index 2f101b558..1d7261aa2 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -97,7 +97,8 @@ typedef enum PlayerActionParam { /* 0x0E */ PLAYER_AP_BOMB, /* 0x0F */ PLAYER_AP_POWDER_KEG, /* 0x10 */ PLAYER_AP_BOMBCHU, - /* 0x12 */ PLAYER_AP_NUT = 0x12, + /* 0x11 */ PLAYER_AP_11, + /* 0x12 */ PLAYER_AP_NUT, /* 0x13 */ PLAYER_AP_PICTO_BOX, /* 0x14 */ PLAYER_AP_OCARINA, /* 0x15 */ PLAYER_AP_BOTTLE, @@ -107,7 +108,8 @@ typedef enum PlayerActionParam { /* 0x19 */ PLAYER_AP_BOTTLE_ZORA_EGG, /* 0x1A */ PLAYER_AP_BOTTLE_DEKU_PRINCESS, /* 0x1B */ PLAYER_AP_BOTTLE_GOLD_DUST, - /* 0x1D */ PLAYER_AP_BOTTLE_SEAHORSE = 0x1D, + /* 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, @@ -128,9 +130,15 @@ typedef enum PlayerActionParam { /* 0x2F */ PLAYER_AP_DEED_SWAMP, /* 0x30 */ PLAYER_AP_DEED_MOUNTAIN, /* 0x31 */ PLAYER_AP_DEED_OCEAN, - /* 0x33 */ PLAYER_AP_LETTER_MAMA = 0x33, - /* 0x36 */ PLAYER_AP_PENDANT_OF_MEMORIES = 0x36, - /* 0x3A */ PLAYER_AP_MASK_TRUTH = 0x3A, + /* 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, @@ -155,7 +163,7 @@ typedef enum PlayerActionParam { /* 0x50 */ PLAYER_AP_MASK_ZORA, /* 0x51 */ PLAYER_AP_MASK_DEKU, /* 0x52 */ PLAYER_AP_LENS, - /* 0xFD */ PLAYER_AP_MAX = 0xFD + /* 0x53 */ PLAYER_AP_MAX } PlayerActionParam; typedef enum { @@ -196,6 +204,134 @@ typedef enum { /* 34 */ PLAYER_MWA_MAX } PlayerMeleeWeaponAnimation; +typedef enum PlayerAnimType { + /* 0 */ PLAYER_ANIMTYPE_0, + /* 1 */ PLAYER_ANIMTYPE_1, + /* 2 */ PLAYER_ANIMTYPE_2, + /* 3 */ PLAYER_ANIMTYPE_3, + /* 4 */ PLAYER_ANIMTYPE_4, + /* 5 */ PLAYER_ANIMTYPE_5, + /* 6 */ PLAYER_ANIMTYPE_MAX +} PlayerAnimType; + +typedef enum PlayerModelType { + // left hand + /* 0 */ PLAYER_MODELTYPE_LH_OPEN, + /* 1 */ PLAYER_MODELTYPE_LH_CLOSED, + /* 2 */ PLAYER_MODELTYPE_LH_ONE_HAND_SWORD, + /* 3 */ PLAYER_MODELTYPE_LH_TWO_HAND_SWORD, + /* 4 */ PLAYER_MODELTYPE_LH_4, + /* 5 */ PLAYER_MODELTYPE_LH_BOTTLE, + // right hand + /* 6 */ PLAYER_MODELTYPE_RH_OPEN, + /* 7 */ PLAYER_MODELTYPE_RH_CLOSED, + /* 8 */ PLAYER_MODELTYPE_RH_SHIELD, + /* 9 */ PLAYER_MODELTYPE_RH_BOW, + /* 10 */ PLAYER_MODELTYPE_RH_INSTRUMENT, + /* 11 */ PLAYER_MODELTYPE_RH_HOOKSHOT, + // sheath + /* 12 */ PLAYER_MODELTYPE_SHEATH_12, + /* 13 */ PLAYER_MODELTYPE_SHEATH_13, + /* 14 */ PLAYER_MODELTYPE_SHEATH_14, + /* 15 */ PLAYER_MODELTYPE_SHEATH_15, + // waist + /* 16 */ PLAYER_MODELTYPE_WAIST, + /* 17 */ PLAYER_MODELTYPE_17, // NULL? + /* 18 */ PLAYER_MODELTYPE_MAX +} PlayerModelType; + +typedef struct PlayerModelIndices { + /* 0x0 */ u8 modelAnimType; // PlayerAnimType enum + /* 0x1 */ u8 leftHandType; // PlayerModelType enum + /* 0x2 */ u8 rightHandType; // PlayerModelType enum + /* 0x3 */ u8 sheathType; // PlayerModelType enum + /* 0x4 */ u8 waistType; // PlayerModelType enum +} PlayerModelIndices; // size = 0x5 + +typedef enum PlayerModelGroup { + /* 0 */ PLAYER_MODELGROUP_0, + /* 1 */ PLAYER_MODELGROUP_1, + /* 2 */ PLAYER_MODELGROUP_ONE_HAND_SWORD, + /* 3 */ PLAYER_MODELGROUP_DEFAULT, // non-specific models, for items that don't have particular link models + /* 4 */ PLAYER_MODELGROUP_4, + /* 5 */ PLAYER_MODELGROUP_TWO_HAND_SWORD, + /* 6 */ PLAYER_MODELGROUP_BOW, + /* 7 */ PLAYER_MODELGROUP_EXPLOSIVES, + /* 8 */ PLAYER_MODELGROUP_8, + /* 9 */ PLAYER_MODELGROUP_HOOKSHOT, + /* 10 */ PLAYER_MODELGROUP_STICK, + /* 11 */ PLAYER_MODELGROUP_INSTRUMENT, + /* 12 */ PLAYER_MODELGROUP_BOTTLE, + /* 13 */ PLAYER_MODELGROUP_13, + /* 14 */ PLAYER_MODELGROUP_ZORA_FINS, + /* 15 */ PLAYER_MODELGROUP_MAX +} PlayerModelGroup; + +typedef enum { + /* 0 */ PLAYER_EYES_OPEN, + /* 1 */ PLAYER_EYES_HALF, + /* 2 */ PLAYER_EYES_CLOSED, + /* 3 */ PLAYER_EYES_ROLL_RIGHT, + /* 4 */ PLAYER_EYES_ROLL_LEFT, + /* 5 */ PLAYER_EYES_ROLL_UP, + /* 6 */ PLAYER_EYES_ROLL_DOWN, + /* 7 */ PLAYER_EYES_7, + /* 8 */ PLAYER_EYES_MAX +} PlayerEyeIndex; + +typedef enum { + /* 0 */ PLAYER_MOUTH_CLOSED, + /* 1 */ PLAYER_MOUTH_TEETH, + /* 2 */ PLAYER_MOUTH_ANGRY, + /* 3 */ PLAYER_MOUTH_HAPPY, + /* 4 */ PLAYER_MOUTH_MAX +} PlayerMouthIndex; + +typedef enum { + /* 0 */ PLAYER_FACE_0, + /* 1 */ PLAYER_FACE_1, + /* 2 */ PLAYER_FACE_2, + /* 3 */ PLAYER_FACE_3, + /* 4 */ PLAYER_FACE_4, + /* 5 */ PLAYER_FACE_5, + /* 6 */ PLAYER_FACE_6, + /* 7 */ PLAYER_FACE_7, + /* 8 */ PLAYER_FACE_8, + /* 9 */ PLAYER_FACE_9, + /* 10 */ PLAYER_FACE_10, + /* 11 */ PLAYER_FACE_11, + /* 12 */ PLAYER_FACE_12, + /* 13 */ PLAYER_FACE_13, + /* 14 */ PLAYER_FACE_14, + /* 15 */ PLAYER_FACE_15 +} PlayerFacialExpression; + +typedef enum { + /* 0x00 */ PLAYER_LIMB_NONE, + /* 0x01 */ PLAYER_LIMB_ROOT, + /* 0x02 */ PLAYER_LIMB_WAIST, + /* 0x03 */ PLAYER_LIMB_LOWER_ROOT, + /* 0x04 */ PLAYER_LIMB_RIGHT_THIGH, + /* 0x05 */ PLAYER_LIMB_RIGHT_SHIN, + /* 0x06 */ PLAYER_LIMB_RIGHT_FOOT, + /* 0x07 */ PLAYER_LIMB_LEFT_THIGH, + /* 0x08 */ PLAYER_LIMB_LEFT_SHIN, + /* 0x09 */ PLAYER_LIMB_LEFT_FOOT, + /* 0x0A */ PLAYER_LIMB_UPPER_ROOT, + /* 0x0B */ PLAYER_LIMB_HEAD, + /* 0x0C */ PLAYER_LIMB_HAT, + /* 0x0D */ PLAYER_LIMB_COLLAR, + /* 0x0E */ PLAYER_LIMB_LEFT_SHOULDER, + /* 0x0F */ PLAYER_LIMB_LEFT_FOREARM, + /* 0x10 */ PLAYER_LIMB_LEFT_HAND, + /* 0x11 */ PLAYER_LIMB_RIGHT_SHOULDER, + /* 0x12 */ PLAYER_LIMB_RIGHT_FOREARM, + /* 0x13 */ PLAYER_LIMB_RIGHT_HAND, + /* 0x14 */ PLAYER_LIMB_SHEATH, + /* 0x15 */ PLAYER_LIMB_TORSO, + /* 0x16 */ PLAYER_LIMB_MAX +} PlayerLimb; + typedef struct { /* 0x00 */ f32 unk_00; /* 0x04 */ f32 unk_04; @@ -245,7 +381,6 @@ typedef void (*PlayerFuncD58)(struct PlayState*, struct Player*); typedef struct { /* 0x00 */ u8 unk_00; /* 0x01 */ u8 alpha; - /* 0x02 */ char unk_02[2]; // probably alignment padding /* 0x04 */ MtxF mf; } struct_80122D44_arg1_unk_04; // size = 0x44 @@ -420,7 +555,7 @@ typedef struct struct_80122744_arg1 { #define PLAYER_STATE3_400 (1 << 10) // #define PLAYER_STATE3_800 (1 << 11) -// +// being curled? #define PLAYER_STATE3_1000 (1 << 12) // #define PLAYER_STATE3_2000 (1 << 13) @@ -467,15 +602,15 @@ typedef struct Player { /* 0x144 */ s8 currentShield; /* 0x145 */ s8 currentBoots; /* 0x146 */ s8 heldItemButton; - /* 0x147 */ s8 itemActionParam; - /* 0x148 */ u8 heldItemId; + /* 0x147 */ s8 itemActionParam; // PlayerActionParam enum + /* 0x148 */ u8 heldItemId; // ItemId enum /* 0x149 */ s8 prevBoots; /* 0x14A */ s8 heldItemActionParam; /* 0x14B */ u8 transformation; - /* 0x14C */ u8 modelGroup; + /* 0x14C */ u8 modelGroup; // PlayerModelGroup enum /* 0x14D */ u8 nextModelGroup; /* 0x14E */ s8 unk_14E; - /* 0x14F */ u8 modelAnimType; + /* 0x14F */ u8 modelAnimType; // PlayerAnimType enum /* 0x150 */ u8 leftHandType; /* 0x151 */ u8 rightHandType; /* 0x152 */ u8 sheathType; diff --git a/include/z64scene.h b/include/z64scene.h index 3af90e02c..088565c0c 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -67,7 +67,7 @@ typedef struct { typedef struct { /* 0x0 */ u8 code; - /* 0x1 */ u8 cUpElfMsgNum; + /* 0x1 */ u8 naviQuestHintFileId; /* 0x4 */ u32 subKeepIndex; } SCmdSpecialFiles; // size = 0x8 @@ -825,6 +825,14 @@ typedef enum { /* 7 */ SCENE_DRAW_CFG_MAT_ANIM_MANUAL_STEP } SceneDrawConfigIds; +// TODO: make ZAPD use this enum for `SCENE_CMD_SPECIAL_FILES` +// Leftover from OoT +typedef enum { + /* 0 */ NAVI_QUEST_HINTS_NONE, + /* 1 */ NAVI_QUEST_HINTS_OVERWORLD, + /* 2 */ NAVI_QUEST_HINTS_DUNGEON +} NaviQuestHintFileId; + // SceneTableEntry commands typedef enum { /* 0x00 */ SCENE_CMD_ID_SPAWN_LIST, @@ -882,8 +890,8 @@ typedef enum { #define SCENE_CMD_ENTRANCE_LIST(entranceList) \ { SCENE_CMD_ID_ENTRANCE_LIST, 0, CMD_PTR(entranceList) } -#define SCENE_CMD_SPECIAL_FILES(elfMessageFile, keepObjectId) \ - { SCENE_CMD_ID_SPECIAL_FILES, elfMessageFile, CMD_W(keepObjectId) } +#define SCENE_CMD_SPECIAL_FILES(naviQuestHintFileId, keepObjectId) \ + { SCENE_CMD_ID_SPECIAL_FILES, naviQuestHintFileId, CMD_W(keepObjectId) } #define SCENE_CMD_ROOM_BEHAVIOR(curRoomUnk3, curRoomUnk2, curRoomUnk5, msgCtxunk12044, enablePosLights, \ kankyoContextUnkE2) \ diff --git a/spec b/spec index e955c0d31..90e749b6c 100644 --- a/spec +++ b/spec @@ -504,8 +504,6 @@ beginseg include "build/src/code/z_path.o" include "build/src/code/z_pause.o" include "build/src/code/z_player_lib.o" - include "build/data/code/z_player_lib.data.o" - include "build/data/code/z_player_lib.bss.o" include "build/src/code/z_prenmi.o" include "build/src/code/z_quake.o" include "build/src/code/z_rcp.o" @@ -1196,11 +1194,7 @@ beginseg name "ovl_Mir_Ray" compress include "build/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.o" -#ifdef NON_MATCHING include "build/src/overlays/actors/ovl_Mir_Ray/ovl_Mir_Ray_reloc.o" -#else - include "build/data/ovl_Mir_Ray/ovl_Mir_Ray.reloc.o" -#endif endseg beginseg @@ -2274,8 +2268,7 @@ beginseg name "ovl_En_Encount4" compress include "build/src/overlays/actors/ovl_En_Encount4/z_en_encount4.o" - include "build/data/ovl_En_Encount4/ovl_En_Encount4.data.o" - include "build/data/ovl_En_Encount4/ovl_En_Encount4.reloc.o" + include "build/src/overlays/actors/ovl_En_Encount4/ovl_En_Encount4_reloc.o" endseg beginseg @@ -3242,8 +3235,7 @@ beginseg name "ovl_fbdemo_wipe5" compress include "build/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.o" - include "build/data/ovl_fbdemo_wipe5/ovl_fbdemo_wipe5.data.o" - include "build/data/ovl_fbdemo_wipe5/ovl_fbdemo_wipe5.reloc.o" + include "build/src/overlays/fbdemos/ovl_fbdemo_wipe5/ovl_fbdemo_wipe5_reloc.o" endseg beginseg @@ -3392,8 +3384,7 @@ beginseg name "ovl_Bg_Dkjail_Ivy" compress include "build/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.o" - include "build/data/ovl_Bg_Dkjail_Ivy/ovl_Bg_Dkjail_Ivy.data.o" - include "build/data/ovl_Bg_Dkjail_Ivy/ovl_Bg_Dkjail_Ivy.reloc.o" + include "build/src/overlays/actors/ovl_Bg_Dkjail_Ivy/ovl_Bg_Dkjail_Ivy_reloc.o" endseg beginseg @@ -3458,8 +3449,7 @@ beginseg name "ovl_En_Lift_Nuts" compress include "build/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.o" - include "build/data/ovl_En_Lift_Nuts/ovl_En_Lift_Nuts.data.o" - include "build/data/ovl_En_Lift_Nuts/ovl_En_Lift_Nuts.reloc.o" + include "build/src/overlays/actors/ovl_En_Lift_Nuts/ovl_En_Lift_Nuts_reloc.o" endseg beginseg @@ -4168,11 +4158,7 @@ beginseg name "ovl_Mir_Ray3" compress include "build/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.o" -#ifdef NON_MATCHING include "build/src/overlays/actors/ovl_Mir_Ray3/ovl_Mir_Ray3_reloc.o" -#else - include "build/data/ovl_Mir_Ray3/ovl_Mir_Ray3.reloc.o" -#endif endseg beginseg @@ -4306,8 +4292,7 @@ beginseg name "ovl_En_Nb" compress include "build/src/overlays/actors/ovl_En_Nb/z_en_nb.o" - include "build/data/ovl_En_Nb/ovl_En_Nb.data.o" - include "build/data/ovl_En_Nb/ovl_En_Nb.reloc.o" + include "build/src/overlays/actors/ovl_En_Nb/ovl_En_Nb_reloc.o" endseg beginseg @@ -4710,8 +4695,7 @@ beginseg name "ovl_En_Rz" compress include "build/src/overlays/actors/ovl_En_Rz/z_en_rz.o" - include "build/data/ovl_En_Rz/ovl_En_Rz.data.o" - include "build/data/ovl_En_Rz/ovl_En_Rz.reloc.o" + include "build/src/overlays/actors/ovl_En_Rz/ovl_En_Rz_reloc.o" endseg beginseg diff --git a/src/boot_O2_g3/idle.c b/src/boot_O2_g3/idle.c index da93f13fd..942435fa7 100644 --- a/src/boot_O2_g3/idle.c +++ b/src/boot_O2_g3/idle.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "global.h" u8 D_80096B20 = 1; diff --git a/src/code/game.c b/src/code/game.c index 73352379f..b7069d312 100644 --- a/src/code/game.c +++ b/src/code/game.c @@ -1,6 +1,7 @@ #include "global.h" #include "system_malloc.h" #include "z64rumble.h" +#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" s32 gFramerateDivisor = 1; f32 gFramerateDivisorF = 1.0f; @@ -140,7 +141,7 @@ void Game_Update(GameState* gameState) { gameState->main(gameState); - if (R_PAUSE_MENU_MODE != 2) { + if (R_PAUSE_BG_PRERENDER_STATE != PAUSE_BG_PRERENDER_PROCESS) { GameState_Draw(gameState, gfxCtx); func_801736DC(gfxCtx); } diff --git a/src/code/graph.c b/src/code/graph.c index 869740e4b..8edc979d4 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -174,8 +174,8 @@ retry: task->ucodeBootSize = SysUcode_GetUCodeBootSize(); task->ucode = SysUcode_GetUCode(); task->ucodeData = SysUcode_GetUCodeData(); - task->ucodeSize = 0x1000; - task->ucodeDataSize = 0x800; + task->ucodeSize = SP_UCODE_SIZE; + task->ucodeDataSize = SP_UCODE_DATA_SIZE; task->dramStack = (u64*)gGfxSPTaskStack; task->dramStackSize = sizeof(gGfxSPTaskStack); task->outputBuff = gGfxSPTaskOutputBufferPtr; diff --git a/src/code/title_setup.c b/src/code/title_setup.c index 641160ea8..8ba6f9b56 100644 --- a/src/code/title_setup.c +++ b/src/code/title_setup.c @@ -27,7 +27,7 @@ void Setup_SetRegs(void) { XREG(88) = 0x56; XREG(89) = 0x258; XREG(90) = 0x1C2; - XREG(91) = 0; + R_STORY_FILL_SCREEN_ALPHA = 0; R_REVERSE_FLOOR_INDEX = 0; R_MINIMAP_DISABLED = false; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 8463cab06..147a98775 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -172,7 +172,7 @@ void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, PlayState* play) { u8 shadowAlpha = actor->shape.shadowAlpha; f32 alphaRatio; - if ((actor->id == ACTOR_PLAYER) && (((Player*)actor)->stateFlags3 & 0x8000)) { + if ((actor->id == ACTOR_PLAYER) && (((Player*)actor)->stateFlags3 & PLAYER_STATE3_8000)) { f32 prevScaleZ = actor->scale.z; actor->scale.z += 0.03f * fabsf(Math_CosS(((Player*)actor)->unk_AAA)); @@ -469,7 +469,8 @@ void Actor_TargetContextInit(TargetContext* targetCtx, Actor* actor, PlayState* void Actor_DrawZTarget(TargetContext* targetCtx, PlayState* play) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & 0x300006C2)) { + if (!(player->stateFlags1 & (PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | + PLAYER_STATE1_400 | PLAYER_STATE1_10000000 | PLAYER_STATE1_20000000))) { Actor* actor = targetCtx->targetedActor; OPEN_DISPS(play->state.gfxCtx); @@ -519,7 +520,7 @@ void Actor_DrawZTarget(TargetContext* targetCtx, PlayState* play) { Target_SetPos(targetCtx, targetCtx->unk4C, projectedPos.x, projectedPos.y, projectedPos.z); - if ((!(player->stateFlags1 & 0x40)) || (actor != player->unk_730)) { + if ((!(player->stateFlags1 & PLAYER_STATE1_40)) || (actor != player->unk_730)) { OVERLAY_DISP = Gfx_CallSetupDL(OVERLAY_DISP, 0x39); for (spB0 = 0, spAC = targetCtx->unk4C; spB0 < spB8; spB0++, spAC = (spAC + 1) % 3) { @@ -1026,7 +1027,7 @@ void* func_800B6680(PlayState* play, s16 id) { return NULL; } -void Actor_MarkForDeath(Actor* actor) { +void Actor_Kill(Actor* actor) { actor->draw = NULL; actor->update = NULL; actor->flags &= ~ACTOR_FLAG_1; @@ -1291,7 +1292,7 @@ void func_800B6F20(PlayState* play, Input* input, f32 magnitude, s16 baseYaw) { f32 Player_GetHeight(Player* player) { f32 extraHeight; - if (player->stateFlags1 & 0x800000) { + if (player->stateFlags1 & PLAYER_STATE1_800000) { extraHeight = 32.0f; } else { extraHeight = 0.0f; @@ -1302,8 +1303,7 @@ f32 Player_GetHeight(Player* player) { case PLAYER_FORM_FIERCE_DEITY: return extraHeight + 124.0f; case PLAYER_FORM_GORON: - // (player->stateFlags3 & 0x1000): being curled? - return extraHeight + ((player->stateFlags3 & 0x1000) ? 34.0f : 80.0f); + return extraHeight + ((player->stateFlags3 & PLAYER_STATE3_1000) ? 34.0f : 80.0f); case PLAYER_FORM_ZORA: return extraHeight + 68.0f; case PLAYER_FORM_DEKU: @@ -1314,9 +1314,9 @@ f32 Player_GetHeight(Player* player) { } f32 Player_GetRunSpeedLimit(Player* player) { - if (player->stateFlags1 & 0x800000) { + if (player->stateFlags1 & PLAYER_STATE1_800000) { return 15.0f; - } else if (player->stateFlags1 & 0x8000000) { + } else if (player->stateFlags1 & PLAYER_STATE1_8000000) { return (R_RUN_SPEED_LIMIT / 100.0f) * 0.6f; } else { return R_RUN_SPEED_LIMIT / 100.0f; @@ -1324,7 +1324,7 @@ f32 Player_GetRunSpeedLimit(Player* player) { } s32 func_800B7118(Player* player) { - return player->stateFlags1 & 0x8; + return player->stateFlags1 & PLAYER_STATE1_8; } s32 func_800B7128(Player* player) { @@ -1334,7 +1334,7 @@ s32 func_800B7128(Player* player) { s32 func_800B715C(PlayState* play) { Player* player = GET_PLAYER(play); - return player->stateFlags2 & 0x8; + return player->stateFlags2 & PLAYER_STATE2_8; } void Actor_SetCameraHorseSetting(PlayState* play, Player* player) { @@ -1349,12 +1349,12 @@ void Actor_SetCameraHorseSetting(PlayState* play, Player* player) { void Actor_MountHorse(PlayState* play, Player* player, Actor* horse) { player->rideActor = horse; - player->stateFlags1 |= 0x800000; + player->stateFlags1 |= PLAYER_STATE1_800000; horse->child = &player->actor; } s32 func_800B7200(Player* player) { - return (player->stateFlags1 & 0x20000080) || (player->csMode != 0); + return (player->stateFlags1 & (PLAYER_STATE1_20000000 | PLAYER_STATE1_80)) || (player->csMode != 0); } void func_800B722C(GameState* gameState, Player* player) { @@ -1999,13 +1999,16 @@ s32 Actor_HasParent(Actor* actor, PlayState* play) { s32 Actor_PickUp(Actor* actor, PlayState* play, s32 getItemId, f32 xzRange, f32 yRange) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & 0x3C7080) && Player_GetExplosiveHeld(player) < 0) { + if (!(player->stateFlags1 & + (PLAYER_STATE1_80 | PLAYER_STATE1_1000 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 | + PLAYER_STATE1_80000 | PLAYER_STATE1_100000 | PLAYER_STATE1_200000)) && + Player_GetExplosiveHeld(player) < 0) { if ((actor->xzDistToPlayer <= xzRange) && (fabsf(actor->playerHeightRel) <= fabsf(yRange))) { if ((getItemId == GI_MASK_CIRCUS_LEADER || getItemId == GI_PENDANT_OF_MEMORIES || getItemId == GI_DEED_LAND || ((player->heldActor != NULL || actor == player->targetActor) && (getItemId > GI_NONE && getItemId < GI_MAX))) || - !(player->stateFlags1 & 0x20000800)) { + !(player->stateFlags1 & (PLAYER_STATE1_800 | PLAYER_STATE1_20000000))) { s16 yawDiff = actor->yawTowardsPlayer - player->actor.shape.rot.y; s32 absYawDiff = ABS_ALT(yawDiff); @@ -2081,7 +2084,9 @@ s32 Actor_HasRider(PlayState* play, Actor* horse) { s32 Actor_SetRideActor(PlayState* play, Actor* horse, s32 mountSide) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & 0x003C7880)) { + if (!(player->stateFlags1 & + (PLAYER_STATE1_80 | PLAYER_STATE1_800 | PLAYER_STATE1_1000 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | + PLAYER_STATE1_40000 | PLAYER_STATE1_80000 | PLAYER_STATE1_100000 | PLAYER_STATE1_200000))) { player->rideActor = horse; player->mountSide = mountSide; ActorCutscene_SetIntentToPlay(0x7C); @@ -2346,14 +2351,14 @@ Actor* Actor_UpdateActor(UpdateActor_Params* params) { } } else { if (!Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) { - Actor_MarkForDeath(actor); + Actor_Kill(actor); } else { s32 tmp = (params->unk_08 == 0); if (((params->unk_08) && !(actor->flags & params->unk_08)) || ((tmp = (params->unk_08 == 0)) && (!(actor->flags & ACTOR_FLAG_100000) || - ((actor->category == ACTORCAT_EXPLOSIVES) && (params->player->stateFlags1 & 0x200))) && + ((actor->category == ACTORCAT_EXPLOSIVES) && (params->player->stateFlags1 & PLAYER_STATE1_200))) && (params->unkC != 0) && (actor != params->unk10) && ((actor != params->player->heldActor)) && (actor->parent != ¶ms->player->actor))) { CollisionCheck_ResetDamage(&actor->colChkInfo); @@ -2395,9 +2400,35 @@ Actor* Actor_UpdateActor(UpdateActor_Params* params) { return nextActor; } -u32 D_801AED58[] = { - 0x100002C2, 0x100002C2, 0x00000200, 0x100006C2, 0x00000282, 0x300002C2, - 0x10000282, 0x00000002, 0x300002C2, 0x100006C2, 0x00000002, 0x100002C2, +u32 D_801AED58[ACTORCAT_MAX] = { + /* ACTORCAT_SWITCH */ + PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000, + /* ACTORCAT_BG */ + PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000, + /* ACTORCAT_PLAYER */ + PLAYER_STATE1_200, + /* ACTORCAT_EXPLOSIVES */ + PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_400 | + PLAYER_STATE1_10000000, + /* ACTORCAT_NPC */ + PLAYER_STATE1_2 | PLAYER_STATE1_80 | PLAYER_STATE1_200, + /* ACTORCAT_ENEMY */ + PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000 | + PLAYER_STATE1_20000000, + /* ACTORCAT_PROP */ + PLAYER_STATE1_2 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000, + /* ACTORCAT_ITEMACTION */ + PLAYER_STATE1_2, + /* ACTORCAT_MISC */ + PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000 | + PLAYER_STATE1_20000000, + /* ACTORCAT_BOSS */ + PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_400 | + PLAYER_STATE1_10000000, + /* ACTORCAT_DOOR */ + PLAYER_STATE1_2, + /* ACTORCAT_CHEST */ + PLAYER_STATE1_2 | PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000, }; void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { @@ -2427,13 +2458,13 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { tmp = D_801AED58; - if (player->stateFlags2 & 0x8000000) { + if (player->stateFlags2 & PLAYER_STATE2_8000000) { params.unk_08 = 0x2000000; } else { params.unk_08 = 0; } - if ((player->stateFlags1 & 0x40) && ((player->actor.textId & 0xFF00) != 0x1900)) { + if ((player->stateFlags1 & PLAYER_STATE1_40) && ((player->actor.textId & 0xFF00) != 0x1900)) { params.unk10 = player->targetActor; } else { params.unk10 = NULL; @@ -2486,7 +2517,7 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { } } - if (!(player->stateFlags1 & 2)) { + if (!(player->stateFlags1 & PLAYER_STATE1_2)) { func_800B5814(&actorCtx->targetContext, player, actor, &play->state); } @@ -2614,200 +2645,128 @@ void Actor_DrawLensOverlay(Gfx** gfxP, s32 lensMaskSize) { ((LENS_MASK_ACTIVE_SIZE - lensMaskSize) * 0.003f) + 1.0f); } -#ifdef NON_EQUIVALENT -void Actor_DrawLensActors(PlayState* play, s32 numActors, Actor** actors) { +void Actor_DrawLensActors(PlayState* play, s32 numInvisibleActors, Actor** invisibleActors) { + s32 dbgVar1; + s32 dbgVar2; s32 spB4; + Actor** invisibleActor; Gfx* spAC; - void* spA8; // pad - s32 spA4; - // void* sp34; - // Gfx* temp_s1_11; - // Gfx** temp_a0_2; - // Gfx** temp_a1; - // GraphicsContext* temp_s2; - // void* temp_s1_10; - // void* temp_s1_7; - // void* temp_s1_8; - // void* temp_s1_9; - // Gfx* phi_s1; - Gfx* phi_s1_2; - // void* phi_s1_4; + void* spA8; + void* spA4; + GraphicsContext* gfxCtx = play->state.gfxCtx; + Gfx* tmp; + s32 pad[2]; - OPEN_DISPS(play->state.gfxCtx); - // temp_s2 = play->state.gfxCtx; + dbgVar1 = true; + dbgVar2 = true; - if (numActors > 0) { - spAC = POLY_XLU_DISP; - // sp34 = play + 0x18000; + if (dbgVar1) { + dbgVar1 = numInvisibleActors > 0; + } + + OPEN_DISPS(gfxCtx); + + if (dbgVar1) { + tmp = POLY_XLU_DISP; + spA8 = gfxCtx->zbuffer; spA4 = play->unk_18E68; - PreRender_SetValues(&play->pauseBgPreRender, D_801FBBCC, D_801FBBCE, __gfxCtx->curFrameBuffer, - __gfxCtx->zbuffer); + if (dbgVar2) { + PreRender_SetValues(&play->pauseBgPreRender, D_801FBBCC, D_801FBBCE, gfxCtx->curFrameBuffer, spA8); - func_80170200(&play->pauseBgPreRender, &spAC, __gfxCtx->zbuffer, (void*)spA4); + spAC = tmp; + func_80170200(&play->pauseBgPreRender, &spAC, spA8, spA4); + tmp = spAC; + } - // spAC->words.w0 = 0xE7000000; - // spAC->words.w1 = 0; - // temp_s1_2 = spAC + 8; - gDPPipeSync(spAC++); + gDPPipeSync(tmp++); + gDPSetPrimDepth(tmp++, 0, 0); - // temp_s1_2->words.w0 = 0xEE000000; - // temp_s1_2->words.w1 = 0; - // temp_s1_3 = temp_s1_2 + 8; - gDPSetPrimDepth(spAC++, 0, 0); - - // temp_s1_3->words.w0 = 0xEF002C30; - // temp_s1_3->words.w1 = 0xAF504365; - // temp_s1_4 = temp_s1_3 + 8; - gDPSetOtherMode(spAC++, + gDPSetOtherMode(tmp++, G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_THRESHOLD | G_ZS_PRIM | Z_UPD | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c1(G_BL_CLR_BL, G_BL_0, G_BL_CLR_MEM, G_BL_1MA) | GBL_c2(G_BL_CLR_BL, G_BL_0, G_BL_CLR_MEM, G_BL_1MA)); - // temp_s1_4->words.w1 = 0xFF; - // temp_s1_4->words.w0 = 0xFA000000; - // temp_s1_5 = temp_s1_4 + 8; - gDPSetPrimColor(spAC++, 0, 0, 0, 0, 0, 255); - // temp_s1_5 = spAC; + gDPSetPrimColor(tmp++, 0, 0, 0, 0, 0, 255); if (play->roomCtx.curRoom.unk5 == 0) { - // temp_s1_5->words.w0 = 0xFC61E6C3; - // temp_s1_5->words.w1 = 0x11CF9FCF; - // phi_s1 = temp_s1_5 + 8; - gDPSetCombineLERP(spAC++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, + gDPSetCombineLERP(tmp++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0); } else { - // temp_s1_5->words.w0 = 0xFC119623; - // temp_s1_5->words.w1 = 0xFF2FFFFF; - // phi_s1 = temp_s1_5 + 8; - gDPSetCombineMode(spAC++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + gDPSetCombineMode(tmp++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); } - // spAC = phi_s1; + spAC = tmp; Actor_DrawLensOverlay(&spAC, play->actorCtx.lensMaskSize); - phi_s1_2 = func_801660B8(play, spAC); + tmp = func_801660B8(play, spAC); - for (spB4 = 0; spB4 < numActors; spB4++, actors++) { - Actor_Draw(play, *actors); + for (spB4 = 0, invisibleActor = invisibleActors; spB4 < numInvisibleActors; spB4++, invisibleActor++) { + POLY_XLU_DISP = tmp; + Actor_Draw(play, *invisibleActor); + tmp = POLY_XLU_DISP; } - // temp_s0_2 = &play->pauseBgPreRender; + if (dbgVar2) { + gDPPipeSync(tmp++); - // phi_s1_2->words.w0 = 0xE7000000; - // phi_s1_2->words.w1 = 0; - // temp_s1_7 = phi_s1_2 + 8; - gDPPipeSync(phi_s1_2++); + gDPSetOtherMode(tmp++, + G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_THRESHOLD | G_ZS_PRIM | AA_EN | IM_RD | CVG_DST_WRAP | ZMODE_OPA | CVG_X_ALPHA | + ALPHA_CVG_SEL | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_1) | + GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_1)); - // temp_s1_7->unk_0 = 0xEF002CF0; - // temp_s1_7->unk_4 = 0xF5A714D; - // temp_s1_8 = temp_s1_7 + 8; - gDPSetOtherMode(phi_s1_2++, - G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | - G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, - G_AC_THRESHOLD | G_ZS_PRIM | AA_EN | IM_RD | CVG_DST_WRAP | ZMODE_OPA | CVG_X_ALPHA | - ALPHA_CVG_SEL | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_1) | - GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_1)); + gDPSetBlendColor(tmp++, 255, 255, 255, 0); + gDPSetPrimColor(tmp++, 0, 0xFF, 0, 0, 0, 32); - // temp_s1_8->unk_4 = -0x100; - // temp_s1_8->unk_0 = 0xF9000000; - // temp_s1_9 = temp_s1_8 + 8; - gDPSetBlendColor(phi_s1_2++, 255, 255, 255, 0); + if (play->roomCtx.curRoom.unk5 == 0) { + gDPSetCombineMode(tmp++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + } else { + gDPSetCombineLERP(tmp++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, + TEXEL0, PRIMITIVE, 0); + } - // temp_s1_9->unk_4 = 0x20; - // temp_s1_9->unk_0 = 0xFA0000FF; - // temp_s1_10 = temp_s1_9 + 8; - gDPSetPrimColor(phi_s1_2++, 0, 0xFF, 0, 0, 0, 32); + gDPSetColorImage(tmp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, play->pauseBgPreRender.width, spA4); - // temp_a0_2 = &spAC; - // if (sp34->unk_6E5 == 0) { - if (play->roomCtx.curRoom.unk5 == 0) { - // temp_s1_10->unk_0 = 0xFC119623; - // temp_s1_10->unk_4 = 0xFF2FFFFF; - // phi_s1_4 = temp_s1_10 + 8; - gDPSetCombineMode(phi_s1_2++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - //} else { - } else { - // temp_s1_10->unk_4 = 0x11CF9FCF; - // temp_s1_10->unk_0 = 0xFC61E6C3; - // phi_s1_4 = temp_s1_10 + 8; - gDPSetCombineLERP(phi_s1_2++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, - TEXEL0, PRIMITIVE, 0); + spAC = tmp; + Actor_DrawLensOverlay(&spAC, play->actorCtx.lensMaskSize); + tmp = spAC; - //} + gDPPipeSync(tmp++); + gDPSetBlendColor(tmp++, 255, 255, 255, 8); + + gDPSetColorImage(tmp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, play->pauseBgPreRender.width, + play->pauseBgPreRender.fbuf); + + spAC = tmp; + func_8016FDB8(&play->pauseBgPreRender, &spAC, (void*)spA4, spA8, 1); + tmp = spAC; } - // phi_s1_4->unk_0 = (s32) (((sp34->unk_B4C - 1) & 0xFFF) | 0xFF100000); - // temp_s1_11 = phi_s1_4 + 8; - // phi_s1_4->unk_4 = spA4; - gDPSetColorImage(phi_s1_2++, G_IM_FMT_RGBA, G_IM_SIZ_16b, ((play->pauseBgPreRender.width - 1) & 0xFFF), spA4); - // temp_s1_11 = phi_s1_2; - spAC = phi_s1_2; - - // spAC = temp_s1_11; - Actor_DrawLensOverlay(&spAC, (s32)play->actorCtx.lensMaskSize); - // temp_s1_11->words.w0 = 0xE7000000; - // temp_s1_11->words.w1 = 0; - // temp_s1_12 = temp_s1_11 + 8; - gDPPipeSync(spAC++); - - // temp_s1_12->words.w1 = -0xF8; - // temp_s1_12->words.w0 = 0xF9000000; - // temp_s1_13 = temp_s1_12 + 8; - gDPSetBlendColor(spAC++, 255, 255, 255, 8); - - // temp_s1_14 = temp_s1_13 + 8; - // temp_s1_13->words.w0 = ((sp34->unk_B4C - 1) & 0xFFF) | 0xFF100000; - // temp_s1_13->words.w1 = sp34->unk_B5C; - gDPSetColorImage(spAC++, G_IM_FMT_RGBA, G_IM_SIZ_16b, ((play->pauseBgPreRender.width - 1) & 0xFFF), - play->pauseBgPreRender.fbuf); - - // temp_a1 = &spAC; - // spAC = temp_s1_14; - // func_8016FDB8(&play->pauseBgPreRender, temp_a1, (void* ) spA4, spA8, 1U); - func_8016FDB8(&play->pauseBgPreRender, &spAC, (void*)spA4, __gfxCtx->zbuffer, 1U); - // - // POLY_OPA_DISP = temp_s1_14; - POLY_OPA_DISP = spAC; + POLY_XLU_DISP = tmp; } - // temp_s1_15 = OVERLAY_DISP; - // temp_s1_15->words.w0 = 0xE7000000; - // temp_s1_15->words.w1 = 0; - // temp_s1_16 = temp_s1_15 + 8; - spAC = OVERLAY_DISP; - gDPPipeSync(spAC++); + tmp = OVERLAY_DISP; - // temp_s1_16->words.w0 = 0xEF002C30; - // temp_s1_16->words.w1 = 0x00504345; - // temp_s1_17 = temp_s1_16 + 8; - gDPSetOtherMode(spAC++, + gDPPipeSync(tmp++); + + gDPSetOtherMode(tmp++, G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_THRESHOLD | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2); - // temp_s1_17->words.w0 = 0xFC61E6C3; - // temp_s1_17->words.w1 = 0x11CF9FCF; - // temp_s1_18 = temp_s1_17 + 8; - gDPSetCombineLERP(spAC++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, + gDPSetCombineLERP(tmp++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0); + gDPSetPrimColor(tmp++, 0, 0, 74, 0, 0, 74); - // temp_s1_18->words.w0 = 0xFA000000; - // temp_s1_18->words.w1 = 0x4A00004A; - // spAC = temp_s1_18 + 8; - gDPSetPrimColor(spAC++, 0, 0, 74, 0, 0, 74); - - Actor_DrawLensOverlay(&spAC, (s32)play->actorCtx.lensMaskSize); - + spAC = tmp; + Actor_DrawLensOverlay(&spAC, play->actorCtx.lensMaskSize); OVERLAY_DISP = spAC; - CLOSE_DISPS(play->state.gfxCtx); + CLOSE_DISPS(gfxCtx); } -#else -void Actor_DrawLensActors(PlayState* play, s32 numActors, Actor** actors); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_DrawLensActors.s") -#endif s32 func_800BA2D8(PlayState* play, Actor* actor) { return func_800BA2FC(play, actor, &actor->projectedPos, actor->projectedW); @@ -2907,7 +2866,7 @@ void Actor_DrawAll(PlayState* play, ActorContext* actorCtx) { if (play->actorCtx.lensActive) { Math_StepToC(&play->actorCtx.lensMaskSize, LENS_MASK_ACTIVE_SIZE, 20); - if (GET_PLAYER(play)->stateFlags2 & 0x8000000) { + if (GET_PLAYER(play)->stateFlags2 & PLAYER_STATE2_8000000) { Actor_DeactivateLens(play); } } else { @@ -2944,7 +2903,7 @@ void func_800BA6FC(PlayState* play, ActorContext* actorCtx) { while (actor != NULL) { if (!Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) { - Actor_MarkForDeath(actor); + Actor_Kill(actor); } actor = actor->next; @@ -2968,7 +2927,7 @@ void func_800BA798(PlayState* play, ActorContext* actorCtx) { if (!actor->isDrawn) { actor = Actor_Delete(actorCtx, actor, play); } else { - Actor_MarkForDeath(actor); + Actor_Kill(actor); Actor_Destroy(actor, play); actor = actor->next; } @@ -2997,7 +2956,7 @@ void func_800BA8B8(PlayState* play, ActorContext* actorCtx) { if (!actor->isDrawn) { actor = Actor_Delete(actorCtx, actor, play); } else { - Actor_MarkForDeath(actor); + Actor_Kill(actor); Actor_Destroy(actor, play); actor = actor->next; } @@ -3730,7 +3689,7 @@ s16 Actor_TestFloorInDirection(Actor* actor, PlayState* play, f32 distance, s16 s32 Actor_IsTargeted(PlayState* play, Actor* actor) { Player* player = GET_PLAYER(play); - if ((player->stateFlags3 & 0x80000000) && actor->isTargeted) { + if ((player->stateFlags3 & PLAYER_STATE3_80000000) && actor->isTargeted) { return true; } @@ -3743,7 +3702,7 @@ s32 Actor_IsTargeted(PlayState* play, Actor* actor) { s32 Actor_OtherIsTargeted(PlayState* play, Actor* actor) { Player* player = GET_PLAYER(play); - if ((player->stateFlags3 & 0x80000000) && !actor->isTargeted) { + if ((player->stateFlags3 & PLAYER_STATE3_80000000) && !actor->isTargeted) { return true; } diff --git a/src/code/z_actor_dlftbls.c b/src/code/z_actor_dlftbls.c index 77b6546ff..02b7a8b5d 100644 --- a/src/code/z_actor_dlftbls.c +++ b/src/code/z_actor_dlftbls.c @@ -1,711 +1,41 @@ #include "global.h" -#include "initvars.h" -#define ACTOR_OVERLAY(name, allocType) \ - { \ - SEGMENT_ROM_START(ovl_##name), SEGMENT_ROM_END(ovl_##name), SEGMENT_START(ovl_##name), \ - SEGMENT_END(ovl_##name), NULL, &name##_InitVars, NULL, allocType, 0 \ - } +// Init Vars declarations (also used in the table below) +#define DEFINE_ACTOR(name, _enumValue, _allocType, _debugName) extern ActorInit name##_InitVars; +#define DEFINE_ACTOR_INTERNAL(name, _enumValue, _allocType, _debugName) extern ActorInit name##_InitVars; +#define DEFINE_ACTOR_UNSET(_enumValue) -#define ACTOR_OVERLAY_INTERNAL(name, allocType) \ - { 0, 0, NULL, NULL, NULL, &name##_InitVars, NULL, allocType, 0 } +#include "tables/actor_table.h" -#define ACTOR_OVERLAY_UNSET \ - { 0 } +#undef DEFINE_ACTOR +#undef DEFINE_ACTOR_INTERNAL +#undef DEFINE_ACTOR_UNSET + +// Actor Overlay Table definition +#define DEFINE_ACTOR(name, _enumValue, allocType, _debugName) \ + { SEGMENT_ROM_START(ovl_##name), \ + SEGMENT_ROM_END(ovl_##name), \ + SEGMENT_START(ovl_##name), \ + SEGMENT_END(ovl_##name), \ + NULL, \ + &name##_InitVars, \ + NULL, \ + allocType, \ + 0 }, + +#define DEFINE_ACTOR_INTERNAL(name, _enumValue, allocType, _debugName) \ + { 0, 0, NULL, NULL, NULL, &name##_InitVars, NULL, allocType, 0 }, + +#define DEFINE_ACTOR_UNSET(_enumValue) { 0 }, ActorOverlay gActorOverlayTable[] = { - ACTOR_OVERLAY_INTERNAL(Player, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Test, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_GirlA, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Part, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Light, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Door, ALLOCTYPE_PERMANENT), - ACTOR_OVERLAY(En_Box, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Pametfrog, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Okuta, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bom, ALLOCTYPE_PERMANENT), - ACTOR_OVERLAY(En_Wallmas, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Dodongo, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Firefly, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Horse, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_INTERNAL(En_Item00, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Arrow, ALLOCTYPE_PERMANENT), - ACTOR_OVERLAY(En_Elf, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Niw, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Tite, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Peehat, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Butte, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Insect, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Fish, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Holl, ALLOCTYPE_PERMANENT), - ACTOR_OVERLAY(En_Dinofos, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Hata, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Zl1, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Viewer, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bubble, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Door_Shutter, ALLOCTYPE_PERMANENT), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Boom, ALLOCTYPE_PERMANENT), - ACTOR_OVERLAY(En_Torch2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Minifrog, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_St, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_INTERNAL(En_A_Obj, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Wturn, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_River_Sound, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Ossan, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Famos, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Bombf, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Am, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Dekubaba, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_M_Fire1, ALLOCTYPE_PERMANENT), - ACTOR_OVERLAY(En_M_Thunder, ALLOCTYPE_PERMANENT), - ACTOR_OVERLAY(Bg_Breakwall, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Door_Warp1, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Syokudai, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Item_B_Heart, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Dekunuts, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bbfall, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Arms_Hook, ALLOCTYPE_PERMANENT), - ACTOR_OVERLAY(En_Bb, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Keikoku_Spr, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Wood02, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Death, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Minideath, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Vm, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Demo_Effect, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Demo_Kankyo, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Floormas, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Rd, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_F40_Flift, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Obj_Mure, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Sw, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Object_Kankyo, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Horse_Link_Child, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Door_Ana, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Encount1, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Demo_Tre_Lgt, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Encount2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Fire_Rock, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Ctower_Rot, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Mir_Ray, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Sb, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bigslime, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Karebaba, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_In, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Ru, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bom_Chu, ALLOCTYPE_PERMANENT), - ACTOR_OVERLAY(En_Horse_Game_Check, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Rr, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Fr, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Fishing, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Oshihiki, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Eff_Dust, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Umajump, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Arrow_Fire, ALLOCTYPE_ABSOLUTE), - ACTOR_OVERLAY(Arrow_Ice, ALLOCTYPE_ABSOLUTE), - ACTOR_OVERLAY(Arrow_Light, ALLOCTYPE_ABSOLUTE), - ACTOR_OVERLAY(Item_Etcetera, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Kibako, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Tsubo, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Ik, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Demo_Shd, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Dns, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Elf_Msg, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Honotrap, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Tubo_Trap, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Ice_Poly, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Fz, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Kusa, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Bean, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Bombiwa, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Switch, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Obj_Lift, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Hsblock, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Okarina_Tag, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Goroiwa, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Daiku, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Nwc, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Item_Inbox, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ge1, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Blockstop, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Sda, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Clear_Tag, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Gm, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ms, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Hs, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Ingate, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Kanban, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Attack_Niw, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Mk, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Owl, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ishi, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Hana, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Lightswitch, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Mure2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Fu, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Stream, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Mm, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Weather_Tag, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ani, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Js, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Okarina_Effect, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Mag, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Elf_Msg2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_F40_Swlift, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Kakasi, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Makeoshihiki, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Oceff_Spot, ALLOCTYPE_ABSOLUTE), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Torch, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Shot_Sun, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Obj_Roomtimer, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ssh, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Oceff_Wipe, ALLOCTYPE_ABSOLUTE), - ACTOR_OVERLAY(Oceff_Storm, ALLOCTYPE_ABSOLUTE), - ACTOR_OVERLAY(Obj_Demo, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Minislime, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Nutsball, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Oceff_Wipe2, ALLOCTYPE_ABSOLUTE), - ACTOR_OVERLAY(Oceff_Wipe3, ALLOCTYPE_ABSOLUTE), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Dg, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Si, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Comb, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Kibako2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Hs2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Mure3, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Tg, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Wf, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Skb, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Gs, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Sound, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Crow, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Cow, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Oceff_Wipe4, ALLOCTYPE_ABSOLUTE), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Zo, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Makekinsuta, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ge3, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Obj_Hamishi, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Zl4, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Mm2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Door_Spiral, ALLOCTYPE_PERMANENT), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Obj_Pzlblock, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Toge, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Obj_Armos, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Boyo, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Grasshopper, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Obj_Grass, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Grass_Carry, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Grass_Unit, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Bg_Fire_Wall, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bu, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Encount3, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Jso, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Chikuwa, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Knight, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Warp_tag, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Aob_01, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Boj_01, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Boj_02, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Boj_03, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Encount4, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bom_Bowl_Man, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Syateki_Man, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Bg_Icicle, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Syateki_Crow, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Boj_04, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Cne_01, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bba_01, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bji_01, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Spdweb, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Mt_tag, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Boss_01, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Boss_02, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Boss_03, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Boss_04, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Boss_05, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Boss_06, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Boss_07, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Dy_Yoseizo, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Boj_05, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Sob1, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Go, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Raf, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Funen, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Raillift, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Numa_Hana, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Flowerpot, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Spinyroll, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Hina, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Syateki_Wf, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Skateblock, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Iceblock, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bigpamet, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Syateki_Dekunuts, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Elf_Msg3, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Fg, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Ravine, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Sa, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Slime, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Pr, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Toudai, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Entotu, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Bell, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Syateki_Okuta, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Obj_Shutter, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Zl, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Elfgrp, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Tsg, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Baguo, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Vspinyroll, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Smork, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Test2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Test3, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Test4, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bat, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Sekihi, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Wiz, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Wiz_Brock, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Wiz_Fire, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Eff_Change, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Statue, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Fireshield, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Ladder, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Mkk, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Demo_Getitem, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Dnb, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Dnh, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Dnk, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Dnq, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Bg_Keikoku_Saku, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Hugebombiwa, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Firefly2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Rat, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Water_Effect, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Kusa2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Spout_Fire, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Bg_Dblue_Movebg, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Dy_Extra, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bal, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ginko_Man, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Warp_Uzu, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Driftice, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Look_Nuts, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Mushi2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Fall, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Mm3, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Crace_Movebg, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Dno, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Pr2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Prz, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Jso2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Etcetera, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Egol, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Mine, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Purify, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Tru, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Trt, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Test5, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Test6, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Az, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Estone, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Hakugin_Post, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Opstage, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Stk, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Char00, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Char01, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Char02, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Char03, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Char04, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Char05, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Char06, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Char07, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Char08, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Char09, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Tokeidai, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Mnk, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Egblock, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Guard_Nuts, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Hakugin_Bombwall, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Tokei_Tobira, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Hakugin_Elvpole, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ma4, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Twig, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Po_Fusen, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Door_Etc, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bigokuta, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Icefloe, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Ocarinalift, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Time_Tag, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Open_Shutter, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Open_Spot, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Fu_Kaiten, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Aqua, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Elforg, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Elfbub, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Fu_Mato, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Fu_Kago, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Osn, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Ctower_Gear, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Trt2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Tokei_Step, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Lotus, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Kame, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Takaraya_Wall, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Fu_Mizu, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Sellnuts, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Dkjail_Ivy, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Obj_Visiblock, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Takaraya, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Tsn, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ds2n, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Fsn, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Shn, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Stop_heishi, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Bigicicle, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Lift_Nuts, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Tk, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(Bg_Market_Step, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Lupygamelift, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Test7, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Lightblock, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Mir_Ray2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Wdhand, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Gamelupy, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Danpei_Movebg, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Snowwd, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Pm, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Gakufu, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Elf_Msg4, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Elf_Msg5, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Col_Man, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Talk_Gibud, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Giant, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Snowball, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Boss_Hakugin, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Gb2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Onpuman, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Tobira01, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Tag_Obj, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Dhouse, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Hakaisi, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Hakugin_Switch, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Snowman, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(TG_Sw, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Po_Sisters, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Pp, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Hakurock, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Hanabi, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Dowsing, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Wind, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Racedog, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Kendo_Js, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Botihasira, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Fish2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Pst, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Poh, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Spidertent, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Zoraegg, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Kbt, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Gg, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Maruta, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Snowball2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Gg2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Ghaka, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Dnp, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Dai, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Goron_Oyu, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Kgy, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Invadepoh, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Gk, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_An, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY_UNSET, - ACTOR_OVERLAY(En_Bee, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ot, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Dragon, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Dora, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bigpo, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Kendo_Kanban, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Hariko, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Sth, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Sinkai_Kabe, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Haka_Curtain, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Kin2_Bombwall, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Kin2_Fence, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Kin2_Picture, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Kin2_Shelf, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Rail_Skb, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Jg, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Tru_Mt, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Um, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Neo_Reeba, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Mbar_Chair, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Ikana_Block, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Ikana_Mirror, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Ikana_Rotaryroom, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Dblue_Balance, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Dblue_Waterfall, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Kaizoku, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ge2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ma_Yts, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ma_Yto, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Tokei_Turret, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Dblue_Elevator, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Warpstone, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Zog, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Rotlift, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Jg_Gakki, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Inibs_Movebg, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Zot, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Tree, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Y2lift, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Y2shutter, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Boat, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Taru, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Hunsui, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Jc_Mato, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Mir_Ray3, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Zob, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Elf_Msg6, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Nozoki, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Toto, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Railgibud, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Baba, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Suttari, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Zod, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Kujiya, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Geg, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Kinoko, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Yasi, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Tanron1, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Tanron2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Tanron3, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Chan, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Zos, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_S_Goro, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Nb, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ja, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_F40_Block, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_F40_Switch, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Po_Composer, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Guruguru, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Oceff_Wipe5, ALLOCTYPE_ABSOLUTE), - ACTOR_OVERLAY(En_Stone_heishi, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Oceff_Wipe6, ALLOCTYPE_ABSOLUTE), - ACTOR_OVERLAY(En_Scopenuts, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Scopecrow, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Oceff_Wipe7, ALLOCTYPE_ABSOLUTE), - ACTOR_OVERLAY(Eff_Kamejima_Wave, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Hg, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Hgo, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Zov, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ah, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Hgdoor, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Ikana_Bombwall, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Ikana_Ray, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Ikana_Shutter, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Haka_Bombwall, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Haka_Tomb, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Sc_Ruppe, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Iknv_Doukutu, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Iknv_Obj, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Pamera, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_HsStump, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Hidden_Nuts, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Zow, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Talk, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Al, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Tab, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Nimotsu, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Hit_Tag, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ruppecrow, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Tanron4, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Tanron5, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Tanron6, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Daiku2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Muto, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Baisen, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Heishi, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Demo_heishi, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Dt, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Cha, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Dinner, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Eff_Lastday, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Ikana_Dharma, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Akindonuts, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Eff_Stk, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ig, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Rg, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Osk, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Sth2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Yb, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Rz, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Scopecoin, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bjt, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bomjima, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bomjimb, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bombers, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bombers2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bombal, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Moon_Stone, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Mu_Pict, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Ikninside, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Eff_Zoraband, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Kepn_Koya, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Usiyane, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Nnh, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Kzsaku, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Milk_Bin, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Kitan, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Astr_Bombwall, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Iknin_Susceil, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bsb, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Recepgirl, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Thiefbird, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Jgame_Tsn, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Jgame_Light, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Yado, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Demo_Syoten, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Demo_Moonend, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Lbfshot, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Bg_Last_Bwall, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_And, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Invadepoh_Demo, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Danpeilift, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Fall2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Al, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_An, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Ah, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Nb, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Drs, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ending_Hero, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Bal, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Paper, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Hint_Skb, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Tag, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Bh, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ending_Hero2, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ending_Hero3, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ending_Hero4, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ending_Hero5, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Ending_Hero6, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Dm_Gm, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Swprize, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Invisible_Ruppe, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(Obj_Ending, ALLOCTYPE_NORMAL), - ACTOR_OVERLAY(En_Rsn, ALLOCTYPE_NORMAL), +#include "tables/actor_table.h" }; +#undef DEFINE_ACTOR +#undef DEFINE_ACTOR_INTERNAL +#undef DEFINE_ACTOR_UNSET + s32 gMaxActorId = 0; FaultClient D_801ED930; diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 7f4247b0d..eda6437af 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -72,17 +72,25 @@ BgSpecialSceneMaxObjects sCustomDynapolyMem[] = { // TODO: All these bss variables are localized to one function and can // likely be made into in-function static bss variables in the future -char D_801ED950[80]; -char D_801ED9A0[80]; + Vec3f D_801ED9F0[3]; // polyVerts Vec3f D_801EDA18[3]; // polyVerts -MtxF D_801EDA40; Vec3f D_801EDA80[3]; // polyVerts +Vec3f D_801EDB48[3]; // polyVerts + +#ifndef NON_MATCHING +Vec3f D_801EDB70[3]; // polyVerts; +Plane D_801EDB98; // plane; +Sphere16 D_801EDBA8; // sphere; +TriNorm D_801EDBB0; // tri; +#endif + +char D_801ED950[80]; +char D_801ED9A0[80]; + char D_801EDAA8[80]; char D_801EDAF8[80]; -Vec3f D_801EDB48[3]; // polyVerts -Vec3f D_801EDB70[3]; -Plane D_801EDB98; +MtxF D_801EDA40; void BgCheck_GetStaticLookupIndicesFromPos(CollisionContext* colCtx, Vec3f* pos, Vec3i* sector); f32 BgCheck_RaycastFloorDyna(DynaRaycast* dynaRaycast); @@ -281,7 +289,7 @@ void CollisionPoly_GetVertices(CollisionPoly* poly, Vec3s* vtxList, Vec3f* dest) void CollisionPoly_GetVerticesByBgId(CollisionPoly* poly, s32 bgId, CollisionContext* colCtx, Vec3f* dest) { Vec3s* vtxList; - if (poly == NULL || bgId > BG_ACTOR_MAX || dest == NULL) { + if ((poly == NULL) || (bgId > BG_ACTOR_MAX) || (dest == NULL)) { if (dest != NULL) { // @bug: dest[2] x and y are not set to 0 dest[0].x = dest[0].y = dest[0].z = dest[1].x = dest[1].y = dest[1].z = dest[2].z = 0.0f; @@ -380,40 +388,52 @@ s32 CollisionPoly_CheckZIntersectApprox(CollisionPoly* poly, Vec3s* vtxList, f32 } #ifdef NON_MATCHING +// Matches, but needs in-function static bss s32 CollisionPoly_LineVsPoly(BgLineVsPolyTest* a0) { - static Vec3f polyVerts[3]; // D_801EDB70 - static Plane plane; // D_801EDB98 + static Vec3f sPolyVerts[3]; // D_801EDB70 + static Plane sPlane; // D_801EDB98 f32 planeDistA; f32 planeDistB; - f32 planeDistDelta; + f32 dpA; + f32 dpB; + f32 originDist; - plane.originDist = a0->poly->dist; - planeDistA = COLPOLY_GET_NORMAL(a0->poly->normal.x * a0->posA->x + a0->poly->normal.y * a0->posA->y + - a0->poly->normal.z * a0->posA->z) + - plane.originDist; - planeDistB = COLPOLY_GET_NORMAL(a0->poly->normal.x * a0->posB->x + a0->poly->normal.y * a0->posB->y + - a0->poly->normal.z * a0->posB->z) + - plane.originDist; + sPlane.originDist = a0->poly->dist; + originDist = sPlane.originDist; + planeDistA = originDist; + planeDistB = originDist; - planeDistDelta = planeDistA - planeDistB; - if ((planeDistA >= 0.0f && planeDistB >= 0.0f) || (planeDistA < 0.0f && planeDistB < 0.0f) || - ((a0->checkOneFace != 0) && (planeDistA < 0.0f && planeDistB > 0.0f)) || IS_ZERO(planeDistDelta)) { + dpA = a0->poly->normal.x * a0->posA->x; + dpB = a0->poly->normal.x * a0->posB->x; + dpA += a0->poly->normal.y * a0->posA->y; + dpB += a0->poly->normal.y * a0->posB->y; + dpA += a0->poly->normal.z * a0->posA->z; + dpB += a0->poly->normal.z * a0->posB->z; + + dpA *= COLPOLY_NORMAL_FRAC; + dpB *= COLPOLY_NORMAL_FRAC; + + planeDistA += dpA; + planeDistB += dpB; + + if (((planeDistA >= 0.0f) && (planeDistB >= 0.0f)) || ((planeDistA < 0.0f) && (planeDistB < 0.0f)) || + ((a0->checkOneFace != 0) && (planeDistA < 0.0f) && (0.0f < planeDistB)) || IS_ZERO(planeDistA - planeDistB)) { return false; } - CollisionPoly_GetNormalF(a0->poly, &plane.normal.x, &plane.normal.y, &plane.normal.z); - CollisionPoly_GetVertices(a0->poly, a0->vtxList, polyVerts); - Math3D_Lerp(a0->posA, a0->posB, planeDistA / planeDistDelta, a0->planeIntersect); + CollisionPoly_GetNormalF(a0->poly, &sPlane.normal.x, &sPlane.normal.y, &sPlane.normal.z); + CollisionPoly_GetVertices(a0->poly, a0->vtxList, sPolyVerts); + Math3D_Lerp(a0->posA, a0->posB, planeDistA / (planeDistA - planeDistB), a0->planeIntersect); - if ((fabsf(plane.normal.x) > 0.5f && - Math3D_TriChkPointParaXDist(&polyVerts[0], &polyVerts[1], &polyVerts[2], a0->planeIntersect->y, - a0->planeIntersect->z, 0.0f, a0->checkDist, plane.normal.x)) || - (fabsf(plane.normal.y) > 0.5f && - Math3D_TriChkPointParaYDist(&polyVerts[0], &polyVerts[1], &polyVerts[2], a0->planeIntersect->z, - a0->planeIntersect->x, 0.0f, a0->checkDist, plane.normal.y)) || - (fabsf(plane.normal.z) > 0.5f && - Math3D_TriChkLineSegParaZDist(&polyVerts[0], &polyVerts[1], &polyVerts[2], a0->planeIntersect->x, - a0->planeIntersect->y, 0.0f, a0->checkDist, plane.normal.z))) { + if (((fabsf(sPlane.normal.x) > 0.5f) && + Math3D_TriChkPointParaXDist(&sPolyVerts[0], &sPolyVerts[1], &sPolyVerts[2], a0->planeIntersect->y, + a0->planeIntersect->z, 0.0f, a0->checkDist, sPlane.normal.x)) || + ((fabsf(sPlane.normal.y) > 0.5f) && + Math3D_TriChkPointParaYDist(&sPolyVerts[0], &sPolyVerts[1], &sPolyVerts[2], a0->planeIntersect->z, + a0->planeIntersect->x, 0.0f, a0->checkDist, sPlane.normal.y)) || + ((fabsf(sPlane.normal.z) > 0.5f) && + Math3D_TriChkLineSegParaZDist(&sPolyVerts[0], &sPolyVerts[1], &sPolyVerts[2], a0->planeIntersect->x, + a0->planeIntersect->y, 0.0f, a0->checkDist, sPlane.normal.z))) { return true; } return false; @@ -423,20 +443,26 @@ s32 CollisionPoly_LineVsPoly(BgLineVsPolyTest* a0); #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/CollisionPoly_LineVsPoly.s") #endif +#ifdef NON_MATCHING +// Matches, but needs in-function static bss s32 CollisionPoly_SphVsPoly(CollisionPoly* poly, Vec3s* vtxList, Vec3f* center, f32 radius) { - static Sphere16 sphere; // D_801EDBA8 - static TriNorm tri; // D_801EDBB0 + static Sphere16 sSphere; // D_801EDBA8 + static TriNorm sTri; // D_801EDBB0 Vec3f intersect; - CollisionPoly_GetVertices(poly, vtxList, tri.vtx); - CollisionPoly_GetNormalF(poly, &tri.plane.normal.x, &tri.plane.normal.y, &tri.plane.normal.z); - tri.plane.originDist = poly->dist; - sphere.center.x = center->x; - sphere.center.y = center->y; - sphere.center.z = center->z; - sphere.radius = radius; - return Math3D_ColSphereTri(&sphere, &tri, &intersect); + CollisionPoly_GetVertices(poly, vtxList, sTri.vtx); + CollisionPoly_GetNormalF(poly, &sTri.plane.normal.x, &sTri.plane.normal.y, &sTri.plane.normal.z); + sTri.plane.originDist = poly->dist; + sSphere.center.x = center->x; + sSphere.center.y = center->y; + sSphere.center.z = center->z; + sSphere.radius = radius; + return Math3D_ColSphereTri(&sSphere, &sTri, &intersect); } +#else +s32 CollisionPoly_SphVsPoly(CollisionPoly* poly, Vec3s* vtxList, Vec3f* center, f32 radius); +#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/CollisionPoly_SphVsPoly.s") +#endif /** * Add poly to StaticLookup table @@ -466,9 +492,9 @@ void StaticLookup_AddPolyToSSList(CollisionContext* colCtx, SSList* ssList, Coll curPolyId = curNode->polyId; // if the poly being inserted has a lower y than the first poly - if (polyYMin < vtxList[COLPOLY_VTX_INDEX(polyList[curPolyId].flags_vIA)].y && - polyYMin < vtxList[COLPOLY_VTX_INDEX(polyList[curPolyId].flags_vIB)].y && - polyYMin < vtxList[polyList[curPolyId].vIC].y) { + if ((polyYMin < vtxList[COLPOLY_VTX_INDEX(polyList[curPolyId].flags_vIA)].y) && + (polyYMin < vtxList[COLPOLY_VTX_INDEX(polyList[curPolyId].flags_vIB)].y) && + (polyYMin < vtxList[polyList[curPolyId].vIC].y)) { SSNodeList_SetSSListHead(&colCtx->polyNodes, ssList, &polyId); return; } @@ -487,9 +513,9 @@ void StaticLookup_AddPolyToSSList(CollisionContext* colCtx, SSList* ssList, Coll curPolyId = nextNode->polyId; // if the poly being inserted is lower than the next poly - if (polyYMin < vtxList[COLPOLY_VTX_INDEX(polyList[curPolyId].flags_vIA)].y && - polyYMin < vtxList[COLPOLY_VTX_INDEX(polyList[curPolyId].flags_vIB)].y && - polyYMin < vtxList[polyList[curPolyId].vIC].y) { + if ((polyYMin < vtxList[COLPOLY_VTX_INDEX(polyList[curPolyId].flags_vIA)].y) && + (polyYMin < vtxList[COLPOLY_VTX_INDEX(polyList[curPolyId].flags_vIB)].y) && + (polyYMin < vtxList[polyList[curPolyId].vIC].y)) { newNodeId = SSNodeList_GetNextNodeIdx(&colCtx->polyNodes); SSNode_SetValue(&colCtx->polyNodes.tbl[newNodeId], &polyId, curNode->next); curNode->next = newNodeId; @@ -542,8 +568,9 @@ f32 BgCheck_RaycastFloorStaticList(CollisionContext* colCtx, u16 xpFlags, SSList if (((flags & 1) && (colPoly->normal.y < 0)) || ((arg9 & 0x20) && ((colCtx->colHeader->surfaceTypeList[colPoly->type].data[0] >> 0x1E) & 1)) || COLPOLY_VIA_FLAG_TEST(colPoly->flags_vIA, xpFlags) || - (COLPOLY_VIA_FLAG_TEST(colPoly->flags_vIB, 4) && ((actor != NULL && actor->category != ACTORCAT_PLAYER) || - (actor == NULL && xpFlags != COLPOLY_IGNORE_CAMERA)))) { + (COLPOLY_VIA_FLAG_TEST(colPoly->flags_vIB, 4) && + (((actor != NULL) && (actor->category != ACTORCAT_PLAYER)) || + ((actor == NULL) && (xpFlags != COLPOLY_IGNORE_CAMERA))))) { if (curNode->next == SS_NULL) { break; } @@ -551,16 +578,16 @@ f32 BgCheck_RaycastFloorStaticList(CollisionContext* colCtx, u16 xpFlags, SSList continue; } - if (pos->y < colCtx->colHeader->vtxList[COLPOLY_VTX_INDEX(colPoly->flags_vIA)].y && - pos->y < colCtx->colHeader->vtxList[COLPOLY_VTX_INDEX(colPoly->flags_vIB)].y && - pos->y < colCtx->colHeader->vtxList[colPoly->vIC].y) { + if ((pos->y < colCtx->colHeader->vtxList[COLPOLY_VTX_INDEX(colPoly->flags_vIA)].y) && + (pos->y < colCtx->colHeader->vtxList[COLPOLY_VTX_INDEX(colPoly->flags_vIB)].y) && + (pos->y < colCtx->colHeader->vtxList[colPoly->vIC].y)) { break; } if (CollisionPoly_CheckYIntersect(colPoly, colCtx->colHeader->vtxList, pos->x, pos->z, &yIntersect, checkDist)) { // if poly is closer to pos without going over - if (yIntersect < pos->y && result < yIntersect) { + if ((yIntersect < pos->y) && (result < yIntersect)) { result = yIntersect; *outPoly = colPoly; } @@ -682,7 +709,7 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16 vtxB = &vtxList[COLPOLY_VTX_INDEX(curPoly->flags_vIB)]; vtxC = &vtxList[curPoly->vIC]; - if (pos->y < vtxA->y && pos->y < vtxB->y && pos->y < vtxC->y) { + if ((pos->y < vtxA->y) && (pos->y < vtxB->y) && (pos->y < vtxC->y)) { break; } @@ -692,8 +719,9 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16 normalXZ = sqrtf(SQ(nx) + SQ(nz)); planeDist = Math3D_DistPlaneToPos(nx, ny, nz, curPoly->dist, &resultPos); if (radius < fabsf(planeDist) || COLPOLY_VIA_FLAG_TEST(curPoly->flags_vIA, xpFlags) || - (COLPOLY_VIA_FLAG_TEST(curPoly->flags_vIB, 4) && ((actor != NULL && actor->category != ACTORCAT_PLAYER) || - (actor == NULL && xpFlags != COLPOLY_IGNORE_CAMERA)))) { + (COLPOLY_VIA_FLAG_TEST(curPoly->flags_vIB, 4) && + (((actor != NULL) && (actor->category != ACTORCAT_PLAYER)) || + ((actor == NULL) && (xpFlags != COLPOLY_IGNORE_CAMERA))))) { if (curNode->next == SS_NULL) { break; } else { @@ -733,7 +761,7 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16 zMin -= radius; zMax += radius; - if (resultPos.z < zMin || resultPos.z > zMax) { + if ((resultPos.z < zMin) || (resultPos.z > zMax)) { if (curNode->next == SS_NULL) { break; } else { @@ -769,7 +797,7 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16 vtxB = &vtxList[COLPOLY_VTX_INDEX(curPoly->flags_vIB)]; vtxC = &vtxList[curPoly->vIC]; - if (pos->y < vtxA->y && pos->y < vtxB->y && pos->y < vtxC->y) { + if ((pos->y < vtxA->y) && (pos->y < vtxB->y) && (pos->y < vtxC->y)) { break; } @@ -779,8 +807,9 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16 normalXZ = sqrtf(SQ(nx) + SQ(nz)); planeDist = Math3D_DistPlaneToPos(nx, ny, nz, curPoly->dist, &resultPos); if (radius < fabsf(planeDist) || COLPOLY_VIA_FLAG_TEST(curPoly->flags_vIA, xpFlags) || - (COLPOLY_VIA_FLAG_TEST(curPoly->flags_vIB, 4) && ((actor != NULL && actor->category != ACTORCAT_PLAYER) || - (actor == NULL && xpFlags != COLPOLY_IGNORE_CAMERA)))) { + (COLPOLY_VIA_FLAG_TEST(curPoly->flags_vIB, 4) && + (((actor != NULL) && (actor->category != ACTORCAT_PLAYER)) || + ((actor == NULL) && (xpFlags != COLPOLY_IGNORE_CAMERA))))) { if (curNode->next == SS_NULL) { break; } else { @@ -820,7 +849,7 @@ s32 BgCheck_SphVsStaticWall(StaticLookup* lookup, CollisionContext* colCtx, u16 xMin -= radius; xMax += radius; - if (resultPos.x < xMin || xMax < resultPos.x) { + if ((resultPos.x < xMin) || (xMax < resultPos.x)) { if (curNode->next == SS_NULL) { break; } else { @@ -886,8 +915,8 @@ s32 BgCheck_CheckStaticCeiling(StaticLookup* lookup, u16 xpFlags, CollisionConte curPoly = &polyList[curPolyId]; if (COLPOLY_VIA_FLAG_TEST(colCtx->colHeader->polyList[curPolyId].flags_vIA, xpFlags) || (COLPOLY_VIA_FLAG_TEST(colCtx->colHeader->polyList[curPolyId].flags_vIB, 4) && - ((actor != NULL && actor->category != ACTORCAT_PLAYER) || - (actor == NULL && xpFlags != COLPOLY_IGNORE_CAMERA)))) { + (((actor != NULL) && (actor->category != ACTORCAT_PLAYER)) || + ((actor == NULL) && (xpFlags != COLPOLY_IGNORE_CAMERA))))) { if (curNode->next == SS_NULL) { break; } else { @@ -900,7 +929,7 @@ s32 BgCheck_CheckStaticCeiling(StaticLookup* lookup, u16 xpFlags, CollisionConte intersectDist = ceilingY - *outY; ny = COLPOLY_GET_NORMAL(curPoly->normal.y); - if (intersectDist > 0 && intersectDist < checkHeight && intersectDist * ny <= 0) { + if ((intersectDist > 0) && (intersectDist < checkHeight) && (intersectDist * ny <= 0)) { *outY = ceilingY - checkHeight; *outPoly = curPoly; result = true; @@ -923,9 +952,8 @@ s32 BgCheck_CheckStaticCeiling(StaticLookup* lookup, u16 xpFlags, CollisionConte * `posB` and `outPos` returns the point of intersection with `outPoly` * `outDistSq` returns the squared distance from `posA` to the point of intersect */ -#ifdef NON_MATCHING s32 BgCheck_CheckLineAgainstSSList(StaticLineTest* arg0) { - CollisionContext* colCtx; + CollisionPoly* polyList; s32 result; Vec3f polyIntersect; // sp7C SSNode* curNode; @@ -934,16 +962,14 @@ s32 BgCheck_CheckLineAgainstSSList(StaticLineTest* arg0) { f32 distSq; BgLineVsPolyTest test; // sp50 s16 polyId; - CollisionPoly* polyList; result = false; if (arg0->ssList->head == SS_NULL) { return result; } - colCtx = arg0->colCtx; - curNode = &colCtx->polyNodes.tbl[arg0->ssList->head]; - polyList = colCtx->colHeader->polyList; - test.vtxList = colCtx->colHeader->vtxList; + curNode = &arg0->colCtx->polyNodes.tbl[arg0->ssList->head]; + polyList = arg0->colCtx->colHeader->polyList; + test.vtxList = arg0->colCtx->colHeader->vtxList; test.posA = arg0->posA; test.posB = arg0->posB; test.planeIntersect = &polyIntersect; // reorder maybe @@ -955,22 +981,22 @@ s32 BgCheck_CheckLineAgainstSSList(StaticLineTest* arg0) { test.poly = &polyList[polyId]; checkedPoly = &arg0->colCtx->polyNodes.polyCheckTbl[polyId]; - if (*checkedPoly == true || - (arg0->xpFlags2 != 0 && !COLPOLY_VIA_FLAG_TEST(test.poly->flags_vIA, arg0->xpFlags2)) || + if ((*checkedPoly == true) || + ((arg0->xpFlags2 != 0) && !COLPOLY_VIA_FLAG_TEST(test.poly->flags_vIA, arg0->xpFlags2)) || COLPOLY_VIA_FLAG_TEST(test.poly->flags_vIA, arg0->xpFlags1) || (COLPOLY_VIA_FLAG_TEST(test.poly->flags_vIB, 4) && - ((arg0->actor != NULL && arg0->actor->category != ACTORCAT_PLAYER) || - (arg0->actor == NULL && arg0->xpFlags1 != COLPOLY_IGNORE_CAMERA)))) { + (((arg0->actor != NULL) && (arg0->actor->category != ACTORCAT_PLAYER)) || + ((arg0->actor == NULL) && (arg0->xpFlags1 != COLPOLY_IGNORE_CAMERA))))) { if (curNode->next == SS_NULL) { break; } else { - curNode = &colCtx->polyNodes.tbl[curNode->next]; + curNode = &arg0->colCtx->polyNodes.tbl[curNode->next]; continue; } } *checkedPoly = true; minY = CollisionPoly_GetMinY(test.poly, test.vtxList); - if (test.posA->y < minY && test.posB->y < minY) { + if (((test.posA->y < minY)) && (test.posB->y < minY)) { break; } if (CollisionPoly_LineVsPoly(&test)) { @@ -990,10 +1016,6 @@ s32 BgCheck_CheckLineAgainstSSList(StaticLineTest* arg0) { } return result; } -#else -s32 BgCheck_CheckLineAgainstSSList(StaticLineTest* arg0); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/BgCheck_CheckLineAgainstSSList.s") -#endif /** * Tests if line `posA` to `posB` intersects with a static poly in `lookup`. Uses polyCheckTbl @@ -1005,21 +1027,21 @@ s32 BgCheck_CheckLineAgainstSSList(StaticLineTest* arg0); s32 BgCheck_CheckLineInSubdivision(StaticLineTest* arg0) { s32 result = false; - if ((arg0->bccFlags & BGCHECK_CHECK_FLOOR) && arg0->lookup->floor.head != SS_NULL) { + if ((arg0->bccFlags & BGCHECK_CHECK_FLOOR) && (arg0->lookup->floor.head != SS_NULL)) { arg0->ssList = &arg0->lookup->floor; if (BgCheck_CheckLineAgainstSSList(arg0)) { result = true; } } - if ((arg0->bccFlags & BGCHECK_CHECK_WALL) && arg0->lookup->wall.head != SS_NULL) { + if ((arg0->bccFlags & BGCHECK_CHECK_WALL) && (arg0->lookup->wall.head != SS_NULL)) { arg0->ssList = &arg0->lookup->wall; if (BgCheck_CheckLineAgainstSSList(arg0)) { result = true; } } - if ((arg0->bccFlags & BGCHECK_CHECK_CEILING) && arg0->lookup->ceiling.head != SS_NULL) { + if ((arg0->bccFlags & BGCHECK_CHECK_CEILING) && (arg0->lookup->ceiling.head != SS_NULL)) { arg0->ssList = &arg0->lookup->ceiling; if (BgCheck_CheckLineAgainstSSList(arg0)) { result = true; @@ -1049,8 +1071,8 @@ s32 BgCheck_SphVsFirstStaticPolyList(SSNode* node, u16 xpFlags, CollisionContext curPoly = &polyList[curPolyId]; if (COLPOLY_VIA_FLAG_TEST(colCtx->colHeader->polyList[curPolyId].flags_vIA, xpFlags) || (COLPOLY_VIA_FLAG_TEST(colCtx->colHeader->polyList[curPolyId].flags_vIB, 4) && - ((actor != NULL && actor->category != ACTORCAT_PLAYER) || - (actor == NULL && xpFlags != COLPOLY_IGNORE_CAMERA)))) { + (((actor != NULL) && (actor->category != ACTORCAT_PLAYER)) || + ((actor == NULL) && (xpFlags != COLPOLY_IGNORE_CAMERA))))) { if (node->next != SS_NULL) { node = &colCtx->polyNodes.tbl[node->next]; continue; @@ -1058,9 +1080,9 @@ s32 BgCheck_SphVsFirstStaticPolyList(SSNode* node, u16 xpFlags, CollisionContext break; } - if (center->y + radius < vtxList[COLPOLY_VTX_INDEX(curPoly->flags_vIA)].y && - center->y + radius < vtxList[COLPOLY_VTX_INDEX(curPoly->flags_vIB)].y && - center->y + radius < vtxList[curPoly->vIC].y) { + if ((center->y + radius < vtxList[COLPOLY_VTX_INDEX(curPoly->flags_vIA)].y) && + (center->y + radius < vtxList[COLPOLY_VTX_INDEX(curPoly->flags_vIB)].y) && + (center->y + radius < vtxList[curPoly->vIC].y)) { break; } @@ -1086,19 +1108,19 @@ s32 BgCheck_SphVsFirstStaticPolyList(SSNode* node, u16 xpFlags, CollisionContext */ s32 BgCheck_SphVsFirstStaticPoly(StaticLookup* lookup, u16 xpFlags, CollisionContext* colCtx, Vec3f* center, f32 radius, CollisionPoly** outPoly, u16 bciFlags, Actor* actor) { - if (lookup->floor.head != SS_NULL && !(bciFlags & BGCHECK_IGNORE_FLOOR) && + if ((lookup->floor.head != SS_NULL) && !(bciFlags & BGCHECK_IGNORE_FLOOR) && BgCheck_SphVsFirstStaticPolyList(&colCtx->polyNodes.tbl[lookup->floor.head], xpFlags, colCtx, center, radius, outPoly, actor)) { return true; } - if (lookup->wall.head != SS_NULL && !(bciFlags & BGCHECK_IGNORE_WALL) && + if ((lookup->wall.head != SS_NULL) && !(bciFlags & BGCHECK_IGNORE_WALL) && BgCheck_SphVsFirstStaticPolyList(&colCtx->polyNodes.tbl[lookup->wall.head], xpFlags, colCtx, center, radius, outPoly, actor)) { return true; } - if (lookup->ceiling.head != SS_NULL && !(bciFlags & BGCHECK_IGNORE_CEILING) && + if ((lookup->ceiling.head != SS_NULL) && !(bciFlags & BGCHECK_IGNORE_CEILING) && BgCheck_SphVsFirstStaticPolyList(&colCtx->polyNodes.tbl[lookup->ceiling.head], xpFlags, colCtx, center, radius, outPoly, actor)) { return true; @@ -1634,7 +1656,7 @@ CollisionHeader* BgCheck_GetCollisionHeader(CollisionContext* colCtx, s32 bgId) if (bgId == BGCHECK_SCENE) { return colCtx->colHeader; } - if (bgId < 0 || bgId > BG_ACTOR_MAX) { + if ((bgId < 0) || (bgId > BG_ACTOR_MAX)) { return NULL; } if (!(colCtx->dyna.bgActorFlags[bgId] & 1)) { @@ -1647,12 +1669,12 @@ CollisionHeader* BgCheck_GetCollisionHeader(CollisionContext* colCtx, s32 bgId) * Test if pos is near collision boundaries */ s32 BgCheck_PosInStaticBoundingBox(CollisionContext* colCtx, Vec3f* pos) { - if (pos->x < (colCtx->minBounds.x - BGCHECK_SUBDIV_OVERLAP) || - (colCtx->maxBounds.x + BGCHECK_SUBDIV_OVERLAP) < pos->x || - pos->y < (colCtx->minBounds.y - BGCHECK_SUBDIV_OVERLAP) || - (colCtx->maxBounds.y + BGCHECK_SUBDIV_OVERLAP) < pos->y || - pos->z < (colCtx->minBounds.z - BGCHECK_SUBDIV_OVERLAP) || - (colCtx->maxBounds.z + BGCHECK_SUBDIV_OVERLAP) < pos->z) { + if ((pos->x < (colCtx->minBounds.x - BGCHECK_SUBDIV_OVERLAP)) || + ((colCtx->maxBounds.x + BGCHECK_SUBDIV_OVERLAP) < pos->x) || + (pos->y < (colCtx->minBounds.y - BGCHECK_SUBDIV_OVERLAP)) || + ((colCtx->maxBounds.y + BGCHECK_SUBDIV_OVERLAP) < pos->y) || + (pos->z < (colCtx->minBounds.z - BGCHECK_SUBDIV_OVERLAP)) || + ((colCtx->maxBounds.z + BGCHECK_SUBDIV_OVERLAP) < pos->z)) { return false; } return true; @@ -1713,7 +1735,7 @@ f32 BgCheck_RaycastFloorImpl(PlayState* play, CollisionContext* colCtx, u16 xpFl } } - if (yIntersect != BGCHECK_Y_MIN && func_800C9B68(colCtx, *outPoly, *outBgId)) { + if ((yIntersect != BGCHECK_Y_MIN) && func_800C9B68(colCtx, *outPoly, *outBgId)) { yIntersect -= 1.0f; } return yIntersect; @@ -1916,7 +1938,7 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul dz = posNext->z - posPrev->z; // if there's movement on the xz plane, and argA flag is 0, - if ((dx != 0.0f || dz != 0.0f) && (argA & 1) == 0) { + if (((dx != 0.0f) || (dz != 0.0f)) && !(argA & 1)) { if ((checkHeight + dy) < 5.0f) { //! @bug checkHeight is not applied to posPrev/posNext result = BgCheck_CheckLineImpl(colCtx, xpFlags, COLPOLY_IGNORE_NONE, posPrev, posNext, &posIntersect, &poly, @@ -1977,7 +1999,7 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul *outPoly = poly; *outBgId = bgId; result = true; - if (COLPOLY_GET_NORMAL(poly->normal.y) > 0.5f) { + if (poly->normal.y * COLPOLY_NORMAL_FRAC > 0.5f) { if (actor != NULL) { actor->bgCheckFlags |= 0x1000; } @@ -2010,7 +2032,7 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul result = true; } // if a collision with a dyna poly was detected - if (dynaPolyCollision || *outBgId != BGCHECK_SCENE) { + if (dynaPolyCollision || (*outBgId != BGCHECK_SCENE)) { if (BgCheck_CheckLineImpl(colCtx, xpFlags, COLPOLY_IGNORE_NONE, posPrev, posResult, &posIntersect2, &poly, &bgId2, actor, 1.0f, BGCHECK_CHECK_ONE_FACE | BGCHECK_CHECK_WALL)) { nx3 = COLPOLY_GET_NORMAL(poly->normal.x); @@ -2202,7 +2224,7 @@ s32 BgCheck_CheckLineImpl(CollisionContext* colCtx, u16 xpFlags1, u16 xpFlags2, checkLine.actor = actor; result = false; - if (subdivMin[0] != subdivMax[0] || subdivMin[1] != subdivMax[1] || subdivMin[2] != subdivMax[2]) { + if ((subdivMin[0] != subdivMax[0]) || (subdivMin[1] != subdivMax[1]) || (subdivMin[2] != subdivMax[2])) { for (i = 0; i < 3; i++) { if (subdivMax[i] < subdivMin[i]) { j = subdivMax[i]; @@ -2512,9 +2534,9 @@ void ScaleRotPos_SetValue(ScaleRotPos* srp, Vec3f* scale, Vec3s* rot, Vec3f* pos * ScaleRotPos equality test */ s32 ScaleRotPos_IsEqual(ScaleRotPos* a, ScaleRotPos* b) { - if (a->scale.x != b->scale.x || a->scale.y != b->scale.y || a->scale.z != b->scale.z || a->rot.x != b->rot.x || - a->rot.y != b->rot.y || a->rot.z != b->rot.z || a->pos.x != b->pos.x || a->pos.y != b->pos.y || - a->pos.z != b->pos.z) { + if ((a->scale.x != b->scale.x) || (a->scale.y != b->scale.y) || (a->scale.z != b->scale.z) || + (a->rot.x != b->rot.x) || (a->rot.y != b->rot.y) || (a->rot.z != b->rot.z) || (a->pos.x != b->pos.x) || + (a->pos.y != b->pos.y) || (a->pos.z != b->pos.z)) { return false; } return true; @@ -2642,7 +2664,7 @@ void DynaPoly_SetBgActorPrevTransform(PlayState* play, BgActor* bgActor) { * Is BgActor Id */ s32 DynaPoly_IsBgIdBgActor(s32 bgId) { - if (bgId < 0 || bgId >= BG_ACTOR_MAX) { + if ((bgId < 0) || (bgId >= BG_ACTOR_MAX)) { return false; } return true; @@ -2714,7 +2736,7 @@ s32 DynaPoly_SetBgActor(PlayState* play, DynaCollisionContext* dyna, Actor* acto */ DynaPolyActor* DynaPoly_GetActor(CollisionContext* colCtx, s32 bgId) { if (!DynaPoly_IsBgIdBgActor(bgId) || !(colCtx->dyna.bgActorFlags[bgId] & 1) || - colCtx->dyna.bgActorFlags[bgId] & 2) { + (colCtx->dyna.bgActorFlags[bgId] & 2)) { return NULL; } return (DynaPolyActor*)colCtx->dyna.bgActors[bgId].actor; @@ -2881,20 +2903,20 @@ void DynaPoly_ExpandSRT(PlayState* play, DynaCollisionContext* dyna, s32 bgId, s if (dyna->bgActorFlags[bgId] & 4) { return; } - - if (!(DYNA_WATERBOX_MAX >= *waterBoxStartIndex + pbgdata->numWaterBoxes)) { + // if(&pos){} // fake but considerably improves match. commented out to stop warnings + if (*waterBoxStartIndex + pbgdata->numWaterBoxes > DYNA_WATERBOX_MAX) { sprintf(D_801EDAA8, "water_poly Error:[MoveBG OSUGI!!!]"); sprintf(D_801EDAF8, "num = %d > %d\n", *waterBoxStartIndex + pbgdata->numWaterBoxes, DYNA_WATERBOX_MAX); Fault_AddHungupAndCrashImpl(D_801EDAA8, D_801EDAF8); } - if (!(dyna->polyListMax >= *polyStartIndex + pbgdata->numPolygons)) { + if (*polyStartIndex + pbgdata->numPolygons > dyna->polyListMax) { sprintf(D_801EDAA8, "bg_poly Error:[MoveBG OSUGI!!!]"); sprintf(D_801EDAF8, "num = %d > %d\n", *polyStartIndex + pbgdata->numPolygons, dyna->polyListMax); Fault_AddHungupAndCrashImpl(D_801EDAA8, D_801EDAF8); } - if (!(dyna->vtxListMax >= *vtxStartIndex + pbgdata->numVertices)) { + if (*vtxStartIndex + pbgdata->numVertices > dyna->vtxListMax) { sprintf(D_801EDAA8, "bg_vert Error:[MoveBG OSUGI!!!]"); sprintf(D_801EDAF8, "num = %d > %d\n", *vtxStartIndex + pbgdata->numVertices, dyna->vtxListMax); Fault_AddHungupAndCrashImpl(D_801EDAA8, D_801EDAF8); @@ -2938,7 +2960,8 @@ void DynaPoly_ExpandSRT(PlayState* play, DynaCollisionContext* dyna, s32 bgId, s dyna->bgActors[bgId].curTransform.pos.x, dyna->bgActors[bgId].curTransform.pos.y, dyna->bgActors[bgId].curTransform.pos.z); - if (pbgdata->numVertices != 0 && pbgdata->numPolygons != 0) { + if ((pbgdata->numVertices != 0) && (pbgdata->numPolygons != 0)) { + s32 j; numVtxInverse = 1.0f / pbgdata->numVertices; newCenterPoint.x = newCenterPoint.y = newCenterPoint.z = 0.0f; for (i = 0; i < pbgdata->numVertices; i++) { @@ -2969,13 +2992,12 @@ void DynaPoly_ExpandSRT(PlayState* play, DynaCollisionContext* dyna, s32 bgId, s sphere->center.z = newCenterPoint.z; newRadiusSq = -100.0f; - for (i = 0; i < pbgdata->numVertices; i++) { + for (i = 0, j = *vtxStartIndex; i < pbgdata->numVertices; i++, j++) { f32 radiusSq; - s32 idx = *vtxStartIndex + i; - newVtx.x = dyna->vtxList[idx].x; - newVtx.y = dyna->vtxList[idx].y; - newVtx.z = dyna->vtxList[idx].z; + newVtx.x = dyna->vtxList[j].x; + newVtx.y = dyna->vtxList[j].y; + newVtx.z = dyna->vtxList[j].z; radiusSq = Math3D_Vec3fDistSq(&newVtx, &newCenterPoint); if (newRadiusSq < radiusSq) { newRadiusSq = radiusSq; @@ -3022,7 +3044,7 @@ void DynaPoly_ExpandSRT(PlayState* play, DynaCollisionContext* dyna, s32 bgId, s newPoly->normal.z = COLPOLY_SNORMAL(newNormal.z); } - newPoly->dist = -DOTXYZ(newNormal, dVtxList[vIA]); + newPoly->dist = func_80086D24(-DOTXYZ(newNormal, vtxA)); if (newNormal.y > 0.5f) { s16 polyId = *polyStartIndex + i; @@ -3039,21 +3061,22 @@ void DynaPoly_ExpandSRT(PlayState* play, DynaCollisionContext* dyna, s32 bgId, s } } - for (wi = 0; wi < pbgdata->numWaterBoxes; wi++) { - Math_Vec3s_ToVec3f(&spB8, &pbgdata->waterBoxes[wi].minPos); - Math_Vec3f_Copy(&spA0, &spB8); - spA0.x += pbgdata->waterBoxes[wi].xLength; - Math_Vec3f_Copy(&sp88, &spB8); - sp88.z += pbgdata->waterBoxes[wi].zLength; - SkinMatrix_Vec3fMtxFMultXYZ(&D_801EDA40, &spB8, &spAC); - SkinMatrix_Vec3fMtxFMultXYZ(&D_801EDA40, &spA0, &sp94); - SkinMatrix_Vec3fMtxFMultXYZ(&D_801EDA40, &sp88, &sp7C); - waterBox = &dyna->waterBoxList.boxes[*waterBoxStartIndex + wi]; - BgCheck_CalcWaterboxDimensions(&spAC, &sp94, &sp7C, &waterBox->minPos, &waterBox->xLength, - &waterBox->zLength); - waterBox->properties = pbgdata->waterBoxes[wi].properties; + if (pbgdata->numWaterBoxes > 0) { + for (wi = 0; wi < pbgdata->numWaterBoxes; wi++) { + Math_Vec3s_ToVec3f(&spB8, &pbgdata->waterBoxes[wi].minPos); + Math_Vec3f_Copy(&spA0, &spB8); + spA0.x += pbgdata->waterBoxes[wi].xLength; + Math_Vec3f_Copy(&sp88, &spB8); + sp88.z += pbgdata->waterBoxes[wi].zLength; + SkinMatrix_Vec3fMtxFMultXYZ(&D_801EDA40, &spB8, &spAC); + SkinMatrix_Vec3fMtxFMultXYZ(&D_801EDA40, &spA0, &sp94); + SkinMatrix_Vec3fMtxFMultXYZ(&D_801EDA40, &sp88, &sp7C); + waterBox = &dyna->waterBoxList.boxes[*waterBoxStartIndex + wi]; + BgCheck_CalcWaterboxDimensions(&spAC, &sp94, &sp7C, &waterBox->minPos, &waterBox->xLength, + &waterBox->zLength); + waterBox->properties = pbgdata->waterBoxes[wi].properties; + } } - *polyStartIndex += pbgdata->numPolygons; *vtxStartIndex += pbgdata->numVertices; *waterBoxStartIndex += pbgdata->numWaterBoxes; @@ -3070,7 +3093,7 @@ void BgCheck_ResetFlagsIfLoadedActor(PlayState* play, DynaCollisionContext* dyna for (i = 0; i < BG_ACTOR_MAX; i++) { if ((dyna->bgActorFlags[i] & 1)) { dynaActor = DynaPoly_GetActor(&play->colCtx, i); - if (dynaActor != NULL && &dynaActor->actor == actor) { + if ((dynaActor != NULL) && (&dynaActor->actor == actor)) { DynaPolyActor_ResetState((DynaPolyActor*)actor); return; } @@ -3101,7 +3124,7 @@ void DynaPoly_Setup(PlayState* play, DynaCollisionContext* dyna) { BgActor_Init(play, &dyna->bgActors[i]); dyna->bitFlag |= DYNAPOLY_INVALIDATE_LOOKUP; } - if (dyna->bgActors[i].actor != NULL && dyna->bgActors[i].actor->update == NULL) { + if ((dyna->bgActors[i].actor != NULL) && (dyna->bgActors[i].actor->update == NULL)) { // Delete BgActor actor = DynaPoly_GetActor(&play->colCtx, i); if (actor == NULL) { @@ -3181,8 +3204,8 @@ f32 BgCheck_RaycastFloorDynaList(DynaRaycast* dynaRaycast, u32 listType) { id = curNode->polyId; if (COLPOLY_VIA_FLAG_TEST(polyList[id].flags_vIA, dynaRaycast->xpFlags) || (COLPOLY_VIA_FLAG_TEST(polyList[id].flags_vIB, 4) && - ((dynaRaycast->actor != NULL && dynaRaycast->actor->category != ACTORCAT_PLAYER) || - (dynaRaycast->actor == NULL && dynaRaycast->xpFlags != COLPOLY_IGNORE_CAMERA))) || + (((dynaRaycast->actor != NULL) && (dynaRaycast->actor->category != ACTORCAT_PLAYER)) || + ((dynaRaycast->actor == NULL) && (dynaRaycast->xpFlags != COLPOLY_IGNORE_CAMERA)))) || ((dynaRaycast->unk_24 & 0x20) && func_800C9B68(dynaRaycast->colCtx, &polyList[id], dynaRaycast->unk1C))) { if (curNode->next == SS_NULL) { break; @@ -3192,7 +3215,7 @@ f32 BgCheck_RaycastFloorDynaList(DynaRaycast* dynaRaycast, u32 listType) { } } if ((listType & (DYNA_RAYCAST_WALLS | DYNA_RAYCAST_CEILINGS)) && (dynaRaycast->unk_24 & 0x10) && - COLPOLY_GET_NORMAL(polyList[id].normal.y) < 0.0f) { + (COLPOLY_GET_NORMAL(polyList[id].normal.y) < 0.0f)) { if (curNode->next == SS_NULL) { break; } else { @@ -3202,7 +3225,7 @@ f32 BgCheck_RaycastFloorDynaList(DynaRaycast* dynaRaycast, u32 listType) { } if (CollisionPoly_CheckYIntersectApprox1(&polyList[id], dynaRaycast->dyna->vtxList, dynaRaycast->pos->x, dynaRaycast->pos->z, &yIntersect, dynaRaycast->checkDist) && - yIntersect < dynaRaycast->pos->y && result < yIntersect) { + (yIntersect < dynaRaycast->pos->y) && (result < yIntersect)) { result = yIntersect; *dynaRaycast->resultPoly = &dynaRaycast->dyna->polyList[id]; } @@ -3250,8 +3273,8 @@ f32 BgCheck_RaycastFloorDyna(DynaRaycast* dynaRaycast) { continue; } - if (dynaRaycast->actor == dynaRaycast->colCtx->dyna.bgActors[i].actor || - dynaRaycast->pos->y < dynaRaycast->colCtx->dyna.bgActors[i].minY || + if ((dynaRaycast->actor == dynaRaycast->colCtx->dyna.bgActors[i].actor) || + (dynaRaycast->pos->y < dynaRaycast->colCtx->dyna.bgActors[i].minY) || !Math3D_XZInSphere(&dynaRaycast->colCtx->dyna.bgActors[i].boundingSphere, dynaRaycast->pos->x, dynaRaycast->pos->z)) { continue; @@ -3270,7 +3293,7 @@ f32 BgCheck_RaycastFloorDyna(DynaRaycast* dynaRaycast) { } } if ((dynaRaycast->unk_24 & BGCHECK_IGNORE_WALL) || - (*dynaRaycast->resultPoly == NULL && (dynaRaycast->unk_24 & 8))) { + ((*dynaRaycast->resultPoly == NULL) && (dynaRaycast->unk_24 & 8))) { dynaRaycast->ssList = &dynaRaycast->colCtx->dyna.bgActors[i].dynaLookup.wall; intersect2 = BgCheck_RaycastFloorDynaList(dynaRaycast, DYNA_RAYCAST_WALLS); if (dynaRaycast->yIntersect < intersect2) { @@ -3295,7 +3318,7 @@ f32 BgCheck_RaycastFloorDyna(DynaRaycast* dynaRaycast) { dynaActor = DynaPoly_GetActor(dynaRaycast->colCtx, *dynaRaycast->bgId); if ((result != BGCHECK_Y_MIN) && (dynaActor != NULL) && (dynaRaycast->play != NULL)) { - pauseState = dynaRaycast->play->pauseCtx.state != 0; + pauseState = (dynaRaycast->play->pauseCtx.state != PAUSE_STATE_OFF); if (!pauseState) { pauseState = dynaRaycast->play->pauseCtx.debugEditor != DEBUG_EDITOR_NONE; } @@ -3388,8 +3411,8 @@ s32 BgCheck_SphVsDynaWallInBgActor(CollisionContext* colCtx, u16 xpFlags, DynaCo planeDist = Math3D_DistPlaneToPos(nx, ny, nz, poly->dist, &resultPos); if (radius < fabsf(planeDist) || COLPOLY_VIA_FLAG_TEST(poly->flags_vIA, xpFlags) || - ((COLPOLY_VIA_FLAG_TEST(poly->flags_vIB, 4)) && ((actor != NULL && actor->category != ACTORCAT_PLAYER) || - (actor == NULL && xpFlags != COLPOLY_IGNORE_CAMERA)))) { + (COLPOLY_VIA_FLAG_TEST(poly->flags_vIB, 4) && (((actor != NULL) && (actor->category != ACTORCAT_PLAYER)) || + ((actor == NULL) && (xpFlags != COLPOLY_IGNORE_CAMERA))))) { if (curNode->next == SS_NULL) { break; } else { @@ -3428,7 +3451,7 @@ s32 BgCheck_SphVsDynaWallInBgActor(CollisionContext* colCtx, u16 xpFlags, DynaCo zMin -= radius; zMax += radius; - if (resultPos.z < zMin || zMax < resultPos.z) { + if ((resultPos.z < zMin) || (zMax < resultPos.z)) { if (curNode->next == SS_NULL) { break; } else { @@ -3464,8 +3487,8 @@ s32 BgCheck_SphVsDynaWallInBgActor(CollisionContext* colCtx, u16 xpFlags, DynaCo planeDist = Math3D_DistPlaneToPos(nx, ny, nz, poly->dist, &resultPos); if (radius < fabsf(planeDist) || COLPOLY_VIA_FLAG_TEST(poly->flags_vIA, xpFlags) || - (COLPOLY_VIA_FLAG_TEST(poly->flags_vIB, 4) && ((actor != NULL && actor->category != ACTORCAT_PLAYER) || - (actor == NULL && xpFlags != COLPOLY_IGNORE_CAMERA)))) { + (COLPOLY_VIA_FLAG_TEST(poly->flags_vIB, 4) && (((actor != NULL) && (actor->category != ACTORCAT_PLAYER)) || + ((actor == NULL) && (xpFlags != COLPOLY_IGNORE_CAMERA))))) { if (curNode->next == SS_NULL) { break; } else { @@ -3504,7 +3527,7 @@ s32 BgCheck_SphVsDynaWallInBgActor(CollisionContext* colCtx, u16 xpFlags, DynaCo xMin -= radius; xMax += radius; - if (resultPos.x < xMin || xMax < resultPos.x) { + if ((resultPos.x < xMin) || (xMax < resultPos.x)) { if (curNode->next == SS_NULL) { break; } else { @@ -3566,7 +3589,7 @@ s32 BgCheck_SphVsDynaWall(CollisionContext* colCtx, u16 xpFlags, f32* outX, f32* } bgActor = &colCtx->dyna.bgActors[i]; - if (bgActor->minY > resultPos.y || bgActor->maxY < resultPos.y) { + if ((bgActor->minY > resultPos.y) || (bgActor->maxY < resultPos.y)) { continue; } @@ -3575,7 +3598,7 @@ s32 BgCheck_SphVsDynaWall(CollisionContext* colCtx, u16 xpFlags, f32* outX, f32* r = bgActor->boundingSphere.radius; dx = bgActor->boundingSphere.center.x - resultPos.x; dz = bgActor->boundingSphere.center.z - resultPos.z; - if (SQ(r) < (SQ(dx) + SQ(dz)) || (!Math3D_XYInSphere(&bgActor->boundingSphere, resultPos.x, resultPos.y) && + if ((SQ(r) < SQ(dx) + SQ(dz)) || (!Math3D_XYInSphere(&bgActor->boundingSphere, resultPos.x, resultPos.y) && !Math3D_YZInSphere(&bgActor->boundingSphere, resultPos.y, resultPos.z))) { bgActor->boundingSphere.radius -= (s16)radius; continue; @@ -3624,8 +3647,8 @@ s32 BgCheck_CheckDynaCeilingList(CollisionContext* colCtx, u16 xpFlags, DynaColl polyId = curNode->polyId; poly = &dyna->polyList[polyId]; if (COLPOLY_VIA_FLAG_TEST(poly->flags_vIA, xpFlags) || - (COLPOLY_VIA_FLAG_TEST(poly->flags_vIB, 4) && ((actor != NULL && actor->category != ACTORCAT_PLAYER) || - (actor == NULL && xpFlags != COLPOLY_IGNORE_CAMERA)))) { + (COLPOLY_VIA_FLAG_TEST(poly->flags_vIB, 4) && (((actor != NULL) && (actor->category != ACTORCAT_PLAYER)) || + ((actor == NULL) && (xpFlags != COLPOLY_IGNORE_CAMERA))))) { if (curNode->next == SS_NULL) { break; } else { @@ -3644,7 +3667,7 @@ s32 BgCheck_CheckDynaCeilingList(CollisionContext* colCtx, u16 xpFlags, DynaColl } if (CollisionPoly_CheckYIntersectApprox2(poly, dyna->vtxList, testPos.x, testPos.z, &ceilingY)) { intersectDist = ceilingY - testPos.y; - if (testPos.y < ceilingY && intersectDist < checkHeight && intersectDist * ny <= 0.0f) { + if ((testPos.y < ceilingY) && (intersectDist < checkHeight) && (intersectDist * ny <= 0.0f)) { sign = (0.0f <= ny) ? 1.0f : -1.0f; testPos.y = (sign * checkHeight) + ceilingY; result = true; @@ -3733,8 +3756,8 @@ s32 BgCheck_CheckLineAgainstBgActorSSList(DynaLineTest* dynaLineTest) { test.poly = &dynaLineTest->dyna->polyList[polyId]; if (COLPOLY_VIA_FLAG_TEST(test.poly->flags_vIA, dynaLineTest->xpFlags) || (COLPOLY_VIA_FLAG_TEST(test.poly->flags_vIB, 4) && - ((dynaLineTest->actor != NULL && dynaLineTest->actor->category != ACTORCAT_PLAYER) || - (dynaLineTest->actor == NULL && dynaLineTest->xpFlags != COLPOLY_IGNORE_CAMERA)))) { + (((dynaLineTest->actor != NULL) && (dynaLineTest->actor->category != ACTORCAT_PLAYER)) || + ((dynaLineTest->actor == NULL) && (dynaLineTest->xpFlags != COLPOLY_IGNORE_CAMERA))))) { if (curNode->next == SS_NULL) { break; } else { @@ -3830,17 +3853,19 @@ s32 BgCheck_CheckLineAgainstDyna(CollisionContext* colCtx, u16 xpFlags, Vec3f* p if (actor != colCtx->dyna.bgActors[i].actor) { ay = posA->y; by = posB->y; - if (!(ay < colCtx->dyna.bgActors[i].minY) || !(by < colCtx->dyna.bgActors[i].minY)) { - if (!(colCtx->dyna.bgActors[i].maxY < ay) || !(colCtx->dyna.bgActors[i].maxY < by)) { - line.a = *posA; - line.b = *posB; - if (Math3D_LineVsSph(&colCtx->dyna.bgActors[i].boundingSphere, &line) != 0) { - if (BgCheck_CheckLineAgainstBgActor(colCtx, xpFlags, posA, posB, posResult, outPoly, distSq, - i, checkDist, bccFlags, actor)) { - *outBgId = i; - result = true; - } - } + if ((ay < colCtx->dyna.bgActors[i].minY) && (by < colCtx->dyna.bgActors[i].minY)) { + continue; + } + if ((ay > colCtx->dyna.bgActors[i].maxY) && (by > colCtx->dyna.bgActors[i].maxY)) { + continue; + } + line.a = *posA; + line.b = *posB; + if (Math3D_LineVsSph(&colCtx->dyna.bgActors[i].boundingSphere, &line) != 0) { + if (BgCheck_CheckLineAgainstBgActor(colCtx, xpFlags, posA, posB, posResult, outPoly, distSq, i, + checkDist, bccFlags, actor)) { + *outBgId = i; + result = true; } } } @@ -3870,10 +3895,9 @@ s32 BgCheck_SphVsFirstDynaPolyList(CollisionContext* colCtx, u16 xpFlags, Collis curPolyId = curNode->polyId; curPoly = &dyna->polyList[curPolyId]; if (COLPOLY_VIA_FLAG_TEST(curPoly->flags_vIA, xpFlags) || - (COLPOLY_VIA_FLAG_TEST(curPoly->flags_vIB, 4) && ((actor != NULL && actor->category != ACTORCAT_PLAYER) || - (actor == NULL && xpFlags != COLPOLY_IGNORE_CAMERA)))) - - { + (COLPOLY_VIA_FLAG_TEST(curPoly->flags_vIB, 4) && + (((actor != NULL) && (actor->category != ACTORCAT_PLAYER)) || + ((actor == NULL) && (xpFlags != COLPOLY_IGNORE_CAMERA))))) { if (curNode->next == SS_NULL) { break; } else { @@ -4016,7 +4040,7 @@ u32 SurfaceType_GetData(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId, SurfaceType* surfaceTypes; colHeader = BgCheck_GetCollisionHeader(colCtx, bgId); - if (colHeader == NULL || poly == NULL) { + if ((colHeader == NULL) || (poly == NULL)) { return 0; } surfaceTypes = colHeader->surfaceTypeList; @@ -4256,7 +4280,7 @@ u32 func_800C9BB8(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) { u16 SurfaceType_GetSfx(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) { s32 id = func_800C9BB8(colCtx, poly, bgId); - if (id < 0 || id > 14) { + if ((id < 0) || (id > 14)) { return NA_SE_PL_WALK_GROUND - SFX_FLAG; } return sSurfaceTypeSfx[id]; @@ -4268,7 +4292,7 @@ u16 SurfaceType_GetSfx(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) s32 func_800C9C24(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId, s32 arg3) { s32 id = func_800C9BB8(colCtx, poly, bgId); - if (id < 0 || id > 14) { + if ((id < 0) || (id > 14)) { return 0; } return D_801B46C0[id] & arg3; @@ -4398,23 +4422,24 @@ u32 SurfaceType_IsWallDamage(CollisionContext* colCtx, CollisionPoly* poly, s32 s32 WaterBox_GetSurfaceImpl(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, WaterBox** outWaterBox, s32* bgId) { CollisionHeader* colHeader; - u32 room; - WaterBox* curWaterBox; + s32 room; s32 i; + WaterBox* curWaterBox; + BgActor* bgActor; *bgId = BGCHECK_SCENE; colHeader = colCtx->colHeader; - if (colHeader->numWaterBoxes != 0 && colHeader->waterBoxes != NULL) { + if ((colHeader->numWaterBoxes != 0) && (colHeader->waterBoxes != NULL)) { for (curWaterBox = colHeader->waterBoxes; curWaterBox < colHeader->waterBoxes + colHeader->numWaterBoxes; curWaterBox++) { room = 0x3F & (curWaterBox->properties >> 13); - if (room == (u32)play->roomCtx.curRoom.num || room == 0x3F) { + if ((room == play->roomCtx.curRoom.num) || (room == 0x3F)) { if (curWaterBox->properties & 0x80000) { continue; } - if (curWaterBox->minPos.x < x && x < curWaterBox->minPos.x + curWaterBox->xLength) { - if (curWaterBox->minPos.z < z && z < curWaterBox->minPos.z + curWaterBox->zLength) { + if ((curWaterBox->minPos.x < x) && (x < curWaterBox->minPos.x + curWaterBox->xLength)) { + if ((curWaterBox->minPos.z < z) && (z < curWaterBox->minPos.z + curWaterBox->zLength)) { *outWaterBox = curWaterBox; *ySurface = curWaterBox->minPos.y; return true; @@ -4425,27 +4450,24 @@ s32 WaterBox_GetSurfaceImpl(PlayState* play, CollisionContext* colCtx, f32 x, f3 } for (i = 0; i < BG_ACTOR_MAX; i++) { - if (colCtx->dyna.bgActorFlags[i] & 1) { - BgActor* bgActor; - if (colCtx->dyna.bgActorFlags[i] & 4) { - continue; - } - bgActor = &colCtx->dyna.bgActors[i]; - if (bgActor->colHeader->numWaterBoxes != 0 && bgActor->colHeader->waterBoxes != NULL) { - for (curWaterBox = colCtx->dyna.waterBoxList.boxes + bgActor->waterboxesStartIndex; - curWaterBox < colCtx->dyna.waterBoxList.boxes + bgActor->waterboxesStartIndex + - bgActor->colHeader->numWaterBoxes; - curWaterBox++) { - if (curWaterBox->properties & 0x80000) { - continue; - } - if (curWaterBox->minPos.x < x && x < curWaterBox->minPos.x + curWaterBox->xLength) { - if (curWaterBox->minPos.z < z && z < curWaterBox->minPos.z + curWaterBox->zLength) { - *outWaterBox = curWaterBox; - *ySurface = curWaterBox->minPos.y; - *bgId = i; - return true; - } + if (!(colCtx->dyna.bgActorFlags[i] & 1) || (colCtx->dyna.bgActorFlags[i] & 4)) { + continue; + } + bgActor = &colCtx->dyna.bgActors[i]; + if ((bgActor->colHeader->numWaterBoxes != 0) && (bgActor->colHeader->waterBoxes != NULL)) { + for (curWaterBox = colCtx->dyna.waterBoxList.boxes + bgActor->waterboxesStartIndex; + curWaterBox < + colCtx->dyna.waterBoxList.boxes + bgActor->waterboxesStartIndex + bgActor->colHeader->numWaterBoxes; + curWaterBox++) { + if (curWaterBox->properties & 0x80000) { + continue; + } + if ((curWaterBox->minPos.x < x) && (x < curWaterBox->minPos.x + curWaterBox->xLength)) { + if ((curWaterBox->minPos.z < z) && (z < curWaterBox->minPos.z + curWaterBox->zLength)) { + *outWaterBox = curWaterBox; + *ySurface = curWaterBox->minPos.y; + *bgId = i; + return true; } } } @@ -4467,7 +4489,6 @@ s32 WaterBox_GetSurface1_2(PlayState* play, CollisionContext* colCtx, f32 x, f32 return WaterBox_GetSurfaceImpl(play, colCtx, x, z, ySurface, outWaterBox, &bgId); } -#ifdef NON_MATCHING /** * Gets the first active WaterBox at `pos` where WaterBox.properties & 0x80000 == 0 * `surfaceCheckDist` is the absolute y distance from the water surface to check @@ -4480,12 +4501,13 @@ s32 WaterBox_GetSurface2(PlayState* play, CollisionContext* colCtx, Vec3f* pos, s32 room; s32 i; WaterBox* waterBox; + BgActor* bgActor; *bgId = BGCHECK_SCENE; colHeader = colCtx->colHeader; //! @bug: check skips testing BgActor waterboxes - if (colHeader->numWaterBoxes == 0 || colHeader->waterBoxes == NULL) { + if ((colHeader->numWaterBoxes == 0) || (colHeader->waterBoxes == NULL)) { *outWaterBox = NULL; return -1; } @@ -4494,15 +4516,16 @@ s32 WaterBox_GetSurface2(PlayState* play, CollisionContext* colCtx, Vec3f* pos, waterBox = &colHeader->waterBoxes[i]; room = WATERBOX_ROOM(waterBox->properties); - if (!(room == play->roomCtx.curRoom.num || room == 0x3F)) { + if ((room != play->roomCtx.curRoom.num) && (room != 0x3F)) { continue; } if ((waterBox->properties & 0x80000)) { continue; } - if ((waterBox->minPos.x < pos->x && pos->x < waterBox->minPos.x + waterBox->xLength)) { - if ((waterBox->minPos.z < pos->z && pos->z < waterBox->minPos.z + waterBox->zLength)) { - if (pos->y - surfaceCheckDist < waterBox->minPos.y && waterBox->minPos.y < pos->y + surfaceCheckDist) { + if (((waterBox->minPos.x < pos->x) && (pos->x < waterBox->minPos.x + waterBox->xLength))) { + if ((waterBox->minPos.z < pos->z) && (pos->z < waterBox->minPos.z + waterBox->zLength)) { + if ((pos->y - surfaceCheckDist < waterBox->minPos.y) && + (waterBox->minPos.y < pos->y + surfaceCheckDist)) { *outWaterBox = waterBox; return i; } @@ -4511,27 +4534,25 @@ s32 WaterBox_GetSurface2(PlayState* play, CollisionContext* colCtx, Vec3f* pos, } for (i = 0; i < BG_ACTOR_MAX; i++) { - WaterBox* iterator; - WaterBox* start; - BgActor* bgActor; + if (!(colCtx->dyna.bgActorFlags[i] & 1) || (colCtx->dyna.bgActorFlags[i] & 4) || (colCtx->dyna.bgActorFlags[i] & 2)) { continue; } bgActor = &colCtx->dyna.bgActors[i]; - for (iterator = colCtx->dyna.waterBoxList.boxes + bgActor->waterboxesStartIndex; - iterator < + for (waterBox = colCtx->dyna.waterBoxList.boxes + bgActor->waterboxesStartIndex; + waterBox < colCtx->dyna.waterBoxList.boxes + bgActor->waterboxesStartIndex + bgActor->colHeader->numWaterBoxes; - iterator++) { - if (iterator->properties & 0x80000) { + waterBox++) { + if (waterBox->properties & 0x80000) { continue; } - if ((iterator->minPos.x < pos->x) && pos->x < iterator->minPos.x + iterator->xLength) { - if ((iterator->minPos.z < pos->z) && pos->z < iterator->minPos.z + iterator->zLength) { - if (pos->y - surfaceCheckDist < iterator->minPos.y && - iterator->minPos.y < pos->y + surfaceCheckDist) { + if ((waterBox->minPos.x < pos->x) && (pos->x < waterBox->minPos.x + waterBox->xLength)) { + if ((waterBox->minPos.z < pos->z) && (pos->z < waterBox->minPos.z + waterBox->zLength)) { + if ((pos->y - surfaceCheckDist < waterBox->minPos.y) && + (waterBox->minPos.y < pos->y + surfaceCheckDist)) { *bgId = i; - *outWaterBox = iterator; + *outWaterBox = waterBox; return i; } } @@ -4542,9 +4563,6 @@ s32 WaterBox_GetSurface2(PlayState* play, CollisionContext* colCtx, Vec3f* pos, *outWaterBox = NULL; return -1; } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/WaterBox_GetSurface2.s") -#endif f32 func_800CA568(CollisionContext* colCtx, s32 waterBoxId, s32 bgId) { CollisionHeader* colHeader; @@ -4611,7 +4629,6 @@ u32 WaterBox_GetLightSettingIndex(CollisionContext* colCtx, WaterBox* waterBox) return prop & 0x1F; } -#ifdef NON_MATCHING /** * Get the water surface at point (`x`, `ySurface`, `z`). `ySurface` doubles as position y input * same as WaterBox_GetSurfaceImpl, but tests if WaterBox properties & 0x80000 != 0 @@ -4621,62 +4638,61 @@ u32 WaterBox_GetLightSettingIndex(CollisionContext* colCtx, WaterBox* waterBox) s32 func_800CA6F0(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, WaterBox** outWaterBox, s32* bgId) { CollisionHeader* colHeader; - u32 room; - WaterBox* curWaterBox; s32 i; + WaterBox* curWaterBox; BgActor* bgActor; + s32 room; - colHeader = colCtx->colHeader; *outWaterBox = NULL; *bgId = BGCHECK_SCENE; + colHeader = colCtx->colHeader; - if (colHeader->numWaterBoxes == 0 || colHeader->waterBoxes == NULL) { + if ((colHeader->numWaterBoxes == 0) || (colHeader->waterBoxes == NULL)) { return false; } for (curWaterBox = colHeader->waterBoxes; curWaterBox < colHeader->waterBoxes + colHeader->numWaterBoxes; curWaterBox++) { room = WATERBOX_ROOM(curWaterBox->properties); - if (room == (u32)play->roomCtx.curRoom.num || room == 0x3F) { - if ((curWaterBox->properties & 0x80000) != 0) { - if (curWaterBox->minPos.x < x && x < curWaterBox->minPos.x + curWaterBox->xLength) { - if (curWaterBox->minPos.z < z && z < curWaterBox->minPos.z + curWaterBox->zLength) { - *outWaterBox = curWaterBox; - *ySurface = curWaterBox->minPos.y; - return true; - } - } + + if ((room != play->roomCtx.curRoom.num) && (room != 0x3F)) { + continue; + } + if (!(curWaterBox->properties & 0x80000)) { + continue; + } + if ((curWaterBox->minPos.x < x) && (x < curWaterBox->minPos.x + curWaterBox->xLength)) { + if ((curWaterBox->minPos.z < z) && (z < curWaterBox->minPos.z + curWaterBox->zLength)) { + *outWaterBox = curWaterBox; + *ySurface = curWaterBox->minPos.y; + return true; } } } - for (i = 0; i < BG_ACTOR_MAX; i++) { - if ((colCtx->dyna.bgActorFlags[i] & 1) && !(colCtx->dyna.bgActorFlags[i] & 2)) { - WaterBox* boxes; - boxes = colCtx->dyna.waterBoxList.boxes; - bgActor = &colCtx->dyna.bgActors[i]; - if (bgActor->colHeader->numWaterBoxes != 0 && bgActor->colHeader->waterBoxes != NULL) { - for (curWaterBox = boxes + bgActor->waterboxesStartIndex; - curWaterBox < boxes + bgActor->waterboxesStartIndex + bgActor->colHeader->numWaterBoxes; - curWaterBox++) { - if ((curWaterBox->properties & 0x80000) != 0) { - if (curWaterBox->minPos.x < x && x < curWaterBox->minPos.x + curWaterBox->xLength) { - if (curWaterBox->minPos.z < z && z < curWaterBox->minPos.z + curWaterBox->zLength) { - *outWaterBox = curWaterBox; - *ySurface = curWaterBox->minPos.y; - *bgId = i; - return true; - } - } - } + if (!(colCtx->dyna.bgActorFlags[i] & 1) || (colCtx->dyna.bgActorFlags[i] & 2)) { + continue; + } + bgActor = &colCtx->dyna.bgActors[i]; + + for (curWaterBox = colCtx->dyna.waterBoxList.boxes + bgActor->waterboxesStartIndex; + curWaterBox < + colCtx->dyna.waterBoxList.boxes + bgActor->waterboxesStartIndex + bgActor->colHeader->numWaterBoxes; + curWaterBox++) { + if (!(curWaterBox->properties & 0x80000)) { + continue; + } + if ((curWaterBox->minPos.x < x) && (x < curWaterBox->minPos.x + curWaterBox->xLength)) { + if ((curWaterBox->minPos.z < z) && (z < curWaterBox->minPos.z + curWaterBox->zLength)) { + *outWaterBox = curWaterBox; + *ySurface = curWaterBox->minPos.y; + *bgId = i; + return true; } } } } return false; } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800CA6F0.s") -#endif s32 func_800CA9D0(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, WaterBox** outWaterBox) { s32 bgId; diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index edaa159c6..0e36f1c54 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" Vec3f D_801EDE00; diff --git a/src/code/z_debug_display.c b/src/code/z_debug_display.c index a8b851ed7..e7c9dd0be 100644 --- a/src/code/z_debug_display.c +++ b/src/code/z_debug_display.c @@ -11,6 +11,7 @@ typedef void (*DebugDispObject_DrawFunc)(DebugDispObject*, void*, PlayState*); void DebugDisplay_DrawSpriteI8(DebugDispObject*, void*, PlayState*); void DebugDisplay_DrawPolygon(DebugDispObject*, void*, PlayState*); +Gfx* DebugDisplay_PathDisplayList(GraphicsContext* gfxCtx, Path* path); DebugDispObject* DebugDisplay_Init(void) { sDebugObjectListHead = NULL; @@ -102,24 +103,107 @@ void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* arg1, PlayState* p CLOSE_DISPS(play->state.gfxCtx); } -s32 D_801BB068[] = { - 0x00140000, 0x0000FFEC, 0x00000000, 0x00000014, 0x00000000, 0xFFEC0000, 0x00000000, 0x00140000, 0x0000FFEC, -}; +/** + * Visualise a path, see DebugDisplay_PathDisplayList for details. + */ -s32 D_801BB08C = 0; - -Gfx* func_800E99B0(GraphicsContext* gfxCtx, s32 arg1); - -void func_800E992C(PlayState* play, s32 arg1) { +void DebugDisplay_DrawPath(PlayState* play, Path* path) { s32 pad; OPEN_DISPS(play->state.gfxCtx); func_8012C560(play->state.gfxCtx); gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, func_800E99B0(play->state.gfxCtx, arg1)); + gSPDisplayList(POLY_XLU_DISP++, DebugDisplay_PathDisplayList(play->state.gfxCtx, path)); CLOSE_DISPS(play->state.gfxCtx); } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug_display/func_800E99B0.s") +#define R_DRAW_PATH_SEGMENT 0 // bREG(82) +#define R_DRAW_PATH_SCALE 1.0f // (1.0f + 0.1f * bREG(83)) +#define R_DRAW_PATH_RED 0 // bREG(84) +#define R_DRAW_PATH_GREEN 0 // bREG(85) +#define R_DRAW_PATH_BLUE 0 // bREG(86) +#define R_DRAW_PATH_ALPHA 0 // bREG(87) + +/** + * Offsets of the points of the triaxial shape used for visualising paths + */ +Vec3s sDebugPathVtxOffsets[][2] = { + { { 20, 0, 0 }, { -20, 0, 0 } }, + { { 0, 20, 0 }, { 0, -20, 0 } }, + { { 0, 0, 20 }, { 0, 0, -20 } }, +}; + +/** + * Constructs a displaylist to show a Path, by extruding the three-axis shape defined by `sPathDebugVtx` along it. + */ +Gfx* DebugDisplay_PathDisplayList(GraphicsContext* gfxCtx, Path* path) { + Gfx* gfxHead; + Gfx* gfx; + Vtx* curVtx; + Vtx* curBaseVtx; // First Vtx for the current point + Vtx* prevBaseVtx; // First Vtx for the previous point + Vec3s* curPoint; + s32 segment; // of path ending at the current point, 1-indexed + + if (path != NULL) { + // count - 1 segments, 1 gSPVertex and 3 gSP2Triangles for each, plus a gSPEndDisplayList + gfx = GRAPH_ALLOC(gfxCtx, ALIGN16(((path->count - 1) * 4 + 1) * sizeof(Gfx))); + curVtx = GRAPH_ALLOC(gfxCtx, ALIGN16(path->count * 6 * sizeof(Vtx))); + + gfxHead = gfx; + curBaseVtx = curVtx; + curPoint = Lib_SegmentedToVirtual(path->points); + + for (segment = 0; segment < path->count; segment++, curPoint++) { + s32 i; + s32 j; + + prevBaseVtx = curBaseVtx; + curBaseVtx = curVtx; + + // Add a vertex for each point in the triaxial shape + for (i = 0; i < ARRAY_COUNT(sDebugPathVtxOffsets); i++) { + for (j = 0; j < ARRAY_COUNT(sDebugPathVtxOffsets[0]); j++) { + curVtx->v.ob[0] = curPoint->x + (s32)(sDebugPathVtxOffsets[i][j].x * R_DRAW_PATH_SCALE); + curVtx->v.ob[1] = curPoint->y + (s32)(sDebugPathVtxOffsets[i][j].y * R_DRAW_PATH_SCALE); + curVtx->v.ob[2] = curPoint->z + (s32)(sDebugPathVtxOffsets[i][j].z * R_DRAW_PATH_SCALE); + curVtx->v.flag = 0; + curVtx->v.tc[0] = 0; + curVtx->v.tc[1] = 0; + curVtx->v.cn[0] = 128 + R_DRAW_PATH_RED; + curVtx->v.cn[1] = 128 + R_DRAW_PATH_GREEN; + curVtx->v.cn[2] = 128 + R_DRAW_PATH_BLUE; + curVtx->v.cn[3] = 128 + R_DRAW_PATH_ALPHA; + curVtx++; + } + } + + // Draw the path segment ending at point `R_DRAW_PATH_SEGMENT`, or the whole path if `R_DRAW_PATH_SEGMENT` + // is 0 + if (R_DRAW_PATH_SEGMENT == 0) { + if (segment > 0) { + gSPVertex(gfx++, prevBaseVtx, 12, 0); + gSP2Triangles(gfx++, 0, 7, 1, 0, 0, 6, 7, 0); + gSP2Triangles(gfx++, 2, 3, 8, 0, 3, 9, 8, 0); + gSP2Triangles(gfx++, 4, 11, 10, 0, 4, 5, 11, 0); + } + } else { + if ((segment > 0) && (segment == R_DRAW_PATH_SEGMENT)) { + gSPVertex(gfx++, prevBaseVtx, 12, 0); + gSP2Triangles(gfx++, 0, 7, 1, 0, 0, 6, 7, 0); + gSP2Triangles(gfx++, 2, 3, 8, 0, 3, 9, 8, 0); + gSP2Triangles(gfx++, 4, 11, 10, 0, 4, 5, 11, 0); + } + } + } + + gSPEndDisplayList(gfx++); + } else { + // No path, trivial displaylist + gfxHead = gfx = GRAPH_ALLOC(gfxCtx, ALIGN16(sizeof(Gfx))); + gSPEndDisplayList(gfx++); + } + return gfxHead; +} diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 25b2b471a..646b91522 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" #include "z64quake.h" #include "z64rumble.h" @@ -270,10 +271,10 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c gSaveContext.save.playerForm = PLAYER_FORM_DEKU; break; case 0x17: - player->stateFlags2 |= 0x4000000; + player->stateFlags2 |= PLAYER_STATE2_4000000; break; case 0x18: - player->stateFlags2 &= ~0x4000000; + player->stateFlags2 &= ~PLAYER_STATE2_4000000; break; case 0x19: sCutsceneStoredPlayerForm = gSaveContext.save.playerForm; diff --git a/src/code/z_elf_message.c b/src/code/z_elf_message.c index 11e4a2743..a5a4890a7 100644 --- a/src/code/z_elf_message.c +++ b/src/code/z_elf_message.c @@ -1,62 +1,93 @@ +/** + * @file z_elf_message.c + * + * This file provides quest hints through Tatl. + * + * In Ocarina of Time, this was a more elaborate system that determined + * which hint to give based on a script. + * That system has been replaced with a single function that hardcodes the checks. + */ #include "global.h" -u16 ElfMessage_GetFirstCycleHint(PlayState* play) { +/** + * Gets the relevant text ID for Tatl hints in first cycle. + */ +u16 QuestHint_GetTatlTextId(PlayState* play) { if (INV_CONTENT(ITEM_OCARINA) == ITEM_OCARINA) { return 0; } + if (CURRENT_DAY <= 0) { return 0; } + if (gSaveContext.save.weekEventReg[88] & 0x20) { return 0; } + if (gSaveContext.save.weekEventReg[79] & 0x10) { if (gSaveContext.save.weekEventReg[8] & 0x40) { return 0; } + return 0x224; } + if (!(gSaveContext.save.weekEventReg[8] & 0x80)) { if (gSaveContext.save.weekEventReg[9] & 1) { return 0x21E; } + if (play->sceneId == SCENE_YOUSEI_IZUMI) { return 0; } + return 0x21D; } + if (gSaveContext.save.playerData.isMagicAcquired != true) { return 0x21F; } + if (INV_CONTENT(ITEM_DEED_LAND) == ITEM_DEED_LAND) { if (play->sceneId != SCENE_OKUJOU) { return 0x244; } + return 0; } + if (INV_CONTENT(ITEM_MOON_TEAR) == ITEM_MOON_TEAR) { if (gSaveContext.save.weekEventReg[86] & 4) { return 0x242; } + return 0x243; } + if (gSaveContext.save.weekEventReg[74] & 0x20) { return 0x223; } + if (gSaveContext.save.weekEventReg[73] & 0x80) { return 0x222; } + if (gSaveContext.save.weekEventReg[73] & 0x20) { return 0x221; } + if (gSaveContext.save.weekEventReg[77] & 2) { if (gSaveContext.save.weekEventReg[73] & 0x10) { return 0x240; } + return 0x241; } + if ((gSaveContext.save.weekEventReg[86] & 2) || (gSaveContext.save.weekEventReg[73] & 0x40)) { return 0x23F; } + return 0x220; } diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index d6ab737c7..944e650a0 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -23,7 +23,7 @@ void EnItem00_DrawSprite(EnItem00* this, PlayState* play); void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play); void EnItem00_DrawHeartPiece(EnItem00* this, PlayState* play); -const ActorInit En_Item00_InitVars = { +ActorInit En_Item00_InitVars = { ACTOR_EN_ITEM00, ACTORCAT_MISC, FLAGS, @@ -86,7 +86,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) { this->collectibleFlag = 0; this->actor.params = ITEM00_RECOVERY_HEART; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -358,7 +358,7 @@ void func_800A640C(EnItem00* this, PlayState* play) { if (this->unk152 == 0) { if ((this->actor.params != ITEM00_SMALL_KEY) && (this->actor.params != ITEM00_HEART_PIECE) && (this->actor.params != ITEM00_HEART_CONTAINER)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -464,7 +464,7 @@ void func_800A6A40(EnItem00* this, PlayState* play) { } if (this->unk152 == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -487,7 +487,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { EnItem00* this = THIS; s32 pad; Player* player = GET_PLAYER(play); - s32 sp38 = player->stateFlags3 & 0x1000; + s32 sp38 = player->stateFlags3 & PLAYER_STATE3_1000; s32 getItemId = GI_NONE; s32 params; @@ -510,7 +510,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 15.0f, 15.0f, 0x1D); if (this->actor.floorHeight <= BGCHECK_Y_MIN) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -659,7 +659,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { case ITEM00_COMPASS: if (Actor_HasParent(&this->actor, play)) { Flags_SetCollectible(play, this->collectibleFlag); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } return; @@ -672,7 +672,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { } else if (getItemId != GI_NONE) { if (Actor_HasParent(&this->actor, play)) { Flags_SetCollectible(play, this->collectibleFlag); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } return; } else { diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c index 7b9254ccd..ad592a40e 100644 --- a/src/code/z_jpeg.c +++ b/src/code/z_jpeg.c @@ -24,22 +24,22 @@ extern u64 njpgdspMainDataStart[]; */ void Jpeg_ScheduleDecoderTask(JpegContext* jpegCtx) { static OSTask_t sJpegTask = { - M_NJPEGTASK, // type - 0, // flags - NULL, // ucode_boot - 0, // ucode_boot_size - njpgdspMainTextStart, // ucode - 0x1000, // ucode_size - njpgdspMainDataStart, // ucode_data - 0x800, // ucode_data_size - NULL, // dram_stack - 0, // dram_stack_size - NULL, // output_buff - NULL, // output_buff_size - NULL, // data_ptr - sizeof(JpegTaskData), // data_size - NULL, // yield_data_ptr - 0x200, // yield_data_size + M_NJPEGTASK, // type + 0, // flags + NULL, // ucode_boot + 0, // ucode_boot_size + njpgdspMainTextStart, // ucode + SP_UCODE_SIZE, // ucode_size + njpgdspMainDataStart, // ucode_data + SP_UCODE_DATA_SIZE, // ucode_data_size + NULL, // dram_stack + 0, // dram_stack_size + NULL, // output_buff + NULL, // output_buff_size + NULL, // data_ptr + sizeof(JpegTaskData), // data_size + NULL, // yield_data_ptr + sizeof(jpegCtx->workBuf->yieldData), // yield_data_size }; JpegWork* workBuf = jpegCtx->workBuf; diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c index 9cea42691..5ab466ddc 100644 --- a/src/code/z_kaleido_scope_call.c +++ b/src/code/z_kaleido_scope_call.c @@ -35,24 +35,25 @@ void KaleidoScopeCall_Update(PlayState* play) { PauseContext* pauseCtx = &play->pauseCtx; KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE]; - if ((play->pauseCtx.state != 0) || (play->pauseCtx.debugEditor != DEBUG_EDITOR_NONE)) { - if (pauseCtx->state == 1 || pauseCtx->state == 19) { + if ((play->pauseCtx.state != PAUSE_STATE_OFF) || (play->pauseCtx.debugEditor != DEBUG_EDITOR_NONE)) { + if ((pauseCtx->state == PAUSE_STATE_OPENING_0) || (pauseCtx->state == PAUSE_STATE_OWLWARP_0)) { if (ShrinkWindow_Letterbox_GetSize() == 0) { - R_PAUSE_MENU_MODE = 1; - pauseCtx->unk_200 = 0; - pauseCtx->unk_208 = 0; + R_PAUSE_BG_PRERENDER_STATE = PAUSE_BG_PRERENDER_SETUP; + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; + pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_0; pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1; } - } else if (pauseCtx->state == 8) { - R_PAUSE_MENU_MODE = 1; - pauseCtx->unk_200 = 0; - pauseCtx->unk_208 = 0; + } else if (pauseCtx->state == PAUSE_STATE_GAMEOVER_0) { + R_PAUSE_BG_PRERENDER_STATE = PAUSE_BG_PRERENDER_SETUP; + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; + pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_0; pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1; - } else if ((pauseCtx->state == 2) || (pauseCtx->state == 9) || (pauseCtx->state == 20)) { - if (R_PAUSE_MENU_MODE == 3) { + } else if ((pauseCtx->state == PAUSE_STATE_OPENING_1) || (pauseCtx->state == PAUSE_STATE_GAMEOVER_1) || + (pauseCtx->state == PAUSE_STATE_OWLWARP_1)) { + if (R_PAUSE_BG_PRERENDER_STATE == PAUSE_BG_PRERENDER_DONE) { pauseCtx->state++; } - } else if (pauseCtx->state != 0) { + } else if (pauseCtx->state != PAUSE_STATE_OFF) { if (gKaleidoMgrCurOvl != kaleidoScopeOvl) { if (gKaleidoMgrCurOvl != NULL) { KaleidoManager_ClearOvl(gKaleidoMgrCurOvl); @@ -64,7 +65,7 @@ void KaleidoScopeCall_Update(PlayState* play) { if (gKaleidoMgrCurOvl == kaleidoScopeOvl) { sKaleidoScopeUpdateFunc(play); - if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE)) { + if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE)) { KaleidoManager_ClearOvl(kaleidoScopeOvl); KaleidoScopeCall_LoadPlayer(); } @@ -76,9 +77,9 @@ void KaleidoScopeCall_Update(PlayState* play) { void KaleidoScopeCall_Draw(PlayState* play) { KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE]; - if (R_PAUSE_MENU_MODE == 3) { - if (((play->pauseCtx.state >= 4) && (play->pauseCtx.state <= 7)) || - ((play->pauseCtx.state >= 11) && (play->pauseCtx.state <= 26))) { + if (R_PAUSE_BG_PRERENDER_STATE == PAUSE_BG_PRERENDER_DONE) { + if (((play->pauseCtx.state >= PAUSE_STATE_OPENING_3) && (play->pauseCtx.state <= PAUSE_STATE_SAVEPROMPT)) || + ((play->pauseCtx.state >= PAUSE_STATE_GAMEOVER_3) && (play->pauseCtx.state <= PAUSE_STATE_UNPAUSE_SETUP))) { if (gKaleidoMgrCurOvl == kaleidoScopeOvl) { sKaleidoScopeDrawFunc(play); } diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c index a096aaabe..475de9819 100644 --- a/src/code/z_kaleido_setup.c +++ b/src/code/z_kaleido_setup.c @@ -4,9 +4,24 @@ #include "z64view.h" #include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" -s16 D_801BDB00[] = { PAUSE_MAP, PAUSE_QUEST, PAUSE_MASK, PAUSE_ITEM }; -f32 sKaleidoSetupEyeX[] = { -64.0f, 0.0f, 64.0f, 0.0f }; -f32 sKaleidoSetupEyeZ[] = { 0.0f, -64.0f, 0.0f, 64.0f }; +s16 sKaleidoSetupRightPageIndex[] = { + PAUSE_MAP, // PAUSE_ITEM + PAUSE_QUEST, // PAUSE_MAP + PAUSE_MASK, // PAUSE_QUEST + PAUSE_ITEM, // PAUSE_MASK +}; +f32 sKaleidoSetupRightPageEyeX[] = { + PAUSE_EYE_DIST * -PAUSE_MAP_X, // PAUSE_ITEM + PAUSE_EYE_DIST * -PAUSE_QUEST_X, // PAUSE_MAP + PAUSE_EYE_DIST * -PAUSE_MASK_X, // PAUSE_QUEST + PAUSE_EYE_DIST * -PAUSE_ITEM_X, // PAUSE_MASK +}; +f32 sKaleidoSetupRightPageEyeZ[] = { + PAUSE_EYE_DIST * -PAUSE_MAP_Z, // PAUSE_ITEM + PAUSE_EYE_DIST * -PAUSE_QUEST_Z, // PAUSE_MAP + PAUSE_EYE_DIST * -PAUSE_MASK_Z, // PAUSE_QUEST + PAUSE_EYE_DIST * -PAUSE_ITEM_Z, // PAUSE_MASK +}; void func_800F4A10(PlayState* play) { PauseContext* pauseCtx = &play->pauseCtx; @@ -14,18 +29,20 @@ void func_800F4A10(PlayState* play) { Rumble_StateReset(); - pauseCtx->unk_206 = 0; - pauseCtx->unk_200 = 1; - pauseCtx->eye.x = sKaleidoSetupEyeX[pauseCtx->pageIndex]; - pauseCtx->eye.z = sKaleidoSetupEyeZ[pauseCtx->pageIndex]; - pauseCtx->pageIndex = D_801BDB00[pauseCtx->pageIndex]; - pauseCtx->unk_27E = -40; + pauseCtx->switchPageTimer = 0; + pauseCtx->mainState = PAUSE_MAIN_STATE_SWITCHING_PAGE; + + // Set eye position and pageIndex such that scrolling left brings to the desired page + pauseCtx->eye.x = sKaleidoSetupRightPageEyeX[pauseCtx->pageIndex]; + pauseCtx->eye.z = sKaleidoSetupRightPageEyeZ[pauseCtx->pageIndex]; + pauseCtx->pageIndex = sKaleidoSetupRightPageIndex[pauseCtx->pageIndex]; + pauseCtx->infoPanelOffsetY = -40; for (i = 0; i < ARRAY_COUNT(pauseCtx->worldMapPoints); i++) { pauseCtx->worldMapPoints[i] = false; } - if (pauseCtx->state == 1) { + if (pauseCtx->state == PAUSE_STATE_OPENING_0) { for (i = 0; i < REGION_MAX; i++) { if ((gSaveContext.save.regionsVisited >> i) & 1) { pauseCtx->worldMapPoints[i] = true; @@ -72,26 +89,27 @@ void KaleidoSetup_Update(PlayState* play) { if (msgCtx && msgCtx) {} } - if ((pauseCtx->state == 0) && (pauseCtx->debugEditor == DEBUG_EDITOR_NONE) && + if ((pauseCtx->state == PAUSE_STATE_OFF) && (pauseCtx->debugEditor == DEBUG_EDITOR_NONE) && (play->gameOverCtx.state == GAMEOVER_INACTIVE)) { if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) { if ((gSaveContext.save.cutscene < 0xFFF0) && (gSaveContext.nextCutsceneIndex < 0xFFF0)) { if (!Play_InCsMode(play) || ((msgCtx->msgMode != 0) && (msgCtx->currentTextId == 0xFF))) { if ((play->unk_1887C < 2) && (gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY) && (gSaveContext.magicState != MAGIC_STATE_FILL)) { - if (!(gSaveContext.eventInf[1] & 0x80) && !(player->stateFlags1 & 0x20)) { + if (!(gSaveContext.eventInf[1] & 0x80) && !(player->stateFlags1 & PLAYER_STATE1_20)) { if (!(play->actorCtx.flags & ACTORCTX_FLAG_1) && !(play->actorCtx.flags & ACTORCTX_FLAG_2)) { if ((play->actorCtx.unk268 == 0) && CHECK_BTN_ALL(input->press.button, BTN_START)) { gSaveContext.prevHudVisibility = gSaveContext.hudVisibility; pauseCtx->itemDescriptionOn = false; - pauseCtx->state = 1; + pauseCtx->state = PAUSE_STATE_OPENING_0; func_800F4A10(play); - pauseCtx->mode = pauseCtx->pageIndex * 2 + 1; + // Set next page mode to scroll left + pauseCtx->nextPageMode = pauseCtx->pageIndex * 2 + 1; func_801A3A7C(1); } - if (pauseCtx->state == 1) { + if (pauseCtx->state == PAUSE_STATE_OPENING_0) { Game_SetFramerateDivisor(&play->state, 2); if (ShrinkWindow_Letterbox_GetSizeTarget() != 0) { ShrinkWindow_Letterbox_SetSizeTarget(0); @@ -115,14 +133,14 @@ void KaleidoSetup_Init(PlayState* play) { pauseCtx->pageIndex = PAUSE_ITEM; - pauseCtx->unk_21C = 160.0f; - pauseCtx->unk_218 = 160.0f; - pauseCtx->unk_214 = 160.0f; - pauseCtx->unk_210 = 160.0f; + pauseCtx->maskPageRoll = 160.0f; + pauseCtx->questPageRoll = 160.0f; + pauseCtx->mapPageRoll = 160.0f; + pauseCtx->itemPageRoll = 160.0f; pauseCtx->eye.x = -64.0f; pauseCtx->unk_20C = 936.0f; - pauseCtx->unk_220 = -314.0f; + pauseCtx->roll = -314.0f; pauseCtx->cursorPoint[PAUSE_MAP] = R_REVERSE_FLOOR_INDEX + (DUNGEON_FLOOR_INDEX_4 - 1); diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c index d2a3a254c..d4927ae97 100644 --- a/src/code/z_lifemeter.c +++ b/src/code/z_lifemeter.c @@ -399,7 +399,7 @@ void LifeMeter_UpdateSizeAndBeep(PlayState* play) { if (interfaceCtx->lifeSizeChange <= 0) { interfaceCtx->lifeSizeChange = 0; interfaceCtx->lifeSizeChangeDirection = 0; - if (!Player_InCsMode(play) && (play->pauseCtx.state == 0) && + if (!Player_InCsMode(play) && (play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) && LifeMeter_IsCritical() && !Play_InCsMode(play)) { play_sound(NA_SE_SY_HITPOINT_ALARM); } diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index 57f51a20a..ac78d1229 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -226,8 +226,8 @@ void Map_Update(PlayState* play) { s16 floor; s32 pad2; - if ((play->pauseCtx.state < 4) && (CHECK_BTN_ALL(controller->press.button, BTN_L)) && (!Play_InCsMode(play)) && - (!func_80106530(play))) { + if ((play->pauseCtx.state <= PAUSE_STATE_OPENING_2) && (CHECK_BTN_ALL(controller->press.button, BTN_L)) && + !Play_InCsMode(play) && !func_80106530(play)) { if (!R_MINIMAP_DISABLED) { play_sound(NA_SE_SY_CAMERA_ZOOM_UP); } else { @@ -239,7 +239,7 @@ void Map_Update(PlayState* play) { func_80105B34(play); - if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE)) { + if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE)) { if (Map_IsInDungeonArea(play)) { floor = func_80109124(player->actor.world.pos.y); if (floor != -1) { diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index d463edff3..a49844e5b 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -2309,7 +2309,7 @@ void Magic_Update(PlayState* play) { case MAGIC_STATE_CONSUME_LENS: // Slowly consume magic while Lens of Truth is active - if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) && + if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) && (msgCtx->msgMode == 0) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play)) { @@ -2352,9 +2352,9 @@ void Magic_Update(PlayState* play) { gSaveContext.magicState = MAGIC_STATE_CONSUME_GORON_ZORA; // fallthrough case MAGIC_STATE_CONSUME_GORON_ZORA: - if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugEditor == 0) && (msgCtx->msgMode == 0) && - (play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && - (play->transitionMode == TRANS_MODE_OFF)) { + if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == 0) && + (msgCtx->msgMode == 0) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) && + (play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) { if (!Play_InCsMode(play)) { interfaceCtx->magicConsumptionTimer--; if (interfaceCtx->magicConsumptionTimer == 0) { @@ -2374,7 +2374,7 @@ void Magic_Update(PlayState* play) { break; case MAGIC_STATE_CONSUME_GIANTS_MASK: - if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) && + if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) && (msgCtx->msgMode == 0) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) { if (!Play_InCsMode(play)) { @@ -2680,7 +2680,7 @@ void Interface_DrawTimers(PlayState* play) { OPEN_DISPS(play->state.gfxCtx); // Not satisfying any of these conditions will pause the timer - if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) && + if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) && ((msgCtx->msgMode == 0) || ((msgCtx->msgMode != 0) && (msgCtx->currentTextId >= 0x1BB2) && (msgCtx->currentTextId <= 0x1BB6))) && @@ -3125,7 +3125,7 @@ void Interface_UpdateBottleTimers(PlayState* play) { s32 pad[2]; // Not satisfying any of these conditions will pause the bottle timer - if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) && + if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) && ((msgCtx->msgMode == 0) || ((msgCtx->currentTextId >= 0x100) && (msgCtx->currentTextId <= 0x200)) || ((msgCtx->currentTextId >= 0x1BB2) && (msgCtx->currentTextId <= 0x1BB6))) && diff --git a/src/code/z_play.c b/src/code/z_play.c index 47bb97a60..71fbc897f 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -540,13 +540,13 @@ void Play_AssignPlayerActorCsIdsFromScene(GameState* thisx, s32 startActorCsId) } } -// These regs are used by Gameplay_Draw, and several actors, purpose as yet unclear. -void func_8016A268(GameState* thisx, s16 arg1, u8 arg2, u8 arg3, u8 arg4, u8 arg5) { - MREG(64) = arg1; - MREG(65) = arg2; - MREG(66) = arg3; - MREG(67) = arg4; - MREG(68) = arg5; +// Set values to fill screen +void Play_FillScreen(GameState* thisx, s16 fillScreenOn, u8 red, u8 green, u8 blue, u8 alpha) { + R_PLAY_FILL_SCREEN_ON = fillScreenOn; + R_PLAY_FILL_SCREEN_R = red; + R_PLAY_FILL_SCREEN_G = green; + R_PLAY_FILL_SCREEN_B = blue; + R_PLAY_FILL_SCREEN_ALPHA = alpha; } #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_Init.s") diff --git a/src/code/z_player_call.c b/src/code/z_player_call.c index 8cd8207b7..a4ceeba95 100644 --- a/src/code/z_player_call.c +++ b/src/code/z_player_call.c @@ -14,7 +14,7 @@ void PlayerCall_Destroy(Actor* thisx, PlayState* play); void PlayerCall_Update(Actor* thisx, PlayState* play); void PlayerCall_Draw(Actor* thisx, PlayState* play); -const ActorInit Player_InitVars = { +ActorInit Player_InitVars = { ACTOR_PLAYER, ACTORCAT_PLAYER, FLAGS, diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 6f4198fc7..21753040f 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -1,9 +1,38 @@ +#include "prevent_bss_reordering.h" #include "global.h" +#include "objects/gameplay_keep/gameplay_keep.h" + +#include "objects/object_link_boy/object_link_boy.h" #include "objects/object_link_goron/object_link_goron.h" #include "objects/object_link_zora/object_link_zora.h" +#include "objects/object_link_nuts/object_link_nuts.h" +#include "objects/object_link_child/object_link_child.h" +#include "objects/object_mask_truth/object_mask_truth.h" +#include "objects/object_mask_kerfay/object_mask_kerfay.h" +#include "objects/object_mask_yofukasi/object_mask_yofukasi.h" +#include "objects/object_mask_rabit/object_mask_rabit.h" +#include "objects/object_mask_ki_tan/object_mask_ki_tan.h" +#include "objects/object_mask_json/object_mask_json.h" +#include "objects/object_mask_romerny/object_mask_romerny.h" +#include "objects/object_mask_zacho/object_mask_zacho.h" +#include "objects/object_mask_posthat/object_mask_posthat.h" #include "objects/object_mask_meoto/object_mask_meoto.h" +#include "objects/object_mask_bigelf/object_mask_bigelf.h" +#include "objects/object_mask_gibudo/object_mask_gibudo.h" +#include "objects/object_mask_gero/object_mask_gero.h" +#include "objects/object_mask_dancer/object_mask_dancer.h" +#include "objects/object_mask_skj/object_mask_skj.h" +#include "objects/object_mask_stone/object_mask_stone.h" +#include "objects/object_mask_bree/object_mask_bree.h" +#include "objects/object_mask_bakuretu/object_mask_bakuretu.h" +#include "objects/object_mask_bu_san/object_mask_bu_san.h" +#include "objects/object_mask_kyojin/object_mask_kyojin.h" +#include "objects/object_mask_boy/object_mask_boy.h" +#include "objects/object_mask_goron/object_mask_goron.h" +#include "objects/object_mask_zora/object_mask_zora.h" +#include "objects/object_mask_nuts/object_mask_nuts.h" void PlayerCall_Init(Actor* thisx, PlayState* play); void PlayerCall_Destroy(Actor* thisx, PlayState* play); @@ -17,15 +46,34 @@ typedef struct { /* 0x1A */ s16 unk_1A; } struct_801F58B0; // size = 0x1C -extern struct_801F58B0 D_801F58B0[3][3]; +struct_801F58B0 D_801F58B0[3][3]; -extern s32 D_801F59C8[2]; +Vec3f D_801F59B0[2]; -extern s32 D_801F59E0; +s32 D_801F59C8[2]; -extern Vec3f D_801F59E8; +typedef struct { + /* 0x0 */ s16 unk_0; + /* 0x2 */ s16 unk_2; + /* 0x4 */ s16 unk_4; + /* 0x6 */ s16 unk_6; + /* 0x8 */ s16 unk_8; +} struct_801F59D0; // size = 0xA -void func_80127B64(struct_801F58B0 arg0[], UNK_TYPE arg1, Vec3f* arg2); +struct_801F59D0 D_801F59D0; + +Vec3f* D_801F59DC; + +s32 D_801F59E0; + +s32 D_801F59E4; + +Vec3f D_801F59E8; + +s32 D_801F59F4; +s32 D_801F59F8; + +void func_80127B64(struct_801F58B0 arg0[], s32 count, Vec3f* arg2); s32 func_801226E0(PlayState* play, s32 arg1) { if (arg1 == 0) { @@ -103,8 +151,6 @@ void func_801229A0(PlayState* play, Player* player) { void func_801229EC(UNK_TYPE arg0, UNK_TYPE arg1) { } -extern s16 sMaskObjectIds[PLAYER_MASK_MAX - 1]; -#if 0 s16 sMaskObjectIds[PLAYER_MASK_MAX - 1] = { OBJECT_MASK_TRUTH, OBJECT_MASK_KERFAY, OBJECT_MASK_YOFUKASI, OBJECT_MASK_RABIT, OBJECT_MASK_KI_TAN, OBJECT_MASK_JSON, OBJECT_MASK_ROMERNY, OBJECT_MASK_ZACHO, OBJECT_MASK_POSTHAT, OBJECT_MASK_MEOTO, @@ -112,7 +158,6 @@ s16 sMaskObjectIds[PLAYER_MASK_MAX - 1] = { OBJECT_MASK_STONE, OBJECT_MASK_BREE, OBJECT_MASK_BAKURETU, OBJECT_MASK_BU_SAN, OBJECT_MASK_KYOJIN, OBJECT_MASK_BOY, OBJECT_MASK_GORON, OBJECT_MASK_ZORA, OBJECT_MASK_NUTS, }; -#endif // Load mask object? /** @@ -197,14 +242,11 @@ typedef struct { /* 0x4 */ Gfx* dList; } struct_801BFDD0; // size = 0x08 -extern struct_801BFDD0 D_801BFDD0[]; -#if 0 struct_801BFDD0 D_801BFDD0[] = { { { 180, 200, 255 }, gLinkGoronCurledDL }, { { 155, 0, 0 }, gLinkGoronRollingSpikesAndEffectDL }, { { 255, 0, 0 }, gLinkGoronGoronPunchEffectDL }, }; -#endif void func_80122D44(PlayState* play, struct_80122D44_arg1* arg1) { struct_801BFDD0* temp_s3; @@ -240,8 +282,6 @@ void func_80122D44(PlayState* play, struct_80122D44_arg1* arg1) { CLOSE_DISPS(play->state.gfxCtx); } -extern u8 sMaskItemIds[PLAYER_MASK_MAX - 1]; -#if 0 u8 sMaskItemIds[PLAYER_MASK_MAX - 1] = { ITEM_MASK_TRUTH, // PLAYER_MASK_TRUTH ITEM_MASK_KAFEIS_MASK, // PLAYER_MASK_KAFEIS_MASK @@ -268,7 +308,6 @@ u8 sMaskItemIds[PLAYER_MASK_MAX - 1] = { ITEM_MASK_ZORA, // PLAYER_MASK_ZORA ITEM_MASK_DEKU, // PLAYER_MASK_DEKU }; -#endif u8 Player_MaskIdToItemId(s32 maskIdMinusOne) { return sMaskItemIds[maskIdMinusOne]; @@ -286,8 +325,8 @@ s32 Player_GetCurMaskItemId(PlayState* play) { void func_80122F28(Player* player) { if ((player->actor.category == ACTORCAT_PLAYER) && - (!(player->stateFlags1 & (PLAYER_STATE1_20000000 | PLAYER_STATE1_800000 | PLAYER_STATE1_200000 | - PLAYER_STATE1_800 | PLAYER_STATE1_400))) && + (!(player->stateFlags1 & (PLAYER_STATE1_400 | PLAYER_STATE1_800 | PLAYER_STATE1_200000 | PLAYER_STATE1_800000 | + PLAYER_STATE1_20000000))) && (!(player->stateFlags2 & PLAYER_STATE2_1))) { if (player->doorType < 0) { ActorCutscene_SetIntentToPlay(0x7C); @@ -341,7 +380,20 @@ void func_8012301C(Player* player, PlayState* play2) { } } -extern s16 D_801BFE14[][18]; +FlexSkeletonHeader* gPlayerSkeletons[PLAYER_FORM_MAX] = { + &gLinkFierceDeitySkel, &gLinkGoronSkel, &gLinkZoraSkel, &gLinkDekuSkel, &gLinkHumanSkel, +}; + +s16 D_801BFE14[][18] = { + { 200, 666, 200, 700, 366, 200, 600, 175, 60, 800, 1000, -100, 600, 590, 800, 125, 300, 65 }, + { 200, 1000, 300, 800, 500, 400, 800, 400, 120, 800, 550, -100, 600, 540, 750, 125, 400, 200 }, + { 100, 1000, 300, 800, 250, 200, 800, 200, 90, 800, 350, -80, 600, 540, 750, 60, 200, 200 }, + { 200, 1000, 300, 700, 550, 270, 600, 1000, 120, 800, 600, -100, 600, 590, 750, 125, 200, 130 }, + { 200, 1000, 300, 700, 550, 270, 700, 300, 120, 800, 600, -100, 600, 590, 750, 125, 200, 130 }, + { 200, 1000, 300, 700, 550, 270, 700, 300, 120, 800, 600, -100, 600, 590, 750, 125, 200, 130 }, + { 200, 1000, 300, 700, 550, 270, 700, 200, 120, 800, 600, -140, 600, 590, 750, 125, 200, 130 }, + { 80, 800, 150, 700, 480, 270, 600, 50, 120, 800, 300, -40, 400, 540, 270, 25, 0, 80 }, +}; // OoT's Player_SetBootData void func_80123140(PlayState* play, Player* player) { @@ -403,7 +455,7 @@ void func_80123140(PlayState* play, Player* player) { } s32 Player_InBlockingCsMode(PlayState* play, Player* player) { - return (player->stateFlags1 & (PLAYER_STATE1_20000000 | PLAYER_STATE1_200 | PLAYER_STATE1_80)) || + return (player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_20000000)) || (player->csMode != 0) || (play->transitionTrigger == TRANS_TRIGGER_START) || (play->transitionMode != TRANS_MODE_OFF) || (player->stateFlags1 & PLAYER_STATE1_1) || (player->stateFlags3 & PLAYER_STATE3_80) || (play->actorCtx.unk268 != 0); @@ -420,7 +472,7 @@ s32 func_80123420(Player* player) { } s32 func_80123434(Player* player) { - return player->stateFlags1 & (PLAYER_STATE1_40000000 | PLAYER_STATE1_20000 | PLAYER_STATE1_10000); + return player->stateFlags1 & (PLAYER_STATE1_10000 | PLAYER_STATE1_20000 | PLAYER_STATE1_40000000); } // Unused @@ -478,7 +530,7 @@ s32 func_801235DC(PlayState* play, f32 arg1, s16 arg2) { return false; } -s32 func_8012364C(PlayState* play, Player* player, s32 arg2) { +ItemId func_8012364C(PlayState* play, Player* player, s32 arg2) { if (arg2 >= 4) { return ITEM_NONE; } @@ -506,42 +558,161 @@ s32 func_8012364C(PlayState* play, Player* player, s32 arg2) { } if (arg2 == 1) { - return (gSaveContext.buttonStatus[1] != BTN_DISABLED) - ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_LEFT] - : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C) - ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_LEFT] - : ITEM_NONE; + return (gSaveContext.buttonStatus[EQUIP_SLOT_C_LEFT] != BTN_DISABLED) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_LEFT) + : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_LEFT) + : ITEM_NONE; } if (arg2 == 2) { - return (gSaveContext.buttonStatus[2] != BTN_DISABLED) - ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_DOWN] - : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C) - ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_DOWN] - : ITEM_NONE; + return (gSaveContext.buttonStatus[EQUIP_SLOT_C_DOWN] != BTN_DISABLED) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_DOWN) + : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_DOWN) + : ITEM_NONE; } - return (gSaveContext.buttonStatus[3] != BTN_DISABLED) ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_RIGHT] - : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C) - ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_RIGHT] - : ITEM_NONE; + return (gSaveContext.buttonStatus[EQUIP_SLOT_C_RIGHT] != BTN_DISABLED) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_RIGHT) + : (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C) ? BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_RIGHT) + : ITEM_NONE; } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80123810.s") +u16 sCItemButtons[] = { BTN_CLEFT, BTN_CDOWN, BTN_CRIGHT }; -extern u8 sActionModelGroups[]; +s32 func_80123810(PlayState* play) { + Player* player = GET_PLAYER(play); + s32 temp_v0; + ItemId itemId; + s32 i; -s32 Player_ActionToModelGroup(Player* player, s32 actionParam) { - s32 modelGroup = sActionModelGroups[actionParam]; + if (gSaveContext.save.unk_06 == 0) { + if (CHECK_BTN_ANY(CONTROLLER1(&play->state)->press.button, BTN_A | BTN_B)) { + play->interfaceCtx.unk_222 = 0; + play->interfaceCtx.unk_224 = 0; + Interface_SetHudVisibility(play->msgCtx.unk_120BC); + return -1; + } + } else { + gSaveContext.save.unk_06--; + } - if ((modelGroup == 2) && Player_IsGoronOrDeku(player)) { - return 1; + for (i = 0; i < ARRAY_COUNT(sCItemButtons); i++) { + if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, sCItemButtons[i])) { + i++; + itemId = func_8012364C(play, player, i); + + play->interfaceCtx.unk_222 = 0; + play->interfaceCtx.unk_224 = 0; + Interface_SetHudVisibility(play->msgCtx.unk_120BC); + + if ((itemId >= ITEM_FD) || (temp_v0 = play->unk_18794(play, player, itemId, i), (temp_v0 < 0))) { + play_sound(NA_SE_SY_ERROR); + return -1; + } else { + s32 pad; + + player->heldItemButton = i; + return temp_v0; + } + } + } + + return 0; +} + +// Used to map action params to model groups +u8 sActionModelGroups[PLAYER_AP_MAX] = { + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_NONE + PLAYER_MODELGROUP_13, // PLAYER_AP_LAST_USED + PLAYER_MODELGROUP_STICK, // PLAYER_AP_FISHING_ROD + PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_AP_SWORD_KOKIRI + PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_AP_SWORD_RAZOR + PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_AP_SWORD_GILDED + PLAYER_MODELGROUP_TWO_HAND_SWORD, // PLAYER_AP_SWORD_GREAT_FAIRY + PLAYER_MODELGROUP_STICK, // PLAYER_AP_STICK + PLAYER_MODELGROUP_ZORA_FINS, // PLAYER_AP_ZORA_FINS + PLAYER_MODELGROUP_BOW, // PLAYER_AP_BOW + PLAYER_MODELGROUP_BOW, // PLAYER_AP_BOW_FIRE + PLAYER_MODELGROUP_BOW, // PLAYER_AP_BOW_ICE + PLAYER_MODELGROUP_BOW, // PLAYER_AP_BOW_LIGHT + PLAYER_MODELGROUP_HOOKSHOT, // PLAYER_AP_HOOKSHOT + PLAYER_MODELGROUP_EXPLOSIVES, // PLAYER_AP_BOMB + PLAYER_MODELGROUP_EXPLOSIVES, // PLAYER_AP_POWDER_KEG + PLAYER_MODELGROUP_EXPLOSIVES, // PLAYER_AP_BOMBCHU + PLAYER_MODELGROUP_8, // PLAYER_AP_11 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_NUT + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_PICTO_BOX + PLAYER_MODELGROUP_INSTRUMENT, // PLAYER_AP_OCARINA + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_FISH + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_SPRING_WATER + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_HOT_SPRING_WATER + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_ZORA_EGG + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_DEKU_PRINCESS + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_GOLD_DUST + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_1C + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_SEAHORSE + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_MUSHROOM + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_HYLIAN_LOACH + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_BUG + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_POE + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_BIG_POE + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_POTION_RED + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_POTION_BLUE + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_POTION_GREEN + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_MILK + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_MILK_HALF + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_CHATEAU + PLAYER_MODELGROUP_BOTTLE, // PLAYER_AP_BOTTLE_FAIRY + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MOON_TEAR + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_DEED_LAND + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_ROOM_KEY + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_LETTER_TO_KAFEI + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MAGIC_BEANS + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_DEED_SWAMP + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_DEED_MOUNTAIN + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_DEED_OCEAN + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_32 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_LETTER_MAMA + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_34 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_35 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_PENDANT_OF_MEMORIES + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_37 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_38 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_39 + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_TRUTH + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_KAFEIS_MASK + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_ALL_NIGHT + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_BUNNY + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_KEATON + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_GARO + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_ROMANI + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_CIRCUS_LEADER + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_POSTMAN + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_COUPLE + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_GREAT_FAIRY + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_GIBDO + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_DON_GERO + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_KAMARO + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_CAPTAIN + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_STONE + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_BREMEN + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_BLAST + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_SCENTS + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_GIANT + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_FIERCE_DEITY + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_GORON + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_ZORA + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_MASK_DEKU + PLAYER_MODELGROUP_DEFAULT, // PLAYER_AP_LENS +}; + +PlayerModelGroup Player_ActionToModelGroup(Player* player, PlayerActionParam actionParam) { + PlayerModelGroup modelGroup = sActionModelGroups[actionParam]; + + if ((modelGroup == PLAYER_MODELGROUP_ONE_HAND_SWORD) && Player_IsGoronOrDeku(player)) { + return PLAYER_MODELGROUP_1; } return modelGroup; } -extern u8 D_801BFF90[PLAYER_FORM_MAX]; -#if 0 u8 D_801BFF90[PLAYER_FORM_MAX] = { PLAYER_BOOTS_FIERCE_DEITY, // PLAYER_FORM_FIERCE_DEITY PLAYER_BOOTS_GORON, // PLAYER_FORM_GORON @@ -549,10 +720,7 @@ u8 D_801BFF90[PLAYER_FORM_MAX] = { PLAYER_BOOTS_DEKU, // PLAYER_FORM_DEKU PLAYER_BOOTS_HYLIAN, // PLAYER_FORM_HUMAN }; -#endif -extern u8 sPlayerStrengths[PLAYER_FORM_MAX]; -#if 0 u8 sPlayerStrengths[PLAYER_FORM_MAX] = { PLAYER_STRENGTH_HUMAN, // PLAYER_FORM_FIERCE_DEITY PLAYER_STRENGTH_GORON, // PLAYER_FORM_GORON @@ -560,44 +728,470 @@ u8 sPlayerStrengths[PLAYER_FORM_MAX] = { PLAYER_STRENGTH_DEKU, // PLAYER_FORM_DEKU PLAYER_STRENGTH_HUMAN, // PLAYER_FORM_HUMAN }; -#endif typedef struct { /* 0x00 */ u8 flag; /* 0x02 */ u16 textId; } TextTriggerEntry; // size = 0x04 -extern TextTriggerEntry sEnvironmentTextTriggers[]; // These textIds are OoT remnants. The corresponding text entries are not present in this game, and so these don't point // to anything relevant. -#if 0 TextTriggerEntry sEnvironmentTextTriggers[] = { { 1, 0x26FC }, { 2, 0x26FD }, { 0, 0 }, { 2, 0x26FD }, }; -#endif -extern Gfx** sPlayerDListGroups[]; +PlayerModelIndices gPlayerModelTypes[PLAYER_MODELGROUP_MAX] = { + /* PLAYER_MODELGROUP_0 */ + { PLAYER_ANIMTYPE_2, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_SHIELD, PLAYER_MODELTYPE_SHEATH_12, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_1 */ + { PLAYER_ANIMTYPE_1, PLAYER_MODELTYPE_LH_ONE_HAND_SWORD, PLAYER_MODELTYPE_RH_CLOSED, PLAYER_MODELTYPE_SHEATH_15, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_ONE_HAND_SWORD */ + { PLAYER_ANIMTYPE_1, PLAYER_MODELTYPE_LH_ONE_HAND_SWORD, PLAYER_MODELTYPE_RH_SHIELD, PLAYER_MODELTYPE_SHEATH_13, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_DEFAULT */ + { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_4 */ + { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_TWO_HAND_SWORD */ + { PLAYER_ANIMTYPE_3, PLAYER_MODELTYPE_LH_TWO_HAND_SWORD, PLAYER_MODELTYPE_RH_CLOSED, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_BOW */ + { PLAYER_ANIMTYPE_4, PLAYER_MODELTYPE_LH_CLOSED, PLAYER_MODELTYPE_RH_BOW, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_EXPLOSIVES */ + { PLAYER_ANIMTYPE_5, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_8 */ + { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_4, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_HOOKSHOT */ + { PLAYER_ANIMTYPE_4, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_HOOKSHOT, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_STICK */ + { PLAYER_ANIMTYPE_3, PLAYER_MODELTYPE_LH_CLOSED, PLAYER_MODELTYPE_RH_CLOSED, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_INSTRUMENT */ + { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_OPEN, PLAYER_MODELTYPE_RH_INSTRUMENT, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_BOTTLE */ + { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_BOTTLE, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_13 */ + { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_ONE_HAND_SWORD, PLAYER_MODELTYPE_RH_OPEN, PLAYER_MODELTYPE_SHEATH_15, + PLAYER_MODELTYPE_WAIST }, + /* PLAYER_MODELGROUP_ZORA_FINS */ + { PLAYER_ANIMTYPE_0, PLAYER_MODELTYPE_LH_CLOSED, PLAYER_MODELTYPE_RH_CLOSED, PLAYER_MODELTYPE_SHEATH_14, + PLAYER_MODELTYPE_WAIST }, +}; -void func_801239AC(Player* player) { +/* DLists groups start */ +// Note: Only the ones with size 2 * PLAYER_FORM_MAX + +Gfx* gPlayerWaistDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityWaistDL, gLinkFierceDeityWaistDL, gLinkGoronWaistDL, gLinkGoronWaistDL, gLinkZoraWaistDL, + gLinkZoraWaistDL, gLinkDekuWaistDL, gLinkDekuWaistDL, gLinkHumanWaistDL, gLinkHumanWaistDL, +}; + +Gfx* gPlayerHandHoldingShields[PLAYER_SHIELD_MAX - 1][2] = { + { gLinkHumanRightHandHoldingHylianShieldDL, gLinkHumanRightHandHoldingHylianShieldDL }, + { gLinkHumanRightHandHoldingMirrorShieldDL, gLinkHumanRightHandHoldingMirrorShieldDL }, +}; + +Gfx* gPlayerSheath12DLs[2 * PLAYER_FORM_MAX] = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + gLinkDekuSheathDL, + gLinkDekuSheathDL, + gLinkHumanSheathEmptyDL, + gLinkHumanSheathEmptyDL, +}; + +Gfx* gPlayerSheath13DLs[2 * PLAYER_FORM_MAX] = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + gLinkDekuSheathDL, + gLinkDekuSheathDL, + gLinkHumanSheathEmptyDL, + gLinkHumanSheathEmptyDL, +}; + +Gfx* gPlayerSheath14DLs[2 * PLAYER_FORM_MAX] = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + gLinkDekuSheathDL, + gLinkDekuSheathDL, + gLinkHumanSheathEmptyDL, + gLinkHumanSheathEmptyDL, +}; + +Gfx* gPlayerShields[][2] = { + { gLinkHumanHylianShieldWithMtxDL, gLinkHumanHylianShieldWithMtxDL }, + { gLinkHumanMirrorShieldWithMtxDL, gLinkHumanMirrorShieldWithMtxDL }, +}; + +Gfx* gPlayerSheathedSwords[][2] = { + { gLinkHumanSheathedKokiriSwordDL, gLinkHumanSheathedKokiriSwordDL }, + { gLinkHumanSheathedRazorSwordDL, gLinkHumanSheathedRazorSwordDL }, + { gLinkHumanSheathedGildedSwordDL, gLinkHumanSheathedGildedSwordDL }, +}; + +Gfx* gPlayerSwordSheaths[][2] = { + { gLinkHumanKokiriSwordSheathDL, gLinkHumanKokiriSwordSheathDL }, + { gLinkHumanRazorSwordSheathDL, gLinkHumanRazorSwordSheathDL }, + { gLinkHumanGildedSwordSheathDL, gLinkHumanGildedSwordSheathDL }, +}; + +Gfx* gPlayerLeftHandTwoHandSwordDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityLeftHandHoldingSwordDL, + gLinkFierceDeityLeftHandHoldingSwordDL, + gLinkGoronLeftHandOpenDL, + gLinkGoronLeftHandOpenDL, + gLinkZoraLeftHandOpenDL, + gLinkZoraLeftHandOpenDL, + gLinkDekuLeftHandDL, + gLinkDekuLeftHandDL, + gLinkHumanLeftHandHoldingGreatFairysSwordDL, + gLinkHumanLeftHandHoldingGreatFairysSwordDL, +}; + +Gfx* gPlayerLeftHandOpenDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityLeftHandDL, gLinkFierceDeityLeftHandDL, gLinkGoronLeftHandOpenDL, gLinkGoronLeftHandOpenDL, + gLinkZoraLeftHandOpenDL, gLinkZoraLeftHandOpenDL, gLinkDekuLeftHandDL, gLinkDekuLeftHandDL, + gLinkHumanLeftHandOpenDL, gLinkHumanLeftHandOpenDL, +}; + +Gfx* gPlayerLeftHandClosedDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityLeftHandDL, gLinkFierceDeityLeftHandDL, gLinkGoronLeftHandClosedDL, gLinkGoronLeftHandClosedDL, + gLinkZoraLeftHandClosedDL, gLinkZoraLeftHandClosedDL, gLinkDekuLeftHandDL, gLinkDekuLeftHandDL, + gLinkHumanLeftHandClosedDL, gLinkHumanLeftHandClosedDL, +}; + +Gfx* gPlayerLeftHandOneHandSwordDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityLeftHandDL, + gLinkFierceDeityLeftHandDL, + gLinkGoronLeftHandOpenDL, + gLinkGoronLeftHandOpenDL, + gLinkZoraLeftHandClosedDL, + gLinkZoraLeftHandClosedDL, + gLinkDekuLeftHandDL, + gLinkDekuLeftHandDL, + gLinkHumanLeftHandHoldingKokiriSwordDL, + gLinkHumanLeftHandHoldingKokiriSwordDL, +}; + +Gfx* D_801C018C[][2] = { + { gLinkHumanLeftHandHoldingKokiriSwordDL, gLinkHumanLeftHandHoldingKokiriSwordDL }, + { gLinkHumanLeftHandHoldingRazorSwordDL, gLinkHumanLeftHandHoldingRazorSwordDL }, + { gLinkHumanLeftHandHoldingGildedSwordDL, gLinkHumanLeftHandHoldingGildedSwordDL }, +}; + +Gfx* gPlayerRightHandOpenDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityRightHandDL, gLinkFierceDeityRightHandDL, gLinkGoronRightHandOpenDL, gLinkGoronRightHandOpenDL, + gLinkZoraRightHandOpenDL, gLinkZoraRightHandOpenDL, gLinkDekuRightHandDL, gLinkDekuRightHandDL, + gLinkHumanRightHandOpenDL, gLinkHumanRightHandOpenDL, +}; + +Gfx* gPlayerRightHandClosedDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityRightHandDL, gLinkFierceDeityRightHandDL, gLinkGoronRightHandClosedDL, gLinkGoronRightHandClosedDL, + gLinkZoraRightHandClosedDL, gLinkZoraRightHandClosedDL, gLinkDekuRightHandDL, gLinkDekuRightHandDL, + gLinkHumanRightHandClosedDL, gLinkHumanRightHandClosedDL, +}; + +Gfx* gPlayerRightHandBowDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityRightHandDL, + gLinkFierceDeityRightHandDL, + gLinkGoronRightHandOpenDL, + gLinkGoronRightHandOpenDL, + gLinkZoraRightHandOpenDL, + gLinkZoraRightHandOpenDL, + gLinkDekuRightHandDL, + gLinkDekuRightHandDL, + gLinkHumanRightHandHoldingBowDL, + gLinkHumanRightHandHoldingBowDL, +}; + +Gfx* gPlayerRightHandInstrumentDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityRightHandDL, + gLinkFierceDeityRightHandDL, + gLinkGoronRightHandOpenDL, + gLinkGoronRightHandOpenDL, + gLinkZoraRightHandOpenDL, + gLinkZoraRightHandOpenDL, + gLinkDekuRightHandDL, + gLinkDekuRightHandDL, + gLinkHumanRightHandHoldingOcarinaDL, + gLinkHumanRightHandHoldingOcarinaDL, +}; + +Gfx* gPlayerRightHandHookshotDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityRightHandDL, + gLinkFierceDeityRightHandDL, + gLinkGoronRightHandOpenDL, + gLinkGoronRightHandOpenDL, + gLinkZoraRightHandOpenDL, + gLinkZoraRightHandOpenDL, + gLinkDekuRightHandDL, + gLinkDekuRightHandDL, + gLinkHumanRightHandHoldingHookshotDL, + gLinkHumanRightHandHoldingHookshotDL, +}; + +Gfx* gPlayerLeftHandBottleDLs[2 * PLAYER_FORM_MAX] = { + gLinkFierceDeityLeftHandDL, + gLinkFierceDeityLeftHandDL, + gLinkGoronLeftHandHoldBottleDL, + gLinkGoronLeftHandHoldBottleDL, + gLinkZoraLeftHandHoldBottleDL, + gLinkZoraLeftHandHoldBottleDL, + gLinkDekuLeftHandDL, + gLinkDekuLeftHandDL, + gLinkHumanLeftHandHoldBottleDL, + gLinkHumanLeftHandHoldBottleDL, +}; + +/* DLists groups end */ + +Gfx* D_801C0294[PLAYER_FORM_MAX] = { + gLinkFierceDeityLeftForearmDL, gLinkGoronLeftForearmDL, gLinkZoraLeftForearmDL, + gLinkDekuLeftForearmDL, gLinkHumanLeftForearmDL, +}; + +Gfx* D_801C02A8[PLAYER_FORM_MAX] = { + gLinkFierceDeityLeftHandDL, gLinkGoronLeftHandOpenDL, gLinkZoraLeftHandClosedDL, + gLinkDekuLeftHandDL, gLinkHumanLeftHandClosedDL, +}; + +Gfx* D_801C02BC[PLAYER_FORM_MAX] = { + gLinkFierceDeityRightShoulderDL, gLinkGoronRightShoulderDL, gLinkZoraRightShoulderDL, + gLinkDekuRightShoulderDL, gLinkHumanRightShoulderDL, +}; + +Gfx* D_801C02D0[PLAYER_FORM_MAX] = { + gLinkFierceDeityRightHandDL, + //! @bug This is in the middle of a texture in the link_goron object. It has the same offset as a link_nuts dlist + 0x060038C0, + gLinkZoraRightHandOpenDL, + gLinkDekuRightHandDL, + object_link_child_DL_018490, +}; + +Gfx* D_801C02E4[PLAYER_FORM_MAX] = { + gLinkFierceDeityRightHandDL, + //! @bug This is in the middle of a texture in the link_goron object. It has the same offset as a link_nuts dlist + 0x060038C0, + gLinkZoraRightHandOpenDL, + gLinkDekuRightHandDL, + object_link_child_DL_017B40, +}; + +// Indexed by model types (left hand, right hand, sheath or waist) +Gfx** sPlayerDListGroups[PLAYER_MODELTYPE_MAX] = { + gPlayerLeftHandOpenDLs, // PLAYER_MODELTYPE_LH_OPEN + gPlayerLeftHandClosedDLs, // PLAYER_MODELTYPE_LH_CLOSED + gPlayerLeftHandOneHandSwordDLs, // PLAYER_MODELTYPE_LH_ONE_HAND_SWORD + gPlayerLeftHandTwoHandSwordDLs, // PLAYER_MODELTYPE_LH_TWO_HAND_SWORD + gPlayerLeftHandOpenDLs, // PLAYER_MODELTYPE_LH_4 + gPlayerLeftHandBottleDLs, // PLAYER_MODELTYPE_LH_BOTTLE + gPlayerRightHandOpenDLs, // PLAYER_MODELTYPE_RH_OPEN + gPlayerRightHandClosedDLs, // PLAYER_MODELTYPE_RH_CLOSED + gPlayerRightHandClosedDLs, // PLAYER_MODELTYPE_RH_SHIELD + gPlayerRightHandBowDLs, // PLAYER_MODELTYPE_RH_BOW + gPlayerRightHandInstrumentDLs, // PLAYER_MODELTYPE_RH_INSTRUMENT + gPlayerRightHandHookshotDLs, // PLAYER_MODELTYPE_RH_HOOKSHOT + gPlayerSheath12DLs, // PLAYER_MODELTYPE_SHEATH_12 + gPlayerSheath13DLs, // PLAYER_MODELTYPE_SHEATH_13 + gPlayerSheath14DLs, // PLAYER_MODELTYPE_SHEATH_14 + gPlayerSheath14DLs, // PLAYER_MODELTYPE_SHEATH_15 + gPlayerWaistDLs, // PLAYER_MODELTYPE_WAIST + NULL, // PLAYER_MODELTYPE_17 +}; + +struct_80124618 D_801C0340[] = { + { 0, { 0, 0, 0 } }, { 5, { 0, 0, 0 } }, { 7, { 100, 100, 100 } }, + { 9, { 110, 110, 110 } }, { 11, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0368[] = { + { 0, { 0, 0, 0 } }, { 4, { 0, 0, 0 } }, { 6, { 120, 150, 60 } }, { 8, { 130, 80, 160 } }, + { 9, { 100, 100, 100 } }, { 10, { 90, 100, 90 } }, { 11, { 100, 100, 100 } }, +}; +struct_80124618 D_801C03A0[] = { + { 0, { 100, 100, 100 } }, + { 2, { 120, 120, 120 } }, + { 6, { 90, 90, 90 } }, + { 7, { 93, 93, 93 } }, +}; +struct_80124618 D_801C03C0[] = { + { 0, { 200, 100, 110 } }, + { 2, { 90, 100, 100 } }, + { 3, { 100, 100, 100 } }, + { 7, { 100, 100, 100 } }, +}; +struct_80124618 D_801C03E0[] = { + { 0, { 100, 100, 110 } }, { 2, { 60, 100, 80 } }, { 3, { 130, 105, 110 } }, + { 7, { 130, 105, 110 } }, { 10, { 100, 100, 100 } }, { 19, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0410[] = { + { 0, { 0, 0, 0 } }, + { 2, { 80, 110, 80 } }, + { 3, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0428[] = { + { 0, { 0, 0, 0 } }, { 6, { 0, 0, 0 } }, { 7, { 60, 60, 50 } }, { 8, { 120, 130, 100 } }, + { 9, { 100, 120, 80 } }, { 11, { 100, 100, 100 } }, { 13, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0460[] = { + { 0, { 100, 100, 100 } }, { 5, { 100, 100, 100 } }, { 7, { 100, 74, 80 } }, + { 8, { 100, 180, 130 } }, { 10, { 100, 80, 80 } }, { 13, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0490[] = { + { 0, { 100, 100, 100 } }, { 1, { 100, 100, 100 } }, { 2, { 90, 100, 105 } }, { 4, { 110, 100, 100 } }, + { 5, { 90, 100, 105 } }, { 6, { 100, 100, 100 } }, { 7, { 90, 100, 105 } }, { 8, { 100, 100, 100 } }, + { 9, { 90, 100, 105 } }, { 10, { 100, 100, 100 } }, { 11, { 90, 100, 105 } }, { 12, { 110, 100, 100 } }, + { 13, { 100, 100, 100 } }, { 14, { 90, 100, 105 } }, { 15, { 90, 100, 105 } }, { 17, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0510[] = { + { 0, { 100, 100, 100 } }, { 4, { 100, 100, 100 } }, { 5, { 90, 110, 100 } }, + { 6, { 110, 105, 100 } }, { 8, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0538[] = { + { 0, { 100, 100, 100 } }, { 5, { 100, 100, 100 } }, { 6, { 0, 0, 0 } }, + { 8, { 100, 100, 100 } }, { 14, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0560[] = { + { 0, { 100, 100, 100 } }, + { 2, { 95, 95, 100 } }, + { 3, { 105, 105, 100 } }, + { 5, { 102, 102, 102 } }, +}; +struct_80124618 D_801C0580[] = { + { 0, { 100, 100, 100 } }, { 9, { 100, 100, 100 } }, { 10, { 150, 150, 150 } }, + { 12, { 0, 0, 0 } }, { 14, { 0, 0, 0 } }, +}; +struct_80124618 D_801C05A8[] = { + { 0, { 100, 100, 100 } }, + { 6, { 100, 100, 100 } }, + { 7, { 0, 0, 0 } }, + { 17, { 0, 0, 0 } }, +}; +struct_80124618 D_801C05C8[] = { + { 0, { 0, 0, 0 } }, + { 17, { 50, 50, 50 } }, +}; +struct_80124618 D_801C05D8[] = { + { 0, { 0, 0, 0 } }, + { 5, { 0, 0, 0 } }, + { 9, { 100, 100, 100 } }, +}; +struct_80124618 D_801C05F0[] = { + { 0, { 100, 100, 100 } }, + { 5, { 100, 100, 100 } }, + { 9, { 0, 0, 0 } }, +}; +struct_80124618 D_801C0608[] = { + { 0, { 100, 100, 100 } }, + { 10, { 100, 100, 100 } }, + { 32, { 100, 115, 105 } }, + { 58, { 100, 101, 100 } }, +}; +struct_80124618 D_801C0628[] = { + { 0, { 100, 100, 100 } }, { 5, { 100, 100, 100 } }, { 15, { 100, 100, 105 } }, { 25, { 100, 100, 105 } }, + { 34, { 100, 100, 100 } }, { 46, { 100, 100, 100 } }, { 57, { 100, 100, 105 } }, { 67, { 100, 100, 105 } }, + { 76, { 100, 100, 100 } }, { 78, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0678[] = { + { 0, { 0, 0, 0 } }, + { 6, { 0, 0, 0 } }, + { 8, { 100, 100, 100 } }, + { 11, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0698[] = { + { 0, { 0, 0, 0 } }, + { 7, { 1120, 112, 112 } }, + { 8, { 140, 168, 168 } }, + { 11, { 140, 140, 140 } }, +}; +struct_80124618 D_801C06B8[] = { + { 0, { 100, 100, 100 } }, { 7, { 100, 100, 100 } }, { 8, { 70, 30, 70 } }, { 10, { 0, 0, 0 } }, { 14, { 0, 0, 0 } }, +}; +struct_80124618 D_801C06E0[] = { + { 0, { 140, 140, 140 } }, + { 1, { 0, 0, 0 } }, + { 14, { 0, 0, 0 } }, +}; +struct_80124618 D_801C06F8[] = { + { 0, { 100, 100, 100 } }, + { 5, { 100, 100, 100 } }, + { 6, { 0, 0, 0 } }, + { 10, { 0, 0, 0 } }, +}; +struct_80124618 D_801C0718[] = { + { 0, { 140, 140, 140 } }, + { 1, { 0, 0, 0 } }, + { 10, { 0, 0, 0 } }, +}; +struct_80124618 D_801C0730[] = { + { 0, { 100, 100, 100 } }, + { 13, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0740[] = { + { 0, { 140, 140, 140 } }, + { 13, { 140, 140, 140 } }, +}; +struct_80124618 D_801C0750[] = { + { 0, { 100, 100, 100 } }, { 5, { 100, 100, 100 } }, { 6, { 200, 200, 200 } }, + { 10, { 200, 200, 200 } }, { 11, { 100, 100, 100 } }, +}; + +// alpha values +u8 D_801C0778[] = { + 0, 0, 0, 0, 0, 100, 200, 255, 255, 255, 200, 100, +}; + +struct_80124618 D_801C0784[] = { + { 0, { 100, 100, 100 } }, { 14, { 100, 100, 100 } }, { 15, { 200, 200, 200 } }, + { 16, { 200, 200, 200 } }, { 18, { 100, 100, 100 } }, +}; + +u8 D_801C07AC[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 200, 255, 255, 255, 200, 100, 0, +}; + +void Player_SetModelsForHoldingShield(Player* player) { if (player->stateFlags1 & PLAYER_STATE1_400000) { if ((player->heldItemActionParam < 0) || (player->heldItemActionParam == player->itemActionParam)) { if (!Player_IsHoldingTwoHandedWeapon(player)) { if (!Player_IsGoronOrDeku(player)) { D_801F59E0 = player->transformation * 2; - player->rightHandType = 8; - player->rightHandDLists = &sPlayerDListGroups[8][D_801F59E0]; + player->rightHandType = PLAYER_MODELTYPE_RH_SHIELD; + player->rightHandDLists = &sPlayerDListGroups[PLAYER_MODELTYPE_RH_SHIELD][D_801F59E0]; - if (player->sheathType == 14) { - player->sheathType = 12; - } else if (player->sheathType == 15) { - player->sheathType = 13; + if (player->sheathType == PLAYER_MODELTYPE_SHEATH_14) { + player->sheathType = PLAYER_MODELTYPE_SHEATH_12; + } else if (player->sheathType == PLAYER_MODELTYPE_SHEATH_15) { + player->sheathType = PLAYER_MODELTYPE_SHEATH_13; } player->sheathDLists = &sPlayerDListGroups[player->sheathType][D_801F59E0]; - player->modelAnimType = 2; + player->modelAnimType = PLAYER_ANIMTYPE_2; player->heldItemActionParam = -1; } } @@ -605,43 +1199,43 @@ void func_801239AC(Player* player) { } } -void Player_SetModels(Player* player, s32 modelGroup) { - u8* playerModelTypes; +void Player_SetModels(Player* player, PlayerModelGroup modelGroup) { + PlayerModelIndices* playerModelTypes; D_801F59E0 = player->transformation * 2; - player->leftHandType = gPlayerModelTypes[modelGroup][1]; - player->rightHandType = gPlayerModelTypes[modelGroup][2]; - player->sheathType = gPlayerModelTypes[modelGroup][3]; + player->leftHandType = gPlayerModelTypes[modelGroup].leftHandType; + player->rightHandType = gPlayerModelTypes[modelGroup].rightHandType; + player->sheathType = gPlayerModelTypes[modelGroup].sheathType; - if (player->sheathType == 14) { + if (player->sheathType == PLAYER_MODELTYPE_SHEATH_14) { if (CUR_FORM_EQUIP(EQUIP_SLOT_B) == ITEM_NONE) { - player->sheathType = 15; + player->sheathType = PLAYER_MODELTYPE_SHEATH_15; } } - playerModelTypes = gPlayerModelTypes[modelGroup]; + playerModelTypes = &gPlayerModelTypes[modelGroup]; - player->leftHandDLists = &sPlayerDListGroups[playerModelTypes[1]][D_801F59E0]; - player->rightHandDLists = &sPlayerDListGroups[playerModelTypes[2]][D_801F59E0]; - player->sheathDLists = &sPlayerDListGroups[playerModelTypes[3]][D_801F59E0]; - player->waistDLists = &sPlayerDListGroups[playerModelTypes[4]][D_801F59E0]; + player->leftHandDLists = &sPlayerDListGroups[playerModelTypes->leftHandType][D_801F59E0]; + player->rightHandDLists = &sPlayerDListGroups[playerModelTypes->rightHandType][D_801F59E0]; + player->sheathDLists = &sPlayerDListGroups[playerModelTypes->sheathType][D_801F59E0]; + player->waistDLists = &sPlayerDListGroups[playerModelTypes->waistType][D_801F59E0]; - func_801239AC(player); + Player_SetModelsForHoldingShield(player); } -void Player_SetModelGroup(Player* player, s32 modelGroup) { +void Player_SetModelGroup(Player* player, PlayerModelGroup modelGroup) { player->modelGroup = modelGroup; - if (modelGroup == 1) { - player->modelAnimType = 0; + if (modelGroup == PLAYER_MODELGROUP_1) { + player->modelAnimType = PLAYER_ANIMTYPE_0; } else { - player->modelAnimType = gPlayerModelTypes[modelGroup][0]; + player->modelAnimType = gPlayerModelTypes[modelGroup].modelAnimType; } - if (player->modelAnimType < 3) { + if (player->modelAnimType < PLAYER_ANIMTYPE_3) { if (((player->transformation != PLAYER_FORM_FIERCE_DEITY) && (player->transformation != PLAYER_FORM_HUMAN)) || (player->currentShield == PLAYER_SHIELD_NONE)) { - player->modelAnimType = 0; + player->modelAnimType = PLAYER_ANIMTYPE_0; } } @@ -669,7 +1263,7 @@ void Player_SetEquipmentData(PlayState* play, Player* player) { } } -void func_80123D50(PlayState* play, Player* player, s32 itemId, s32 actionParam) { +void func_80123D50(PlayState* play, Player* player, ItemId itemId, PlayerActionParam actionParam) { Inventory_UpdateBottleItem(play, itemId, player->heldItemButton); if (itemId != ITEM_BOTTLE) { @@ -687,16 +1281,16 @@ void func_80123DA4(Player* player) { void func_80123DC0(Player* player) { if ((player->actor.bgCheckFlags & 1) || - (player->stateFlags1 & (PLAYER_STATE1_8000000 | PLAYER_STATE1_800000 | PLAYER_STATE1_200000)) || - (!(player->stateFlags1 & (PLAYER_STATE1_80000 | PLAYER_STATE1_40000)) && + (player->stateFlags1 & (PLAYER_STATE1_200000 | PLAYER_STATE1_800000 | PLAYER_STATE1_8000000)) || + (!(player->stateFlags1 & (PLAYER_STATE1_40000 | PLAYER_STATE1_80000)) && ((player->actor.world.pos.y - player->actor.floorHeight) < 100.0f))) { - player->stateFlags1 &= ~(PLAYER_STATE1_40000000 | PLAYER_STATE1_80000 | PLAYER_STATE1_40000 | - PLAYER_STATE1_20000 | PLAYER_STATE1_10000 | PLAYER_STATE1_8000); - } else if (!(player->stateFlags1 & (PLAYER_STATE1_200000 | PLAYER_STATE1_80000 | PLAYER_STATE1_40000))) { + player->stateFlags1 &= ~(PLAYER_STATE1_8000 | PLAYER_STATE1_10000 | PLAYER_STATE1_20000 | PLAYER_STATE1_40000 | + PLAYER_STATE1_80000 | PLAYER_STATE1_40000000); + } else if (!(player->stateFlags1 & (PLAYER_STATE1_40000 | PLAYER_STATE1_80000 | PLAYER_STATE1_200000))) { player->stateFlags1 |= PLAYER_STATE1_80000; } else if ((player->stateFlags1 & PLAYER_STATE1_40000) && (player->transformation == PLAYER_FORM_DEKU)) { player->stateFlags1 &= - ~(PLAYER_STATE1_40000000 | PLAYER_STATE1_20000 | PLAYER_STATE1_10000 | PLAYER_STATE1_8000); + ~(PLAYER_STATE1_8000 | PLAYER_STATE1_10000 | PLAYER_STATE1_20000 | PLAYER_STATE1_40000000); } func_80123DA4(player); @@ -764,7 +1358,7 @@ s32 Player_HasMirrorShieldEquipped(PlayState* play) { s32 Player_IsHoldingMirrorShield(PlayState* play) { Player* player = GET_PLAYER(play); - return (player->transformation == PLAYER_FORM_HUMAN) && (player->rightHandType == 8) && + return (player->transformation == PLAYER_FORM_HUMAN) && (player->rightHandType == PLAYER_MODELTYPE_RH_SHIELD) && (player->currentShield == PLAYER_SHIELD_MIRROR_SHIELD); } @@ -776,7 +1370,7 @@ s32 func_801240DC(Player* player) { return Player_IsHoldingHookshot(player) && (player->heldActor == NULL); } -s32 func_80124110(Player* player, s32 actionParam) { +s32 func_80124110(Player* player, PlayerActionParam actionParam) { s32 temp_v0 = actionParam - PLAYER_AP_FISHING_ROD; if (player->transformation != PLAYER_FORM_GORON) { @@ -793,7 +1387,7 @@ s32 func_80124148(Player* player) { return func_80124110(player, player->itemActionParam); } -s32 Player_ActionToMeleeWeapon(s32 actionParam) { +s32 Player_ActionToMeleeWeapon(PlayerActionParam actionParam) { s32 weapon = actionParam - (PLAYER_AP_SWORD_KOKIRI - 1); if ((weapon > 0) && (weapon <= (PLAYER_AP_ZORA_FINS - (PLAYER_AP_SWORD_KOKIRI - 1)))) { @@ -815,7 +1409,7 @@ s32 Player_IsHoldingTwoHandedWeapon(Player* player) { return false; } -s32 Player_ActionToBottle(Player* player, s32 actionParam) { +s32 Player_ActionToBottle(Player* player, PlayerActionParam actionParam) { s32 bottle = actionParam - PLAYER_AP_BOTTLE; // Relies on bottle-related action params to be contiguous @@ -830,7 +1424,7 @@ s32 Player_GetBottleHeld(Player* Player) { return Player_ActionToBottle(Player, Player->itemActionParam); } -s32 Player_ActionToExplosive(Player* player, s32 actionParam) { +s32 Player_ActionToExplosive(Player* player, PlayerActionParam actionParam) { s32 explosive = actionParam - PLAYER_AP_BOMB; // Relies on explosive-related action params to be contiguous @@ -845,8 +1439,7 @@ s32 Player_GetExplosiveHeld(Player* player) { return Player_ActionToExplosive(player, player->itemActionParam); } -// Convert actionParam to sword -s32 func_80124278(Actor* actor, s32 actionParam) { +s32 Player_ActionToSword(Actor* actor, PlayerActionParam actionParam) { s32 sword = 0; //! FAKE: @@ -896,6 +1489,7 @@ s32 Player_GetEnvTimerType(PlayState* play) { return envTimerType + 1; } +void func_80124420(Player* player); #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80124420.s") void func_80124618(struct_80124618 arg0[], f32 curFrame, Vec3f* arg2) { @@ -911,7 +1505,6 @@ void func_80124618(struct_80124618 arg0[], f32 curFrame, Vec3f* arg2) { } while (temp_v1 < currentFrame); temp_f0 = arg0[-1].unk_0; - progress = (curFrame - temp_f0) / (temp_v1 - temp_f0); temp_f14 = arg0[-1].unk_2.x; @@ -924,16 +1517,185 @@ void func_80124618(struct_80124618 arg0[], f32 curFrame, Vec3f* arg2) { arg2->z = LERPIMP(temp_f14, arg0->unk_2.z, progress) * 0.01f; } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_801246F4.s") +struct_80124618 D_801C07C0[] = { + { 0, { 100, 100, 100 } }, { 10, { 100, 100, 100 } }, { 11, { 100, 120, 120 } }, + { 12, { 100, 120, 120 } }, { 14, { 100, 100, 100 } }, { 19, { 100, 100, 100 } }, +}; + +struct_80124618 D_801C07F0[] = { + { 0, { 40, 60, 70 } }, { 3, { 40, 60, 70 } }, { 4, { 75, 90, 85 } }, + { 5, { 110, 120, 100 } }, { 7, { 100, 100, 100 } }, { 8, { 100, 100, 100 } }, +}; +struct_80124618 D_801C0820[] = { + { 0, { 100, 100, 100 } }, + { 7, { 100, 100, 100 } }, + { 12, { 40, 60, 70 } }, +}; +struct_80124618 D_801C0838[] = { + { 0, { 40, 60, 70 } }, + { 7, { 40, 60, 70 } }, + { 12, { 100, 100, 100 } }, +}; + +Gfx gCullBackDList[] = { + gsSPSetGeometryMode(G_CULL_BACK), + gsSPEndDisplayList(), +}; +Gfx gCullFrontDList[] = { + gsSPSetGeometryMode(G_CULL_FRONT), + gsSPEndDisplayList(), +}; + +TexturePtr sPlayerEyesTextures[] = { + gLinkHumanEyesOpenTex, gLinkHumanEyesHalfTex, gLinkHumanEyesClosedTex, gLinkHumanEyesRollRightTex, + gLinkHumanEyesRollLeftTex, gLinkHumanEyesRollUpTex, gLinkHumanEyesRollDownTex, object_link_child_Tex_003800, +}; + +TexturePtr sPlayerMouthTextures[] = { + gLinkHumanMouthClosedTex, + gLinkHumanMouthTeethTex, + gLinkHumanMouthAngryTex, + gLinkHumanMouthHappyTex, +}; + +typedef struct PlayerFaceIndices { + /* 0x00 */ u8 eyeIndex; + /* 0x01 */ u8 mouthIndex; +} PlayerFaceIndices; // size = 0x02 + +PlayerFaceIndices sPlayerFaces[] = { + { PLAYER_EYES_OPEN, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_0 + { PLAYER_EYES_HALF, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_1 + { PLAYER_EYES_CLOSED, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_2 + { PLAYER_EYES_OPEN, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_3 + { PLAYER_EYES_HALF, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_4 + { PLAYER_EYES_CLOSED, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_5 + { PLAYER_EYES_ROLL_LEFT, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_6 + { PLAYER_EYES_ROLL_UP, PLAYER_MOUTH_TEETH }, // PLAYER_FACE_7 + { PLAYER_EYES_7, PLAYER_MOUTH_ANGRY }, // PLAYER_FACE_8 + { PLAYER_EYES_OPEN, PLAYER_MOUTH_ANGRY }, // PLAYER_FACE_9 + { PLAYER_EYES_ROLL_RIGHT, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_10 + { PLAYER_EYES_ROLL_LEFT, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_11 + { PLAYER_EYES_CLOSED, PLAYER_MOUTH_ANGRY }, // PLAYER_FACE_12 + { PLAYER_EYES_HALF, PLAYER_MOUTH_TEETH }, // PLAYER_FACE_13 + { PLAYER_EYES_OPEN, PLAYER_MOUTH_ANGRY }, // PLAYER_FACE_14 + { PLAYER_EYES_OPEN, PLAYER_MOUTH_HAPPY }, // PLAYER_FACE_15 +}; + +// Note the correct pointer to pass as the jointTable is the jointTable pointer from the SkelAnime struct, not the +// buffer from the Player struct itself since that one may be misaligned. +void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, + PlayerTransformation playerForm, s32 boots, s32 face, OverrideLimbDrawFlex overrideLimbDraw, + PostLimbDrawFlex postLimbDraw, Actor* actor) { + s32 eyeIndex = (jointTable[22].x & 0xF) - 1; + s32 mouthIndex = ((jointTable[22].x >> 4) & 0xF) - 1; + Gfx* gfx; + + OPEN_DISPS(play->state.gfxCtx); + + gfx = POLY_OPA_DISP; + + if (eyeIndex < 0) { + eyeIndex = sPlayerFaces[face].eyeIndex; + } + + if (playerForm == PLAYER_FORM_GORON) { + if ((eyeIndex >= PLAYER_EYES_ROLL_RIGHT) && (eyeIndex <= PLAYER_EYES_ROLL_DOWN)) { + eyeIndex = PLAYER_EYES_OPEN; + } else if (eyeIndex == PLAYER_EYES_7) { + eyeIndex = PLAYER_EYES_ROLL_RIGHT; + } + } + + gSPSegment(&gfx[0], 0x08, Lib_SegmentedToVirtual(sPlayerEyesTextures[eyeIndex])); + + if (mouthIndex < 0) { + mouthIndex = sPlayerFaces[face].mouthIndex; + } + + gSPSegment(&gfx[1], 0x09, Lib_SegmentedToVirtual(sPlayerMouthTextures[mouthIndex])); + + POLY_OPA_DISP = &gfx[2]; + + D_801F59E0 = playerForm * 2; + D_801F59E4 = lod; + SkelAnime_DrawFlexLod(play, skeleton, jointTable, dListCount, overrideLimbDraw, postLimbDraw, actor, lod); + + CLOSE_DISPS(play->state.gfxCtx); +} + +Vec3f D_801C08C0[PLAYER_FORM_MAX] = { + { 1304.0f, 0.0f, 0.0f }, { 1156.0f, 0.0f, 0.0f }, { 1406.0f, 0.0f, 0.0f }, + { 408.0f, 0.0f, 0.0f }, { 695.0f, 0.0f, 0.0f }, +}; + +f32 D_801C08FC[PLAYER_FORM_MAX] = { + 1265.0f, 1056.0f, 1506.0f, 359.0f, 826.0f, +}; +f32 D_801C0910[PLAYER_FORM_MAX] = { + 170.0416f, 133.63359f, 197.68358f, 16.646399f, 48.302498f, +}; +f32 D_801C0924[PLAYER_FORM_MAX] = { + 10.019104f, 22.120003f, -29.12001f, 3.7582989f, -19.925102f, +}; +f32 D_801C0938[PLAYER_FORM_MAX] = { + 5.0f, 4.0f, 1.0f, 1.0f, 3.0f, +}; #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80124870.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80124CC4.s") +void func_80124CC4(PlayState* play, Player* player, f32 arg2) { + static Vec3f D_801C094C = { -500.0f, -100.0f, 0.0f }; + CollisionPoly* poly; + s32 bgId; + Vec3f sp7C; + Vec3f sp70; + Vec3f pos; + Vec3f sp58; + f32 sp54; + f32 scale; + + D_801C094C.z = 0.0f; + Matrix_MultVec3f(&D_801C094C, &sp7C); + D_801C094C.z = arg2; + Matrix_MultVec3f(&D_801C094C, &sp70); + + if (BgCheck_AnyLineTest3(&play->colCtx, &sp7C, &sp70, &pos, &poly, true, true, true, true, &bgId)) { + if (!func_800B90AC(play, &player->actor, poly, bgId, &pos) || + BgCheck_ProjectileLineTest(&play->colCtx, &sp7C, &sp70, &pos, &poly, true, true, true, true, &bgId)) { + OPEN_DISPS(play->state.gfxCtx); + + OVERLAY_DISP = Gfx_CallSetupDL(OVERLAY_DISP, 7); + + SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &pos, &sp58, &sp54); + if (sp54 < 200.0f) { + scale = 0.08f; + } else { + scale = (sp54 / 200.0f) * 0.08f; + } + Matrix_Translate(pos.x, pos.y, pos.z, MTXMODE_NEW); + Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); + + gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gSPSegment(OVERLAY_DISP++, 0x06, play->objectCtx.status[player->actor.objBankIndex].segment); + gSPDisplayList(OVERLAY_DISP++, gameplay_keep_DL_04F250); + + CLOSE_DISPS(play->state.gfxCtx); + } + } +} -extern s32 D_801C0958; -#if 0 s32 D_801C0958 = false; -#endif + +Gfx** D_801C095C[] = { + gPlayerLeftHandClosedDLs, + gPlayerLeftHandOpenDLs, +}; +Gfx** D_801C0964[] = { + gPlayerRightHandClosedDLs, + gPlayerRightHandOpenDLs, +}; void func_80124F18(s16* arg0, f32* arg1, s16 arg2, f32 arg3, f32 arg4) { f32 phi_f12; @@ -1067,14 +1829,11 @@ s32 func_801263FC(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80126440.s") -extern u8 D_801C096C[PLAYER_SHIELD_MAX]; -#if 0 u8 D_801C096C[PLAYER_SHIELD_MAX] = { COLTYPE_METAL, COLTYPE_METAL, COLTYPE_METAL, }; -#endif void func_801265C8(PlayState* play, Player* player, ColliderQuad* collider, Vec3f arg3[4]) { if (player->stateFlags1 & PLAYER_STATE1_400000) { @@ -1094,6 +1853,146 @@ void func_801265C8(PlayState* play, Player* player, ColliderQuad* collider, Vec3 } } +Vec3f D_801C0970[] = { + { 0.0f, 400.0f, 0.0f }, + { 0.0f, 1400.0f, -1000.0f }, + { 0.0f, -400.0f, 1000.0f }, +}; + +Vec3f D_801C0994[] = { + { 5000.0f, 400.0f, 0.0f }, + { 5000.0f, -400.0f, 1000.0f }, + { 5000.0f, 1400.0f, -1000.0f }, +}; + +Vec3f D_801C09B8[] = { + { 0.0f, 750.0f, 750.0f }, + { 1500.0f, 1500.0f, 1500.0f }, + { -2500.0f, -2000.0f, -3000.0f }, +}; + +Vec3f D_801C09DC[] = { + { 900.0f, 300.0f, 100.0f }, + { 1300.0f, 700.0f, -300.0f }, + { 500.0f, -100.0f, 500.0f }, +}; + +Vec3f D_801C0A00[] = { + { -2500.0f, 1400.0f, 1100.0f }, + { -2900.0f, 1000.0f, 1500.0f }, + { -2100.0f, 1800.0f, 700.0f }, +}; + +Vec3f D_801C0A24[] = { + { 0.0f, 0.0f, 0.0f }, + { -800.0f, 800.0f, 800.0f }, + { -800.0f, -800.0f, -800.0f }, +}; + +Vec3f D_801C0A48[] = { + { 2000.0f, 0.0f, 0.0f }, + { 2800.0f, -800.0f, -800.0f }, + { 2800.0f, 800.0f, 800.0f }, +}; + +Vec3f D_801C0A6C[] = { + { -400.0f, 800.0f, 0.0f }, + { -5000.0f, -500.0f, -4000.0f }, + { -5000.0f, 8000.0f, 4000.0f }, +}; + +Vec3f D_801C0A90[] = { + { -400.0f, 1800.0f, 0.0f }, + { 5000.0f, 8000.0f, 4000.0f }, + { 5000.0f, -500.0f, -4000.0f }, +}; + +Gfx* D_801C0AB4[] = { + object_link_zora_DL_00CC38, + object_link_zora_DL_00CDA0, +}; + +Gfx* D_801C0ABC[] = { + object_link_zora_DL_010868, + object_link_zora_DL_010978, +}; + +Vec3f D_801C0AC4[] = { + { 5400.0f, 1700.0f, 1800.0f }, + { 5400.0f, 1700.0f, -1800.0f }, +}; + +Vec3f D_801C0ADC[] = { + { 5250.0f, 570.0f, 2400.0f }, + { 5250.0f, 570.0f, -2400.0f }, +}; + +struct_80124618* D_801C0AF4[] = { + D_801C0678, + D_801C0698, +}; + +struct_80124618* D_801C0AFC[] = { + D_801C06B8, + D_801C06E0, +}; + +struct_80124618* D_801C0B04[] = { + D_801C06F8, + D_801C0718, +}; + +struct_80124618* D_801C0B0C[] = { + D_801C0730, + D_801C0740, +}; + +Gfx* D_801C0B14[] = { + object_link_nuts_DL_008760, + object_link_nuts_DL_008660, +}; + +u8 D_801C0B1C[] = { + 0x0C, + 0x0F, +}; + +Gfx* D_801C0B20[] = { + object_mask_truth_DL_0001A0, + object_mask_kerfay_DL_000D40, + object_mask_yofukasi_DL_000490, + object_mask_rabit_DL_000610, + object_mask_ki_tan_DL_0004A0, + object_mask_json_DL_0004C0, + object_mask_romerny_DL_0007A0, + object_mask_zacho_DL_000700, + object_mask_posthat_DL_000290, + object_mask_meoto_DL_0005A0, + object_mask_bigelf_DL_0016F0, + object_mask_gibudo_DL_000250, + gDonGeroMaskDL, + object_mask_dancer_DL_000EF0, + object_mask_skj_DL_0009F0, + object_mask_stone_DL_000820, + object_mask_bree_DL_0003C0, + object_mask_bakuretu_DL_0005C0, + object_mask_bu_san_DL_000710, + object_mask_kyojin_DL_000380, + gameplay_keep_DL_00B260, + gameplay_keep_DL_005A10, + gameplay_keep_DL_005360, + gDekuMaskDL, + object_mask_boy_DL_000900, + object_mask_goron_DL_0014A0, + object_mask_zora_DL_000DB0, + object_mask_nuts_DL_001D90, +}; + +Vec3f D_801C0B90[] = { + { 950.0f, -800.0f, 300.0f }, + { 950.0f, -800.0f, -300.0f }, +}; + #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8012669C.s") void Player_DrawGetItemImpl(PlayState* play, Player* player, Vec3f* refPos, s32 drawIdPlusOne) { @@ -1191,21 +2090,270 @@ void Player_DrawCouplesMask(PlayState* play, Player* player) { AnimatedMat_DrawOpa(play, Lib_SegmentedToVirtual(&object_mask_meoto_Matanimheader_001CD8)); } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80127594.s") +void Player_DrawCircusLeadersMask(PlayState* play, Actor* actor) { + static Vec3f bubbleVelocity = { 0.0f, 0.0f, 0.0f }; + static Vec3f bubbleAccel = { 0.0f, 0.0f, 0.0f }; + Gfx* gfx; + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_801278F8.s") + OPEN_DISPS(play->state.gfxCtx); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80127A60.s") + gfx = POLY_XLU_DISP; + + for (i = 0; i < ARRAY_COUNT(D_801C0B90); i++) { + f32 scaleY = (D_801F59C8[i] / 400.0f) * 0.1f; + + Matrix_MultVec3f(&D_801C0B90[i], &D_801F59B0[i]); + + //! FAKE + if (1) {} + + D_801F59B0[i].y += -10.0f * scaleY; + + if (D_801F59C8[i] < 0x190) { + f32 scaleXZ = CLAMP_MAX(scaleY, 0.05f); + + Matrix_Push(); + Matrix_Translate(D_801F59B0[i].x, D_801F59B0[i].y, D_801F59B0[i].z, MTXMODE_NEW); + Matrix_Scale(scaleXZ, scaleY, scaleXZ, MTXMODE_APPLY); + + gSPMatrix(&gfx[0], Matrix_NewMtx(play->state.gfxCtx), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPSegment(&gfx[1], 0x08, VIRTUAL_TO_PHYSICAL(SEGMENTED_TO_VIRTUAL(gEffBubble1Tex))); + gDPSetPrimColor(&gfx[2], 0, 0, 255, 255, 255, 255); + gDPSetEnvColor(&gfx[3], 150, 150, 150, 0); + gSPDisplayList(&gfx[4], gEffBubbleDL); + gSPPopMatrix(&gfx[5], G_MTX_MODELVIEW); + + Matrix_Pop(); + + gfx = &gfx[6]; + } else { + Player* player = (Player*)actor; + f32 temp_f0 = sqrtf(SQ(player->actor.velocity.x) + SQ(player->actor.velocity.z)); + s16 phi_s0 = temp_f0 * 2000.0f; + f32 temp_f20; + + bubbleVelocity.y = temp_f0 * 0.4f; + bubbleAccel.y = -0.3f; + + if (phi_s0 > 0x3E80) { + phi_s0 = 0x3E80; + } + + phi_s0 = player->actor.focus.rot.y + ((i != 0) ? phi_s0 : -phi_s0); + temp_f20 = temp_f0 * 0.2f; + + if (temp_f20 > 4.0f) { + temp_f20 = 4.0f; + } + + bubbleVelocity.x = -Math_SinS(phi_s0) * temp_f20; + bubbleVelocity.z = -Math_CosS(phi_s0) * temp_f20; + + EffectSsDtBubble_SpawnColorProfile(play, &D_801F59B0[i], &bubbleVelocity, &bubbleAccel, 20, 20, 3, 0); + D_801F59C8[i] -= 0x190; + } + } + + POLY_XLU_DISP = gfx; + + CLOSE_DISPS(play->state.gfxCtx); +} + +void Player_DrawBlastMask(PlayState* play, Player* player) { + static Gfx D_801C0BC0[] = { + gsDPSetEnvColor(0, 0, 0, 255), + gsSPEndDisplayList(), + }; + static Gfx D_801C0BD0[] = { + gsDPSetRenderMode(AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | + G_RM_FOG_SHADE_A, + AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | + GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)), + gsSPEndDisplayList(), + }; + + OPEN_DISPS(play->state.gfxCtx); + + if (player->unk_B60 != 0) { + s32 alpha; + + gSegments[0xA] = VIRTUAL_TO_PHYSICAL(player->maskObjectSegment); + + AnimatedMat_DrawOpa(play, Lib_SegmentedToVirtual(&object_mask_bakuretu_Matanimheader_0011F8)); + + if (player->unk_B60 < 11) { + alpha = (player->unk_B60 / 10.0f) * 255; + } else { + alpha = 255; + } + + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, (u8)alpha); + gSPDisplayList(POLY_OPA_DISP++, object_mask_bakuretu_DL_000440); + gSPSegment(POLY_OPA_DISP++, 0x09, D_801C0BD0); + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, (u8)(255 - alpha)); + } else { + gSPSegment(POLY_OPA_DISP++, 0x09, D_801C0BC0); + } + + CLOSE_DISPS(play->state.gfxCtx); +} + +Vec3f D_801C0BE0 = { 0.0f, 0.3f, 0.0f }; +Vec3f D_801C0BEC = { 0.0f, -0.025f, 0.0f }; +Color_RGBA8 D_801C0BF8 = { 250, 100, 100, 0 }; +Color_RGBA8 D_801C0BFC = { 0, 0, 100, 0 }; + +Vec3f D_801C0C00 = { 0.0f, 20.0f, 0.0f }; + +Vec3f D_801C0C0C[] = { + { 174.0f, -1269.0f, -1.0f }, + { 401.0f, -729.0f, -701.0f }, + { 401.0f, -729.0f, 699.0f }, +}; + +Vec3f D_801C0C30[] = { + { 74.0f, -1269.0f, -1.0f }, + { 301.0f, -729.0f, -701.0f }, + { 301.0f, -729.0f, 699.0f }, +}; + +typedef struct { + /* 0x00 */ f32 unk_00; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ Vec3f unk_08; + /* 0x14 */ f32 unk_14; + /* 0x18 */ s16 unk_18; + /* 0x1A */ s16 unk_1A; +} struct_80128388_arg1; // size = 0x1C + +struct_80128388_arg1 D_801C0C54[] = { + { 0.0f, 0x0000, 0x8000, { 0.0f, 0.0f, 0.0f }, 0.0f, 0x0000, 0x0000 }, + { 16.8f, 0x0000, 0x0000, { 0.0f, 0.0f, 0.0f }, 20.0f, 0x1388, 0x1388 }, + { 30.0f, 0x0000, 0x0000, { 0.0f, 0.0f, 0.0f }, 20.0f, 0x1F40, 0x2EE0 }, +}; + +Color_RGB8 D_801C0CA8[] = { + { 255, 255, 255 }, { 80, 80, 255 }, { 136, 192, 255 }, { 136, 192, 255 }, { 184, 232, 232 }, { 248, 200, 0 }, + { 255, 180, 0 }, { 0, 128, 0 }, { 252, 238, 0 }, { 131, 0, 174 }, { 64, 64, 32 }, { 0, 0, 255 }, + { 255, 0, 255 }, { 255, 0, 255 }, { 255, 0, 0 }, { 0, 0, 255 }, { 0, 200, 0 }, { 255, 255, 255 }, + { 255, 255, 255 }, { 255, 255, 255 }, { 80, 80, 255 }, +}; + +Vec3f D_801C0CE8[PLAYER_FORM_MAX] = { + { 0.0f, 0.0f, 0.0f }, { 300.0f, 300.0f, -230.0f }, { 0.0f, 90.0f, -50.0f }, + { 0.0f, 20.0f, -60.0f }, { 0.0f, 0.0f, 0.0f }, +}; +Vec3f D_801C0D24[PLAYER_FORM_MAX] = { + { 200.0f, 300.0f, 0.0f }, { 200.0f, 200.0f, 0.0f }, { 200.0f, 300.0f, 0.0f }, + { 200.0f, 150.0f, 0.0f }, { 200.0f, 200.0f, 0.0f }, +}; +Vec3f D_801C0D60 = { 398.0f, 1419.0f, 244.0f }; +Vec3f D_801C0D6C = { 420.0f, 1210.0f, 380.0f }; + +f32 D_801C0D78[] = { + 0.0f, // Player is not holding a melee weapon + 3000.0f, // PLAYER_AP_SWORD_KOKIRI + 3000.0f, // PLAYER_AP_SWORD_RAZOR + 4000.0f, // PLAYER_AP_SWORD_GILDED + 5500.0f, // PLAYER_AP_SWORD_GREAT_FAIRY + -1.0f, // PLAYER_AP_STICK + 2500.0f, // PLAYER_AP_ZORA_FINS +}; + +Gfx* D_801C0D94 = object_link_child_DL_017818; + +f32 D_801C0D98 = -35.0f; + +f32 D_801C0D9C = -395.0f; +f32 D_801C0DA0 = 0.0f; + +f32 D_801C0DA4 = 0.0f; + +Vec3f D_801C0DA8[4] = { + { -4500.0f, -3000.0f, -600.0f }, + { 1500.0f, -3000.0f, -600.0f }, + { -4500.0f, 3000.0f, -600.0f }, + { 1500.0f, 3000.0f, -600.0f }, +}; + +Vec3f D_801C0DD8 = { 50.0f, 800.0f, 0.0f }; +Vec3f D_801C0DE4 = { 50.0f, 850.0f, 0.0f }; +Gfx* D_801C0DF0[] = { + object_link_goron_DL_010590, object_link_goron_DL_010368, object_link_goron_DL_010140, + object_link_goron_DL_00FF18, object_link_goron_DL_00FCF0, +}; + +Vec2f D_801C0E04[PLAYER_FORM_MAX] = { + { 140.0f, -130.0f }, { 0.0f, -200.0f }, { -160.0f, 0.0f }, { 220.0f, -200.0f }, { 0.0f, 0.0f }, +}; + +Gfx* D_801C0E2C[] = { + object_link_nuts_DL_007A28, object_link_nuts_DL_0077D0, object_link_nuts_DL_007548, + object_link_nuts_DL_007900, object_link_nuts_DL_0076A0, +}; +Vec3f D_801C0E40[PLAYER_FORM_MAX] = { + { 0.0f, 0.0f, 0.0f }, { -578.3f, -1100.9f, 0.0f }, { -189.5f, -594.87f, 0.0f }, + { -570.0f, -812.0f, 0.0f }, { -230.0f, -520.0f, 0.0f }, +}; +Vec3f D_801C0E7C = { 1100.0f, -700.0f, 0.0f }; + +// unused +Vec3f D_801C0E88 = { 1600.0f, -1700.0f, -70.0f }; + +Vec3f D_801C0E94 = { 1800.0f, -300.0f, 0.0f }; +Vec3f D_801C0EA0 = { 1300.0f, -400.0f, 0.0f }; +Vec3f D_801C0EAC = { 630.0f, 100.0f, -30.0f }; +Vec3s D_801C0EB8 = { 0, 0, 0x7FFF }; + +#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/Player_DrawBunnyHood.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80127B64.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80127BE8.s") +void func_80127DA4(PlayState* play, struct_801F58B0 arg1[], struct_80128388_arg1 arg2[], s32 arg3, Vec3f* arg4, + Vec3f* arg5, u32* arg6); #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80127DA4.s") +void func_80128388(struct_801F58B0 arg0[], struct_80128388_arg1 arg1[], s32 arg2, Mtx** arg3); #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80128388.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_801284A0.s") +void Player_DrawGreatFairysMask(PlayState* play, Player* player) { + s32 pad; + Mtx* sp90 = GRAPH_ALLOC(play->state.gfxCtx, 6 * sizeof(Mtx)); + Vec3f sp84; + Vec3f sp78; + Vec3f* iter = D_801C0C0C; + Vec3f* iter2 = D_801C0C30; + u32 sp6C = play->gameplayFrames; + s32 i; + + OPEN_DISPS(play->state.gfxCtx); + + gSPSegment(POLY_OPA_DISP++, 0x0B, sp90); + + Matrix_MultVec3f(&D_801C0C00, &D_801C0C54[1].unk_08); + Math_Vec3f_Lerp(&player->bodyPartsPos[7], &player->bodyPartsPos[0], 0.2f, &D_801C0C54[2].unk_08); + + for (i = 0; i < ARRAY_COUNT(D_801C0C0C); i++) { + Matrix_MultVec3f(iter, &sp84); + Matrix_MultVec3f(iter2, &sp78); + + func_80127DA4(play, D_801F58B0[i], D_801C0C54, 3, &sp84, &sp78, &sp6C); + sp6C += 11; + + Matrix_Push(); + Matrix_Translate(iter->x, iter->y, iter->z, MTXMODE_APPLY); + func_80128388(D_801F58B0[i], D_801C0C54, 3, &sp90); + Matrix_Pop(); + iter++; + iter2++; + } + + CLOSE_DISPS(play->state.gfxCtx); +} #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80128640.s") diff --git a/src/code/z_rcp.c b/src/code/z_rcp.c index ace1cc4cd..057424e3c 100644 --- a/src/code/z_rcp.c +++ b/src/code/z_rcp.c @@ -1,4 +1,5 @@ #include "global.h" +#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" Gfx sSetupDL[438] = { /* 0x00 */ @@ -1328,7 +1329,7 @@ void func_8012CF0C(GraphicsContext* gfxCtx, s32 clearFb, s32 clearZb, u8 r, u8 g } void func_8012D374(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b) { - if ((R_PAUSE_MENU_MODE < 2) && (D_801F6D10 < 2)) { + if ((R_PAUSE_BG_PRERENDER_STATE <= PAUSE_BG_PRERENDER_SETUP) && (D_801F6D10 < 2)) { func_8012CF0C(gfxCtx, true, true, r, g, b); } else { func_8012CF0C(gfxCtx, false, false, r, g, b); diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 1167f14ab..7cb180b80 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -216,7 +216,9 @@ void Scene_HeaderCmdEntranceList(PlayState* play, SceneCmd* cmd) { // SceneTableEntry Header Command 0x07: Special Files void Scene_HeaderCmdSpecialFiles(PlayState* play, SceneCmd* cmd) { - static RomFile tatlMessageFiles[2] = { + // @note These quest hint files are identical to OoT's. + // They are not relevant in this game and the system to process these scripts has been removed. + static RomFile naviQuestHintFiles[2] = { { SEGMENT_ROM_START(elf_message_field), SEGMENT_ROM_END(elf_message_field) }, { SEGMENT_ROM_START(elf_message_ydan), SEGMENT_ROM_END(elf_message_ydan) }, }; @@ -227,8 +229,8 @@ void Scene_HeaderCmdSpecialFiles(PlayState* play, SceneCmd* cmd) { gSegments[0x05] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[play->objectCtx.subKeepIndex].segment); } - if (cmd->specialFiles.cUpElfMsgNum != 0) { - play->unk_18868 = Play_LoadScene(play, &tatlMessageFiles[cmd->specialFiles.cUpElfMsgNum - 1]); + if (cmd->specialFiles.naviQuestHintFileId != NAVI_QUEST_HINTS_NONE) { + play->naviQuestHints = Play_LoadScene(play, &naviQuestHintFiles[cmd->specialFiles.naviQuestHintFileId - 1]); } } diff --git a/src/code/z_shrink_window.c b/src/code/z_shrink_window.c index acbdb5c5b..21d8bde40 100644 --- a/src/code/z_shrink_window.c +++ b/src/code/z_shrink_window.c @@ -2,7 +2,7 @@ * File: z_shrink_window.c * Description: Draws black top/bottom/side borders on the viewing window (e.g. Z-targeting, talking to NPC) */ -#include "prevent_bss_reordering.h" + #include "global.h" #include "z64shrink_window.h" diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index 3be9ff149..5cdc8d181 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -20,7 +20,7 @@ void ArmsHook_Draw(Actor* thisx, PlayState* play); void ArmsHook_Wait(ArmsHook* this, PlayState* play); void ArmsHook_Shoot(ArmsHook* this, PlayState* play); -const ActorInit Arms_Hook_InitVars = { +ActorInit Arms_Hook_InitVars = { ACTOR_ARMS_HOOK, ACTORCAT_ITEMACTION, FLAGS, @@ -107,9 +107,10 @@ void ArmsHook_DetachHookFromActor(ArmsHook* this) { s32 ArmsHook_CheckForCancel(ArmsHook* this) { Player* player = (Player*)this->actor.parent; + if (Player_IsHoldingHookshot(player)) { - if ((player->heldItemActionParam != player->itemActionParam) || ((player->actor.flags & ACTOR_FLAG_100)) || - ((player->stateFlags1 & 0x4000080))) { + if ((player->heldItemActionParam != player->itemActionParam) || (player->actor.flags & ACTOR_FLAG_100) || + (player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_4000000))) { this->timer = 0; ArmsHook_DetachHookFromActor(this); Math_Vec3f_Copy(&this->actor.world.pos, &player->rightHandWorld.pos); @@ -130,7 +131,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { if ((this->actor.parent == NULL) || (!Player_IsHoldingHookshot(player))) { ArmsHook_DetachHookFromActor(this); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -143,7 +144,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { if ((touchedActor->update != NULL) && (touchedActor->flags & (ACTOR_FLAG_200 | ACTOR_FLAG_400))) { if (this->collider.info.atHitInfo->bumperFlags & BUMP_HOOKABLE) { ArmsHook_AttachHookToActor(this, touchedActor); - if ((touchedActor->flags & ACTOR_FLAG_400) == ACTOR_FLAG_400) { + if (CHECK_FLAG_ALL(touchedActor->flags, ACTOR_FLAG_400)) { func_808C1154(this); } } @@ -155,28 +156,25 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { } if (DECR(this->timer) == 0) { - Actor* grabbed; + Actor* grabbed = this->grabbed; Vec3f bodyDistDiffVec; Vec3f newPos; f32 bodyDistDiff; f32 phi_f16; s32 pad; - grabbed = this->grabbed; if (grabbed != NULL) { if ((grabbed->update == NULL) || !CHECK_FLAG_ALL(grabbed->flags, ACTOR_FLAG_2000)) { grabbed = NULL; this->grabbed = NULL; - } else { - if (this->actor.child != NULL) { - f32 sp94 = Actor_DistanceBetweenActors(&this->actor, grabbed); - f32 sp90 = sqrtf(SQXYZ(this->unk1FC)); + } else if (this->actor.child != NULL) { + f32 sp94 = Actor_DistanceBetweenActors(&this->actor, grabbed); + f32 sp90 = sqrtf(SQXYZ(this->unk1FC)); - Math_Vec3f_Diff(&grabbed->world.pos, &this->unk1FC, &this->actor.world.pos); - if (50.0f < (sp94 - sp90)) { - ArmsHook_DetachHookFromActor(this); - grabbed = NULL; - } + Math_Vec3f_Diff(&grabbed->world.pos, &this->unk1FC, &this->actor.world.pos); + if (50.0f < (sp94 - sp90)) { + ArmsHook_DetachHookFromActor(this); + grabbed = NULL; } } } @@ -257,11 +255,10 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { this->actor.world.pos.z += 10.0f * nz; this->timer = 1; if (SurfaceType_IsHookshotSurface(&play->colCtx, poly, bgId)) { - { - DynaPolyActor* dynaPolyActor; - if (bgId != BGCHECK_SCENE && (dynaPolyActor = DynaPoly_GetActor(&play->colCtx, bgId)) != NULL) { - ArmsHook_AttachHookToActor(this, &dynaPolyActor->actor); - } + DynaPolyActor* dynaPolyActor; + + if ((bgId != BGCHECK_SCENE) && (dynaPolyActor = DynaPoly_GetActor(&play->colCtx, bgId)) != NULL) { + ArmsHook_AttachHookToActor(this, &dynaPolyActor->actor); } func_808C1154(this); Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_IT_HOOKSHOT_STICK_OBJ); @@ -269,12 +266,11 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { CollisionCheck_SpawnShieldParticlesMetal(play, &this->actor.world.pos); Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_IT_HOOKSHOT_REFLECT); } - } else { - if (CHECK_BTN_ANY(CONTROLLER1(&play->state)->press.button, - BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) { - s32 pad; - this->timer = 1; - } + } else if (CHECK_BTN_ANY(CONTROLLER1(&play->state)->press.button, + BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) { + s32 pad; + + this->timer = 1; } } } @@ -286,19 +282,19 @@ void ArmsHook_Update(Actor* thisx, PlayState* play) { this->unk1EC = this->unk1E0; } -static Vec3f D_808C1C10 = { 0.0f, 0.0f, 0.0f }; -static Vec3f D_808C1C1C = { 0.0f, 0.0f, 900.0f }; -static Vec3f D_808C1C28 = { 0.0f, 500.0f, -3000.0f }; -static Vec3f D_808C1C34 = { 0.0f, -500.0f, -3000.0f }; -static Vec3f D_808C1C40 = { 0.0f, 500.0f, 0.0f }; -static Vec3f D_808C1C4C = { 0.0f, -500.0f, 0.0f }; +Vec3f D_808C1C10 = { 0.0f, 0.0f, 0.0f }; +Vec3f D_808C1C1C = { 0.0f, 0.0f, 900.0f }; +Vec3f D_808C1C28 = { 0.0f, 500.0f, -3000.0f }; +Vec3f D_808C1C34 = { 0.0f, -500.0f, -3000.0f }; +Vec3f D_808C1C40 = { 0.0f, 500.0f, 0.0f }; +Vec3f D_808C1C4C = { 0.0f, -500.0f, 0.0f }; void ArmsHook_Draw(Actor* thisx, PlayState* play) { ArmsHook* this = THIS; f32 f0; Player* player = GET_PLAYER(play); - if (player->actor.draw != NULL && player->rightHandType == 0xB) { + if ((player->actor.draw != NULL) && (player->rightHandType == PLAYER_MODELTYPE_RH_HOOKSHOT)) { Vec3f sp68; Vec3f sp5C; Vec3f sp50; @@ -311,13 +307,13 @@ void ArmsHook_Draw(Actor* thisx, PlayState* play) { Matrix_MultVec3f(&D_808C1C10, &this->unk1E0); Matrix_MultVec3f(&D_808C1C28, &sp5C); Matrix_MultVec3f(&D_808C1C34, &sp50); - this->unk_1C4.active = false; + this->weaponInfo.active = false; } else { Matrix_MultVec3f(&D_808C1C1C, &this->unk1E0); Matrix_MultVec3f(&D_808C1C40, &sp5C); Matrix_MultVec3f(&D_808C1C4C, &sp50); } - func_80126440(play, &this->collider, &this->unk_1C4, &sp5C, &sp50); + func_80126440(play, &this->collider, &this->weaponInfo, &sp5C, &sp50); func_8012C28C(play->state.gfxCtx); func_80122868(play, player); diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h index 7afe3a2ce..31b675f41 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h @@ -10,7 +10,7 @@ typedef void (*ArmsHookActionFunc)(struct ArmsHook*, PlayState*); typedef struct ArmsHook { /* 0x000 */ Actor actor; /* 0x144 */ ColliderQuad collider; - /* 0x1C4 */ WeaponInfo unk_1C4; + /* 0x1C4 */ WeaponInfo weaponInfo; /* 0x1E0 */ Vec3f unk1E0; /* 0x1EC */ Vec3f unk1EC; /* 0x1F8 */ Actor* grabbed; @@ -20,6 +20,4 @@ typedef struct ArmsHook { /* 0x20C */ ArmsHookActionFunc actionFunc; } ArmsHook; // size = 0x210 -extern const ActorInit Arms_Hook_InitVars; - #endif // Z_ARMS_HOOK_H diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c index 9cf65349f..41a3f25ec 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -21,7 +21,7 @@ void FireArrow_Fly(ArrowFire* this, PlayState* play); #include "overlays/ovl_Arrow_fire/ovl_Arrow_Fire.c" -const ActorInit Arrow_Fire_InitVars = { +ActorInit Arrow_Fire_InitVars = { ACTOR_ARROW_FIRE, ACTORCAT_ITEMACTION, FLAGS, @@ -90,7 +90,7 @@ void FireArrow_ChargeAndWait(ArrowFire* this, PlayState* play) { EnArrow* arrow = (EnArrow*)this->actor.parent; if ((arrow == NULL) || (arrow->actor.update == NULL)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (this->radius < 10) { @@ -156,7 +156,7 @@ void FireArrow_Hit(ArrowFire* this, PlayState* play) { } if (this->timer == 0) { this->timer = 255; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (this->timer >= 13) { @@ -171,7 +171,7 @@ void FireArrow_Fly(ArrowFire* this, PlayState* play) { s32 pad2; if ((arrow == NULL) || (arrow->actor.update == NULL)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -194,7 +194,7 @@ void FireArrow_Fly(ArrowFire* this, PlayState* play) { } if (arrow->unk_260 < 34) { if (this->alpha < 35) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->alpha -= 25; @@ -205,7 +205,7 @@ void ArrowFire_Update(Actor* thisx, PlayState* play) { ArrowFire* this = (ArrowFire*)thisx; if ((play->msgCtx.msgMode == 0xE) || (play->msgCtx.msgMode == 0x12)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h index ce43cc5ed..1d0c09dcb 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h @@ -21,6 +21,4 @@ typedef struct ArrowFire { } ArrowFire; // size = 0x264 -extern const ActorInit Arrow_Fire_InitVars; - #endif // Z_ARROW_FIRE_H diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c index 88eddb39e..5c5cd0c87 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -23,7 +23,7 @@ void ArrowIce_Fly(ArrowIce* this, PlayState* play); s32 unused; // Needed for bss -const ActorInit Arrow_Ice_InitVars = { +ActorInit Arrow_Ice_InitVars = { ACTOR_ARROW_ICE, ACTORCAT_ITEMACTION, FLAGS, @@ -65,7 +65,7 @@ void ArrowIce_Charge(ArrowIce* this, PlayState* play) { EnArrow* arrow = (EnArrow*)this->actor.parent; if ((arrow == NULL) || (arrow->actor.update == NULL)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -136,7 +136,7 @@ void ArrowIce_Hit(ArrowIce* this, PlayState* play) { if (this->timer == 0) { this->timer = 255; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -146,7 +146,7 @@ void ArrowIce_Fly(ArrowIce* this, PlayState* play) { s32 pad; if ((arrow == NULL) || (arrow->actor.update == NULL)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } // copy position and rotation from arrow @@ -166,7 +166,7 @@ void ArrowIce_Fly(ArrowIce* this, PlayState* play) { this->alpha = 255; } else if (arrow->unk_260 < 34) { if (this->alpha < 35) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->alpha -= 25; } @@ -177,7 +177,7 @@ void ArrowIce_Update(Actor* thisx, PlayState* play) { ArrowIce* this = THIS; if ((play->msgCtx.msgMode == 0xE) || (play->msgCtx.msgMode == 0x12)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } else { this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h index a90cfe0ae..bf7a1ae51 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h @@ -18,6 +18,4 @@ typedef struct ArrowIce { /* 0x160 */ ArrowIceActionFunc actionFunc; } ArrowIce; // size = 0x164 -extern const ActorInit Arrow_Ice_InitVars; - #endif // Z_ARROW_ICE_H diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c index 9f974472f..b7918b5b4 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -21,7 +21,7 @@ void ArrowLight_Fly(ArrowLight* this, PlayState* play); #include "overlays/ovl_Arrow_Light/ovl_Arrow_Light.c" -const ActorInit Arrow_Light_InitVars = { +ActorInit Arrow_Light_InitVars = { ACTOR_ARROW_LIGHT, ACTORCAT_ITEMACTION, FLAGS, @@ -64,7 +64,7 @@ void ArrowLight_Charge(ArrowLight* this, PlayState* play) { EnArrow* arrow = (EnArrow*)this->actor.parent; if ((arrow == NULL) || (arrow->actor.update == NULL)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -129,7 +129,7 @@ void ArrowLight_Hit(ArrowLight* this, PlayState* play) { } if (this->timer == 0) { this->timer = 255; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -139,7 +139,7 @@ void ArrowLight_Fly(ArrowLight* this, PlayState* play) { s32 pad[2]; if ((arrow == NULL) || (arrow->actor.update == NULL)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -162,7 +162,7 @@ void ArrowLight_Fly(ArrowLight* this, PlayState* play) { } if (arrow->unk_260 < 34) { if (this->alpha < 35) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->alpha -= 25; @@ -173,7 +173,7 @@ void ArrowLight_Update(Actor* thisx, PlayState* play) { ArrowLight* this = THIS; if ((play->msgCtx.msgMode == 0xE) || (play->msgCtx.msgMode == 0x12)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h index bf58b1e40..0f42435ca 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h @@ -19,6 +19,4 @@ typedef struct ArrowLight { } ArrowLight; // size = 0x164 -extern const ActorInit Arrow_Light_InitVars; - #endif // Z_ARROW_LIGHT_H diff --git a/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c b/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c index ab7ac8a52..dcf37d848 100644 --- a/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c @@ -23,7 +23,7 @@ void func_80C0A418(BgAstrBombwall* this, PlayState* play); void func_80C0A458(BgAstrBombwall* this, PlayState* play); void func_80C0A4BC(BgAstrBombwall* this, PlayState* play); -const ActorInit Bg_Astr_Bombwall_InitVars = { +ActorInit Bg_Astr_Bombwall_InitVars = { ACTOR_BG_ASTR_BOMBWALL, ACTORCAT_BG, FLAGS, @@ -104,12 +104,12 @@ void BgAstrBombwall_Init(Actor* thisx, PlayState* play) { DynaPolyActor_LoadMesh(play, &this->dyna, &object_astr_obj_Colheader_002498); Collider_InitTris(play, &this->collider); if (Flags_GetSwitch(play, BGASTRBOMBWALL_GET_SWITCHFLAG(thisx))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } this->dyna.actor.flags |= ACTOR_FLAG_10000000; if (!Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInit, this->colliderElements)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } BgAstrBombwall_InitCollider(&sTrisInit, &this->dyna.actor.world.pos, &this->dyna.actor.shape.rot, &this->collider); diff --git a/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.h b/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.h index 58b60b944..4f42a8b3c 100644 --- a/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.h +++ b/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.h @@ -15,6 +15,4 @@ typedef struct BgAstrBombwall { /* 0x180 */ ColliderTrisElement colliderElements[2]; /* 0x238 */ s16 cutscenes[1]; } BgAstrBombwall; -extern const ActorInit Bg_Astr_Bombwall_InitVars; - #endif // Z_BG_ASTR_BOMBWALL_H diff --git a/src/overlays/actors/ovl_Bg_Botihasira/z_bg_botihasira.c b/src/overlays/actors/ovl_Bg_Botihasira/z_bg_botihasira.c index dfa31a6a0..a5168eb24 100644 --- a/src/overlays/actors/ovl_Bg_Botihasira/z_bg_botihasira.c +++ b/src/overlays/actors/ovl_Bg_Botihasira/z_bg_botihasira.c @@ -18,7 +18,7 @@ void BgBotihasira_Draw(Actor* thisx, PlayState* play); void BgBotihasira_DoNothing(BgBotihasira* this, PlayState* play); -const ActorInit Bg_Botihasira_InitVars = { +ActorInit Bg_Botihasira_InitVars = { ACTOR_BG_BOTIHASIRA, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Botihasira/z_bg_botihasira.h b/src/overlays/actors/ovl_Bg_Botihasira/z_bg_botihasira.h index 529b5a904..6cb290f65 100644 --- a/src/overlays/actors/ovl_Bg_Botihasira/z_bg_botihasira.h +++ b/src/overlays/actors/ovl_Bg_Botihasira/z_bg_botihasira.h @@ -13,6 +13,4 @@ typedef struct BgBotihasira { /* 0x160 */ ColliderCylinder collider; } BgBotihasira; // size = 0x1AC -extern const ActorInit Bg_Botihasira_InitVars; - #endif // Z_BG_BOTIHASIRA_H diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index 9a272e6aa..25f6d0a88 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -45,7 +45,7 @@ void func_808B7B54(Actor* thisx, PlayState* play); void func_808B7D34(Actor* thisx, PlayState* play); void BgBreakwall_Draw(Actor* thisx, PlayState* play); -const ActorInit Bg_Breakwall_InitVars = { +ActorInit Bg_Breakwall_InitVars = { ACTOR_BG_BREAKWALL, ACTORCAT_ITEMACTION, FLAGS, GAMEPLAY_KEEP, sizeof(BgBreakwall), (ActorFunc)BgBreakwall_Init, (ActorFunc)NULL, (ActorFunc)BgBreakwall_Update, (ActorFunc)NULL, @@ -216,7 +216,7 @@ void BgBreakwall_Init(Actor* thisx, PlayState* play) { this->unk_15C = Object_GetIndex(&play->objectCtx, sp24->unk_00); if ((this->unk_15C < 0) || !sp24->unk_14(this, play)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -286,7 +286,7 @@ void func_808B782C(BgBreakwall* this, PlayState* play) { void func_808B78A4(BgBreakwall* this, PlayState* play) { if (gSaveContext.save.weekEventReg[55] & 0x80) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h index 77c1b8808..bcdda2327 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h @@ -26,6 +26,4 @@ typedef struct BgBreakwall { /* 0x160 */ BgBreakwallActionFunc actionFunc; } BgBreakwall; // size = 0x164 -extern const ActorInit Bg_Breakwall_InitVars; - #endif // Z_BG_BREAKWALL_H diff --git a/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c b/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c index 9a4f0849a..da899ac26 100644 --- a/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c +++ b/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c @@ -41,7 +41,7 @@ typedef enum { u8 sIsLoaded[32]; -const ActorInit Bg_Crace_Movebg_InitVars = { +ActorInit Bg_Crace_Movebg_InitVars = { ACTOR_BG_CRACE_MOVEBG, ACTORCAT_BG, FLAGS, @@ -92,7 +92,7 @@ void BgCraceMovebg_Init(Actor* thisx, PlayState* play) { for (j = 0; j < sLoadedDoorCount; j++) { if (sIsLoaded[j] == this->index) { this->stateFlags |= BG_CRACE_MOVEBG_FLAG_ALREADY_LOADED; - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } } @@ -125,7 +125,7 @@ void BgCraceMovebg_Init(Actor* thisx, PlayState* play) { break; default: - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); break; } } diff --git a/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.h b/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.h index fb24b10d3..8f3b1aabe 100644 --- a/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.h +++ b/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.h @@ -38,6 +38,4 @@ typedef struct BgCraceMovebg { /* 0x188 */ Vec3f prevPlayerPos; } BgCraceMovebg; // size = 0x194 -extern const ActorInit Bg_Crace_Movebg_InitVars; - #endif // Z_BG_CRACE_MOVEBG_H diff --git a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c index 056af77bb..68b2d77d2 100644 --- a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c +++ b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c @@ -19,7 +19,7 @@ void BgCtowerGear_Draw(Actor* thisx, PlayState* play); void BgCtowerGear_UpdateOrgan(Actor* thisx, PlayState* play); void BgCtowerGear_DrawOrgan(Actor* thisx, PlayState* play); -const ActorInit Bg_Ctower_Gear_InitVars = { +ActorInit Bg_Ctower_Gear_InitVars = { ACTOR_BG_CTOWER_GEAR, ACTORCAT_PROP, FLAGS, @@ -174,7 +174,7 @@ void BgCtowerGear_UpdateOrgan(Actor* thisx, PlayState* play) { func_800C6314(play, &play->colCtx.dyna, this->dyna.bgId); break; case 3: - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); break; } } diff --git a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.h b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.h index 952a13c4a..afea1bf0d 100644 --- a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.h +++ b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.h @@ -19,6 +19,4 @@ typedef struct BgCtowerGear { /* 0x000 */ DynaPolyActor dyna; } BgCtowerGear; // size = 0x15C -extern const ActorInit Bg_Ctower_Gear_InitVars; - #endif // Z_BG_CTOWER_GEAR_H diff --git a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c index 2ca48b346..85dcb0aca 100644 --- a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c +++ b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c @@ -21,7 +21,7 @@ void BgCtowerRot_DoorDoNothing(BgCtowerRot* this, PlayState* play); void BgCtowerRot_DoorIdle(BgCtowerRot* this, PlayState* play); void BgCtowerRot_SetupDoorClose(BgCtowerRot* this, PlayState* play); -const ActorInit Bg_Ctower_Rot_InitVars = { +ActorInit Bg_Ctower_Rot_InitVars = { ACTOR_BG_CTOWER_ROT, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.h b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.h index e8b83fa22..52a905ed5 100644 --- a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.h +++ b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.h @@ -21,6 +21,4 @@ typedef struct BgCtowerRot { /* 0x164 */ f32 timer; } BgCtowerRot; // size = 0x168 -extern const ActorInit Bg_Ctower_Rot_InitVars; - #endif // Z_BG_CTOWER_ROT_H diff --git a/src/overlays/actors/ovl_Bg_Danpei_Movebg/z_bg_danpei_movebg.c b/src/overlays/actors/ovl_Bg_Danpei_Movebg/z_bg_danpei_movebg.c index a998936ec..a5d01fe65 100644 --- a/src/overlays/actors/ovl_Bg_Danpei_Movebg/z_bg_danpei_movebg.c +++ b/src/overlays/actors/ovl_Bg_Danpei_Movebg/z_bg_danpei_movebg.c @@ -15,7 +15,7 @@ void BgDanpeiMovebg_Destroy(Actor* thisx, PlayState* play); void BgDanpeiMovebg_Update(Actor* thisx, PlayState* play); #if 0 -const ActorInit Bg_Danpei_Movebg_InitVars = { +ActorInit Bg_Danpei_Movebg_InitVars = { ACTOR_BG_DANPEI_MOVEBG, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Danpei_Movebg/z_bg_danpei_movebg.h b/src/overlays/actors/ovl_Bg_Danpei_Movebg/z_bg_danpei_movebg.h index 1bdf17933..c99bb813f 100644 --- a/src/overlays/actors/ovl_Bg_Danpei_Movebg/z_bg_danpei_movebg.h +++ b/src/overlays/actors/ovl_Bg_Danpei_Movebg/z_bg_danpei_movebg.h @@ -15,6 +15,4 @@ typedef struct BgDanpeiMovebg { /* 0x1CE */ char unk_1CE[0xA]; } BgDanpeiMovebg; // size = 0x1D8 -extern const ActorInit Bg_Danpei_Movebg_InitVars; - #endif // Z_BG_DANPEI_MOVEBG_H diff --git a/src/overlays/actors/ovl_Bg_Dblue_Balance/z_bg_dblue_balance.c b/src/overlays/actors/ovl_Bg_Dblue_Balance/z_bg_dblue_balance.c index d7e1bef1f..c962cf8ef 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Balance/z_bg_dblue_balance.c +++ b/src/overlays/actors/ovl_Bg_Dblue_Balance/z_bg_dblue_balance.c @@ -30,7 +30,7 @@ void func_80B83758(Actor* thisx, PlayState* play); AnimatedMaterial* D_80B83C70; AnimatedMaterial* D_80B83C74; -const ActorInit Bg_Dblue_Balance_InitVars = { +ActorInit Bg_Dblue_Balance_InitVars = { ACTOR_BG_DBLUE_BALANCE, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Dblue_Balance/z_bg_dblue_balance.h b/src/overlays/actors/ovl_Bg_Dblue_Balance/z_bg_dblue_balance.h index 098f96770..f2200e96f 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Balance/z_bg_dblue_balance.h +++ b/src/overlays/actors/ovl_Bg_Dblue_Balance/z_bg_dblue_balance.h @@ -44,6 +44,4 @@ typedef struct BgDblueBalance { /* 0x228 */ f32 unk_228; } BgDblueBalance; // size = 0x22C -extern const ActorInit Bg_Dblue_Balance_InitVars; - #endif // Z_BG_DBLUE_BALANCE_H diff --git a/src/overlays/actors/ovl_Bg_Dblue_Elevator/z_bg_dblue_elevator.c b/src/overlays/actors/ovl_Bg_Dblue_Elevator/z_bg_dblue_elevator.c index a945160f0..a1d724b29 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Elevator/z_bg_dblue_elevator.c +++ b/src/overlays/actors/ovl_Bg_Dblue_Elevator/z_bg_dblue_elevator.c @@ -16,7 +16,7 @@ void BgDblueElevator_Update(Actor* thisx, PlayState* play); void BgDblueElevator_Draw(Actor* thisx, PlayState* play); #if 0 -const ActorInit Bg_Dblue_Elevator_InitVars = { +ActorInit Bg_Dblue_Elevator_InitVars = { ACTOR_BG_DBLUE_ELEVATOR, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Dblue_Elevator/z_bg_dblue_elevator.h b/src/overlays/actors/ovl_Bg_Dblue_Elevator/z_bg_dblue_elevator.h index db6cba5b4..89a18dd0c 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Elevator/z_bg_dblue_elevator.h +++ b/src/overlays/actors/ovl_Bg_Dblue_Elevator/z_bg_dblue_elevator.h @@ -14,6 +14,4 @@ typedef struct BgDblueElevator { /* 0x160 */ char unk_160[0x10]; } BgDblueElevator; // size = 0x170 -extern const ActorInit Bg_Dblue_Elevator_InitVars; - #endif // Z_BG_DBLUE_ELEVATOR_H diff --git a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c index 44e38f0da..31c0c387d 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c +++ b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c @@ -45,7 +45,7 @@ u8 D_80A2B870[][2] = { { 0x03, 0x03 }, { 0x03, 0x05 }, { 0x03, 0x01 }, { 0x03, 0x06 }, { 0x03, 0x02 }, { 0x03, 0x04 }, { 0x03, 0x00 }, }; -const ActorInit Bg_Dblue_Movebg_InitVars = { +ActorInit Bg_Dblue_Movebg_InitVars = { ACTOR_BG_DBLUE_MOVEBG, ACTORCAT_BG, FLAGS, @@ -167,7 +167,7 @@ void BgDblueMovebg_Init(Actor* thisx, PlayState* play) { if ((this->unk_160 == 9) || (this->unk_160 == 8)) { if (D_80A2BBF4.unk_00 != 0) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } this->unk_170 = this->dyna.actor.room; @@ -178,7 +178,7 @@ void BgDblueMovebg_Init(Actor* thisx, PlayState* play) { this->dyna.actor.shape.rot.z = 0; } else if (this->unk_160 == 6) { if (D_80A2BBF4.unk_01 != 0) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } this->unk_171 = this->dyna.actor.world.rot.z; @@ -238,7 +238,7 @@ void BgDblueMovebg_Init(Actor* thisx, PlayState* play) { this->dyna.actor.world.rot.z = 0; this->dyna.actor.shape.rot.z = 0; if (Flags_GetSwitch(play, this->unk_1C0)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); break; } this->unk_18C = 0; @@ -350,7 +350,7 @@ void func_80A2A1E0(BgDblueMovebg* this, PlayState* play) { if (play->roomCtx.curRoom.num != this->unk_171) { if ((play->roomCtx.prevRoom.num != this->unk_170) && (play->roomCtx.prevRoom.num != this->unk_171)) { D_80A2BBF4.unk_01 = 0; - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } } @@ -390,7 +390,7 @@ void func_80A2A32C(BgDblueMovebg* this, PlayState* play) { this->unk_172 |= 8; this->actionFunc = func_80A2A444; } else { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } @@ -410,7 +410,7 @@ void func_80A2A444(BgDblueMovebg* this, PlayState* play) { this->dyna.actor.shape.rot.y = (s32)((this->unk_18C + temp_v0) * 0.1f * (0x10000 / 360.0f)) + this->dyna.actor.home.rot.y; - if ((player->stateFlags2 & 0x10) && (this->unk_184 > 0.0f)) { + if ((player->stateFlags2 & PLAYER_STATE2_10) && (this->unk_184 > 0.0f)) { player->actor.world.pos.x = (Math_SinS(this->dyna.actor.shape.rot.y - this->unk_18E) * this->unk_184) + this->dyna.actor.home.pos.x; player->actor.world.pos.z = @@ -420,7 +420,7 @@ void func_80A2A444(BgDblueMovebg* this, PlayState* play) { } if (sp20) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; Flags_SetSwitch(play, this->unk_1C0); Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); @@ -452,7 +452,7 @@ void func_80A2A688(BgDblueMovebg* this, PlayState* play) { if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 60.0f, 2.0f) && (this->unk_180 <= 0)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } @@ -498,7 +498,7 @@ void func_80A2A7F8(BgDblueMovebg* this, PlayState* play) { this->dyna.actor.shape.rot.y = (s32)((this->unk_18C + sp26) * 0.1f * (0x10000 / 360.0f)) + this->dyna.actor.home.rot.y; - if ((player->stateFlags2 & 0x10) && (this->unk_184 > 0.0f)) { + if ((player->stateFlags2 & PLAYER_STATE2_10) && (this->unk_184 > 0.0f)) { player->actor.world.pos.x = (Math_SinS(this->dyna.actor.shape.rot.y - this->unk_18E) * this->unk_184) + this->dyna.actor.home.pos.x; player->actor.world.pos.z = @@ -516,8 +516,8 @@ void func_80A2A7F8(BgDblueMovebg* this, PlayState* play) { Flags_UnsetSwitch(play, this->unk_1C0); } - player->stateFlags1 |= 0x20; - player->stateFlags2 &= ~0x10; + player->stateFlags1 |= PLAYER_STATE1_20; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; this->unk_18C = (this->unk_18C + sp26 + 3600) % 3600; @@ -565,12 +565,12 @@ void func_80A2AAB8(BgDblueMovebg* this, PlayState* play) { if (this->unk_1D0 == 1) { this->dyna.pushForce = 0.0f; - player->stateFlags1 |= 0x20; - player->stateFlags2 &= ~0x10; + player->stateFlags1 |= PLAYER_STATE1_20; + player->stateFlags2 &= ~PLAYER_STATE2_10; } if (this->unk_1D0 <= 0) { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->actionFunc = func_80A2A714; } } @@ -632,7 +632,7 @@ void func_80A2AED0(BgDblueMovebg* this, PlayState* play) { if (play->roomCtx.curRoom.num != this->unk_171) { if ((play->roomCtx.prevRoom.num != this->unk_170) && (play->roomCtx.prevRoom.num != this->unk_171)) { D_80A2BBF4.unk_00 = 0; - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } } @@ -733,7 +733,7 @@ void func_80A2B274(Actor* thisx, PlayState* play) { s16 temp_v1; if (this != D_80A2BBF0) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } diff --git a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.h b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.h index 6b5351c2c..8fc016585 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.h +++ b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.h @@ -55,6 +55,4 @@ typedef struct BgDblueMovebg { /* 0x310 */ UNK_TYPE1 unk310[0x60]; } BgDblueMovebg; // size = 0x370 -extern const ActorInit Bg_Dblue_Movebg_InitVars; - #endif // Z_BG_DBLUE_MOVEBG_H diff --git a/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.c b/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.c index a2fa18103..b4c97fdde 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.c +++ b/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.c @@ -25,7 +25,7 @@ void func_80B84BCC(BgDblueWaterfall* this, PlayState* play); void func_80B84EF0(BgDblueWaterfall* this, PlayState* play); void func_80B84F20(BgDblueWaterfall* this, PlayState* play); -const ActorInit Bg_Dblue_Waterfall_InitVars = { +ActorInit Bg_Dblue_Waterfall_InitVars = { ACTOR_BG_DBLUE_WATERFALL, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.h b/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.h index c02b82619..5ab64495e 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.h +++ b/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.h @@ -28,6 +28,4 @@ typedef struct BgDblueWaterfall { /* 0x1A8 */ f32 unk_1A8; } BgDblueWaterfall; // size = 0x1AC -extern const ActorInit Bg_Dblue_Waterfall_InitVars; - #endif // Z_BG_DBLUE_WATERFALL_H diff --git a/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.c b/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.c index adeba93c8..6ec845e2c 100644 --- a/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.c +++ b/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.c @@ -5,6 +5,8 @@ */ #include "z_bg_dkjail_ivy.h" +#include "assets/objects/gameplay_keep/gameplay_keep.h" +#include "assets/objects/object_dkjail_obj/object_dkjail_obj.h" #define FLAGS 0x00000000 @@ -15,8 +17,14 @@ void BgDkjailIvy_Destroy(Actor* thisx, PlayState* play); void BgDkjailIvy_Update(Actor* thisx, PlayState* play); void BgDkjailIvy_Draw(Actor* thisx, PlayState* play); -#if 0 -const ActorInit Bg_Dkjail_Ivy_InitVars = { +void BgDkjailIvy_SetupWaitForCut(BgDkjailIvy* this); +void BgDkjailIvy_WaitForCut(BgDkjailIvy* this, PlayState* play); +void BgDkjailIvy_SetupCutscene(BgDkjailIvy* this); +void BgDkjailIvy_BeginCutscene(BgDkjailIvy* this, PlayState* play); +void BgDkjailIvy_SetupFadeOut(BgDkjailIvy* this); +void BgDkjailIvy_FadeOut(BgDkjailIvy* this, PlayState* play); + +ActorInit Bg_Dkjail_Ivy_InitVars = { ACTOR_BG_DKJAIL_IVY, ACTORCAT_BG, FLAGS, @@ -28,47 +36,175 @@ const ActorInit Bg_Dkjail_Ivy_InitVars = { (ActorFunc)BgDkjailIvy_Draw, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80ADE950 = { - { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, OC2_NONE, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x01000200, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, }, +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x01000200, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { 20, 80, 0, { 0, 0, 0 } }, }; -// static InitChainEntry sInitChain[] = { -static InitChainEntry D_80ADE98C[] = { +void BgDkjailIvy_IvyCutEffects(BgDkjailIvy* this, PlayState* play) { + static Gfx* sLeafDlists[] = { gKakeraLeafMiddle, gKakeraLeafTip }; + static s16 sLeafScales[] = { 110, 80, 60, 40 }; + f32 phi_fs0; + s32 i; + Vec3f spD4; + Vec3f pos; + Vec3f vel; + Vec3f accel; + s16 angle; + + Matrix_RotateYS(this->dyna.actor.home.rot.y, MTXMODE_NEW); + + for (i = 0, angle = 0; i < 50; i++, angle += 0x4E20) { + spD4.y = (i * (90.0f / 49.0f)) + 2.0f; + if (spD4.y < 45.0f) { + phi_fs0 = ((1.0f / 180.0f) * spD4.y) + 0.75f; + } else if (spD4.y < 90.0f) { + phi_fs0 = ((-1.0f / 180.0f) * spD4.y) + 1.25f; + } else { + phi_fs0 = ((-1.0f / 30.0f) * spD4.y) + 3.75f; + } + + spD4.x = Math_SinS(angle) * 40.0f * phi_fs0; + spD4.z = (Rand_ZeroOne() * 6.0f) - 3.0f; + + Matrix_MultVec3f(&spD4, &pos); + + vel.x = (Rand_ZeroOne() - 0.5f) + (pos.x * 0.075f); + vel.y = 2.0f * Rand_ZeroOne(); + vel.z = (Rand_ZeroOne() - 0.5f) + (pos.z * 0.075f); + + pos.x += this->dyna.actor.world.pos.x; + pos.y += this->dyna.actor.world.pos.y; + pos.z += this->dyna.actor.world.pos.z; + + EffectSsKakera_Spawn(play, &pos, &vel, &pos, -0x82, 0x40, 0x28, 0, 0, sLeafScales[i & 3], 0, 0, 44, -1, + GAMEPLAY_KEEP, sLeafDlists[(s32)Rand_Next() > 0]); + + if ((i > 20) && ((i % 2) != 0)) { + accel.x = (Rand_ZeroOne() - 0.5f) * 0.2f; + accel.y = (Rand_ZeroOne() * 0.02f) - 0.1f; + accel.z = (Rand_ZeroOne() - 0.5f) * 0.2f; + + func_800B12F0(play, &pos, &gZeroVec3f, &accel, ((Rand_Next() >> 26) + 10), (Rand_Next() >> 28), 50); + } + } +} + +static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 200, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 200, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -#endif +void BgDkjailIvy_Init(Actor* thisx, PlayState* play) { + s32 pad; + BgDkjailIvy* this = THIS; -extern ColliderCylinderInit D_80ADE950; -extern InitChainEntry D_80ADE98C[]; + Actor_ProcessInitChain(&this->dyna.actor, sInitChain); + DynaPolyActor_Init(&this->dyna, 0); + Collider_InitCylinder(play, &this->collider); -extern UNK_TYPE D_06000080; -extern UNK_TYPE D_060011A8; + if (Flags_GetSwitch(play, BG_DKJAIL_GET_SWITCH(thisx))) { + Actor_Kill(&this->dyna.actor); + } else { + DynaPolyActor_LoadMesh(play, &this->dyna, &object_dkjail_obj_Colheader_0011A8); + Collider_SetCylinder(play, &this->collider, &this->dyna.actor, &sCylinderInit); + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); + this->alpha = 255; + BgDkjailIvy_SetupWaitForCut(this); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/func_80ADE230.s") +void BgDkjailIvy_Destroy(Actor* thisx, PlayState* play) { + BgDkjailIvy* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/BgDkjailIvy_Init.s") + DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); + Collider_DestroyCylinder(play, &this->collider); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/BgDkjailIvy_Destroy.s") +void BgDkjailIvy_SetupWaitForCut(BgDkjailIvy* this) { + this->actionFunc = BgDkjailIvy_WaitForCut; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/func_80ADE6AC.s") +void BgDkjailIvy_WaitForCut(BgDkjailIvy* this, PlayState* play) { + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + this->dyna.actor.flags |= ACTOR_FLAG_10; + ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + BgDkjailIvy_SetupCutscene(this); + } else { + CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/func_80ADE6C0.s") +void BgDkjailIvy_SetupCutscene(BgDkjailIvy* this) { + this->actionFunc = BgDkjailIvy_BeginCutscene; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/func_80ADE734.s") +void BgDkjailIvy_BeginCutscene(BgDkjailIvy* this, PlayState* play) { + if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { + ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + this->fadeOutTimer = 50; + func_800C62BC(play, &play->colCtx.dyna, this->dyna.bgId); + Flags_SetSwitch(play, BG_DKJAIL_GET_SWITCH(&this->dyna.actor)); + BgDkjailIvy_IvyCutEffects(this, play); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_GRASS_WALL_BROKEN); + BgDkjailIvy_SetupFadeOut(this); + } else { + ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/func_80ADE748.s") +void BgDkjailIvy_SetupFadeOut(BgDkjailIvy* this) { + this->actionFunc = BgDkjailIvy_FadeOut; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/func_80ADE7E0.s") +void BgDkjailIvy_FadeOut(BgDkjailIvy* this, PlayState* play) { + if (this->alpha > 8) { + this->alpha -= 8; + } else { + this->alpha = 0; + this->dyna.actor.draw = NULL; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/func_80ADE7F4.s") + this->fadeOutTimer--; + if (this->fadeOutTimer <= 0) { + Actor_Kill(&this->dyna.actor); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/BgDkjailIvy_Update.s") +void BgDkjailIvy_Update(Actor* thisx, PlayState* play) { + BgDkjailIvy* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dkjail_Ivy/BgDkjailIvy_Draw.s") + this->actionFunc(this, play); +} + +void BgDkjailIvy_Draw(Actor* thisx, PlayState* play) { + BgDkjailIvy* this = THIS; + + OPEN_DISPS(play->state.gfxCtx); + + func_8012C2DC(play->state.gfxCtx); + + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0xFF, 255, 255, 255, this->alpha); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_XLU_DISP++, &gDkjailIvyDL); + + CLOSE_DISPS(play->state.gfxCtx); +} diff --git a/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.h b/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.h index c4d824dc0..4835b7a0b 100644 --- a/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.h +++ b/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.h @@ -3,17 +3,18 @@ #include "global.h" +#define BG_DKJAIL_GET_SWITCH(thisx) ((thisx)->params & 0x7F) + struct BgDkjailIvy; typedef void (*BgDkjailIvyActionFunc)(struct BgDkjailIvy*, PlayState*); typedef struct BgDkjailIvy { - /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x64]; + /* 0x000 */ DynaPolyActor dyna; + /* 0x15C */ ColliderCylinder collider; /* 0x1A8 */ BgDkjailIvyActionFunc actionFunc; - /* 0x1AC */ char unk_1AC[0x4]; + /* 0x1AC */ s8 fadeOutTimer; + /* 0x1AD */ u8 alpha; } BgDkjailIvy; // size = 0x1B0 -extern const ActorInit Bg_Dkjail_Ivy_InitVars; - #endif // Z_BG_DKJAIL_IVY_H diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index b1bdc822c..332e4e543 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -26,7 +26,7 @@ void func_80A0B8CC(BgDyYoseizo* this, PlayState* play); void func_80A0BB08(BgDyYoseizo* this, PlayState* play); #if 0 -const ActorInit Bg_Dy_Yoseizo_InitVars = { +ActorInit Bg_Dy_Yoseizo_InitVars = { ACTOR_BG_DY_YOSEIZO, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h index 5d9d84749..bd06cdb38 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h @@ -13,6 +13,4 @@ typedef struct BgDyYoseizo { /* 0x0148 */ char unk_148[0x33BC]; } BgDyYoseizo; // size = 0x3504 -extern const ActorInit Bg_Dy_Yoseizo_InitVars; - #endif // Z_BG_DY_YOSEIZO_H diff --git a/src/overlays/actors/ovl_Bg_F40_Block/z_bg_f40_block.c b/src/overlays/actors/ovl_Bg_F40_Block/z_bg_f40_block.c index 4d2a8632e..71aa958dc 100644 --- a/src/overlays/actors/ovl_Bg_F40_Block/z_bg_f40_block.c +++ b/src/overlays/actors/ovl_Bg_F40_Block/z_bg_f40_block.c @@ -26,7 +26,7 @@ void func_80BC44F4(BgF40Block* this, PlayState* play); void func_80BC4530(BgF40Block* this, PlayState* play); void func_80BC457C(BgF40Block* this, PlayState* play); -const ActorInit Bg_F40_Block_InitVars = { +ActorInit Bg_F40_Block_InitVars = { ACTOR_BG_F40_BLOCK, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_F40_Block/z_bg_f40_block.h b/src/overlays/actors/ovl_Bg_F40_Block/z_bg_f40_block.h index df21bf933..37a5c360e 100644 --- a/src/overlays/actors/ovl_Bg_F40_Block/z_bg_f40_block.h +++ b/src/overlays/actors/ovl_Bg_F40_Block/z_bg_f40_block.h @@ -19,6 +19,4 @@ typedef struct BgF40Block { /* 0x16C */ BgF40BlockActionFunc actionFunc; } BgF40Block; // size = 0x170 -extern const ActorInit Bg_F40_Block_InitVars; - #endif // Z_BG_F40_BLOCK_H diff --git a/src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.c b/src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.c index 3974b2fc5..4ae6a8ed7 100644 --- a/src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.c +++ b/src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.c @@ -19,7 +19,7 @@ void BgF40Flift_Draw(Actor* thisx, PlayState* play); void func_808D75F0(BgF40Flift* this, PlayState* play); void func_808D7714(BgF40Flift* this, PlayState* play); -const ActorInit Bg_F40_Flift_InitVars = { +ActorInit Bg_F40_Flift_InitVars = { ACTOR_BG_F40_FLIFT, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.h b/src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.h index 95b2e9073..4bdb16e3e 100644 --- a/src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.h +++ b/src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.h @@ -13,6 +13,4 @@ typedef struct BgF40Flift { /* 0x160 */ s32 timer; } BgF40Flift; // size = 0x164 -extern const ActorInit Bg_F40_Flift_InitVars; - #endif // Z_BG_F40_FLIFT_H diff --git a/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.c b/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.c index 7838dadb7..3a7916e7d 100644 --- a/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.c +++ b/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.c @@ -24,7 +24,7 @@ void BgF40Switch_Press(BgF40Switch* this, PlayState* play); void BgF40Switch_WaitToPress(BgF40Switch* this, PlayState* play); void BgF40Switch_IdleUnpressed(BgF40Switch* this, PlayState* play); -const ActorInit Bg_F40_Switch_InitVars = { +ActorInit Bg_F40_Switch_InitVars = { ACTOR_BG_F40_SWITCH, ACTORCAT_SWITCH, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.h b/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.h index b0fe89341..cfa8c5462 100644 --- a/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.h +++ b/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.h @@ -20,6 +20,4 @@ typedef struct BgF40Switch { /* 0x164 */ BgF40SwitchActionFunc actionFunc; } BgF40Switch; // size = 0x168 -extern const ActorInit Bg_F40_Switch_InitVars; - #endif // Z_BG_F40_SWITCH_H diff --git a/src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.c b/src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.c index 16b39cdd3..97fd3f068 100644 --- a/src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.c +++ b/src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.c @@ -16,7 +16,7 @@ void BgF40Swlift_Update(Actor* thisx, PlayState* play); void BgF40Swlift_Draw(Actor* thisx, PlayState* play); #if 0 -const ActorInit Bg_F40_Swlift_InitVars = { +ActorInit Bg_F40_Swlift_InitVars = { ACTOR_BG_F40_SWLIFT, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.h b/src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.h index 48a369e30..a687fc642 100644 --- a/src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.h +++ b/src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.h @@ -10,6 +10,4 @@ typedef struct BgF40Swlift { /* 0x144 */ char unk_144[0x1C]; } BgF40Swlift; // size = 0x160 -extern const ActorInit Bg_F40_Swlift_InitVars; - #endif // Z_BG_F40_SWLIFT_H diff --git a/src/overlays/actors/ovl_Bg_Fire_Wall/z_bg_fire_wall.c b/src/overlays/actors/ovl_Bg_Fire_Wall/z_bg_fire_wall.c index 1ad295e68..40b8c78a7 100644 --- a/src/overlays/actors/ovl_Bg_Fire_Wall/z_bg_fire_wall.c +++ b/src/overlays/actors/ovl_Bg_Fire_Wall/z_bg_fire_wall.c @@ -21,7 +21,7 @@ void func_809AC638(BgFireWall* this, PlayState* play); void func_809AC68C(BgFireWall* this, PlayState* play); void func_809AC6C0(BgFireWall* this, PlayState* play); -const ActorInit Bg_Fire_Wall_InitVars = { +ActorInit Bg_Fire_Wall_InitVars = { ACTOR_BG_FIRE_WALL, ACTORCAT_BG, FLAGS, @@ -166,7 +166,7 @@ void func_809AC7F8(BgFireWall* this, PlayState* play) { void func_809AC970(BgFireWall* this, PlayState* play) { if (Math_StepToF(&this->actor.scale.y, 0.005f, this->unk_158)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -193,7 +193,7 @@ void BgFireWall_Update(Actor* thisx, PlayState* play2) { if (this->actionFunc != func_809AC970) { if (this->actor.parent != NULL) { EnEncount4* parent = (EnEncount4*)this->actor.parent; - if ((parent->actor.update != NULL) && (parent->unk_150 != 0)) { + if ((parent->actor.update != NULL) && (parent->timer != 0)) { this->actionFunc = func_809AC970; } } diff --git a/src/overlays/actors/ovl_Bg_Fire_Wall/z_bg_fire_wall.h b/src/overlays/actors/ovl_Bg_Fire_Wall/z_bg_fire_wall.h index 018e9f5f1..af5a29923 100644 --- a/src/overlays/actors/ovl_Bg_Fire_Wall/z_bg_fire_wall.h +++ b/src/overlays/actors/ovl_Bg_Fire_Wall/z_bg_fire_wall.h @@ -7,6 +7,11 @@ struct BgFireWall; typedef void (*BgFireWallActionFunc)(struct BgFireWall*, PlayState*); +typedef enum { + /* 0 */ BGFIREWALL_PARAMS_0, + /* 1 */ BGFIREWALL_PARAMS_1, +} BgFireWallParams; + typedef struct BgFireWall { /* 0x000 */ Actor actor; /* 0x144 */ BgFireWallActionFunc actionFunc; @@ -21,6 +26,4 @@ typedef struct BgFireWall { /* 0x164 */ ColliderCylinder collider; } BgFireWall; // size = 0x1B0 -extern const ActorInit Bg_Fire_Wall_InitVars; - #endif // Z_BG_FIRE_WALL_H diff --git a/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c b/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c index a98025524..40a981a6e 100644 --- a/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c +++ b/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c @@ -16,7 +16,7 @@ void BgFuKaiten_Destroy(Actor* thisx, PlayState* play); void BgFuKaiten_Update(Actor* thisx, PlayState* play); void BgFuKaiten_Draw(Actor* thisx, PlayState* play); -const ActorInit Bg_Fu_Kaiten_InitVars = { +ActorInit Bg_Fu_Kaiten_InitVars = { ACTOR_BG_FU_KAITEN, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.h b/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.h index 6937fbf53..b09083519 100644 --- a/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.h +++ b/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.h @@ -15,6 +15,4 @@ typedef struct BgFuKaiten { /* 0x16C */ s16 bounce; } BgFuKaiten; // size = 0x170 -extern const ActorInit Bg_Fu_Kaiten_InitVars; - #endif // Z_BG_FU_KAITEN_H diff --git a/src/overlays/actors/ovl_Bg_Fu_Mizu/z_bg_fu_mizu.c b/src/overlays/actors/ovl_Bg_Fu_Mizu/z_bg_fu_mizu.c index c485927ce..5cb337238 100644 --- a/src/overlays/actors/ovl_Bg_Fu_Mizu/z_bg_fu_mizu.c +++ b/src/overlays/actors/ovl_Bg_Fu_Mizu/z_bg_fu_mizu.c @@ -16,7 +16,7 @@ void BgFuMizu_Destroy(Actor* thisx, PlayState* play); void BgFuMizu_Update(Actor* thisx, PlayState* play); void BgFuMizu_Draw(Actor* thisx, PlayState* play); -const ActorInit Bg_Fu_Mizu_InitVars = { +ActorInit Bg_Fu_Mizu_InitVars = { ACTOR_BG_FU_MIZU, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Fu_Mizu/z_bg_fu_mizu.h b/src/overlays/actors/ovl_Bg_Fu_Mizu/z_bg_fu_mizu.h index 89b1df323..d17f64638 100644 --- a/src/overlays/actors/ovl_Bg_Fu_Mizu/z_bg_fu_mizu.h +++ b/src/overlays/actors/ovl_Bg_Fu_Mizu/z_bg_fu_mizu.h @@ -11,6 +11,4 @@ typedef struct BgFuMizu { /* 0x160 */ s16 unk_160; } BgFuMizu; // size = 0x164 -extern const ActorInit Bg_Fu_Mizu_InitVars; - #endif // Z_BG_FU_MIZU_H diff --git a/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c b/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c index fbae48df2..cfd9003ec 100644 --- a/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c +++ b/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c @@ -23,7 +23,7 @@ void BgGoronOyu_UpdateWaterBoxInfo(BgGoronOyu* this, PlayState* play); void BgGoronOyu_SpawnEffects(BgGoronOyu* this, PlayState* play); void func_80B40160(BgGoronOyu* this, PlayState* play); -const ActorInit Bg_Goron_Oyu_InitVars = { +ActorInit Bg_Goron_Oyu_InitVars = { ACTOR_BG_GORON_OYU, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.c b/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.c index f494131d9..10cea7035 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.c @@ -24,7 +24,7 @@ void BgHakaBombwall_PlayCutscene(BgHakaBombwall* this, PlayState* play); void BgHakaBombwall_SetupEndCutscene(BgHakaBombwall* this); void BgHakaBombwall_EndCutscene(BgHakaBombwall* this, PlayState* play); -const ActorInit Bg_Haka_Bombwall_InitVars = { +ActorInit Bg_Haka_Bombwall_InitVars = { ACTOR_BG_HAKA_BOMBWALL, ACTORCAT_BG, FLAGS, @@ -137,7 +137,7 @@ void func_80BD5E6C(BgHakaBombwall* this, PlayState* play) { } EffectSsKakera_Spawn(play, &spE0, &spD4, &spE0, gravity, phi_s0, 30, 0, 0, D_80BD64CC[i & 3], phi_t0, 0, 50, -1, - OBJECT_IKANA_OBJ, object_haka_obj_DL_001680); + OBJECT_HAKA_OBJ, object_haka_obj_DL_001680); } Matrix_Pop(); @@ -154,7 +154,7 @@ void BgHakaBombwall_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); Collider_InitCylinder(play, &this->collider); if (Flags_GetSwitch(play, BGHAKABOMBWALL_GET_7F(thisx))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } else { DynaPolyActor_LoadMesh(play, &this->dyna, &object_haka_obj_Colheader_000148); Collider_SetCylinder(play, &this->collider, &this->dyna.actor, &sCylinderInit); @@ -211,7 +211,7 @@ void BgHakaBombwall_EndCutscene(BgHakaBombwall* this, PlayState* play) { this->csTimer--; if (this->csTimer <= 0) { ActorCutscene_Stop(this->dyna.actor.cutscene); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.h b/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.h index 6a37e3625..9e5bd1c43 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.h +++ b/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.h @@ -16,6 +16,4 @@ typedef struct BgHakaBombwall { /* 0x1AC */ s8 csTimer; } BgHakaBombwall; // size = 0x1B0 -extern const ActorInit Bg_Haka_Bombwall_InitVars; - #endif // Z_BG_HAKA_BOMBWALL_H diff --git a/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c b/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c index cc90ccd94..412ea3a39 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c +++ b/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c @@ -26,7 +26,7 @@ void func_80B6DD9C(BgHakaCurtain* this, PlayState* play); void func_80B6DEA8(BgHakaCurtain* this, PlayState* play); void func_80B6DE80(BgHakaCurtain* this); -const ActorInit Bg_Haka_Curtain_InitVars = { +ActorInit Bg_Haka_Curtain_InitVars = { ACTOR_BG_HAKA_CURTAIN, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.h b/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.h index 4b5e564b2..ab5ec0e89 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.h +++ b/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.h @@ -12,6 +12,4 @@ typedef struct BgHakaCurtain { /* 0x15C */ BgHakaCurtainActionFunc actionFunc; } BgHakaCurtain; // size = 0x160 -extern const ActorInit Bg_Haka_Curtain_InitVars; - #endif // Z_BG_HAKA_CURTAIN_H diff --git a/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c b/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c index 8d48168a6..a8d63c309 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c +++ b/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c @@ -23,7 +23,7 @@ void func_80BD6768(BgHakaTomb* this, PlayState* play); void BgHakaTomb_SetupDoNothing(BgHakaTomb* this); void BgHakaTomb_DoNothing(BgHakaTomb* this, PlayState* play); -const ActorInit Bg_Haka_Tomb_InitVars = { +ActorInit Bg_Haka_Tomb_InitVars = { ACTOR_BG_HAKA_TOMB, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.h b/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.h index c1cefddc8..3c607e0e2 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.h +++ b/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.h @@ -13,6 +13,4 @@ typedef struct BgHakaTomb { /* 0x160 */ s16 cutscenes[1]; } BgHakaTomb; // size = 0x164 -extern const ActorInit Bg_Haka_Tomb_InitVars; - #endif // Z_BG_HAKA_TOMB_H diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Bombwall/z_bg_hakugin_bombwall.c b/src/overlays/actors/ovl_Bg_Hakugin_Bombwall/z_bg_hakugin_bombwall.c index 37a232bc5..bde3c8540 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Bombwall/z_bg_hakugin_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Hakugin_Bombwall/z_bg_hakugin_bombwall.c @@ -26,7 +26,7 @@ void func_80ABCCE4(BgHakuginBombwall* this, PlayState* play); void func_80ABCD98(BgHakuginBombwall* this, PlayState* play); void func_80ABCE60(BgHakuginBombwall* this, PlayState* play); -const ActorInit Bg_Hakugin_Bombwall_InitVars = { +ActorInit Bg_Hakugin_Bombwall_InitVars = { ACTOR_BG_HAKUGIN_BOMBWALL, ACTORCAT_BG, FLAGS, @@ -317,7 +317,7 @@ void BgHakuginBombwall_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); if (Flags_GetSwitch(play, BGHAKUGIN_BOMBWALL_SWITCHFLAG(&this->dyna.actor))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -414,7 +414,7 @@ void func_80ABCE60(BgHakuginBombwall* this, PlayState* play) { this->unk_1AC--; if (this->unk_1AC <= 0) { ActorCutscene_Stop(this->dyna.actor.cutscene); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } else if (this->unk_1AC == ptr->unk_2C) { ptr->unk_28(this, play); } diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Bombwall/z_bg_hakugin_bombwall.h b/src/overlays/actors/ovl_Bg_Hakugin_Bombwall/z_bg_hakugin_bombwall.h index f849b356f..24b04139e 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Bombwall/z_bg_hakugin_bombwall.h +++ b/src/overlays/actors/ovl_Bg_Hakugin_Bombwall/z_bg_hakugin_bombwall.h @@ -19,6 +19,4 @@ typedef struct BgHakuginBombwall { /* 0x1AC */ s32 unk_1AC; } BgHakuginBombwall; // size = 0x1B0 -extern const ActorInit Bg_Hakugin_Bombwall_InitVars; - #endif // Z_BG_HAKUGIN_BOMBWALL_H diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.c b/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.c index 8100c6205..0b8d2490b 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.c +++ b/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.c @@ -18,7 +18,7 @@ void BgHakuginElvpole_Draw(Actor* thisx, PlayState* play); void func_80ABD92C(BgHakuginElvpole* this, PlayState* play); -const ActorInit Bg_Hakugin_Elvpole_InitVars = { +ActorInit Bg_Hakugin_Elvpole_InitVars = { ACTOR_BG_HAKUGIN_ELVPOLE, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.h b/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.h index b8316a4e6..ace71e7b3 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.h +++ b/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.h @@ -17,6 +17,4 @@ typedef struct BgHakuginElvpole { /* 0x164 */ BgHakuginElvpoleActionFunc actionFunc; } BgHakuginElvpole; // size = 0x168 -extern const ActorInit Bg_Hakugin_Elvpole_InitVars; - #endif // Z_BG_HAKUGIN_ELVPOLE_H diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c index ec2fd9e9c..7f77b6645 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c +++ b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c @@ -39,7 +39,7 @@ void func_80A9D61C(Actor* thisx, PlayState* play); BgHakuginPostColliders D_80A9DDC0; BgHakuginPostUnkStruct D_80A9E028; -const ActorInit Bg_Hakugin_Post_InitVars = { +ActorInit Bg_Hakugin_Post_InitVars = { ACTOR_BG_HAKUGIN_POST, ACTORCAT_BG, FLAGS, @@ -709,7 +709,7 @@ void BgHakuginPost_Init(Actor* thisx, PlayState* play) { func_80A9CA94(this); } else { func_80A9AFB4(this, play, &D_80A9E028); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.h b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.h index 8e702a006..5a23fa070 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.h +++ b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.h @@ -70,6 +70,4 @@ typedef struct BgHakuginPost { /* 0x186 */ s16 unk_186; } BgHakuginPost; // size = 0x188 -extern const ActorInit Bg_Hakugin_Post_InitVars; - #endif // Z_BG_HAKUGIN_POST_H diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.c b/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.c index 0498dc2ee..aa22dd8af 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.c +++ b/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.c @@ -38,7 +38,7 @@ void func_80B165E0(BgHakuginSwitch* this, PlayState* play); u32 D_80B16AF0; -const ActorInit Bg_Hakugin_Switch_InitVars = { +ActorInit Bg_Hakugin_Switch_InitVars = { ACTOR_BG_HAKUGIN_SWITCH, ACTORCAT_SWITCH, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.h b/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.h index 74757f836..164220b29 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.h +++ b/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.h @@ -32,6 +32,4 @@ typedef struct BgHakuginSwitch { /* 0x1C8 */ f32 unk_1C8; } BgHakuginSwitch; // size = 0x1CC -extern const ActorInit Bg_Hakugin_Switch_InitVars; - #endif // Z_BG_HAKUGIN_SWITCH_H diff --git a/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c b/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c index e64cbef70..265490e52 100644 --- a/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c +++ b/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c @@ -23,7 +23,7 @@ void func_80AC4D2C(BgIcefloe* this, PlayState* play); void func_80AC4C34(BgIcefloe* this, PlayState* play); void func_80AC4CF0(BgIcefloe* this); -const ActorInit Bg_Icefloe_InitVars = { +ActorInit Bg_Icefloe_InitVars = { ACTOR_BG_ICEFLOE, ACTORCAT_BG, FLAGS, @@ -158,7 +158,7 @@ void func_80AC4D2C(BgIcefloe* this, PlayState* play) { } this->dyna.actor.scale.y -= 0.0026f; if (this->dyna.actor.scale.y <= 0.0f) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.h b/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.h index 91c007d26..0278089cf 100644 --- a/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.h +++ b/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.h @@ -13,6 +13,4 @@ typedef struct BgIcefloe { /* 0x160 */ s32 timer; } BgIcefloe; // size = 0x164 -extern const ActorInit Bg_Icefloe_InitVars; - #endif // Z_BG_ICEFLOE_H diff --git a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c index aec62ce15..743213652 100644 --- a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c +++ b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c @@ -42,7 +42,7 @@ static ColliderCylinderInit sCylinderInit = { { 13, 120, 0, { 0, 0, 0 } }, }; -const ActorInit Bg_Icicle_InitVars = { +ActorInit Bg_Icicle_InitVars = { ACTOR_BG_ICICLE, ACTORCAT_PROP, FLAGS, @@ -178,8 +178,7 @@ void BgIcicle_Fall(BgIcicle* this, PlayState* play) { func_800C6314(play, &play->colCtx.dyna, this->dyna.bgId); this->actionFunc = BgIcicle_Regrow; } else { - Actor_MarkForDeath(&this->dyna.actor); - return; + Actor_Kill(&this->dyna.actor); } } else { Actor_MoveWithGravity(&this->dyna.actor); @@ -225,7 +224,7 @@ void BgIcicle_UpdateAttacked(BgIcicle* this, PlayState* play) { BgIcicle_Break(this, play, 40.0f); } - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.h b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.h index 20450f929..b8f432458 100644 --- a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.h +++ b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.h @@ -23,6 +23,4 @@ typedef struct BgIcicle { /* 0x164 */ ColliderCylinder collider; } BgIcicle; // size = 0x1B0 -extern const ActorInit Bg_Icicle_InitVars; - #endif // Z_BG_ICICLE_H diff --git a/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c b/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c index 0a4c31d12..9d249314a 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c @@ -25,7 +25,7 @@ void func_80B7F360(BgIkanaBlock* this); void func_80B7F398(BgIkanaBlock* this, PlayState* play); void func_80B7F564(Actor* thisx, PlayState* play); -const ActorInit Bg_Ikana_Block_InitVars = { +ActorInit Bg_Ikana_Block_InitVars = { ACTOR_BG_IKANA_BLOCK, ACTORCAT_BG, FLAGS, @@ -240,7 +240,7 @@ void func_80B7F0D0(BgIkanaBlock* this, PlayState* play) { if ((sp24 != 2) && (this->unk_17A & (0x8 | 0x4 | 0x2 | 0x1))) { Player* player = GET_PLAYER(play); - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } @@ -297,7 +297,7 @@ void func_80B7F290(BgIkanaBlock* this, PlayState* play) { Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; if (func_80B7EDC4(this, play)) { diff --git a/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.h b/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.h index 5c5281911..416a1c2dc 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.h +++ b/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.h @@ -24,6 +24,4 @@ typedef struct BgIkanaBlock { /* 0x17F */ s8 unk_17F; } BgIkanaBlock; // size = 0x180 -extern const ActorInit Bg_Ikana_Block_InitVars; - #endif // Z_BG_IKANA_BLOCK_H diff --git a/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c b/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c index 43627317e..7dbe579a0 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c @@ -25,7 +25,7 @@ void func_80BD503C(BgIkanaBombwall* this, PlayState* play); void func_80BD5118(BgIkanaBombwall* this); void func_80BD5134(BgIkanaBombwall* this, PlayState* play); -const ActorInit Bg_Ikana_Bombwall_InitVars = { +ActorInit Bg_Ikana_Bombwall_InitVars = { ACTOR_BG_IKANA_BOMBWALL, ACTORCAT_BG, FLAGS, @@ -239,7 +239,7 @@ void BgIkanaBombwall_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); if (Flags_GetSwitch(play, BGIKANABOMBWALL_GET_SWITCHFLAG(&this->dyna.actor))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -349,14 +349,14 @@ void func_80BD5134(BgIkanaBombwall* this, PlayState* play) { this->unk_1AC--; if (this->unk_1AC <= 0) { ActorCutscene_Stop(this->dyna.actor.cutscene); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } else if (this->dyna.actor.cutscene >= 0) { if (ActorCutscene_GetCurrentIndex() != this->dyna.actor.cutscene) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } else { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.h b/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.h index da11bcfea..e9ff850ad 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.h +++ b/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.h @@ -17,6 +17,4 @@ typedef struct BgIkanaBombwall { /* 0x1AC */ s8 unk_1AC; } BgIkanaBombwall; // size = 0x1B0 -extern const ActorInit Bg_Ikana_Bombwall_InitVars; - #endif // Z_BG_IKANA_BOMBWALL_H diff --git a/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c b/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c index 6c5e85e73..678080ae1 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c @@ -24,7 +24,7 @@ void BgIkanaDharma_StartCutscene(BgIkanaDharma* this, PlayState* play); void BgIkanaDharma_SetupWaitForCutsceneToEnd(BgIkanaDharma* this); void BgIkanaDharma_WaitForCutsceneToEnd(BgIkanaDharma* this, PlayState* play); -const ActorInit Bg_Ikana_Dharma_InitVars = { +ActorInit Bg_Ikana_Dharma_InitVars = { ACTOR_BG_IKANA_DHARMA, ACTORCAT_BG, FLAGS, @@ -204,13 +204,14 @@ void BgIkanaDharma_WaitForCutsceneToEnd(BgIkanaDharma* this, PlayState* play) { } } - if (Math_StepToF(&this->dyna.actor.scale.y, 0.0f, 1.0f / 300.0f) != 0) { - Actor_MarkForDeath(&this->dyna.actor); - } else { - this->dyna.actor.scale.x = this->dyna.actor.scale.y * 3.0f; - this->dyna.actor.scale.z = this->dyna.actor.scale.y * 3.0f; - BgIkanaDharma_SpawnEffects(this, play); + if (Math_StepToF(&this->dyna.actor.scale.y, 0.0f, 1.0f / 300.0f)) { + Actor_Kill(&this->dyna.actor); + return; } + + this->dyna.actor.scale.x = this->dyna.actor.scale.y * 3.0f; + this->dyna.actor.scale.z = this->dyna.actor.scale.y * 3.0f; + BgIkanaDharma_SpawnEffects(this, play); } void BgIkanaDharma_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.h b/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.h index 4642a4369..ac1bcadf0 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.h +++ b/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.h @@ -19,6 +19,4 @@ typedef struct BgIkanaDharma { /* 0x1AC */ s8 cutsceneFramesRemaining; } BgIkanaDharma; // size = 0x1B0 -extern const ActorInit Bg_Ikana_Dharma_InitVars; - #endif // Z_BG_IKANA_DHARMA_H diff --git a/src/overlays/actors/ovl_Bg_Ikana_Mirror/z_bg_ikana_mirror.c b/src/overlays/actors/ovl_Bg_Ikana_Mirror/z_bg_ikana_mirror.c index 11734b284..c7e61cad7 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Mirror/z_bg_ikana_mirror.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Mirror/z_bg_ikana_mirror.c @@ -26,7 +26,7 @@ void BgIkanaMirror_Wait(BgIkanaMirror* this, PlayState* play); void BgIkanaMirror_SetupEmitLight(BgIkanaMirror* this); void BgIkanaMirror_EmitLight(BgIkanaMirror* this, PlayState* play); -const ActorInit Bg_Ikana_Mirror_InitVars = { +ActorInit Bg_Ikana_Mirror_InitVars = { ACTOR_BG_IKANA_MIRROR, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c b/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c index f4d964817..6a08ba101 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c @@ -21,7 +21,7 @@ void BgIkanaRay_UpdateCheckForActivation(BgIkanaRay* this, PlayState* play); void BgIkanaRay_SetActivated(BgIkanaRay* this); void BgIkanaRay_UpdateActivated(BgIkanaRay* this, PlayState* play); -const ActorInit Bg_Ikana_Ray_InitVars = { +ActorInit Bg_Ikana_Ray_InitVars = { ACTOR_BG_IKANA_RAY, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.h b/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.h index 9aa4f89d4..79d406fde 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.h +++ b/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.h @@ -16,6 +16,4 @@ typedef struct BgIkanaRay { /* 0x194 */ BgIkanaRayActionFunc actionFunc; } BgIkanaRay; // size = 0x198 -extern const ActorInit Bg_Ikana_Ray_InitVars; - #endif // Z_BG_IKANA_RAY_H diff --git a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c index fb29ca2bb..a979ac08e 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c @@ -34,7 +34,7 @@ void func_80B81BA0(Actor* thisx, PlayState* play); void func_80B81DAC(BgIkanaRotaryroom* this); void func_80B81DC8(Actor* thisx, PlayState* play); -const ActorInit Bg_Ikana_Rotaryroom_InitVars = { +ActorInit Bg_Ikana_Rotaryroom_InitVars = { ACTOR_BG_IKANA_ROTARYROOM, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.h b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.h index 89021fa54..4184220e0 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.h +++ b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.h @@ -49,6 +49,4 @@ typedef struct BgIkanaRotaryroom { /* 0x584 */ s16 unk_584; } BgIkanaRotaryroom; // size = 0x588 -extern const ActorInit Bg_Ikana_Rotaryroom_InitVars; - #endif // Z_BG_IKANA_ROTARYROOM_H diff --git a/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c b/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c index b3da7b2bf..a7ba89cdc 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c @@ -36,7 +36,7 @@ void func_80BD5BD8(BgIkanaShutter* this, PlayState* play); void BgIkanaShutter_SetupDoNothing(BgIkanaShutter* this); void BgIkanaShutter_DoNothing(BgIkanaShutter* this, PlayState* play); -const ActorInit Bg_Ikana_Shutter_InitVars = { +ActorInit Bg_Ikana_Shutter_InitVars = { ACTOR_BG_IKANA_SHUTTER, ACTORCAT_SWITCH, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.h b/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.h index 1d39f3593..094334600 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.h +++ b/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.h @@ -12,6 +12,4 @@ typedef struct BgIkanaShutter { /* 0x15C */ BgIkanaShutterActionFunc actionFunc; } BgIkanaShutter; // size = 0x160 -extern const ActorInit Bg_Ikana_Shutter_InitVars; - #endif // Z_BG_IKANA_SHUTTER_H diff --git a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c index 017f9ef04..f9a9fcc37 100644 --- a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c +++ b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c @@ -29,7 +29,7 @@ void func_80C0AD44(BgIkninSusceil* this); void func_80C0AD64(BgIkninSusceil* this, PlayState* play); void func_80C0AE5C(BgIkninSusceil* this, PlayState* play); -const ActorInit Bg_Iknin_Susceil_InitVars = { +ActorInit Bg_Iknin_Susceil_InitVars = { ACTOR_BG_IKNIN_SUSCEIL, ACTORCAT_BG, FLAGS, @@ -226,7 +226,8 @@ void BgIkninSusceil_Update(Actor* thisx, PlayState* play) { BgIkninSusceil* this = THIS; Player* player = GET_PLAYER(play); - if ((this->unk168 == 0) && (this->unk166 > 0) && (player->stateFlags3 & 0x100) && (player->unk_B48 > 1000.0f)) { + if ((this->unk168 == 0) && (this->unk166 > 0) && (player->stateFlags3 & PLAYER_STATE3_100) && + (player->unk_B48 > 1000.0f)) { this->unk168 = 2; if ((func_80C0A95C(this, play) != 0) && (this->actionFunc != func_80C0AE5C)) { func_800B8E58(player, NA_SE_PL_BODY_HIT); @@ -242,7 +243,7 @@ void BgIkninSusceil_Update(Actor* thisx, PlayState* play) { if ((this->dyna.actor.home.pos.y + 70.0f) < this->dyna.actor.world.pos.y) { this->unk166 = 0; - } else if (player->stateFlags3 & 0x100) { + } else if (player->stateFlags3 & PLAYER_STATE3_100) { this->unk166 = 3; } else { if (this->unk166 > 0) { diff --git a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.h b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.h index 8fc32bd06..2fa153ac0 100644 --- a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.h +++ b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.h @@ -19,6 +19,4 @@ typedef struct BgIkninSusceil { /* 0x16A */ UNK_TYPE2 unk16A; } BgIkninSusceil; // size = 0x16C -extern const ActorInit Bg_Iknin_Susceil_InitVars; - #endif // Z_BG_IKNIN_SUSCEIL_H diff --git a/src/overlays/actors/ovl_Bg_Ikninside/z_bg_ikninside.c b/src/overlays/actors/ovl_Bg_Ikninside/z_bg_ikninside.c index 07de845c0..6016b2e44 100644 --- a/src/overlays/actors/ovl_Bg_Ikninside/z_bg_ikninside.c +++ b/src/overlays/actors/ovl_Bg_Ikninside/z_bg_ikninside.c @@ -18,7 +18,7 @@ void BgIkninside_Draw(Actor* thisx, PlayState* play); void func_80C072D0(BgIkninside* this, PlayState* play); -const ActorInit Bg_Ikninside_InitVars = { +ActorInit Bg_Ikninside_InitVars = { ACTOR_BG_IKNINSIDE, ACTORCAT_BG, FLAGS, @@ -65,7 +65,7 @@ void BgIkninside_Init(Actor* thisx, PlayState* play) { Collider_InitAndSetCylinder(play, &this->collider, &this->dyna.actor, &sCylinderInit); Collider_UpdateCylinder(&this->dyna.actor, &this->collider); if (Flags_GetSwitch(play, DMIKNINSIDE_GET_SWITCH(thisx))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c b/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c index 06091b12b..9d11c6a6f 100644 --- a/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c +++ b/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c @@ -27,7 +27,7 @@ void func_80BD7820(Actor* thisx, PlayState* play); void func_80BD78C4(Actor* thisx, PlayState* play); void func_80BD7538(Actor* thisx, PlayState* play); -const ActorInit Bg_Iknv_Doukutu_InitVars = { +ActorInit Bg_Iknv_Doukutu_InitVars = { ACTOR_BG_IKNV_DOUKUTU, ACTORCAT_BG, FLAGS, @@ -70,7 +70,7 @@ void BgIknvDoukutu_Init(Actor* thisx, PlayState* play) { CollisionHeader_GetVirtual(&object_iknv_obj_Colheader_012788, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); if (!(gSaveContext.save.weekEventReg[14] & 4)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } break; @@ -90,7 +90,7 @@ void BgIknvDoukutu_Init(Actor* thisx, PlayState* play) { break; default: - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); break; } } diff --git a/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.h b/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.h index d9c4f78ad..f36393869 100644 --- a/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.h +++ b/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.h @@ -23,6 +23,4 @@ typedef struct BgIknvDoukutu { /* 0x164 */ BgIknvDoukutuActionFunc actionFunc; } BgIknvDoukutu;// size = 0x168 -extern const ActorInit Bg_Iknv_Doukutu_InitVars; - #endif // Z_BG_IKNV_DOUKUTU_H diff --git a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c index c0e9bdc42..4add85012 100644 --- a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c +++ b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c @@ -21,7 +21,7 @@ void BgIknvObj_UpdateWaterwheel(BgIknvObj* this, PlayState* play); void BgIknvObj_UpdateRaisedDoor(BgIknvObj* this, PlayState* play); void BgIknvObj_UpdateSakonDoor(BgIknvObj* this, PlayState* play); -const ActorInit Bg_Iknv_Obj_InitVars = { +ActorInit Bg_Iknv_Obj_InitVars = { ACTOR_BG_IKNV_OBJ, ACTORCAT_BG, FLAGS, @@ -88,7 +88,7 @@ void BgIknvObj_Init(Actor* thisx, PlayState* play) { Actor_SetFocus(&this->dyna.actor, IREG(88)); break; default: - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.h b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.h index 333b9d59e..a5c01165d 100644 --- a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.h +++ b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.h @@ -22,6 +22,4 @@ typedef enum { /* 2 */ IKNV_OBJ_SAKON_DOOR, // door to Sakon's Hideout } BgIknvObjType; -extern const ActorInit Bg_Iknv_Obj_InitVars; - #endif // Z_BG_IKNV_OBJ_H diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index 95ca8936e..911eb9243 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -26,7 +26,7 @@ void func_809542A0(BgIngate* this, PlayState* play); void func_80954340(BgIngate* this, PlayState* play); void func_809543D4(BgIngate* this, PlayState* play); -const ActorInit Bg_Ingate_InitVars = { +ActorInit Bg_Ingate_InitVars = { ACTOR_BG_INGATE, ACTORCAT_BG, FLAGS, @@ -215,11 +215,11 @@ void func_80953F9C(BgIngate* this, PlayState* play) { if (ActorCutscene_GetCurrentIndex() != this->unk16E) { if (ActorCutscene_GetCurrentIndex() != -1) { Camera_ChangeSetting(mainCam, CAM_SET_NORMAL0); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; play->actorCtx.flags &= ~ACTORCTX_FLAG_2; } else { Camera_ChangeSetting(mainCam, CAM_SET_BOAT_CRUISE); - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } } this->unk16E = ActorCutscene_GetCurrentIndex(); @@ -364,7 +364,7 @@ void BgIngate_Init(Actor* thisx, PlayState* play2) { } this->timePath = SubS_GetAdditionalPath(play, BGINGATE_GET_FF(&this->dyna.actor), 0); } else { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h index b38ce2eeb..cc0befd19 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h @@ -26,6 +26,4 @@ typedef struct BgIngate { /* 0x18C */ s32 timePathElapsedTime; } BgIngate; // size = 0x190 -extern const ActorInit Bg_Ingate_InitVars; - #endif // Z_BG_INGATE_H diff --git a/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c b/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c index 68c432c5f..1b1deb6c2 100644 --- a/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c +++ b/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c @@ -15,7 +15,7 @@ void BgInibsMovebg_Init(Actor* thisx, PlayState* play); void BgInibsMovebg_Destroy(Actor* thisx, PlayState* play); void BgInibsMovebg_Draw(Actor* thisx, PlayState* play); -const ActorInit Bg_Inibs_Movebg_InitVars = { +ActorInit Bg_Inibs_Movebg_InitVars = { ACTOR_BG_INIBS_MOVEBG, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.h b/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.h index 629a5cd03..03ea34fc9 100644 --- a/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.h +++ b/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.h @@ -14,6 +14,4 @@ typedef struct BgInibsMovebg { /* 0x164 */ AnimatedMaterial* sandTexAnim; } BgInibsMovebg; // size = 0x168 -extern const ActorInit Bg_Inibs_Movebg_InitVars; - #endif // Z_BG_INIBS_MOVEBG_H diff --git a/src/overlays/actors/ovl_Bg_Keikoku_Saku/z_bg_keikoku_saku.c b/src/overlays/actors/ovl_Bg_Keikoku_Saku/z_bg_keikoku_saku.c index 63ef9d369..12bfc0f3c 100644 --- a/src/overlays/actors/ovl_Bg_Keikoku_Saku/z_bg_keikoku_saku.c +++ b/src/overlays/actors/ovl_Bg_Keikoku_Saku/z_bg_keikoku_saku.c @@ -20,7 +20,7 @@ void func_80A5389C(BgKeikokuSaku* this, PlayState* play); void func_80A538E0(BgKeikokuSaku* this, PlayState* play); void func_80A53994(BgKeikokuSaku* this, PlayState* play); -const ActorInit Bg_Keikoku_Saku_InitVars = { +ActorInit Bg_Keikoku_Saku_InitVars = { ACTOR_BG_KEIKOKU_SAKU, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Keikoku_Saku/z_bg_keikoku_saku.h b/src/overlays/actors/ovl_Bg_Keikoku_Saku/z_bg_keikoku_saku.h index c39994d77..6a3bad9c8 100644 --- a/src/overlays/actors/ovl_Bg_Keikoku_Saku/z_bg_keikoku_saku.h +++ b/src/overlays/actors/ovl_Bg_Keikoku_Saku/z_bg_keikoku_saku.h @@ -16,6 +16,4 @@ typedef struct BgKeikokuSaku { /* 0x162 */ s16 timer; } BgKeikokuSaku; // Size = 0x164 -extern const ActorInit Bg_Keikoku_Saku_InitVars; - #endif // Z_BG_KEIKOKU_SAKU_H diff --git a/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.c b/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.c index f54564e2d..8afd5d730 100644 --- a/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.c +++ b/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.c @@ -16,7 +16,7 @@ void BgKeikokuSpr_Destroy(Actor* thisx, PlayState* play); void BgKeikokuSpr_Update(Actor* thisx, PlayState* play); void BgKeikokuSpr_Draw(Actor* thisx, PlayState* play); -const ActorInit Bg_Keikoku_Spr_InitVars = { +ActorInit Bg_Keikoku_Spr_InitVars = { ACTOR_BG_KEIKOKU_SPR, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.h b/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.h index ca72665b8..9686a44a1 100644 --- a/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.h +++ b/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.h @@ -9,6 +9,4 @@ typedef struct BgKeikokuSpr { /* 0x000 */ Actor actor; } BgKeikokuSpr; // size = 0x144 -extern const ActorInit Bg_Keikoku_Spr_InitVars; - #endif // Z_BG_KEIKOKU_SPR_H diff --git a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c index 86854cbe8..2da4ddcee 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c @@ -146,14 +146,15 @@ void BgKin2Bombwall_Init(Actor* thisx, PlayState* play) { bombwallCollider = &this->collider; Collider_InitCylinder(play, bombwallCollider); if (Flags_GetSwitch(play, BG_KIN2_BOMBWALL_SWITCH_FLAG(&this->dyna.actor))) { - Actor_MarkForDeath(&this->dyna.actor); - } else { - DynaPolyActor_LoadMesh(play, &this->dyna, &gOceanSpiderHouseBombableWallCol); - Collider_SetCylinder(play, bombwallCollider, &this->dyna.actor, &sCylinderInit); - Collider_UpdateCylinder(&this->dyna.actor, bombwallCollider); - Actor_SetFocus(&this->dyna.actor, 60.0f); - BgKin2Bombwall_SetupWait(this); + Actor_Kill(&this->dyna.actor); + return; } + + DynaPolyActor_LoadMesh(play, &this->dyna, &gOceanSpiderHouseBombableWallCol); + Collider_SetCylinder(play, bombwallCollider, &this->dyna.actor, &sCylinderInit); + Collider_UpdateCylinder(&this->dyna.actor, bombwallCollider); + Actor_SetFocus(&this->dyna.actor, 60.0f); + BgKin2Bombwall_SetupWait(this); } void BgKin2Bombwall_Destroy(Actor* thisx, PlayState* play) { @@ -205,7 +206,7 @@ void BgKin2Bombwall_EndCutscene(BgKin2Bombwall* this, PlayState* play) { this->timer--; if (this->timer <= 0) { ActorCutscene_Stop(this->dyna.actor.cutscene); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c b/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c index 34aba7769..dfb22deee 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c @@ -27,7 +27,7 @@ void BgKin2Fence_RaiseFence(BgKin2Fence* this, PlayState* play); void BgKin2Fence_SetupDoNothing(BgKin2Fence* this); void BgKin2Fence_DoNothing(BgKin2Fence* this, PlayState* play); -const ActorInit Bg_Kin2_Fence_InitVars = { +ActorInit Bg_Kin2_Fence_InitVars = { ACTOR_BG_KIN2_FENCE, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.h b/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.h index 00d08b85f..98bb51243 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.h +++ b/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.h @@ -17,6 +17,4 @@ typedef struct BgKin2Fence { /* 0x282 */ s8 waitBeforeOpenTimer; } BgKin2Fence; // size = 0x284 -extern const ActorInit Bg_Kin2_Fence_InitVars; - #endif // Z_BG_KIN2_FENCE_H diff --git a/src/overlays/actors/ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c b/src/overlays/actors/ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c index 39c72a108..5892376ba 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c @@ -27,7 +27,7 @@ void BgKin2Picture_Fall(BgKin2Picture* this, PlayState* play); void BgKin2Picture_SetupDoNothing(BgKin2Picture* this); void BgKin2Picture_DoNothing(BgKin2Picture* this, PlayState* play); -const ActorInit Bg_Kin2_Picture_InitVars = { +ActorInit Bg_Kin2_Picture_InitVars = { ACTOR_BG_KIN2_PICTURE, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c b/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c index 8080c4444..6c30347ef 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.c @@ -23,7 +23,7 @@ void func_80B70230(BgKin2Shelf* this, PlayState* play); void func_80B70498(BgKin2Shelf* this); void func_80B704B4(BgKin2Shelf* this, PlayState* play); -const ActorInit Bg_Kin2_Shelf_InitVars = { +ActorInit Bg_Kin2_Shelf_InitVars = { ACTOR_BG_KIN2_SHELF, ACTORCAT_BG, FLAGS, @@ -260,7 +260,7 @@ void func_80B700C0(BgKin2Shelf* this, PlayState* play) { } else { Player* player = GET_PLAYER(play); - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } else { @@ -292,7 +292,7 @@ void func_80B70230(BgKin2Shelf* this, PlayState* play) { Player* player = GET_PLAYER(play); this->unk_160 = 1.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; if (this->unk_164 & 8) { @@ -339,7 +339,7 @@ void func_80B704B4(BgKin2Shelf* this, PlayState* play) { Player* player = GET_PLAYER(play); this->unk_160 = 1.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; if (this->unk_164 & 4) { diff --git a/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.h b/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.h index ce88b25e0..bd5180c34 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.h +++ b/src/overlays/actors/ovl_Bg_Kin2_Shelf/z_bg_kin2_shelf.h @@ -19,6 +19,4 @@ typedef struct BgKin2Shelf { /* 0x167 */ s8 unk_167; } BgKin2Shelf; // size = 0x168 -extern const ActorInit Bg_Kin2_Shelf_InitVars; - #endif // Z_BG_KIN2_SHELF_H diff --git a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c index 36226212e..f766fef78 100644 --- a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c +++ b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c @@ -20,7 +20,7 @@ void BgLadder_StartCutscene(BgLadder* this, PlayState* play); void BgLadder_FadeIn(BgLadder* this, PlayState* play); void BgLadder_DoNothing(BgLadder* this, PlayState* play); -const ActorInit Bg_Ladder_InitVars = { +ActorInit Bg_Ladder_InitVars = { ACTOR_BG_LADDER, ACTORCAT_PROP, FLAGS, @@ -63,7 +63,7 @@ void BgLadder_Init(Actor* thisx, PlayState* play) { } else if (size == LADDER_SIZE_24RUNG) { DynaPolyActor_LoadMesh(play, &this->dyna, &object_ladder_Colheader_000868); } else { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } diff --git a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.h b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.h index c53a80352..e4cd15c15 100644 --- a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.h +++ b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.h @@ -24,6 +24,4 @@ typedef enum { /* 3 */ LADDER_SIZE_24RUNG, } BgLadderSize; -extern const ActorInit Bg_Ladder_InitVars; - #endif // Z_BG_LADDER_H diff --git a/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.c b/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.c index 85272fa51..d704adf86 100644 --- a/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.c +++ b/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.c @@ -37,7 +37,7 @@ void func_80C18884(BgLastBwall* this, PlayState* play); void func_80C188C4(BgLastBwall* this, PlayState* play); void BgLastBwall_DoNothing(BgLastBwall* this, PlayState* play); -const ActorInit Bg_Last_Bwall_InitVars = { +ActorInit Bg_Last_Bwall_InitVars = { ACTOR_BG_LAST_BWALL, ACTORCAT_BG, FLAGS, @@ -153,15 +153,19 @@ void BgLastBwall_Init(Actor* thisx, PlayState* play) { DynaPolyActor_LoadMesh(play, &this->dyna, D_80C18A48[this->type].colHeader); Collider_InitTris(play, &this->colliderTris); if (Flags_GetSwitch(play, BGLASTBWALL_GET_SWITCHFLAGS(&this->dyna.actor))) { - Actor_MarkForDeath(&this->dyna.actor); - } else if (!Collider_SetTris(play, &this->colliderTris, &this->dyna.actor, &sTrisInit, this->colliderTrisElement)) { - Actor_MarkForDeath(&this->dyna.actor); - } else { - BgLastBwall_InitCollider(&sTrisInit, &this->dyna.actor.world.pos, &this->dyna.actor.shape.rot, - &this->colliderTris, D_80C18AC0[this->type]); - SubS_FillCutscenesList(&this->dyna.actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); - func_80C187E4(this); + Actor_Kill(&this->dyna.actor); + return; } + + if (!Collider_SetTris(play, &this->colliderTris, &this->dyna.actor, &sTrisInit, this->colliderTrisElement)) { + Actor_Kill(&this->dyna.actor); + return; + } + + BgLastBwall_InitCollider(&sTrisInit, &this->dyna.actor.world.pos, &this->dyna.actor.shape.rot, &this->colliderTris, + D_80C18AC0[this->type]); + SubS_FillCutscenesList(&this->dyna.actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); + func_80C187E4(this); } void BgLastBwall_Destroy(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.h b/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.h index d24b8ba42..3fafc71ea 100644 --- a/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.h +++ b/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.h @@ -25,6 +25,4 @@ typedef struct BgLastBwall { /* 0x23A */ s16 cutscenes[1]; } BgLastBwall; // size = 0x23C -extern const ActorInit Bg_Last_Bwall_InitVars; - #endif // Z_BG_LAST_BWALL_H diff --git a/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c b/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c index 35d61af5e..75e7b9e32 100644 --- a/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c +++ b/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c @@ -15,7 +15,7 @@ void BgLbfshot_Init(Actor* thisx, PlayState* play); void BgLbfshot_Destroy(Actor* thisx, PlayState* play); void BgLbfshot_Draw(Actor* thisx, PlayState* play); -const ActorInit Bg_Lbfshot_InitVars = { +ActorInit Bg_Lbfshot_InitVars = { ACTOR_BG_LBFSHOT, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.h b/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.h index 069bfa048..2874a2d13 100644 --- a/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.h +++ b/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.h @@ -10,6 +10,4 @@ typedef struct BgLbfshot { /* 0x15C */ UNK_TYPE1 pad15C[0x4]; } BgLbfshot; // size = 0x160 -extern const ActorInit Bg_Lbfshot_InitVars; - #endif // Z_BG_LBFSHOT_H diff --git a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c index 72a38b21b..20be54a2f 100644 --- a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c +++ b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c @@ -20,7 +20,7 @@ void BgLotus_Wait(BgLotus* this, PlayState* play); void BgLotus_Sink(BgLotus* this, PlayState* play); void BgLotus_WaitToAppear(BgLotus* this, PlayState* play); -const ActorInit Bg_Lotus_InitVars = { +ActorInit Bg_Lotus_InitVars = { ACTOR_BG_LOTUS, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.h b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.h index a4d8f2ebb..540c21b0e 100644 --- a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.h +++ b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.h @@ -16,6 +16,4 @@ typedef struct BgLotus { /* 0x168 */ s16 timer2; } BgLotus; // size = 0x16C -extern const ActorInit Bg_Lotus_InitVars; - #endif // Z_BG_LOTUS_H diff --git a/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.c b/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.c index f2f5ef870..44d797b8e 100644 --- a/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.c +++ b/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.c @@ -14,7 +14,7 @@ void BgMarketStep_Init(Actor* thisx, PlayState* play); void BgMarketStep_Draw(Actor* thisx, PlayState* play); -const ActorInit Bg_Market_Step_InitVars = { +ActorInit Bg_Market_Step_InitVars = { ACTOR_BG_MARKET_STEP, ACTORCAT_BG, FLAGS, OBJECT_MARKET_OBJ, sizeof(BgMarketStep), (ActorFunc)BgMarketStep_Init, (ActorFunc)Actor_Noop, (ActorFunc)Actor_Noop, (ActorFunc)BgMarketStep_Draw, diff --git a/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.h b/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.h index c779b227a..9a957b742 100644 --- a/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.h +++ b/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.h @@ -11,6 +11,4 @@ typedef struct BgMarketStep { /* 0x000 */ Actor actor; } BgMarketStep; // size = 0x144 -extern const ActorInit Bg_Market_Step_InitVars; - #endif // Z_BG_MARKET_STEP_H diff --git a/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c b/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c index f81e53611..305c3084e 100644 --- a/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c +++ b/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c @@ -16,7 +16,7 @@ void BgMbarChair_Destroy(Actor* thisx, PlayState* play); void BgMbarChair_Update(Actor* thisx, PlayState* play); void BgMbarChair_Draw(Actor* thisx, PlayState* play); -const ActorInit Bg_Mbar_Chair_InitVars = { +ActorInit Bg_Mbar_Chair_InitVars = { ACTOR_BG_MBAR_CHAIR, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.h b/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.h index ee4854d07..0d9326464 100644 --- a/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.h +++ b/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.h @@ -9,6 +9,4 @@ typedef struct BgMbarChair { /* 0x000 */ DynaPolyActor dyna; } BgMbarChair; // size = 0x15C -extern const ActorInit Bg_Mbar_Chair_InitVars; - #endif // Z_BG_MBAR_CHAIR_H diff --git a/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c b/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c index 8554e2b5a..2a5d44929 100644 --- a/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c +++ b/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c @@ -30,7 +30,7 @@ void BgNumaHana_RaiseFlower(BgNumaHana* this, PlayState* play); void BgNumaHana_SetupOpenedIdle(BgNumaHana* this); void BgNumaHana_OpenedIdle(BgNumaHana* this, PlayState* play); -const ActorInit Bg_Numa_Hana_InitVars = { +ActorInit Bg_Numa_Hana_InitVars = { ACTOR_BG_NUMA_HANA, ACTORCAT_BG, FLAGS, @@ -157,7 +157,7 @@ void BgNumaHana_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->torchCollider, &this->dyna.actor, &sCylinderInit); this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; if (!BgNumaHana_SpawnOpenFlowerCollisionChild(this, play)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } diff --git a/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.h b/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.h index e715b5c09..fd71577cd 100644 --- a/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.h +++ b/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.h @@ -40,6 +40,4 @@ typedef struct BgNumaHana { /* 0x33E */ s16 transitionTimer; } BgNumaHana; // size = 0x340 -extern const ActorInit Bg_Numa_Hana_InitVars; - #endif // Z_BG_NUMA_HANA_H diff --git a/src/overlays/actors/ovl_Bg_Open_Shutter/z_bg_open_shutter.c b/src/overlays/actors/ovl_Bg_Open_Shutter/z_bg_open_shutter.c index 6504ec00e..1b45578c1 100644 --- a/src/overlays/actors/ovl_Bg_Open_Shutter/z_bg_open_shutter.c +++ b/src/overlays/actors/ovl_Bg_Open_Shutter/z_bg_open_shutter.c @@ -27,7 +27,7 @@ typedef enum { /* 0x2 */ BGOPENSHUTTER_DOOR_CLOSED, } BGOpenShutterDoorState; -const ActorInit Bg_Open_Shutter_InitVars = { +ActorInit Bg_Open_Shutter_InitVars = { ACTOR_BG_OPEN_SHUTTER, ACTORCAT_DOOR, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Open_Shutter/z_bg_open_shutter.h b/src/overlays/actors/ovl_Bg_Open_Shutter/z_bg_open_shutter.h index fdf2791e1..f6c6067d4 100644 --- a/src/overlays/actors/ovl_Bg_Open_Shutter/z_bg_open_shutter.h +++ b/src/overlays/actors/ovl_Bg_Open_Shutter/z_bg_open_shutter.h @@ -16,6 +16,4 @@ typedef struct BgOpenShutter { /* 0x164 */ s32 unk_164; } BgOpenShutter; // size = 0x168 -extern const ActorInit Bg_Open_Shutter_InitVars; - #endif // Z_BG_OPEN_SHUTTER_H diff --git a/src/overlays/actors/ovl_Bg_Open_Spot/z_bg_open_spot.c b/src/overlays/actors/ovl_Bg_Open_Spot/z_bg_open_spot.c index 0f800f97b..dbe935b3f 100644 --- a/src/overlays/actors/ovl_Bg_Open_Spot/z_bg_open_spot.c +++ b/src/overlays/actors/ovl_Bg_Open_Spot/z_bg_open_spot.c @@ -16,7 +16,7 @@ void BgOpenSpot_Destroy(Actor* thisx, PlayState* play); void BgOpenSpot_Update(Actor* thisx, PlayState* play); void BgOpenSpot_Draw(Actor* thisx, PlayState* play); -const ActorInit Bg_Open_Spot_InitVars = { +ActorInit Bg_Open_Spot_InitVars = { ACTOR_BG_OPEN_SPOT, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Open_Spot/z_bg_open_spot.h b/src/overlays/actors/ovl_Bg_Open_Spot/z_bg_open_spot.h index 3a2b92125..0cc4d55b9 100644 --- a/src/overlays/actors/ovl_Bg_Open_Spot/z_bg_open_spot.h +++ b/src/overlays/actors/ovl_Bg_Open_Spot/z_bg_open_spot.h @@ -10,6 +10,4 @@ typedef struct BgOpenSpot { /* 0x144 */ AnimatedMaterial* texScrolls; } BgOpenSpot; // size = 0x148 -extern const ActorInit Bg_Open_Spot_InitVars; - #endif // Z_BG_OPEN_SPOT_H diff --git a/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c b/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c index fb8f04d78..8edd322ba 100644 --- a/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c +++ b/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c @@ -24,7 +24,7 @@ void BgSinkaiKabe_Update(Actor* thisx, PlayState* play); void BgSinkaiKabe_WaitForPlayer(BgSinkaiKabe* this, PlayState* play); -const ActorInit Bg_Sinkai_Kabe_InitVars = { +ActorInit Bg_Sinkai_Kabe_InitVars = { ACTOR_BG_SINKAI_KABE, ACTORCAT_ITEMACTION, FLAGS, @@ -103,7 +103,7 @@ void BgSinkaiKabe_Init(Actor* thisx, PlayState* play) { this->dyna.actor.unk20, NULL); } - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } this->actionFunc = BgSinkaiKabe_WaitForPlayer; @@ -140,7 +140,7 @@ void BgSinkaiKabe_WaitForPlayer(BgSinkaiKabe* this, PlayState* play) { } if (this->deepPython == NULL) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.h b/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.h index bc39da0ee..abb341797 100644 --- a/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.h +++ b/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.h @@ -17,6 +17,4 @@ typedef struct BgSinkaiKabe { /* 0x16C */ s32 pythonIndex; } BgSinkaiKabe; // size = 0x170 -extern const ActorInit Bg_Sinkai_Kabe_InitVars; - #endif // Z_BG_SINKAI_KABE_H 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 296f56268..d8885a829 100644 --- a/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c +++ b/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c @@ -24,7 +24,7 @@ void func_809CEBC0(BgSpdweb* this, PlayState* play); void func_809CEE74(BgSpdweb* this); void func_809CEEAC(BgSpdweb* this, PlayState* play); -const ActorInit Bg_Spdweb_InitVars = { +ActorInit Bg_Spdweb_InitVars = { ACTOR_BG_SPDWEB, ACTORCAT_BG, FLAGS, @@ -170,7 +170,7 @@ void BgSpdweb_Init(Actor* thisx, PlayState* play) { this->unk_162 = 0; if (Flags_GetSwitch(play, this->switchFlag)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } @@ -230,7 +230,7 @@ void func_809CE234(BgSpdweb* this, PlayState* play) { if (this->unk_162 == 0) { ActorCutscene_Stop(this->dyna.actor.cutscene); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -311,7 +311,7 @@ void func_809CE4C8(BgSpdweb* this, PlayState* play) { this->unk_164 = temp_f12; this->unk_162 = 12; if (sp3A > 50) { - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->unk_161 = 1; } } else if (player->actor.speedXZ != 0.0f) { @@ -332,7 +332,7 @@ void func_809CE4C8(BgSpdweb* this, PlayState* play) { player->actor.velocity.y = this->unk_164 * 0.7f; player->unk_B68 = (SQ(this->unk_164) * 0.15f) + this->dyna.actor.world.pos.y; this->unk_161 = 0; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } } else if (this->unk_162 == 11) { if (this->unk_164 > 3.0f) { @@ -373,7 +373,7 @@ void func_809CE830(BgSpdweb* this, PlayState* play) { if (ActorCutscene_GetLength(this->dyna.actor.cutscene) == -1) { ActorCutscene_Stop(this->dyna.actor.cutscene); } - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } diff --git a/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.h b/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.h index 64a6fd34b..c57353ce0 100644 --- a/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.h +++ b/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.h @@ -24,6 +24,4 @@ typedef struct BgSpdweb { /* 0x2F8 */ Vec3s* unk_2F8; } BgSpdweb; // size = 0x2FC -extern const ActorInit Bg_Spdweb_InitVars; - #endif // Z_BG_SPDWEB_H diff --git a/src/overlays/actors/ovl_Bg_Spout_Fire/z_bg_spout_fire.c b/src/overlays/actors/ovl_Bg_Spout_Fire/z_bg_spout_fire.c index 055598c00..fdf56d87c 100644 --- a/src/overlays/actors/ovl_Bg_Spout_Fire/z_bg_spout_fire.c +++ b/src/overlays/actors/ovl_Bg_Spout_Fire/z_bg_spout_fire.c @@ -22,7 +22,7 @@ void func_80A60CDC(BgSpoutFire* this, PlayState* play); void func_80A60D10(BgSpoutFire* this, PlayState* play); void func_80A60E08(BgSpoutFire* this, PlayState* play); -const ActorInit Bg_Spout_Fire_InitVars = { +ActorInit Bg_Spout_Fire_InitVars = { ACTOR_BG_SPOUT_FIRE, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Bg_Spout_Fire/z_bg_spout_fire.h b/src/overlays/actors/ovl_Bg_Spout_Fire/z_bg_spout_fire.h index 808b72061..5cbf36a05 100644 --- a/src/overlays/actors/ovl_Bg_Spout_Fire/z_bg_spout_fire.h +++ b/src/overlays/actors/ovl_Bg_Spout_Fire/z_bg_spout_fire.h @@ -15,6 +15,4 @@ typedef struct BgSpoutFire { /* 0x14C */ ColliderCylinder collider; } BgSpoutFire; // size = 0x198 -extern const ActorInit Bg_Spout_Fire_InitVars; - #endif // Z_BG_SPOUT_FIRE_H diff --git a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c index 55276b217..a4256de8f 100644 --- a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c +++ b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c @@ -16,7 +16,7 @@ void BgTobira01_Destroy(Actor* thisx, PlayState* play); void BgTobira01_Update(Actor* thisx, PlayState* play); void BgTobira01_Draw(Actor* thisx, PlayState* play); -const ActorInit Bg_Tobira01_InitVars = { +ActorInit Bg_Tobira01_InitVars = { ACTOR_BG_TOBIRA01, ACTORCAT_PROP, FLAGS, @@ -67,7 +67,8 @@ void BgTobira01_Open(BgTobira01* this, PlayState* play) { this->timer2 = 180; } - if (!(player->stateFlags1 & 0x40) && (gSaveContext.save.weekEventReg[88] & 0x40) && (DECR(this->timer2) == 0)) { + if (!(player->stateFlags1 & PLAYER_STATE1_40) && (gSaveContext.save.weekEventReg[88] & 0x40) && + (DECR(this->timer2) == 0)) { gSaveContext.save.weekEventReg[88] &= (u8)~0x40; } } diff --git a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.h b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.h index 559ea6351..14a5e1b8e 100644 --- a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.h +++ b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.h @@ -17,6 +17,4 @@ typedef struct BgTobira01 { /* 0x16C */ s32 unk_16C; // unused besides being set to 0 } BgTobira01; // size = 0x170 -extern const ActorInit Bg_Tobira01_InitVars; - #endif // Z_BG_TOBIRA01_H diff --git a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c index 2a584bb31..479239f05 100644 --- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c +++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c @@ -18,7 +18,7 @@ void BgUmajump_Draw(Actor* thisx, PlayState* play); void func_8091A5A0(Actor* thisx, PlayState* play); -const ActorInit Bg_Umajump_InitVars = { +ActorInit Bg_Umajump_InitVars = { ACTOR_BG_UMAJUMP, ACTORCAT_PROP, FLAGS, @@ -107,13 +107,13 @@ void BgUmajump_Init(Actor* thisx, PlayState* play) { this->objectIndex = Object_GetIndex(&play->objectCtx, OBJECT_UMAJUMP); if (this->objectIndex < 0) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } if ((thisx->params == BG_UMAJUMP_TYPE_3) && CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_KANBAN, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, thisx->shape.rot.x, thisx->shape.rot.y, thisx->shape.rot.z, 0x3E); - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } } } @@ -187,7 +187,7 @@ void func_8091A5A0(Actor* thisx, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_KANBAN, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, 0x3E); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } if (this->dyna.actor.params == BG_UMAJUMP_TYPE_5) { diff --git a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.h b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.h index 733bf77da..62aaf6cb7 100644 --- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.h +++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.h @@ -30,6 +30,4 @@ typedef struct BgUmajump { /* 0x168 */ Actor* horse; } BgUmajump; // size = 0x16C -extern const ActorInit Bg_Umajump_InitVars; - #endif // Z_BG_UMAJUMP_H diff --git a/src/overlays/actors/ovl_Boss_01/z_boss_01.c b/src/overlays/actors/ovl_Boss_01/z_boss_01.c index 40800569f..8d13ab6d3 100644 --- a/src/overlays/actors/ovl_Boss_01/z_boss_01.c +++ b/src/overlays/actors/ovl_Boss_01/z_boss_01.c @@ -234,7 +234,7 @@ static ColliderCylinderInit D_809D7CA0 = { { 8, 15, 10, { 0, 0, 0 } }, }; -const ActorInit Boss_01_InitVars = { +ActorInit Boss_01_InitVars = { ACTOR_BOSS_01, ACTORCAT_BOSS, FLAGS, diff --git a/src/overlays/actors/ovl_Boss_01/z_boss_01.h b/src/overlays/actors/ovl_Boss_01/z_boss_01.h index 3d874a01f..37c8d4b00 100644 --- a/src/overlays/actors/ovl_Boss_01/z_boss_01.h +++ b/src/overlays/actors/ovl_Boss_01/z_boss_01.h @@ -14,6 +14,4 @@ typedef struct Boss01 { /* 0x468 */ char unk_468[0x674]; } Boss01; // size = 0xADC -extern const ActorInit Boss_01_InitVars; - #endif // Z_BOSS_01_H diff --git a/src/overlays/actors/ovl_Boss_02/z_boss_02.c b/src/overlays/actors/ovl_Boss_02/z_boss_02.c index 0d0e55e62..8ab8b2651 100644 --- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c +++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c @@ -112,7 +112,7 @@ static DamageTable sRedTwinmoldDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0xF), }; -const ActorInit Boss_02_InitVars = { +ActorInit Boss_02_InitVars = { ACTOR_BOSS_02, ACTORCAT_BOSS, FLAGS, @@ -462,20 +462,20 @@ Vec3f D_809DFA2C[] = { { -800.0f, -1000.0f, 0.0f }, { -800.0f, -1000.0f, 0.0f }, { -800.0f, -1000.0f, 0.0f }, }; -void func_809DA1D0(PlayState* play, u8 arg1, u8 arg2, u8 arg3, u8 arg4) { - MREG(64) = 1; - MREG(65) = arg1; - MREG(66) = arg2; - MREG(67) = arg3; - MREG(68) = arg4; +void func_809DA1D0(PlayState* play, u8 red, u8 green, u8 blue, u8 alpha) { + R_PLAY_FILL_SCREEN_ON = true; + R_PLAY_FILL_SCREEN_R = red; + R_PLAY_FILL_SCREEN_G = green; + R_PLAY_FILL_SCREEN_B = blue; + R_PLAY_FILL_SCREEN_ALPHA = alpha; } -void func_809DA22C(PlayState* play, u8 arg1) { - MREG(68) = arg1; +void func_809DA22C(PlayState* play, u8 alpha) { + R_PLAY_FILL_SCREEN_ALPHA = alpha; } void func_809DA24C(PlayState* play) { - MREG(64) = 0; + R_PLAY_FILL_SCREEN_ON = false; } void Boss02_SpawnEffectSand(TwinmoldEffect* effects, Vec3f* pos, f32 scale) { @@ -1097,7 +1097,7 @@ void func_809DBFB4(Boss02* this, PlayState* play) { } while (0); if ((s8)this->actor.colChkInfo.health <= 0) { - Actor_MarkForDeath(this->actor.child); + Actor_Kill(this->actor.child); this->actor.child = NULL; Enemy_StartFinishingBlow(play, &this->actor); this->skelAnime.playSpeed = 2.0f; @@ -1626,13 +1626,13 @@ void func_809DD934(Boss02* this, PlayState* play) { Vec3f sp58; u8 sp57 = 0; f32 phi_f0_2; - s16 phi_v1; + s16 alpha; this->unk_1D14++; switch (this->unk_1D18) { case 0: - if (player->stateFlags1 & 0x100) { + if (player->stateFlags1 & PLAYER_STATE1_100) { Cutscene_Start(play, &play->csCtx); this->subCamId = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); @@ -1755,7 +1755,7 @@ void func_809DD934(Boss02* this, PlayState* play) { this->subCamId = SUB_CAM_ID_DONE; Cutscene_End(play, &play->csCtx); this->actor.flags |= ACTOR_FLAG_1; - player->stateFlags1 &= ~0x100; + player->stateFlags1 &= ~PLAYER_STATE1_100; this->unk_1D70 = 0.01f; func_80165690(); break; @@ -1924,7 +1924,7 @@ void func_809DD934(Boss02* this, PlayState* play) { temp_a0_5 = play->actorCtx.actorLists[ACTORCAT_BG].first; while (temp_a0_5 != NULL) { if (temp_a0_5->id == ACTOR_BG_INIBS_MOVEBG) { - Actor_MarkForDeath(temp_a0_5); + Actor_Kill(temp_a0_5); break; } temp_a0_5 = temp_a0_5->next; @@ -1995,11 +1995,9 @@ void func_809DD934(Boss02* this, PlayState* play) { if (this->unk_1D7A >= 400) { this->unk_1D78 = 3; } - phi_v1 = this->unk_1D7A; - if (phi_v1 > 255) { - phi_v1 = 255; - } - func_809DA22C(play, phi_v1); + alpha = this->unk_1D7A; + alpha = CLAMP_MAX(alpha, 255); + func_809DA22C(play, alpha); break; case 3: @@ -2009,11 +2007,9 @@ void func_809DD934(Boss02* this, PlayState* play) { this->unk_1D78 = 0; func_809DA24C(play); } else { - phi_v1 = this->unk_1D7A; - if (phi_v1 > 255) { - phi_v1 = 255; - } - func_809DA22C(play, phi_v1); + alpha = this->unk_1D7A; + alpha = CLAMP_MAX(alpha, 255); + func_809DA22C(play, alpha); } break; } diff --git a/src/overlays/actors/ovl_Boss_02/z_boss_02.h b/src/overlays/actors/ovl_Boss_02/z_boss_02.h index 17028912b..e7efc1199 100644 --- a/src/overlays/actors/ovl_Boss_02/z_boss_02.h +++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.h @@ -108,6 +108,4 @@ typedef struct Boss02 { /* 0x1D7E */ s16 unk_1D7E; } Boss02; // size = 0x1D80 -extern const ActorInit Boss_02_InitVars; - #endif // Z_BOSS_02_H diff --git a/src/overlays/actors/ovl_Boss_03/z_boss_03.c b/src/overlays/actors/ovl_Boss_03/z_boss_03.c index a0f3a208b..a4c58e71d 100644 --- a/src/overlays/actors/ovl_Boss_03/z_boss_03.c +++ b/src/overlays/actors/ovl_Boss_03/z_boss_03.c @@ -278,7 +278,7 @@ Actor* Boss03_FindActorDblueMovebg(PlayState* play) { /* Start of Gyorg's Init and actionFuncs section */ -const ActorInit Boss_03_InitVars = { +ActorInit Boss_03_InitVars = { ACTOR_BOSS_03, ACTORCAT_BOSS, FLAGS, @@ -457,7 +457,7 @@ void Boss03_Init(Actor* thisx, PlayState* play2) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, 0.0f, PLATFORM_HEIGHT, 200.0f, 0, 0, 0, ENDOORWARP1_FF_1); Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, 0.0f, PLATFORM_HEIGHT, 0.0f, 0, 0, 0, 0); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_Boss_04/z_boss_04.c b/src/overlays/actors/ovl_Boss_04/z_boss_04.c index 9a7371c97..26965b257 100644 --- a/src/overlays/actors/ovl_Boss_04/z_boss_04.c +++ b/src/overlays/actors/ovl_Boss_04/z_boss_04.c @@ -62,7 +62,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0xF), }; -const ActorInit Boss_04_InitVars = { +ActorInit Boss_04_InitVars = { ACTOR_BOSS_04, ACTORCAT_BOSS, FLAGS, @@ -157,7 +157,7 @@ void Boss04_Init(Actor* thisx, PlayState* play2) { s32 pad; if (Flags_GetClear(play, play->roomCtx.curRoom.num)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -252,7 +252,7 @@ void func_809EC568(Boss04* this, PlayState* play) { case 0: this->unk_2C8 = 50; this->unk_2D0 = 2000.0f; - if ((player->stateFlags1 & 0x100000) && (this->actor.projectedPos.z > 0.0f) && + if ((player->stateFlags1 & PLAYER_STATE1_100000) && (this->actor.projectedPos.z > 0.0f) && (fabsf(this->actor.projectedPos.x) < 300.0f) && (fabsf(this->actor.projectedPos.y) < 300.0f)) { if ((this->unk_704 >= 15) && (ActorCutscene_GetCurrentIndex() == -1)) { Actor* boss; @@ -277,7 +277,7 @@ void func_809EC568(Boss04* this, PlayState* play) { boss = play->actorCtx.actorLists[ACTORCAT_BOSS].first; while (boss != NULL) { if (boss->id == ACTOR_EN_WATER_EFFECT) { - Actor_MarkForDeath(boss); + Actor_Kill(boss); } boss = boss->next; } @@ -559,7 +559,7 @@ void func_809ED2A0(Boss04* this, PlayState* play) { } if (this->unk_1FA == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Boss_04/z_boss_04.h b/src/overlays/actors/ovl_Boss_04/z_boss_04.h index c0944ce82..6aa153597 100644 --- a/src/overlays/actors/ovl_Boss_04/z_boss_04.h +++ b/src/overlays/actors/ovl_Boss_04/z_boss_04.h @@ -76,6 +76,4 @@ typedef struct Boss04 { /* 0x74A */ u8 unk_74A; } Boss04; // size = 0x74C -extern const ActorInit Boss_04_InitVars; - #endif // Z_BOSS_04_H diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.c b/src/overlays/actors/ovl_Boss_05/z_boss_05.c index 7b40069d7..314370079 100644 --- a/src/overlays/actors/ovl_Boss_05/z_boss_05.c +++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.c @@ -147,7 +147,7 @@ static DamageTable D_809F1C20 = { /* Powder Keg */ DMG_ENTRY(1, 0xF), }; -const ActorInit Boss_05_InitVars = { +ActorInit Boss_05_InitVars = { ACTOR_BOSS_05, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.h b/src/overlays/actors/ovl_Boss_05/z_boss_05.h index 7a3f29507..8f46476ea 100644 --- a/src/overlays/actors/ovl_Boss_05/z_boss_05.h +++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.h @@ -14,6 +14,4 @@ typedef struct Boss05 { /* 0x174 */ char unk_174[0x394]; } Boss05; // size = 0x508 -extern const ActorInit Boss_05_InitVars; - #endif // Z_BOSS_05_H diff --git a/src/overlays/actors/ovl_Boss_06/z_boss_06.c b/src/overlays/actors/ovl_Boss_06/z_boss_06.c index 1b8b6fef6..a72dcf8b3 100644 --- a/src/overlays/actors/ovl_Boss_06/z_boss_06.c +++ b/src/overlays/actors/ovl_Boss_06/z_boss_06.c @@ -4,7 +4,6 @@ * Description: Igos du Ikana window - curtains and ray effects */ -#include "prevent_bss_reordering.h" #include "z_boss_06.h" #include "z64shrink_window.h" #include "overlays/actors/ovl_En_Knight/z_en_knight.h" @@ -29,11 +28,11 @@ void func_809F2E34(Boss06* this, PlayState* play); void func_809F2ED0(Boss06* this, PlayState* play); void func_809F2EE8(Boss06* this, PlayState* play); -static Vec3f D_809F4370[128]; -static EnKnight* D_809F4970; -static s32 D_809F4974; -static s32 D_809F4978; -static s32 D_809F497C; +Vec3f D_809F4370[128]; +EnKnight* D_809F4970; +s32 D_809F4974; +s32 D_809F4978; +s32 D_809F497C; static DamageTable sDamageTable = { /* Deku Nut */ DMG_ENTRY(0, 0xF), @@ -70,7 +69,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(0, 0xF), }; -const ActorInit Boss_06_InitVars = { +ActorInit Boss_06_InitVars = { ACTOR_BOSS_06, ACTORCAT_BOSS, FLAGS, @@ -102,7 +101,7 @@ static ColliderCylinderInit sCylinderInit = { { 90, 140, 10, { 0, 0, 0 } }, }; -static Vec3f D_809F40EC[] = { +Vec3f D_809F40EC[] = { { 1081.0f, 235.0f, 3224.0f }, { 676.0f, 235.0f, 3224.0f }, }; @@ -183,7 +182,7 @@ void func_809F24A8(Boss06* this) { } #ifdef NON_MATCHING -// Weird loading of 1 +// The 1 constant from the switch branch is reused in case 2 for some reason. void func_809F24C8(Boss06* this, PlayState* play) { s16 sp4E = 0; Player* player = GET_PLAYER(play); @@ -213,7 +212,7 @@ void func_809F24C8(Boss06* this, PlayState* play) { temp_s0 = play->actorCtx.actorLists[ACTORCAT_ITEMACTION].first; while (temp_s0 != NULL) { if (temp_s0->id == ACTOR_EN_ARROW) { - Actor_MarkForDeath(temp_s0); + Actor_Kill(temp_s0); } temp_s0 = temp_s0->next; } @@ -382,7 +381,7 @@ void func_809F2C44(Boss06* this, PlayState* play) { } if (D_809F4970->unk_153 == 2) { - Actor_MarkForDeath(this->actor.child); + Actor_Kill(this->actor.child); this->actor.child = NULL; func_809F2E14(this, play); } diff --git a/src/overlays/actors/ovl_Boss_06/z_boss_06.h b/src/overlays/actors/ovl_Boss_06/z_boss_06.h index 39d2f900a..f7b4d3ec0 100644 --- a/src/overlays/actors/ovl_Boss_06/z_boss_06.h +++ b/src/overlays/actors/ovl_Boss_06/z_boss_06.h @@ -50,6 +50,4 @@ typedef struct Boss06 { /* 0xA2C */ f32 unk_A2C; } Boss06; // size = 0xA30 -extern const ActorInit Boss_06_InitVars; - #endif // Z_BOSS_06_H diff --git a/src/overlays/actors/ovl_Boss_07/z_boss_07.c b/src/overlays/actors/ovl_Boss_07/z_boss_07.c index 2aca3b4b9..fd0d78f7a 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -5,10 +5,10 @@ */ #include "z_boss_07.h" +#include "z64shrink_window.h" #include "overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "objects/gameplay_keep/gameplay_keep.h" -#include "z64shrink_window.h" #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20) @@ -370,7 +370,7 @@ static s16 sShotPrimColors[4][3] = { #include "z_boss_07_dmgtbl.inc" -const ActorInit Boss_07_InitVars = { +ActorInit Boss_07_InitVars = { ACTOR_BOSS_07, ACTORCAT_BOSS, FLAGS, @@ -3500,7 +3500,7 @@ void Boss07_Incarnation_Death(Boss07* this, PlayState* play) { if (this->timer_ABC8 == 40) { Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, this->subCamIndex, MAJORAS_WRATH); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; } @@ -3585,7 +3585,7 @@ void Boss07_Afterimage_Update(Actor* thisx, PlayState* play2) { Boss07* this = THIS; if (DECR(this->timers[0]) == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -4682,7 +4682,7 @@ void Boss07_Mask_Death(Boss07* this, PlayState* play) { case MAJORAS_MASK_DEATH_STATE_2: Actor_Spawn(&play->actorCtx, play, ACTOR_BOSS_07, 0.0f, 0.0f, 0.0f, 0, this->actor.shape.rot.y, this->subCamIndex, MAJORAS_INCARNATION); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; } @@ -5181,7 +5181,7 @@ void Boss07_Projectile_Update(Actor* thisx, PlayState* play2) { this->actor.shape.rot.z += 0x1200; if ((this->actor.bgCheckFlags & 0x19) || (this->spawnCollider.base.atFlags & AT_HIT) || (this->spawnCollider.base.atFlags & AT_HIT) || sKillProjectiles) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, this->shotColorIndex, CLEAR_TAG_SMALL_LIGHT_RAYS); } @@ -5682,7 +5682,7 @@ void Boss07_Top_Ground(Boss07* this, PlayState* play) { if (bomb != NULL) { bomb->timer = 0; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if (this->timers[1] == 25) { this->dmgFogEffectTimer = 25; func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_EXPLOSIVES); @@ -5830,7 +5830,7 @@ void Boss07_Top_Update(Actor* thisx, PlayState* play2) { this->topSpinAngle += 2.0f * M_PI; } if (sMajorasWrath->actionFunc == Boss07_Wrath_Death) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Math_ApproachF(&this->actor.scale.x, (sREG(77) * 0.001f) + 0.06f, 1.0f, 0.012f); Actor_SetScale(&this->actor, this->actor.scale.x); diff --git a/src/overlays/actors/ovl_Boss_07/z_boss_07.h b/src/overlays/actors/ovl_Boss_07/z_boss_07.h index cf17e0e4d..3914ff587 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.h +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.h @@ -15,6 +15,20 @@ struct Boss07; typedef void (*Boss07ActionFunc)(struct Boss07*, struct PlayState*); +typedef enum { + /* 0 */ MAJORAS_BOSS, + /* 10 */ MAJORAS_MASK = 10, + /* 11 */ MAJORAS_MASK_CS, + /* 20 */ MAJORAS_INCARNATION = 20, + /* 21 */ MAJORAS_AFTERIMAGE, + /* 30 */ MAJORAS_WRATH = 30, + /* 100 */ MAJORAS_REMAINS_SHOT = 100, + /* 101 */ MAJORAS_INCARNATION_SHOT, + /* 150 */ MAJORAS_STATIC = 150, + /* 180 */ MAJORAS_TOP = 180, + /* 200 */ MAJORAS_REMAINS = 200, +} MajoraParams; + typedef struct { Vec3f base; Vec3f pos[MAJORAS_TENT_LENGTH]; @@ -162,20 +176,4 @@ typedef struct Boss07 { /* 0xAC18 */ UNK_TYPE1 unkAC18[8]; // probably floats } Boss07; // size = 0xAC20 -extern const ActorInit Boss_07_InitVars; - -typedef enum { - /* 0 */ MAJORAS_BOSS, - /* 10 */ MAJORAS_MASK = 10, - /* 11 */ MAJORAS_MASK_CS, - /* 20 */ MAJORAS_INCARNATION = 20, - /* 21 */ MAJORAS_AFTERIMAGE, - /* 30 */ MAJORAS_WRATH = 30, - /* 100 */ MAJORAS_REMAINS_SHOT = 100, - /* 101 */ MAJORAS_INCARNATION_SHOT, - /* 150 */ MAJORAS_STATIC = 150, - /* 180 */ MAJORAS_TOP = 180, - /* 200 */ MAJORAS_REMAINS = 200, -} MajoraParams; - #endif // Z_BOSS_07_H diff --git a/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.c b/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.c index efb46a892..d9a7cb348 100644 --- a/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.c +++ b/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.c @@ -34,7 +34,7 @@ void func_80B0A638(BossHakugin* this, PlayState* play); void func_80B0A8C4(BossHakugin* this, PlayState* play); #if 0 -const ActorInit Boss_Hakugin_InitVars = { +ActorInit Boss_Hakugin_InitVars = { ACTOR_BOSS_HAKUGIN, ACTORCAT_BOSS, FLAGS, diff --git a/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.h b/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.h index 4b8227021..10a01989a 100644 --- a/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.h +++ b/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.h @@ -36,6 +36,4 @@ typedef struct BossHakugin { /* 0x3734 */ char unk_3734[0xDC]; } BossHakugin; // size = 0x3810 -extern const ActorInit Boss_Hakugin_InitVars; - #endif // Z_BOSS_HAKUGIN_H diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index 8b5deef59..279a4f0d0 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -25,7 +25,7 @@ void func_808CDDE0(DemoEffect* this, PlayState* play); void func_808CDFF8(Actor* thisx, PlayState* play); void func_808CE078(Actor* thisx, PlayState* play2); -const ActorInit Demo_Effect_InitVars = { +ActorInit Demo_Effect_InitVars = { ACTOR_DEMO_EFFECT, ACTORCAT_BG, FLAGS, @@ -213,7 +213,7 @@ void func_808CDBDC(DemoEffect* this, PlayState* play) { func_800B8FE8(&this->actor, NA_SE_EV_TIMETRIP_LIGHT - SFX_FLAG); } else { func_808CDAD0(1.0f); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -232,7 +232,7 @@ void func_808CDD70(DemoEffect* this, PlayState* play) { this->timer++; if (this->actor.scale.x < 0.02f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h index 985e2c30c..9901a3189 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h @@ -34,6 +34,4 @@ typedef struct DemoEffect { /* 0x178 */ DemoEffectActionFunc actionFunc; } DemoEffect; // size = 0x17C -extern const ActorInit Demo_Effect_InitVars; - #endif // Z_DEMO_EFFECT_H diff --git a/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c b/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c index d39c8aa17..aa37e7b85 100644 --- a/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c +++ b/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c @@ -18,7 +18,7 @@ void func_80A4FB10(DemoGetitem* this, PlayState* play); void func_80A4FB68(DemoGetitem* this, PlayState* play2); void DemoGetitem_Draw(Actor* thisx, PlayState* play); -const ActorInit Demo_Getitem_InitVars = { +ActorInit Demo_Getitem_InitVars = { ACTOR_DEMO_GETITEM, ACTORCAT_BG, FLAGS, @@ -52,10 +52,11 @@ void DemoGetitem_Init(Actor* thisx, PlayState* play) { this->csAction = sCsActionIndices[itemIndex]; objectIndex = Object_GetIndex(&play->objectCtx, sObjectBankIndices[itemIndex]); if (objectIndex < 0) { - Actor_MarkForDeath(&this->actor); - } else { - this->objectIndex = objectIndex; + Actor_Kill(&this->actor); + return; } + + this->objectIndex = objectIndex; } void DemoGetitem_Destroy(Actor* thisx, PlayState* play) { @@ -82,17 +83,22 @@ void func_80A4FB68(DemoGetitem* this, PlayState* play2) { this->actor.draw = DemoGetitem_Draw; Cutscene_ActorTranslate(&this->actor, play, Cutscene_GetActorActionIndex(play, this->csAction)); this->actor.shape.rot.y += 0x3E8; - return; + break; + case 3: - Actor_MarkForDeath(&this->actor); - return; + Actor_Kill(&this->actor); + break; + case 4: this->actor.draw = DemoGetitem_Draw; Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->csAction)); this->actor.shape.yOffset = Math_SinS(sp22) * 15.0f; - return; + break; + + default: + this->actor.draw = NULL; + break; } - this->actor.draw = NULL; } else { this->actor.draw = NULL; } diff --git a/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.h b/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.h index acc2c0312..91c7dc97e 100644 --- a/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.h +++ b/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.h @@ -17,6 +17,4 @@ typedef struct DemoGetitem { /* 0x14C */ DemoGetitemActionFunc actionFunc; } DemoGetitem; // size = 0x150 -extern const ActorInit Demo_Getitem_InitVars; - #endif // Z_DEMO_GETITEM_H diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index 10b72634a..8b396cad9 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -22,7 +22,7 @@ void DemoKakyo_MoonSparklesActionFunc(DemoKankyo* this, PlayState* play); static u8 sLostWoodsSparklesMutex = false; // make sure only one can exist at once static s16 sLostWoodsSkyFishParticleNum = 0; -const ActorInit Demo_Kankyo_InitVars = { +ActorInit Demo_Kankyo_InitVars = { ACTOR_DEMO_KANKYO, ACTORCAT_ITEMACTION, FLAGS, @@ -59,7 +59,7 @@ void DemoKakyo_LostWoodsSparkleActionFunc(DemoKankyo* this, PlayState* play) { if (play->envCtx.unk_F2[3] != 0) { play->envCtx.unk_F2[3]--; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (play->envCtx.unk_F2[3] < DEMOKANKYO_EFFECT_COUNT) { play->envCtx.unk_F2[3] += 16; @@ -454,7 +454,7 @@ void DemoKankyo_Init(Actor* thisx, PlayState* play) { DemoKankyo_SetupAction(this, DemoKakyo_LostWoodsSparkleActionFunc); sLostWoodsSparklesMutex = true; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; @@ -484,7 +484,7 @@ void DemoKankyo_Init(Actor* thisx, PlayState* play) { void DemoKankyo_Destroy(Actor* thisx, PlayState* play) { DemoKankyo* this = THIS; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void DemoKankyo_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h index f6f05d0a6..971adb3bd 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h @@ -48,6 +48,4 @@ typedef enum { /* 3 */ DEMO_KANKYO_STATE_DISABLED, } DemoKankyoStateType; -extern const ActorInit Demo_Kankyo_InitVars; - #endif // Z_DEMO_KANKYO_H diff --git a/src/overlays/actors/ovl_Demo_Moonend/z_demo_moonend.c b/src/overlays/actors/ovl_Demo_Moonend/z_demo_moonend.c index c051ccf49..76a4230f5 100644 --- a/src/overlays/actors/ovl_Demo_Moonend/z_demo_moonend.c +++ b/src/overlays/actors/ovl_Demo_Moonend/z_demo_moonend.c @@ -16,7 +16,7 @@ void DemoMoonend_Update(Actor* thisx, PlayState* play); void DemoMoonend_Draw(Actor* thisx, PlayState* play); #if 0 -const ActorInit Demo_Moonend_InitVars = { +ActorInit Demo_Moonend_InitVars = { ACTOR_DEMO_MOONEND, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Demo_Moonend/z_demo_moonend.h b/src/overlays/actors/ovl_Demo_Moonend/z_demo_moonend.h index 212e93d84..d36dcb284 100644 --- a/src/overlays/actors/ovl_Demo_Moonend/z_demo_moonend.h +++ b/src/overlays/actors/ovl_Demo_Moonend/z_demo_moonend.h @@ -13,6 +13,4 @@ typedef struct DemoMoonend { /* 0x2E0 */ DemoMoonendActionFunc actionFunc; } DemoMoonend; // size = 0x2E4 -extern const ActorInit Demo_Moonend_InitVars; - #endif // Z_DEMO_MOONEND_H diff --git a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c index 0078f8959..f5e20a509 100644 --- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c +++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c @@ -15,7 +15,7 @@ void DemoShd_Destroy(Actor* thisx, PlayState* play); void DemoShd_Update(Actor* thisx, PlayState* play); void DemoShd_Draw(Actor* thisx, PlayState* play); -const ActorInit Demo_Shd_InitVars = { +ActorInit Demo_Shd_InitVars = { ACTOR_DEMO_SHD, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h index 4e375a243..05707f073 100644 --- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h +++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h @@ -10,6 +10,4 @@ typedef struct DemoShd { /* 0x0144 */ char unk_0144[0x118C]; } DemoShd; // size = 0x12D0 -extern const ActorInit Demo_Shd_InitVars; - #endif // Z_DEMO_SHD_H diff --git a/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c b/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c index b3a79895e..853d91cb9 100644 --- a/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c +++ b/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c @@ -25,7 +25,7 @@ void func_80C17008(DemoSyoten* this, PlayState* play); void func_80C173B4(Actor* thisx, PlayState* play); void func_80C17690(Actor* thisx, PlayState* play); -const ActorInit Demo_Syoten_InitVars = { +ActorInit Demo_Syoten_InitVars = { ACTOR_DEMO_SYOTEN, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.h b/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.h index b0a00f2a6..7b60ae951 100644 --- a/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.h +++ b/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.h @@ -37,6 +37,4 @@ typedef struct DemoSyoten { /* 0x3F4 */ DemoSyotenActionFunc actionFunc; } DemoSyoten; // size = 0x3F8 -extern const ActorInit Demo_Syoten_InitVars; - #endif // Z_DEMO_SYOTEN_H diff --git a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c index ca833fe0e..b2b8e0077 100644 --- a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c +++ b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c @@ -35,7 +35,7 @@ static DemoTreLgtInfo D_808E1490[2] = { { 1.0f, 136.0f, 220.0f, 50.0f }, }; -const ActorInit Demo_Tre_Lgt_InitVars = { +ActorInit Demo_Tre_Lgt_InitVars = { ACTOR_DEMO_TRE_LGT, ACTORCAT_ITEMACTION, FLAGS, @@ -131,7 +131,7 @@ void DemoTreLgt_Animate(DemoTreLgt* this, PlayState* play) { } } if (SkelCurve_Update(play, &this->skelCurve)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h index 83a210b8c..e6d5d568c 100644 --- a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h +++ b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h @@ -18,6 +18,4 @@ typedef struct DemoTreLgt { /* 0x174 */ s32 animationType; } DemoTreLgt; // size = 0x178 -extern const ActorInit Demo_Tre_Lgt_InitVars; - #endif // Z_DEMO_TRE_LGT_H diff --git a/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c b/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c index 58d27d448..047d17b90 100644 --- a/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c +++ b/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c @@ -15,7 +15,7 @@ void DmAh_Destroy(Actor* thisx, PlayState* play); void DmAh_Update(Actor* thisx, PlayState* play); void DmAh_Draw(Actor* thisx, PlayState* play); -const ActorInit Dm_Ah_InitVars = { +ActorInit Dm_Ah_InitVars = { ACTOR_DM_AH, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.h b/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.h index dc9a437ed..df179c6f6 100644 --- a/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.h +++ b/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.h @@ -33,6 +33,4 @@ typedef struct DmAh { /* 0x29C */ s32 unk_29C; } DmAh; // size = 0x2A0 -extern const ActorInit Dm_Ah_InitVars; - #endif // Z_DM_AH_H diff --git a/src/overlays/actors/ovl_Dm_Al/z_dm_al.c b/src/overlays/actors/ovl_Dm_Al/z_dm_al.c index 6c7a1be69..f81713731 100644 --- a/src/overlays/actors/ovl_Dm_Al/z_dm_al.c +++ b/src/overlays/actors/ovl_Dm_Al/z_dm_al.c @@ -15,7 +15,7 @@ void DmAl_Destroy(Actor* thisx, PlayState* play); void DmAl_Update(Actor* thisx, PlayState* play); void DmAl_Draw(Actor* thisx, PlayState* play); -const ActorInit Dm_Al_InitVars = { +ActorInit Dm_Al_InitVars = { ACTOR_EN_AL, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_Dm_Al/z_dm_al.h b/src/overlays/actors/ovl_Dm_Al/z_dm_al.h index 8f89a4448..57e462de1 100644 --- a/src/overlays/actors/ovl_Dm_Al/z_dm_al.h +++ b/src/overlays/actors/ovl_Dm_Al/z_dm_al.h @@ -21,6 +21,9 @@ typedef struct DmAl { /* 0x45C */ s32 unk_45C; } DmAl; // size = 0x460 -extern const ActorInit Dm_Al_InitVars; +typedef enum { + /* 0x0 */ MADAME_AROMA_ANIMATION_0, + /* 0x1 */ MADAME_AROMA_ANIMATION_1 +} DmAlAnimations; #endif // Z_DM_AL_H diff --git a/src/overlays/actors/ovl_Dm_An/z_dm_an.c b/src/overlays/actors/ovl_Dm_An/z_dm_an.c index 592800e9d..d536425b0 100644 --- a/src/overlays/actors/ovl_Dm_An/z_dm_an.c +++ b/src/overlays/actors/ovl_Dm_An/z_dm_an.c @@ -21,7 +21,7 @@ void func_80C1CAB0(DmAn* this, PlayState* play); void func_80C1CC80(DmAn* this, PlayState* play); void func_80C1D0B0(Actor* thisx, PlayState* play); -const ActorInit Dm_An_InitVars = { +ActorInit Dm_An_InitVars = { ACTOR_DM_AN, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_Dm_An/z_dm_an.h b/src/overlays/actors/ovl_Dm_An/z_dm_an.h index 2282fee9c..2001a8ba6 100644 --- a/src/overlays/actors/ovl_Dm_An/z_dm_an.h +++ b/src/overlays/actors/ovl_Dm_An/z_dm_an.h @@ -36,6 +36,4 @@ typedef struct DmAn { /* 0x2D4 */ s32 unk_2D4; } DmAn; // size = 0x2D8 -extern const ActorInit Dm_An_InitVars; - #endif // Z_DM_AN_H diff --git a/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c b/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c index 04dd13ca4..e2dc0daa7 100644 --- a/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c +++ b/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c @@ -18,7 +18,7 @@ void DmBal_Draw(Actor* thisx, PlayState* play); void func_80C1EAC4(DmBal* this); void func_80C1EAD8(DmBal* this, PlayState* play); -const ActorInit Dm_Bal_InitVars = { +ActorInit Dm_Bal_InitVars = { ACTOR_DM_BAL, ACTORCAT_NPC, FLAGS, @@ -191,7 +191,7 @@ s32 DmBal_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p void DmBal_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { } -TexturePtr sEyeTextures[] = { object_bal_Tex_006050, object_bal_Tex_0094D0 }; +static TexturePtr sEyeTextures[] = { object_bal_Tex_006050, object_bal_Tex_0094D0 }; void DmBal_Draw(Actor* thisx, PlayState* play) { DmBal* this = THIS; diff --git a/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.h b/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.h index bda05149f..7b3835653 100644 --- a/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.h +++ b/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.h @@ -23,6 +23,4 @@ typedef struct DmBal { /* 0x33A */ s16 unk_33A; } DmBal; /* size = 0x33C */ -extern const ActorInit Dm_Bal_InitVars; - #endif // Z_DM_BAL_H diff --git a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c index a40bd1bc3..95aef1835 100644 --- a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c +++ b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c @@ -20,7 +20,7 @@ void DmChar00_Draw(Actor* thisx, PlayState* play2); void func_80AA67F8(DmChar00* this, PlayState* play); void func_80AA695C(DmChar00* this, PlayState* play); -const ActorInit Dm_Char00_InitVars = { +ActorInit Dm_Char00_InitVars = { ACTOR_DM_CHAR00, ACTORCAT_ITEMACTION, FLAGS, @@ -528,7 +528,7 @@ void DmChar00_Init(Actor* thisx, PlayState* play) { DmChar00* this = THIS; if ((play->sceneId == SCENE_LOST_WOODS) && !Cutscene_IsPlaying(play)) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } this->unk_240 = D_80AA77A8[DMCHAR00_GET(thisx)]; @@ -648,7 +648,7 @@ void func_80AA62FC(DmChar00* this, PlayState* play) { break; case 0x16: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; case 0x17: diff --git a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.h b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.h index 1df0df06d..62ee0cb40 100644 --- a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.h +++ b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.h @@ -28,6 +28,4 @@ typedef struct DmChar00 { /* 0x262 */ u16 unk_262; } DmChar00; // size = 0x264 -extern const ActorInit Dm_Char00_InitVars; - #endif // Z_DM_CHAR00_H diff --git a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c index 6d3b18c2d..fb68b17c6 100644 --- a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c +++ b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c @@ -35,7 +35,7 @@ s16 D_80AAAE26; #include "overlays/ovl_Dm_Char01/ovl_Dm_Char01.c" -const ActorInit Dm_Char01_InitVars = { +ActorInit Dm_Char01_InitVars = { ACTOR_DM_CHAR01, ACTORCAT_ITEMACTION, FLAGS, @@ -124,7 +124,7 @@ void DmChar01_Init(Actor* thisx, PlayState* play) { this->dyna.actor.world.rot.y += 0x8000; this->dyna.actor.shape.rot.y += 0x8000; if (!(gSaveContext.save.weekEventReg[20] & 1)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -164,7 +164,7 @@ void func_80AA8698(DmChar01* this, PlayState* play) { return; } - if ((player->stateFlags2 & 0x8000000) && (player2->actor.world.pos.x > -40.0f) && + if ((player->stateFlags2 & PLAYER_STATE2_8000000) && (player2->actor.world.pos.x > -40.0f) && (player2->actor.world.pos.x < 40.0f) && (player2->actor.world.pos.z > 1000.0f) && (player2->actor.world.pos.z < 1078.0f)) { if (!D_80AAAAB4) { diff --git a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.h b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.h index 677a2b59b..6f29531a0 100644 --- a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.h +++ b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.h @@ -28,6 +28,4 @@ typedef struct DmChar01 { /* 0x34D */ u8 unk_34D; } DmChar01; // size = 0x350 -extern const ActorInit Dm_Char01_InitVars; - #endif // Z_DM_CHAR01_H diff --git a/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c b/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c index da67e6f1c..b618281c2 100644 --- a/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c +++ b/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c @@ -18,7 +18,7 @@ void DmChar02_Draw(Actor* thisx, PlayState* play); void DmChar02_PerformCutsceneActions(DmChar02* this, PlayState* play); -const ActorInit Dm_Char02_InitVars = { +ActorInit Dm_Char02_InitVars = { ACTOR_DM_CHAR02, ACTORCAT_ITEMACTION, FLAGS, @@ -92,7 +92,7 @@ void DmChar02_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); this->actionFunc = DmChar02_PerformCutsceneActions; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -151,7 +151,7 @@ void DmChar02_Update(Actor* thisx, PlayState* play) { Actor_PickUp(&this->actor, play, GI_OCARINA, 30.0f, 80.0f); } else { gSaveContext.save.playerForm = PLAYER_FORM_HUMAN; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } DmChar02_PlaySfxForCutscenes(this, play); diff --git a/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.h b/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.h index 697989496..7a9722554 100644 --- a/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.h +++ b/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.h @@ -18,6 +18,4 @@ typedef struct DmChar02 { /* 0x2F0 */ u32 unk_2F0; } DmChar02; // size = 0x2F4 -extern const ActorInit Dm_Char02_InitVars; - #endif // Z_DM_CHAR02_H diff --git a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c index 397fbfa3c..714913231 100644 --- a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c +++ b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c @@ -20,7 +20,7 @@ void func_80AAB644(DmChar03* this, PlayState* play); void DmChar03_DoNothing(DmChar03* this, PlayState* play); void func_80AABA84(PlayState* play, DmChar03* this); -const ActorInit Dm_Char03_InitVars = { +ActorInit Dm_Char03_InitVars = { ACTOR_DM_CHAR03, ACTORCAT_ITEMACTION, FLAGS, @@ -32,7 +32,9 @@ const ActorInit Dm_Char03_InitVars = { (ActorFunc)DmChar03_Draw, }; -AnimationInfo sAnimationInfo[] = { { &object_osn_Anim_020530, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f } }; +AnimationInfo sAnimationInfo[] = { + { &gDekuMaskFallOverAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, +}; void DmChar03_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animationInfo, u16 animIndex) { f32 frame; @@ -106,7 +108,7 @@ void func_80AAB710(DmChar03* this, PlayState* play) { case 3: this->unk_18E = false; shouldChangeAnim = false; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; case 4: Item_Give(play, ITEM_MASK_DEKU); diff --git a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.h b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.h index f736220c8..5b4a2e621 100644 --- a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.h +++ b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.h @@ -17,6 +17,4 @@ typedef struct DmChar03 { /* 0x190 */ Vec3f offset; } DmChar03; // size = 0x19C -extern const ActorInit Dm_Char03_InitVars; - #endif // Z_DM_CHAR03_H diff --git a/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c b/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c index f7b4b47e8..12165ed89 100644 --- a/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c +++ b/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c @@ -18,7 +18,7 @@ void DmChar04_Draw(Actor* thisx, PlayState* play); void func_80AABE34(DmChar04* this, PlayState* play); -const ActorInit Dm_Char04_InitVars = { +ActorInit Dm_Char04_InitVars = { ACTOR_DM_CHAR04, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.h b/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.h index 42c4a8501..0f0fcb6a1 100644 --- a/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.h +++ b/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.h @@ -20,6 +20,4 @@ typedef struct DmChar04 { /* 0x262 */ u16 timer; } DmChar04; // size = 0x264 -extern const ActorInit Dm_Char04_InitVars; - #endif // Z_DM_CHAR04_H diff --git a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c index 5b6613813..7e368b9e3 100644 --- a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c +++ b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c @@ -35,7 +35,7 @@ void func_80AADF54(PlayState* play, DmChar05* this); void func_80AAE030(PlayState* play, DmChar05* this); void func_80AAE114(PlayState* play, DmChar05* this); -const ActorInit Dm_Char05_InitVars = { +ActorInit Dm_Char05_InitVars = { ACTOR_DM_CHAR05, ACTORCAT_ITEMACTION, FLAGS, @@ -338,7 +338,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) { case 5: sp2F = false; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; default: @@ -382,7 +382,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) { case 5: sp2F = false; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; default: @@ -425,7 +425,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) { case 5: sp2F = false; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; default: diff --git a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.h b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.h index 212cdb03e..3bff39f6a 100644 --- a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.h +++ b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.h @@ -42,6 +42,4 @@ typedef struct DmChar05 { /* 0x1B4 */ u8 unk_1B4; } DmChar05; // size = 0x1B8 -extern const ActorInit Dm_Char05_InitVars; - #endif // Z_DM_CHAR05_H diff --git a/src/overlays/actors/ovl_Dm_Char06/z_dm_char06.c b/src/overlays/actors/ovl_Dm_Char06/z_dm_char06.c index a419ed5aa..4013293fb 100644 --- a/src/overlays/actors/ovl_Dm_Char06/z_dm_char06.c +++ b/src/overlays/actors/ovl_Dm_Char06/z_dm_char06.c @@ -18,7 +18,7 @@ void DmChar06_Draw(Actor* thisx, PlayState* play); void DmChar06_SetupAction(DmChar06* this, DmChar06ActionFunc actionFunc); void func_80AAE6F0(DmChar06* this, PlayState* play); -const ActorInit Dm_Char06_InitVars = { +ActorInit Dm_Char06_InitVars = { ACTOR_DM_CHAR06, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Dm_Char06/z_dm_char06.h b/src/overlays/actors/ovl_Dm_Char06/z_dm_char06.h index c6b83b4ff..fd08c83ff 100644 --- a/src/overlays/actors/ovl_Dm_Char06/z_dm_char06.h +++ b/src/overlays/actors/ovl_Dm_Char06/z_dm_char06.h @@ -16,6 +16,4 @@ typedef struct DmChar06 { /* 0x2A0 */ u8 alpha; } DmChar06; // size = 0x2A4 -extern const ActorInit Dm_Char06_InitVars; - #endif // Z_DM_CHAR06_H diff --git a/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.c b/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.c index 7058500a9..844be223e 100644 --- a/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.c +++ b/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.c @@ -18,7 +18,7 @@ void DmChar07_Draw(Actor* thisx, PlayState* play); void DmChar07_DoNothing(DmChar07* this, PlayState* play); -const ActorInit Dm_Char07_InitVars = { +ActorInit Dm_Char07_InitVars = { ACTOR_DM_CHAR07, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.h b/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.h index 8d3528347..ce54f1be1 100644 --- a/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.h +++ b/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.h @@ -32,6 +32,4 @@ typedef struct DmChar07 { /* 0x2BA */ u8 isStage; } DmChar07; // size = 0x2BC -extern const ActorInit Dm_Char07_InitVars; - #endif // Z_DM_CHAR07_H diff --git a/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c b/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c index 94d15be60..46bee748c 100644 --- a/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c +++ b/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c @@ -51,7 +51,7 @@ typedef enum { /* 6 */ TURTLE_ANIM_YAWN, } TurtleAnimation; -const ActorInit Dm_Char08_InitVars = { +ActorInit Dm_Char08_InitVars = { ACTOR_DM_CHAR08, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.h b/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.h index 2cdbb52c7..f339bceaa 100644 --- a/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.h +++ b/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.h @@ -40,6 +40,4 @@ typedef struct DmChar08 { /* 0x209 */ u8 dynapolyInitialized; } DmChar08; // size = 0x20C -extern const ActorInit Dm_Char08_InitVars; - #endif // Z_DM_CHAR08_H diff --git a/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.c b/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.c index 0bb112b43..654bc6c07 100644 --- a/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.c +++ b/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.c @@ -18,7 +18,7 @@ void DmChar09_Draw(Actor* thisx, PlayState* play); void DmChar09_DoNothing(DmChar09* this, PlayState* play); void func_80AB2268(DmChar09* this, PlayState* play); -const ActorInit Dm_Char09_InitVars = { +ActorInit Dm_Char09_InitVars = { ACTOR_DM_CHAR09, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.h b/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.h index ce01f164a..dffe65975 100644 --- a/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.h +++ b/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.h @@ -34,6 +34,4 @@ typedef struct DmChar09 { /* 0x22F */ u8 unk_22F; } DmChar09; // size = 0x230 -extern const ActorInit Dm_Char09_InitVars; - #endif // Z_DM_CHAR09_H diff --git a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c index 1ed25ede2..5321abc92 100644 --- a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c +++ b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c @@ -21,7 +21,7 @@ void func_80C24A00(DmGm* this, PlayState* play); void func_80C24BD0(DmGm* this, PlayState* play); void func_80C25000(Actor* thisx, PlayState* play); -const ActorInit Dm_Gm_InitVars = { +ActorInit Dm_Gm_InitVars = { ACTOR_DM_GM, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.h b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.h index b7e45a3a1..54db8d30f 100644 --- a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.h +++ b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.h @@ -36,6 +36,4 @@ typedef struct DmGm { /* 0x2D4 */ s32 unk_2D4; } DmGm; // size = 0x2D8 -extern const ActorInit Dm_Gm_InitVars; - #endif // Z_DM_GM_H diff --git a/src/overlays/actors/ovl_Dm_Hina/z_dm_hina.c b/src/overlays/actors/ovl_Dm_Hina/z_dm_hina.c index 07c2d2bdd..a2a2589fb 100644 --- a/src/overlays/actors/ovl_Dm_Hina/z_dm_hina.c +++ b/src/overlays/actors/ovl_Dm_Hina/z_dm_hina.c @@ -21,7 +21,7 @@ void func_80A1F5AC(DmHina* this, PlayState* play); void func_80A1F63C(DmHina* this, PlayState* play); #if 0 -const ActorInit Dm_Hina_InitVars = { +ActorInit Dm_Hina_InitVars = { ACTOR_DM_HINA, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Dm_Hina/z_dm_hina.h b/src/overlays/actors/ovl_Dm_Hina/z_dm_hina.h index 02d12ee7d..21c9e55dc 100644 --- a/src/overlays/actors/ovl_Dm_Hina/z_dm_hina.h +++ b/src/overlays/actors/ovl_Dm_Hina/z_dm_hina.h @@ -16,6 +16,4 @@ typedef struct DmHina { /* 0x160 */ char unk_160[0x24]; } DmHina; // size = 0x184 -extern const ActorInit Dm_Hina_InitVars; - #endif // Z_DM_HINA_H diff --git a/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c b/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c index 3dcde3787..98f7bac48 100644 --- a/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c +++ b/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c @@ -5,7 +5,6 @@ */ #include "z_dm_nb.h" -#include "objects/object_nb/object_nb.h" #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8) @@ -16,7 +15,7 @@ void DmNb_Destroy(Actor* thisx, PlayState* play); void DmNb_Update(Actor* thisx, PlayState* play); void DmNb_Draw(Actor* thisx, PlayState* play); -const ActorInit Dm_Nb_InitVars = { +ActorInit Dm_Nb_InitVars = { ACTOR_DM_NB, ACTORCAT_NPC, FLAGS, @@ -28,7 +27,9 @@ const ActorInit Dm_Nb_InitVars = { (ActorFunc)DmNb_Draw, }; -static AnimationInfoS sAnimationInfo[] = { { &object_nb_Anim_000990, 1.0f, 0, -1, ANIMMODE_LOOP, 0 } }; +static AnimationInfoS sAnimationInfo[] = { + { &gNbIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, +}; s32 func_80C1DED0(DmNb* this, s32 arg1) { s32 ret = false; @@ -70,7 +71,7 @@ void DmNb_Init(Actor* thisx, PlayState* play) { DmNb* this = THIS; ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &object_nb_Skel_008C40, NULL, this->jointTable, this->morphTable, 8); + SkelAnime_InitFlex(play, &this->skelAnime, &gNbSkel, NULL, this->jointTable, this->morphTable, NB_LIMB_MAX); this->unk1F0 = -1; func_80C1DED0(this, 0); this->actor.flags &= ~ACTOR_FLAG_1; diff --git a/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.h b/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.h index eafc4ef99..3f35beea0 100644 --- a/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.h +++ b/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.h @@ -2,6 +2,7 @@ #define Z_DM_NB_H #include "global.h" +#include "objects/object_nb/object_nb.h" struct DmNb; @@ -11,14 +12,12 @@ typedef struct DmNb { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; /* 0x188 */ DmNbActionFunc actionFunc; - /* 0x18C */ Vec3s jointTable[8]; - /* 0x1BC */ Vec3s morphTable[8]; + /* 0x18C */ Vec3s jointTable[NB_LIMB_MAX]; + /* 0x1BC */ Vec3s morphTable[NB_LIMB_MAX]; /* 0x1EC */ u8 unk1EC; /* 0x1F0 */ s32 unk1F0; /* 0x1F4 */ s32 unk1F4; /* 0x1F8 */ s32 unk1F8; } DmNb; // size = 0x1FC -extern const ActorInit Dm_Nb_InitVars; - #endif // Z_DM_NB_H diff --git a/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c b/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c index 7a4142971..db76db278 100644 --- a/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c +++ b/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c @@ -18,7 +18,7 @@ void DmOpstage_Draw(Actor* thisx, PlayState* play); void DmOpstage_FollowCutsceneScript(DmOpstage* this, PlayState* play); -const ActorInit Dm_Opstage_InitVars = { +ActorInit Dm_Opstage_InitVars = { ACTOR_DM_OPSTAGE, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.h b/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.h index 073efa1bf..3d9195413 100644 --- a/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.h +++ b/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.h @@ -24,6 +24,4 @@ typedef struct DmOpstage { /* 0x1A4 */ Vec3f drawOffset; } DmOpstage; // size = 0x1B0 -extern const ActorInit Dm_Opstage_InitVars; - #endif // Z_DM_OPSTAGE_H diff --git a/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c b/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c index afcd2b55d..ba4c3bb00 100644 --- a/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c +++ b/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c @@ -16,7 +16,7 @@ void DmRavine_DoNothing(DmRavine* this, PlayState* play); void DmRavine_Update(Actor* thisx, PlayState* play); void DmRavine_Draw(Actor* thisx, PlayState* play); -const ActorInit Dm_Ravine_InitVars = { +ActorInit Dm_Ravine_InitVars = { ACTOR_DM_RAVINE, ACTORCAT_ITEMACTION, FLAGS, @@ -33,7 +33,7 @@ void DmRavine_Init(Actor* thisx, PlayState* play) { DmRavine* this = THIS; if (((((void)0, gSaveContext.save.weekEventReg[0]) & 0x10) | cREG(0)) != 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -71,7 +71,7 @@ void DmRavine_Update(Actor* thisx, PlayState* play) { } break; case DM_RAVINE_STATE_PENDING_DEATH: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; } } diff --git a/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.h b/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.h index d634ec5e9..01b9b52af 100644 --- a/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.h +++ b/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.h @@ -20,6 +20,4 @@ typedef struct DmRavine { /* 0x149 */ u8 isActive; } DmRavine; // size = 0x14C -extern const ActorInit Dm_Ravine_InitVars; - #endif // Z_DM_RAVINE_H diff --git a/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c b/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c index d9f775f6a..00abe6e05 100644 --- a/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c +++ b/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c @@ -18,7 +18,7 @@ void DmSa_Draw(Actor* thisx, PlayState* play); void DmSa_DoNothing(DmSa* this, PlayState* play); -const ActorInit Dm_Sa_InitVars = { +ActorInit Dm_Sa_InitVars = { ACTOR_DM_SA, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.h b/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.h index d1d37128b..3dd827a15 100644 --- a/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.h +++ b/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.h @@ -20,6 +20,4 @@ typedef struct DmSa { /* 0x2F0 */ u32 alpha; } DmSa; // size = 0x2F4 -extern const ActorInit Dm_Sa_InitVars; - #endif // Z_DM_SA_H diff --git a/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.c b/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.c index 62c267322..11f2724de 100644 --- a/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.c +++ b/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.c @@ -16,7 +16,7 @@ void DmStatue_Destroy(Actor* thisx, PlayState* play); void DmStatue_Update(Actor* thisx, PlayState* play); void DmStatue_Draw(Actor* thisx, PlayState* play); -const ActorInit Dm_Statue_InitVars = { +ActorInit Dm_Statue_InitVars = { ACTOR_DM_STATUE, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.h b/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.h index 1ad123523..eb06acd01 100644 --- a/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.h +++ b/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.h @@ -10,6 +10,4 @@ typedef struct DmStatue { /* 0x144 */ char unk_144[0x50]; } DmStatue; // size = 0x194 -extern const ActorInit Dm_Statue_InitVars; - #endif // Z_DM_STATUE_H diff --git a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c index 90ccb1382..6d0fd48a4 100644 --- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c +++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c @@ -150,7 +150,7 @@ typedef enum { /* 4 */ SK_DEKU_PIPES_CS_STATE_END } SkullKidDekuPipesCutsceneState; -const ActorInit Dm_Stk_InitVars = { +ActorInit Dm_Stk_InitVars = { ACTOR_DM_STK, ACTORCAT_ITEMACTION, FLAGS, @@ -1017,7 +1017,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { this->objectStk2ObjectIndex = Object_GetIndex(&play->objectCtx, OBJECT_STK2); this->objectStk3ObjectIndex = Object_GetIndex(&play->objectCtx, OBJECT_STK3); if (this->objectStkObjectIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->tatlMessageTimer = 0; @@ -1090,7 +1090,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { } else if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 0)) { if (!(play->actorCtx.flags & ACTORCTX_FLAG_1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->maskType = SK_MASK_TYPE_GLOWING_EYES; @@ -1102,7 +1102,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { this->actionFunc = DmStk_WaitForTelescope; } else { if ((play->sceneId == SCENE_LOST_WOODS) && !Cutscene_IsPlaying(play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->maskType = SK_MASK_TYPE_GLOWING_EYES; @@ -1272,7 +1272,7 @@ void DmStk_ClockTower_DeflectHit(DmStk* this, PlayState* play) { this->deflectCount++; if (this->deflectCount >= 3) { this->deflectCount = 0; - if (!(player->stateFlags2 & 0x8000000)) { + if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) { // That won't do you any good Message_StartTextbox(play, 0x2013, &this->actor); } @@ -1420,7 +1420,7 @@ void DmStk_UpdateCutscenes(DmStk* this, PlayState* play) { break; case 25: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; case 26: @@ -1632,7 +1632,7 @@ void DmStk_UpdateCutscenes(DmStk* this, PlayState* play) { this->fadeOutState = SK_FADE_OUT_STATE_NONE; gSaveContext.save.weekEventReg[12] |= 4; if (!(play->actorCtx.flags & ACTORCTX_FLAG_1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->shouldDraw = false; } @@ -1720,7 +1720,7 @@ void DmStk_ClockTower_IdleWithOcarina(DmStk* this, PlayState* play) { this->tatlMessageTimer++; if (this->tatlMessageTimer > 800) { this->tatlMessageTimer = 0; - if (!(player->stateFlags2 & 0x8000000)) { + if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) { // Why are you just standing around? Message_StartTextbox(play, 0x2014, &this->actor); } diff --git a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.h b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.h index ffea61265..f55321ef7 100644 --- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.h +++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.h @@ -51,6 +51,4 @@ typedef struct DmStk { /* 0x33B */ u8 shouldDraw; } DmStk; // size = 0x33C -extern const ActorInit Dm_Stk_InitVars; - #endif // Z_DM_STK_H diff --git a/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c b/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c index 2c8bf046f..d91be440a 100644 --- a/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c +++ b/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c @@ -18,7 +18,7 @@ void func_80C229AC(DmTag* this, PlayState* play); void func_80C229EC(DmTag* this, PlayState* play); void func_80C229FC(DmTag* this, PlayState* play); -const ActorInit Dm_Tag_InitVars = { +ActorInit Dm_Tag_InitVars = { ACTOR_DM_TAG, ACTORCAT_ITEMACTION, FLAGS, @@ -231,7 +231,7 @@ void DmTag_Init(Actor* thisx, PlayState* play) { Player* player = GET_PLAYER(play); if (gSaveContext.save.weekEventReg[85] & 4) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -243,7 +243,7 @@ void DmTag_Init(Actor* thisx, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_1; this->actionFunc = func_80C229EC; } else if (this->actor.room == 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->actor.targetMode = 1; this->unk_18E = 1; diff --git a/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.h b/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.h index d68cd38d4..eec741df6 100644 --- a/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.h +++ b/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.h @@ -21,6 +21,4 @@ typedef struct DmTag { /* 0x1A8 */ DmTagMsgEventFunc msgEventCallback; } DmTag; // size = 0x1AC -extern const ActorInit Dm_Tag_InitVars; - #endif // Z_DM_TAG_H diff --git a/src/overlays/actors/ovl_Dm_Tsg/z_dm_tsg.c b/src/overlays/actors/ovl_Dm_Tsg/z_dm_tsg.c index ab0aca40e..7dec0540e 100644 --- a/src/overlays/actors/ovl_Dm_Tsg/z_dm_tsg.c +++ b/src/overlays/actors/ovl_Dm_Tsg/z_dm_tsg.c @@ -16,7 +16,7 @@ void DmTsg_Update(Actor* thisx, PlayState* play); void DmTsg_Draw(Actor* thisx, PlayState* play); #if 0 -const ActorInit Dm_Tsg_InitVars = { +ActorInit Dm_Tsg_InitVars = { ACTOR_DM_TSG, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Dm_Tsg/z_dm_tsg.h b/src/overlays/actors/ovl_Dm_Tsg/z_dm_tsg.h index e1263ef2d..e8e62b6c2 100644 --- a/src/overlays/actors/ovl_Dm_Tsg/z_dm_tsg.h +++ b/src/overlays/actors/ovl_Dm_Tsg/z_dm_tsg.h @@ -10,6 +10,4 @@ typedef struct DmTsg { /* 0x144 */ char unk_144[0x7DC]; } DmTsg; // size = 0x920 -extern const ActorInit Dm_Tsg_InitVars; - #endif // Z_DM_TSG_H diff --git a/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c b/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c index 47706cb9f..a671fe3f2 100644 --- a/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c +++ b/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c @@ -17,7 +17,7 @@ void DmZl_Draw(Actor* thisx, PlayState* play); void DmZl_DoNothing(DmZl* this, PlayState* play); -const ActorInit Dm_Zl_InitVars = { +ActorInit Dm_Zl_InitVars = { ACTOR_DM_ZL, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.h b/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.h index c267d9ae9..cae6ce74e 100644 --- a/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.h +++ b/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.h @@ -26,6 +26,4 @@ typedef struct DmZl { /* 0x2BC */ UNK_TYPE1 pad2BC[0x18]; // unused by DmZl } DmZl; // size = 0x2D4 -extern const ActorInit Dm_Zl_InitVars; - #endif // Z_DM_ZL_H diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 173c3ea52..8ae44b909 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -20,7 +20,7 @@ void DoorAna_WaitClosed(DoorAna* this, PlayState* play); void DoorAna_WaitOpen(DoorAna* this, PlayState* play); void DoorAna_GrabLink(DoorAna* this, PlayState* play); -const ActorInit Door_Ana_InitVars = { +ActorInit Door_Ana_InitVars = { ACTOR_DOOR_ANA, ACTORCAT_ITEMACTION, FLAGS, @@ -131,7 +131,8 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) { if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f)) { if ((this->actor.targetMode != 0) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && - (play->transitionMode == TRANS_MODE_OFF) && (player->stateFlags1 & 0x80000000) && (player->unk_AE7 == 0)) { + (play->transitionMode == TRANS_MODE_OFF) && (player->stateFlags1 & PLAYER_STATE1_80000000) && + (player->unk_AE7 == 0)) { if (grottoType == DOORANA_TYPE_VISIBLE_SCENE_EXIT) { s32 exitIndex = DOORANA_GET_EXIT_INDEX(&this->actor); @@ -157,10 +158,10 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) { DoorAna_SetupAction(this, DoorAna_GrabLink); - } else if (!Play_InCsMode(play) && !(player->stateFlags1 & 0x08800000) && + } else if (!Play_InCsMode(play) && !(player->stateFlags1 & (PLAYER_STATE1_8000000 | PLAYER_STATE1_800000)) && (this->actor.xzDistToPlayer <= 20.0f) && (this->actor.playerHeightRel >= -50.0f) && (this->actor.playerHeightRel <= 15.0f)) { - player->stateFlags1 |= 0x80000000; + player->stateFlags1 |= PLAYER_STATE1_80000000; this->actor.targetMode = 1; } else { diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.h b/src/overlays/actors/ovl_Door_Ana/z_door_ana.h index 980d0140f..8e016824d 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.h +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.h @@ -13,8 +13,6 @@ typedef struct DoorAna { /* 0x190 */ DoorAnaActionFunc actionFunc; } DoorAna; // size = 0x194 -extern const ActorInit Door_Ana_InitVars; - #define DOORANA_TYPE_BITMASK 0x300 #define DOORANA_TYPE_VISIBLE 0x000 #define DOORANA_TYPE_HIDDEN_STORMS 0x100 // Incomplete, leftover from OoT diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index d7913b775..116b07a6c 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -40,7 +40,7 @@ void func_808A1B48(DoorShutter* this, PlayState* play); void func_808A1C50(DoorShutter* this, PlayState* play); void DoorShutter_Draw(Actor* thisx, PlayState* play); -const ActorInit Door_Shutter_InitVars = { +ActorInit Door_Shutter_InitVars = { ACTOR_DOOR_SHUTTER, ACTORCAT_DOOR, FLAGS, @@ -200,7 +200,6 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) { DoorShutter* this = THIS; s32 sp24; s32 i; - s8 objId; Actor_ProcessInitChain(&this->actor, sInitChain); this->doorType = DOORSHUTTER_GET_380(&this->actor); @@ -233,9 +232,10 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) { this->actor.room = -1; } - // clang-format off - objId = Object_GetIndex(&play->objectCtx, D_808A2180[sp24].objectId); this->requiredObjBankIndex = objId; if (objId < 0) { Actor_MarkForDeath(&this->actor); return; } - // clang-format on + if ((this->requiredObjBankIndex = Object_GetIndex(&play->objectCtx, D_808A2180[sp24].objectId)) < 0) { + Actor_Kill(&this->actor); + return; + } DoorShutter_SetupAction(this, DoorShutter_SetupType); this->unk_163 = sp24; @@ -261,7 +261,8 @@ void DoorShutter_Destroy(Actor* thisx, PlayState* play) { } void DoorShutter_SetupType(DoorShutter* this, PlayState* play) { - if (Object_IsLoaded(&play->objectCtx, this->requiredObjBankIndex) && ((MREG(64) == 0) || (MREG(68) == 0))) { + if (Object_IsLoaded(&play->objectCtx, this->requiredObjBankIndex) && + (!R_PLAY_FILL_SCREEN_ON || (R_PLAY_FILL_SCREEN_ALPHA == 0))) { this->actor.objBankIndex = this->requiredObjBankIndex; this->actor.draw = DoorShutter_Draw; DoorShutter_SetupDoor(this, play); @@ -566,7 +567,7 @@ void func_808A1884(DoorShutter* this, PlayState* play) { this->unk_15C = 0; this->actor.velocity.y = 0.0f; - if (DoorShutter_SetupDoor(this, play) && !(player->stateFlags1 & 0x800)) { + if (DoorShutter_SetupDoor(this, play) && !(player->stateFlags1 & PLAYER_STATE1_800)) { DoorShutter_SetupAction(this, func_808A1C50); if (ActorCutscene_GetCurrentIndex() == 0x7D) { func_801226E0(play, ((void)0, gSaveContext.respawn[RESPAWN_MODE_DOWN].data)); @@ -633,7 +634,8 @@ void DoorShutter_Update(Actor* thisx, PlayState* play) { DoorShutter* this = THIS; Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & 0x100004C0) || (this->actionFunc == DoorShutter_SetupType)) { + if (!(player->stateFlags1 & (PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_400 | PLAYER_STATE1_10000000)) || + (this->actionFunc == DoorShutter_SetupType)) { this->actionFunc(this, play); if (this->unk_163 == 7) { diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h index e0d5653e2..c64d3d523 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h @@ -28,6 +28,4 @@ typedef struct DoorShutter { /* 0x016C */ DoorShutterActionFunc actionFunc; } DoorShutter; // size = 0x170 -extern const ActorInit Door_Shutter_InitVars; - #endif // Z_DOOR_SHUTTER_H diff --git a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c index be9b5c093..5f0031487 100644 --- a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c +++ b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c @@ -67,7 +67,7 @@ void DoorSpiral_WaitForObject(DoorSpiral* this, PlayState* play); void DoorSpiral_Wait(DoorSpiral* this, PlayState* play); void DoorSpiral_PlayerClimb(DoorSpiral* this, PlayState* play); -const ActorInit Door_Spiral_InitVars = { +ActorInit Door_Spiral_InitVars = { ACTOR_DOOR_SPIRAL, ACTORCAT_DOOR, FLAGS, @@ -179,7 +179,7 @@ void DoorSpiral_Init(Actor* thisx, PlayState* play) { s8 objBankId; if (this->actor.room != play->doorCtx.transitionActorList[transition].sides[0].room) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -191,7 +191,7 @@ void DoorSpiral_Init(Actor* thisx, PlayState* play) { this->bankIndex = objBankId; if (objBankId < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -290,7 +290,7 @@ void DoorSpiral_Wait(DoorSpiral* this, PlayState* play) { void DoorSpiral_PlayerClimb(DoorSpiral* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & 0x20000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_20000000)) { DoorSpiral_SetupAction(this, DoorSpiral_WaitForObject); this->shouldClimb = 0; } @@ -301,7 +301,8 @@ void DoorSpiral_Update(Actor* thisx, PlayState* play) { s32 pad; Player* player = GET_PLAYER(play); - if ((!(player->stateFlags1 & 0x100004C0)) || (this->actionFunc == DoorSpiral_WaitForObject)) { + if (!(player->stateFlags1 & (PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_400 | PLAYER_STATE1_10000000)) || + (this->actionFunc == DoorSpiral_WaitForObject)) { this->actionFunc(this, play); } } diff --git a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.h b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.h index f12b79d84..0f3e32a39 100644 --- a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.h +++ b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.h @@ -23,6 +23,4 @@ typedef struct DoorSpiral { /* 0x14C */ DoorSpiralActionFunc actionFunc; } DoorSpiral; // size = 0x150 -extern const ActorInit Door_Spiral_InitVars; - #endif // Z_DOOR_SPIRAL_H diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 2d384ccf6..707150e33 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -49,7 +49,7 @@ void func_808BB8D4(DoorWarp1* this, PlayState* play, s32 arg2); static s16 D_808BC000; static f32 D_808BC004; -const ActorInit Door_Warp1_InitVars = { +ActorInit Door_Warp1_InitVars = { ACTOR_DOOR_WARP1, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h index c57f610a0..076999e57 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h @@ -56,6 +56,4 @@ typedef struct DoorWarp1 { /* 0x208 */ u8 unk_208; } DoorWarp1; // size = 0x20C -extern const ActorInit Door_Warp1_InitVars; - #endif // Z_DOOR_WARP1_H diff --git a/src/overlays/actors/ovl_Eff_Change/z_eff_change.c b/src/overlays/actors/ovl_Eff_Change/z_eff_change.c index 0f5245617..cad0ec095 100644 --- a/src/overlays/actors/ovl_Eff_Change/z_eff_change.c +++ b/src/overlays/actors/ovl_Eff_Change/z_eff_change.c @@ -18,7 +18,7 @@ void EffChange_Draw(Actor* thisx, PlayState* play); void EffChange_SetColors(EffChange* this, s32 arg1); void func_80A4C5CC(EffChange* this, PlayState* play); -const ActorInit Eff_Change_InitVars = { +ActorInit Eff_Change_InitVars = { ACTOR_EFF_CHANGE, ACTORCAT_ITEMACTION, FLAGS, @@ -79,40 +79,41 @@ void func_80A4C5CC(EffChange* this, PlayState* play) { f32 phi_fv0; if (func_80183DE0(&this->skeletonInfo)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); ActorCutscene_Stop(0x7B); func_800FD2B4(play, 0.0f, 850.0f, 0.2f, 0.0f); - } else { - this->step++; - if (this->skeletonInfo.frameCtrl.unk_10 < 20.0f) { - if ((this->primColors[3]) < 242) { - this->primColors[3] += 13; - } else { - this->primColors[3] = 255; - } - } else if (this->skeletonInfo.frameCtrl.unk_10 > 70.0f) { - if ((this->primColors[3]) >= 14) { - this->primColors[3] -= 13; - } else { - this->primColors[3] = 0; - } + return; + } + + this->step++; + if (this->skeletonInfo.frameCtrl.unk_10 < 20.0f) { + if ((this->primColors[3]) < 242) { + this->primColors[3] += 13; } else { this->primColors[3] = 255; } - - phi_fv0 = this->primColors[3] * (1.0f / 255.0f); - if (phi_fv0 > 1.0f) { - phi_fv0 = 1.0f; - } else if (phi_fv0 < 0.0f) { - phi_fv0 = 0.0f; + } else if (this->skeletonInfo.frameCtrl.unk_10 > 70.0f) { + if ((this->primColors[3]) >= 14) { + this->primColors[3] -= 13; + } else { + this->primColors[3] = 0; } - func_800FD2B4(play, phi_fv0, 850.0f, 0.2f, 0.0f); - if (ActorCutscene_GetCurrentIndex() != 0x7B) { - if (ActorCutscene_GetCanPlayNext(0x7B)) { - ActorCutscene_Start(0x7B, &this->actor); - } else { - ActorCutscene_SetIntentToPlay(0x7B); - } + } else { + this->primColors[3] = 255; + } + + phi_fv0 = this->primColors[3] * (1.0f / 255.0f); + if (phi_fv0 > 1.0f) { + phi_fv0 = 1.0f; + } else if (phi_fv0 < 0.0f) { + phi_fv0 = 0.0f; + } + func_800FD2B4(play, phi_fv0, 850.0f, 0.2f, 0.0f); + if (ActorCutscene_GetCurrentIndex() != 0x7B) { + if (ActorCutscene_GetCanPlayNext(0x7B)) { + ActorCutscene_Start(0x7B, &this->actor); + } else { + ActorCutscene_SetIntentToPlay(0x7B); } } } diff --git a/src/overlays/actors/ovl_Eff_Change/z_eff_change.h b/src/overlays/actors/ovl_Eff_Change/z_eff_change.h index aed7e534a..194ae3ee2 100644 --- a/src/overlays/actors/ovl_Eff_Change/z_eff_change.h +++ b/src/overlays/actors/ovl_Eff_Change/z_eff_change.h @@ -21,6 +21,4 @@ typedef struct EffChange { /* 0x1C8 */ EffChangeActionFunc actionFunc; } EffChange; // size = 0x1CC -extern const ActorInit Eff_Change_InitVars; - #endif // Z_EFF_CHANGE_H diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c index e23ed1204..2833477e4 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c @@ -24,7 +24,7 @@ void func_80919230(EffDust* this, PlayState* play); void func_80919768(Actor* thisx, PlayState* play2); void func_809199FC(Actor* thisx, PlayState* play2); -const ActorInit Eff_Dust_InitVars = { +ActorInit Eff_Dust_InitVars = { ACTOR_EFF_DUST, ACTORCAT_NPC, FLAGS, @@ -171,11 +171,11 @@ void func_80919230(EffDust* this, PlayState* play) { s32 i; s32 j; - if (parent == NULL || parent->update == NULL || !(player->stateFlags1 & 0x1000)) { + if (parent == NULL || parent->update == NULL || !(player->stateFlags1 & PLAYER_STATE1_1000)) { if (this->life != 0) { this->life--; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } for (i = 0; i < ARRAY_COUNT(this->distanceTraveled); i++) { diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h index d73b5ce0e..38b724865 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h @@ -30,6 +30,4 @@ typedef enum { /* 0x5 */ EFF_DUST_TYPE_5 } EffDustType; -extern const ActorInit Eff_Dust_InitVars; - #endif // Z_EFF_DUST_H diff --git a/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c b/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c index 2de3d8604..75ff275a1 100644 --- a/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c +++ b/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c @@ -4,6 +4,7 @@ * Description: Wave Created by Turtle Awakening */ +#include "prevent_bss_reordering.h" #include "z_eff_kamejima_wave.h" #include "objects/object_kamejima/object_kamejima.h" @@ -22,7 +23,7 @@ void func_80BCEBC0(EffKamejimaWave* this, PlayState* play); void func_80BCED34(EffKamejimaWave* this, PlayState* play); void EffKamejimaWave_SetVtxAlpha(u8 alpha); -const ActorInit Eff_Kamejima_Wave_InitVars = { +ActorInit Eff_Kamejima_Wave_InitVars = { ACTOR_EFF_KAMEJIMA_WAVE, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.h b/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.h index 9b4713034..c79537363 100644 --- a/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.h +++ b/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.h @@ -21,6 +21,4 @@ typedef enum params { /* 0x1 */ EFFKAMEJIMAWAVE_PARAMS_1 } EffKamejimaWaveParams; -extern const ActorInit Eff_Kamejima_Wave_InitVars; - #endif // Z_EFF_KAMEJIMA_WAVE_H diff --git a/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c b/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c index 773e881ed..0041f1e99 100644 --- a/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c +++ b/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c @@ -28,7 +28,7 @@ typedef enum EffLastDayAction { /* 0x3 */ EFFLASTDAY_ACTION_3 } EffLastDayAction; -const ActorInit Eff_Lastday_InitVars = { +ActorInit Eff_Lastday_InitVars = { ACTOR_EFF_LASTDAY, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.h b/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.h index d1f81a184..89266d744 100644 --- a/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.h +++ b/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.h @@ -26,6 +26,4 @@ typedef enum EffLastDayParams { /* 0x3 */ EFFLASTDAY_PARAMS_3 } EffLastDayParams; -extern const ActorInit Eff_Lastday_InitVars; - #endif // Z_EFF_LASTDAY_H diff --git a/src/overlays/actors/ovl_Eff_Stk/z_eff_stk.c b/src/overlays/actors/ovl_Eff_Stk/z_eff_stk.c index 778417139..4d66cc827 100644 --- a/src/overlays/actors/ovl_Eff_Stk/z_eff_stk.c +++ b/src/overlays/actors/ovl_Eff_Stk/z_eff_stk.c @@ -16,7 +16,7 @@ void EffStk_Update(Actor* thisx, PlayState* play); void EffStk_Draw(Actor* thisx, PlayState* play); #if 0 -const ActorInit Eff_Stk_InitVars = { +ActorInit Eff_Stk_InitVars = { ACTOR_EFF_STK, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Eff_Stk/z_eff_stk.h b/src/overlays/actors/ovl_Eff_Stk/z_eff_stk.h index 9c8d5946e..4b2b84783 100644 --- a/src/overlays/actors/ovl_Eff_Stk/z_eff_stk.h +++ b/src/overlays/actors/ovl_Eff_Stk/z_eff_stk.h @@ -13,6 +13,4 @@ typedef struct EffStk { /* 0x14C */ EffStkActionFunc actionFunc; } EffStk; // size = 0x150 -extern const ActorInit Eff_Stk_InitVars; - #endif // Z_EFF_STK_H diff --git a/src/overlays/actors/ovl_Eff_Zoraband/z_eff_zoraband.c b/src/overlays/actors/ovl_Eff_Zoraband/z_eff_zoraband.c index b566e5c62..842ae4b9e 100644 --- a/src/overlays/actors/ovl_Eff_Zoraband/z_eff_zoraband.c +++ b/src/overlays/actors/ovl_Eff_Zoraband/z_eff_zoraband.c @@ -18,7 +18,7 @@ void EffZoraband_Draw(Actor* thisx, PlayState* play2); void EffZoraband_MikauFadeOut(EffZoraband* this, PlayState* play); -const ActorInit Eff_Zoraband_InitVars = { +ActorInit Eff_Zoraband_InitVars = { ACTOR_EFF_ZORABAND, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Eff_Zoraband/z_eff_zoraband.h b/src/overlays/actors/ovl_Eff_Zoraband/z_eff_zoraband.h index 2ecaf7187..4fdb977d8 100644 --- a/src/overlays/actors/ovl_Eff_Zoraband/z_eff_zoraband.h +++ b/src/overlays/actors/ovl_Eff_Zoraband/z_eff_zoraband.h @@ -16,6 +16,4 @@ typedef struct EffZoraband { /* 0x148 */ EffZorabandActionFunc actionFunc; } EffZoraband; // size = 0x14C -extern const ActorInit Eff_Zoraband_InitVars; - #endif // Z_EFF_ZORABAND_H diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index 5d3905914..3d7df7c27 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -18,7 +18,7 @@ void ElfMsg_Update(Actor* thisx, PlayState* play); void ElfMsg_SetupAction(ElfMsg* this, ElfMsgActionFunc actionFunc); void func_8092E284(ElfMsg* this, PlayState* play); -const ActorInit Elf_Msg_InitVars = { +ActorInit Elf_Msg_InitVars = { ACTOR_ELF_MSG, ACTORCAT_ITEMACTION, FLAGS, @@ -46,7 +46,7 @@ s32 func_8092DF9C(ElfMsg* this, PlayState* play) { if (ELFMSG_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG_GET_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } if (this->actor.home.rot.y == 0x81) { @@ -54,7 +54,7 @@ s32 func_8092DF9C(ElfMsg* this, PlayState* play) { if (ELFMSG_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG_GET_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } } @@ -63,7 +63,7 @@ s32 func_8092DF9C(ElfMsg* this, PlayState* play) { } if (Flags_GetSwitch(play, ELFMSG_GET_SWITCHFLAG(&this->actor))) { (void)"共倒れ"; // "Collapse together" - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } return false; @@ -139,9 +139,12 @@ void ElfMsg_Update(Actor* thisx, PlayState* play) { if (ELFMSG_GET_SWITCHFLAG(thisx) != 0x7F) { Flags_SetSwitch(play, ELFMSG_GET_SWITCHFLAG(thisx)); } - Actor_MarkForDeath(&this->actor); - } else if ((this->actor.home.rot.y >= 0) || (this->actor.home.rot.y < -0x80) || - (Flags_GetSwitch(play, -1 - this->actor.home.rot.y))) { + Actor_Kill(&this->actor); + return; + } + + if ((this->actor.home.rot.y >= 0) || (this->actor.home.rot.y < -0x80) || + (Flags_GetSwitch(play, -1 - this->actor.home.rot.y))) { this->actionFunc(this, play); } } diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h index f335f0158..51a3ddda3 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h @@ -16,6 +16,4 @@ typedef struct ElfMsg { /* 0x144 */ ElfMsgActionFunc actionFunc; } ElfMsg; // size = 0x148 -extern const ActorInit Elf_Msg_InitVars; - #endif // Z_ELF_MSG_H diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index 6e78ef085..a29b226b0 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -18,7 +18,7 @@ s32 func_8096EE50(ElfMsg2* this); void func_8096EF98(ElfMsg2* this, PlayState* play); void func_8096EFD0(ElfMsg2* this, PlayState* play); -const ActorInit Elf_Msg2_InitVars = { +ActorInit Elf_Msg2_InitVars = { ACTOR_ELF_MSG2, ACTORCAT_BG, FLAGS, @@ -46,7 +46,7 @@ s32 func_8096EC4C(ElfMsg2* this, PlayState* play) { if (ELFMSG2_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG2_GET_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } if (this->actor.home.rot.y == 129) { @@ -56,7 +56,7 @@ s32 func_8096EC4C(ElfMsg2* this, PlayState* play) { if (ELFMSG2_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG2_GET_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } } @@ -65,7 +65,7 @@ s32 func_8096EC4C(ElfMsg2* this, PlayState* play) { } if (Flags_GetSwitch(play, ELFMSG2_GET_SWITCHFLAG(&this->actor))) { (void)"共倒れ"; // "Collapse together" - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } return false; @@ -105,14 +105,16 @@ void func_8096EE64(ElfMsg2* this, PlayState* play) { ActorCutscene_Stop(this->actor.cutscene); } } + if (this->actor.home.rot.z != 1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if (ELFMSG2_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG2_GET_SWITCHFLAG(&this->actor)); } - } else { - ElfMsg2_SetupAction(this, func_8096EF98); + return; } + + ElfMsg2_SetupAction(this, func_8096EF98); } else if ((this->actor.cutscene != -1) && (ActorCutscene_GetCurrentIndex() != this->actor.cutscene)) { if (ActorCutscene_GetCurrentIndex() == 0x7C) { ActorCutscene_Stop(0x7C); diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h index e8b48dfd7..4d9583d20 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h @@ -15,6 +15,4 @@ typedef struct ElfMsg2 { /* 0x144 */ ElfMsg2ActionFunc actionFunc; } ElfMsg2; // size = 0x148 -extern const ActorInit Elf_Msg2_InitVars; - #endif // Z_ELF_MSG2_H diff --git a/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c b/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c index a62a22ad0..da6b29180 100644 --- a/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c +++ b/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c @@ -17,7 +17,7 @@ void ElfMsg3_Update(Actor* thisx, PlayState* play); void func_80A2CF7C(ElfMsg3* this, PlayState* play); -const ActorInit Elf_Msg3_InitVars = { +ActorInit Elf_Msg3_InitVars = { ACTOR_ELF_MSG3, ACTORCAT_ITEMACTION, FLAGS, @@ -45,7 +45,7 @@ s32 func_80A2CD1C(ElfMsg3* this, PlayState* play) { if (ELFMSG3_GET_SWITCH(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG3_GET_SWITCH(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } if (this->actor.home.rot.y == 0x81) { @@ -53,7 +53,7 @@ s32 func_80A2CD1C(ElfMsg3* this, PlayState* play) { if (ELFMSG3_GET_SWITCH(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG3_GET_SWITCH(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } } @@ -62,7 +62,7 @@ s32 func_80A2CD1C(ElfMsg3* this, PlayState* play) { } if (Flags_GetSwitch(play, ELFMSG3_GET_SWITCH(&this->actor))) { (void)"共倒れ"; // "Collapse together" - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } return false; @@ -137,9 +137,12 @@ void ElfMsg3_Update(Actor* thisx, PlayState* play) { if (ELFMSG3_GET_SWITCH(thisx) != 0x7F) { Flags_SetSwitch(play, ELFMSG3_GET_SWITCH(thisx)); } - Actor_MarkForDeath(&this->actor); - } else if ((this->actor.home.rot.y >= 0) || (this->actor.home.rot.y < -0x80) || - (Flags_GetSwitch(play, -1 - this->actor.home.rot.y))) { + Actor_Kill(&this->actor); + return; + } + + if ((this->actor.home.rot.y >= 0) || (this->actor.home.rot.y < -0x80) || + (Flags_GetSwitch(play, -1 - this->actor.home.rot.y))) { this->actionFunc(this, play); } } diff --git a/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.h b/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.h index cb71166e8..615cde1eb 100644 --- a/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.h +++ b/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.h @@ -16,6 +16,4 @@ typedef struct ElfMsg3 { /* 0x144 */ ElfMsg3ActionFunc actionFunc; } ElfMsg3; // size = 0x148 -extern const ActorInit Elf_Msg3_InitVars; - #endif // Z_ELF_MSG3_H diff --git a/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c b/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c index 4c6f143ff..7fbf402fa 100644 --- a/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c +++ b/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c @@ -22,7 +22,7 @@ s32 func_80AFD380(ElfMsg4* this, PlayState* play); s32 ElfMsg4_GetTextId(ElfMsg4* this); s32 func_80AFD5E0(ElfMsg4* this); -const ActorInit Elf_Msg4_InitVars = { +ActorInit Elf_Msg4_InitVars = { ACTOR_ELF_MSG4, ACTORCAT_ITEMACTION, FLAGS, @@ -46,7 +46,7 @@ s32 func_80AFD380(ElfMsg4* this, PlayState* play) { if (ELFMSG4_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG4_GET_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } if (this->actor.home.rot.y == 0x81) { @@ -54,7 +54,7 @@ s32 func_80AFD380(ElfMsg4* this, PlayState* play) { if (ELFMSG4_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG4_GET_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } } @@ -63,7 +63,7 @@ s32 func_80AFD380(ElfMsg4* this, PlayState* play) { } if (Flags_GetSwitch(play, ELFMSG4_GET_SWITCHFLAG(&this->actor))) { (void)"共倒れ"; // "Collapse together" - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } return false; @@ -156,14 +156,20 @@ void ElfMsg4_Update(Actor* thisx, PlayState* play) { if (!func_80AFD380(this, play)) { bgActor = this->elfMsg5; if ((bgActor != NULL) && (bgActor->update == NULL)) { - Actor_MarkForDeath(&this->actor); - } else if ((bgActor != NULL) && (Actor_ProcessTalkRequest(bgActor, &play->state))) { + Actor_Kill(&this->actor); + return; + } + + if ((bgActor != NULL) && (Actor_ProcessTalkRequest(bgActor, &play->state))) { if (ELFMSG4_GET_SWITCHFLAG(thisx) != 0x7F) { Flags_SetSwitch(play, ELFMSG4_GET_SWITCHFLAG(thisx)); } - Actor_MarkForDeath(&this->actor); - } else if ((this->actor.home.rot.y >= 0) || (this->actor.home.rot.y < -0x80) || - (Flags_GetSwitch(play, -1 - this->actor.home.rot.y))) { + Actor_Kill(&this->actor); + return; + } + + if ((this->actor.home.rot.y >= 0) || (this->actor.home.rot.y < -0x80) || + (Flags_GetSwitch(play, -1 - this->actor.home.rot.y))) { this->actionFunc(this, play); } } diff --git a/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.h b/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.h index f3d523ba4..e9ccbc906 100644 --- a/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.h +++ b/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.h @@ -17,6 +17,4 @@ typedef struct ElfMsg4 { /* 0x148 */ ElfMsg4ActionFunc actionFunc; } ElfMsg4; // size = 0x14C -extern const ActorInit Elf_Msg4_InitVars; - #endif // Z_ELF_MSG4_H diff --git a/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c b/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c index bcc88ad5d..db97a0f74 100644 --- a/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c +++ b/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c @@ -17,7 +17,7 @@ void ElfMsg5_Update(Actor* thisx, PlayState* play); void func_80AFDB38(ElfMsg5* this, PlayState* play); s32 func_80AFD990(ElfMsg5* this, PlayState* play); -const ActorInit Elf_Msg5_InitVars = { +ActorInit Elf_Msg5_InitVars = { ACTOR_ELF_MSG5, ACTORCAT_BG, FLAGS, @@ -41,7 +41,7 @@ s32 func_80AFD990(ElfMsg5* this, PlayState* play) { if (ELFMSG5_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG5_GET_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } if (this->actor.home.rot.y == 0x81) { @@ -50,7 +50,7 @@ s32 func_80AFD990(ElfMsg5* this, PlayState* play) { if (ELFMSG5_GET_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG5_GET_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } } @@ -59,7 +59,7 @@ s32 func_80AFD990(ElfMsg5* this, PlayState* play) { } if (Flags_GetSwitch(play, ELFMSG5_GET_SWITCHFLAG(&this->actor))) { (void)"共倒れ"; // Collapse together - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } return false; diff --git a/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.h b/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.h index af2589434..36daecca1 100644 --- a/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.h +++ b/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.h @@ -15,6 +15,4 @@ typedef struct ElfMsg5 { /* 0x144 */ ElfMsg5ActionFunc actionFunc; } ElfMsg5; // size = 0x148 -extern const ActorInit Elf_Msg5_InitVars; - #endif // Z_ELF_MSG5_H diff --git a/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c b/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c index c21da42b0..e69806ac7 100644 --- a/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c +++ b/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c @@ -23,7 +23,7 @@ void func_80BA2048(ElfMsg6* this, PlayState* play); void func_80BA215C(ElfMsg6* this, PlayState* play); void func_80BA21C4(ElfMsg6* this, PlayState* play); -const ActorInit Elf_Msg6_InitVars = { +ActorInit Elf_Msg6_InitVars = { ACTOR_ELF_MSG6, ACTORCAT_ITEMACTION, FLAGS, @@ -147,7 +147,7 @@ void ElfMsg6_Init(Actor* thisx, PlayState* play) { case 0: this->actionFunc = func_80BA1E30; if (func_80BA16F4(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; @@ -156,21 +156,21 @@ void ElfMsg6_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80BA1F80; if ((this->actor.cutscene == -1) || ((ELFMSG6_SWITCHFLAG(&this->actor) != 0x7F) && Flags_GetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor)))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } switch (ELFMSG6_GET_F0(&this->actor)) { case 0: if (gSaveContext.save.inventory.items[ITEM_HOOKSHOT] != ITEM_HOOKSHOT) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; case 1: if (gSaveContext.save.weekEventReg[83] & 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; @@ -179,19 +179,19 @@ void ElfMsg6_Init(Actor* thisx, PlayState* play) { case 2: if (INV_CONTENT(ITEM_OCARINA) == ITEM_OCARINA) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (gSaveContext.save.weekEventReg[8] & 0x40) { if (gSaveContext.save.weekEventReg[88] & 0x20) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actor.textId = 0x25B; } else { if (!(gSaveContext.save.weekEventReg[74] & 0x20) || (gSaveContext.save.weekEventReg[79] & 0x10)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actor.textId = 0x224; @@ -204,7 +204,7 @@ void ElfMsg6_Init(Actor* thisx, PlayState* play) { Flags_GetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor))) || (gSaveContext.save.weekEventReg[88] & 0x10) || (gSaveContext.save.weekEventReg[91] & 1) || (INV_CONTENT(ITEM_MASK_ZORA) == ITEM_MASK_ZORA)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc = func_80BA2048; @@ -272,7 +272,7 @@ void func_80BA1CF8(ElfMsg6* this, PlayState* play) { gSaveContext.save.weekEventReg[88] |= 0x20; break; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -315,7 +315,7 @@ void func_80BA1E30(ElfMsg6* this, PlayState* play) { break; } func_80BA165C(); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -331,7 +331,7 @@ void func_80BA1E30(ElfMsg6* this, PlayState* play) { void func_80BA1F80(ElfMsg6* this, PlayState* play) { if (((ELFMSG6_GET_F0(&this->actor)) == 1) && (gSaveContext.save.weekEventReg[83] & 2)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -339,10 +339,11 @@ void func_80BA1F80(ElfMsg6* this, PlayState* play) { if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, NULL); Flags_SetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor)); - Actor_MarkForDeath(&this->actor); - } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + Actor_Kill(&this->actor); + return; } + + ActorCutscene_SetIntentToPlay(this->actor.cutscene); } } @@ -357,14 +358,14 @@ void func_80BA2048(ElfMsg6* this, PlayState* play) { if (ELFMSG6_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (((ELFMSG6_SWITCHFLAG(&this->actor) != 0x7F) && Flags_GetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor))) || (gSaveContext.save.weekEventReg[88] & 0x10) || (gSaveContext.save.weekEventReg[91] & 1) || (INV_CONTENT(ITEM_MASK_ZORA) == ITEM_MASK_ZORA)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -375,7 +376,7 @@ void func_80BA2048(ElfMsg6* this, PlayState* play) { void func_80BA215C(ElfMsg6* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -392,13 +393,13 @@ void func_80BA21C4(ElfMsg6* this, PlayState* play) { if (ELFMSG6_SWITCHFLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor)); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (((ELFMSG6_SWITCHFLAG(&this->actor) != 0x7F) && Flags_GetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor))) || CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.h b/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.h index cd33b350b..8e9a5d0ed 100644 --- a/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.h +++ b/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.h @@ -16,6 +16,4 @@ typedef struct ElfMsg6 { /* 0x144 */ ElfMsg6ActionFunc actionFunc; } ElfMsg6; // size = 0x148 -extern const ActorInit Elf_Msg6_InitVars; - #endif // Z_ELF_MSG6_H diff --git a/src/overlays/actors/ovl_En_Ah/z_en_ah.c b/src/overlays/actors/ovl_En_Ah/z_en_ah.c index 7c0dfa71c..2c0cb4ce3 100644 --- a/src/overlays/actors/ovl_En_Ah/z_en_ah.c +++ b/src/overlays/actors/ovl_En_Ah/z_en_ah.c @@ -47,7 +47,7 @@ s32 D_80BD3DF8[] = { 0x00330100, 0x050E28FE, 0x0C100E28, -0x03F3F000 }; s32 D_80BD3E08[] = { 0x0E28FD0C, 0x0F29540C, 0x10000000 }; -const ActorInit En_Ah_InitVars = { +ActorInit En_Ah_InitVars = { ACTOR_EN_AH, ACTORCAT_NPC, FLAGS, @@ -307,7 +307,7 @@ s32 func_80BD3198(EnAh* this, PlayState* play) { Player* player = GET_PLAYER(play); u16 temp = play->msgCtx.currentTextId; - if (player->stateFlags1 & 0x40) { + if (player->stateFlags1 & PLAYER_STATE1_40) { if (this->unk_2DA != temp) { if (temp == 0x2954) { this->unk_18C = func_80BD3118; @@ -512,7 +512,7 @@ void EnAh_Init(Actor* thisx, PlayState* play) { EnAh* this = THIS; if (func_80BD2A30(this, play, ACTORCAT_NPC, ACTOR_EN_AH)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Ah/z_en_ah.h b/src/overlays/actors/ovl_En_Ah/z_en_ah.h index 78872a270..d361a8358 100644 --- a/src/overlays/actors/ovl_En_Ah/z_en_ah.h +++ b/src/overlays/actors/ovl_En_Ah/z_en_ah.h @@ -38,6 +38,4 @@ typedef struct EnAh { /* 0x300 */ s32 unk_300; } EnAh; // size = 0x304 -extern const ActorInit En_Ah_InitVars; - #endif // Z_EN_AH_H 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 4e7a51c97..e0c19903d 100644 --- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c +++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c @@ -31,7 +31,7 @@ void func_80BEF9F0(EnAkindonuts* this, PlayState* play); void func_80BEFAF0(EnAkindonuts* this, PlayState* play); void func_80BEFD74(EnAkindonuts* this, PlayState* play); -const ActorInit En_Akindonuts_InitVars = { +ActorInit En_Akindonuts_InitVars = { ACTOR_EN_AKINDONUTS, ACTORCAT_NPC, FLAGS, @@ -1099,10 +1099,10 @@ void func_80BEE938(EnAkindonuts* this, PlayState* play) { if (ENAKINDONUTS_GET_4(&this->actor)) { this->unk_2DC = func_80BED680; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (ENAKINDONUTS_GET_4(&this->actor)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk_2DC = func_80BED3BC; } @@ -1113,10 +1113,10 @@ void func_80BEE938(EnAkindonuts* this, PlayState* play) { if (ENAKINDONUTS_GET_4(&this->actor)) { this->unk_2DC = func_80BEDB88; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (ENAKINDONUTS_GET_4(&this->actor)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk_2DC = func_80BED8A4; } @@ -1127,10 +1127,10 @@ void func_80BEE938(EnAkindonuts* this, PlayState* play) { if (ENAKINDONUTS_GET_4(&this->actor)) { this->unk_2DC = func_80BEE070; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (ENAKINDONUTS_GET_4(&this->actor)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk_2DC = func_80BEDDAC; } @@ -1141,10 +1141,10 @@ void func_80BEE938(EnAkindonuts* this, PlayState* play) { if (ENAKINDONUTS_GET_4(&this->actor)) { this->unk_2DC = func_80BEE530; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (ENAKINDONUTS_GET_4(&this->actor)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk_2DC = func_80BEE274; } @@ -1586,7 +1586,7 @@ void func_80BEFAF0(EnAkindonuts* this, PlayState* play) { } void func_80BEFD74(EnAkindonuts* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void EnAkindonuts_Init(Actor* thisx, PlayState* play) { @@ -1608,7 +1608,7 @@ void EnAkindonuts_Init(Actor* thisx, PlayState* play) { if (!ENAKINDONUTS_GET_4(&this->actor)) { this->path = SubS_GetPathByIndex(play, ENAKINDONUTS_GET_FC00(&this->actor), 0x3F); if (this->path == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } diff --git a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.h b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.h index ec0446f95..72c932d0c 100644 --- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.h +++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.h @@ -50,6 +50,4 @@ typedef struct EnAkindonuts { /* 0x368 */ s16 unk_368; } EnAkindonuts; // size = 0x36C -extern const ActorInit En_Akindonuts_InitVars; - #endif // Z_EN_AKINDONUTS_H diff --git a/src/overlays/actors/ovl_En_Al/z_en_al.c b/src/overlays/actors/ovl_En_Al/z_en_al.c index 8792f8038..7cb0d7d54 100644 --- a/src/overlays/actors/ovl_En_Al/z_en_al.c +++ b/src/overlays/actors/ovl_En_Al/z_en_al.c @@ -85,7 +85,7 @@ s32 D_80BDFF24[] = { 0x11390411, 0x390819FF, 0xB10E2B3C, 0x2D00080C, 0x19FFA700, }; -const ActorInit En_Al_InitVars = { +ActorInit En_Al_InitVars = { ACTOR_EN_AL, ACTORCAT_NPC, FLAGS, @@ -575,7 +575,7 @@ s32 func_80BDF064(EnAl* this, PlayState* play) { Actor* sp1C = func_80BDE1A0(this, play, 4, 0xA4); Actor* temp_v0 = func_80BDE1A0(this, play, 4, 0x234); - if (player->stateFlags1 & 0x40) { + if (player->stateFlags1 & PLAYER_STATE1_40) { this->unk_4C2 |= 0x400; if (this->unk_4C4 != sp22) { switch (sp22) { diff --git a/src/overlays/actors/ovl_En_Al/z_en_al.h b/src/overlays/actors/ovl_En_Al/z_en_al.h index 4a92743df..77e1011bf 100644 --- a/src/overlays/actors/ovl_En_Al/z_en_al.h +++ b/src/overlays/actors/ovl_En_Al/z_en_al.h @@ -45,6 +45,4 @@ typedef struct EnAl { /* 0x4FC */ UNK_TYPE1 unk4FC[4]; } EnAl; // size = 0x500 -extern const ActorInit En_Al_InitVars; - #endif // Z_EN_AL_H diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index 858d125c0..f76ebc4f3 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -37,7 +37,7 @@ void func_808B0894(EnAm* this, PlayState* play); void func_808B0B4C(EnAm* this, PlayState* play); void EnAm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); -const ActorInit En_Am_InitVars = { +ActorInit En_Am_InitVars = { ACTOR_EN_AM, ACTORCAT_ENEMY, FLAGS, @@ -437,7 +437,7 @@ void func_808B0894(EnAm* this, PlayState* play) { func_800B0EB0(play, &dustPos, &gZeroVec3f, &gZeroVec3f, &D_808B1120, &D_808B1124, 200, 45, 12); } } else if (this->explodeTimer == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } else if (!(this->explodeTimer & 3)) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 4); diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.h b/src/overlays/actors/ovl_En_Am/z_en_am.h index 79d3a81bd..e482e2cba 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.h +++ b/src/overlays/actors/ovl_En_Am/z_en_am.h @@ -27,6 +27,4 @@ typedef struct EnAm { /* 0x334 */ ColliderCylinder interactCollider; // Collider for when an interactable Armos is docile } EnAm; // size = 0x380 -extern const ActorInit En_Am_InitVars; - #endif // Z_EN_AM_H diff --git a/src/overlays/actors/ovl_En_An/z_en_an.c b/src/overlays/actors/ovl_En_An/z_en_an.c index 33638774e..6b85ffc53 100644 --- a/src/overlays/actors/ovl_En_An/z_en_an.c +++ b/src/overlays/actors/ovl_En_An/z_en_an.c @@ -19,7 +19,7 @@ void func_80B578F8(EnAn* this, PlayState* play); void func_80B57A44(EnAn* this, PlayState* play); #if 0 -const ActorInit En_An_InitVars = { +ActorInit En_An_InitVars = { ACTOR_EN_AN, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_An/z_en_an.h b/src/overlays/actors/ovl_En_An/z_en_an.h index c4d2dd5ae..7f1a11930 100644 --- a/src/overlays/actors/ovl_En_An/z_en_an.h +++ b/src/overlays/actors/ovl_En_An/z_en_an.h @@ -14,6 +14,4 @@ typedef struct EnAn { /* 0x18C */ char unk_18C[0x23C]; } EnAn; // size = 0x3C8 -extern const ActorInit En_An_InitVars; - #endif // Z_EN_AN_H diff --git a/src/overlays/actors/ovl_En_And/z_en_and.c b/src/overlays/actors/ovl_En_And/z_en_and.c index 04c461908..5c888ba45 100644 --- a/src/overlays/actors/ovl_En_And/z_en_and.c +++ b/src/overlays/actors/ovl_En_And/z_en_and.c @@ -18,7 +18,7 @@ void EnAnd_Draw(Actor* thisx, PlayState* play); void func_80C18C50(EnAnd* this, PlayState* play); #if 0 -const ActorInit En_And_InitVars = { +ActorInit En_And_InitVars = { ACTOR_EN_AND, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_And/z_en_and.h b/src/overlays/actors/ovl_En_And/z_en_and.h index 0ebd1a743..a0610a408 100644 --- a/src/overlays/actors/ovl_En_And/z_en_and.h +++ b/src/overlays/actors/ovl_En_And/z_en_and.h @@ -14,6 +14,4 @@ typedef struct EnAnd { /* 0x18C */ char unk_18C[0x188]; } EnAnd; // size = 0x314 -extern const ActorInit En_And_InitVars; - #endif // Z_EN_AND_H diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index ec464815e..ec98213bb 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -40,7 +40,7 @@ void EnAni_IdleInPain(EnAni* this, PlayState* play); void EnAni_Talk(EnAni* this, PlayState* play); void EnAni_IdleStanding(EnAni* this, PlayState* play); -const ActorInit En_Ani_InitVars = { +ActorInit En_Ani_InitVars = { ACTOR_EN_ANI, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c index 575cf2d35..6af60b84d 100644 --- a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c +++ b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c @@ -32,7 +32,7 @@ void func_809C2C9C(EnAob01* this, PlayState* play); void func_809C2D0C(EnAob01* this, PlayState* play); s32 func_809C2EC4(EnAob01* this, PlayState* play); -const ActorInit En_Aob_01_InitVars = { +ActorInit En_Aob_01_InitVars = { ACTOR_EN_AOB_01, ACTORCAT_NPC, FLAGS, @@ -489,7 +489,7 @@ void func_809C1EC8(EnAob01* this, PlayState* play) { func_809C10B0(this, 3); SubS_FillLimbRotTables(play, this->unk_2F8, this->unk_318, ARRAY_COUNT(this->unk_2F8)); func_809C165C(this, play); - if (player->stateFlags1 & 0x20) { + if (player->stateFlags1 & PLAYER_STATE1_20) { func_809C1124(); } } @@ -876,7 +876,7 @@ void func_809C2F34(EnAob01* this, PlayState* play) { player->actor.world.pos.z = 1464.0f; player->actor.shape.rot.y = player->actor.world.rot.y; player->actor.draw = NULL; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->actor.world.pos.x = -4308.0f; this->actor.world.pos.z = 1620.0f; this->actor.prevPos = this->actor.world.pos; diff --git a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.h b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.h index 7414f1890..2507b1728 100644 --- a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.h +++ b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.h @@ -42,6 +42,4 @@ typedef struct EnAob01 { /* 0x440 */ s16 unk_440; } EnAob01; // size = 0x444 -extern const ActorInit En_Aob_01_InitVars; - #endif // Z_EN_AOB_01_H diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index 8fd78fb51..dd6f503ef 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -22,7 +22,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play); void func_8088B630(EnArrow* this, PlayState* play); void func_8088B6B0(EnArrow* this, PlayState* play); -const ActorInit En_Arrow_InitVars = { +ActorInit En_Arrow_InitVars = { ACTOR_EN_ARROW, ACTORCAT_ITEMACTION, FLAGS, @@ -170,7 +170,7 @@ void func_8088A594(EnArrow* this, PlayState* play) { if (this->actor.params == ENARROW_7) { Magic_Reset(play); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -298,7 +298,7 @@ void func_8088AA98(EnArrow* this, PlayState* play) { if ((this->actor.params == ENARROW_4) || (this->actor.params == ENARROW_3)) { if ((this->actor.params == ENARROW_4) && (func_8088B6B0 != this->actionFunc)) { Actor_Spawn(&play->actorCtx, play, ACTOR_BG_ICEFLOE, sp44.x, sp44.y, sp44.z, 0, 0, 0, 300); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -306,7 +306,7 @@ void func_8088AA98(EnArrow* this, PlayState* play) { this->collider.info.toucher.dmgFlags = 0x20; if (this->actor.child != NULL) { - Actor_MarkForDeath(this->actor.child); + Actor_Kill(this->actor.child); return; } @@ -357,7 +357,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) { EffectSs_Spawn(play, EFFECT_SS_SBN, 128, &sp84); } } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -382,7 +382,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) { } EffectSsStone1_Spawn(play, &this->actor.world.pos, 0); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, sp82); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { EffectSsHitmark_SpawnCustomScale(play, 0, 150, &this->actor.world.pos); @@ -516,7 +516,7 @@ void func_8088B630(EnArrow* this, PlayState* play) { } if (DECR(this->unk_260) == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -526,7 +526,7 @@ void func_8088B6B0(EnArrow* this, PlayState* play) { func_8088AA98(this, play); if (DECR(this->unk_260) == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h index fadf7fbf2..d16dbd380 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h @@ -53,6 +53,4 @@ typedef struct EnArrow { /* 0x274 */ EnArrowActionFunc actionFunc; } EnArrow; // size = 0x278 -extern const ActorInit En_Arrow_InitVars; - #endif // Z_EN_ARROW_H diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c index 72ca1ba8e..b4501ffa0 100644 --- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c +++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c @@ -20,7 +20,7 @@ void EnAttackNiw_EnterViewFromOffscreen(EnAttackNiw* this, PlayState* play); void EnAttackNiw_AimAtPlayer(EnAttackNiw* this, PlayState* play); void EnAttackNiw_FlyAway(EnAttackNiw* this, PlayState* play); -const ActorInit En_Attack_Niw_InitVars = { +ActorInit En_Attack_Niw_InitVars = { ACTOR_EN_ATTACK_NIW, ACTORCAT_ENEMY, FLAGS, @@ -282,7 +282,7 @@ void EnAttackNiw_EnterViewFromOffscreen(EnAttackNiw* this, PlayState* play) { void EnAttackNiw_AimAtPlayer(EnAttackNiw* this, PlayState* play) { if (!EnAttackNiw_IsOnScreen(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -334,7 +334,7 @@ void EnAttackNiw_AimAtPlayer(EnAttackNiw* this, PlayState* play) { void EnAttackNiw_FlyAway(EnAttackNiw* this, PlayState* play) { if (!EnAttackNiw_IsOnScreen(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -376,10 +376,12 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) { } if (this->actor.floorHeight <= BGCHECK_Y_MIN) { // under the world - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); + return; + } - } else if ((this->actor.bgCheckFlags & 0x20) && // on or below water - (this->actionFunc != EnAttackNiw_FlyAway)) { + if ((this->actor.bgCheckFlags & 0x20) && // on or below water + (this->actionFunc != EnAttackNiw_FlyAway)) { Math_Vec3f_Copy(&splashPos, &this->actor.world.pos); splashPos.y += this->actor.depthInWater; EffectSsGSplash_Spawn(play, &splashPos, NULL, NULL, 0, 400); diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h index a1e29d627..f49778d9a 100644 --- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h +++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h @@ -54,8 +54,6 @@ typedef struct EnAttackNiw { /* 0x2DC */ f32 targetHeight; // never set, but sent to Actor_SetFocus } EnAttackNiw; // size = 0x2E0 -extern const ActorInit En_Attack_Niw_InitVars; - #define ATTACK_NIW_REGULAR 0 // spawned by EnNiw 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 08333482e..f5a028152 100644 --- a/src/overlays/actors/ovl_En_Az/z_en_az.c +++ b/src/overlays/actors/ovl_En_Az/z_en_az.c @@ -92,7 +92,7 @@ static AnimationSpeedInfo sAnimationInfo[] = { { &gBeaverIdleFaceRightAnim, 1.0f, ANIMMODE_LOOP, -5.0f }, }; -const ActorInit En_Az_InitVars = { +ActorInit En_Az_InitVars = { ACTOR_EN_AZ, ACTORCAT_NPC, FLAGS, @@ -162,7 +162,7 @@ void func_80A94B20(PlayState* play) { ring = SubS_FindActor(play, ring, ACTORCAT_MISC, ACTOR_EN_TWIG); if (ring != NULL) { if (RACERING_GET_PARAM_F(ring) == 1) { - Actor_MarkForDeath(ring); + Actor_Kill(ring); } ring = ring->next; } @@ -240,7 +240,7 @@ void EnAz_Init(Actor* thisx, PlayState* play2) { break; } if (phi_v1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Az/z_en_az.h b/src/overlays/actors/ovl_En_Az/z_en_az.h index ffe094a93..2a219eb24 100644 --- a/src/overlays/actors/ovl_En_Az/z_en_az.h +++ b/src/overlays/actors/ovl_En_Az/z_en_az.h @@ -51,6 +51,4 @@ typedef struct EnAz { /* 0x3D6 */ s16 unk_3D6; } EnAz; // size = 0x3D8 -extern const ActorInit En_Az_InitVars; - #endif // Z_EN_AZ_H 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 dcbbee65d..00e63c7d6 100644 --- a/src/overlays/actors/ovl_En_Baba/z_en_baba.c +++ b/src/overlays/actors/ovl_En_Baba/z_en_baba.c @@ -50,7 +50,7 @@ typedef enum { /* 2 */ BOMB_SHOP_LADY_SCH_FOLLOW_TIME_PATH } BombShopLadyScheduleResult; -const ActorInit En_Baba_InitVars = { +ActorInit En_Baba_InitVars = { ACTOR_EN_BABA, ACTORCAT_NPC, FLAGS, @@ -514,7 +514,7 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) { (BOMB_SHOP_LADY_GET_PATH_INDEX(&this->actor) != 0x3F)) { if ((gSaveContext.save.weekEventReg[58] & 0x40) || (gSaveContext.save.time >= CLOCK_TIME(0, 20) && (gSaveContext.save.time < CLOCK_TIME(6, 0)))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -525,7 +525,7 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) { } else if ((BOMB_SHOP_LADY_GET_TYPE(&this->actor) == BOMB_SHOP_LADY_TYPE_IDLE) && (gSaveContext.save.entrance == ENTRANCE(NORTH_CLOCK_TOWN, 7))) { if (gSaveContext.save.weekEventReg[81] & 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -540,7 +540,7 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) { this->stateFlags |= BOMB_SHOP_LADY_STATE_AUTOTALK; this->actionFunc = EnBaba_Idle; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else { diff --git a/src/overlays/actors/ovl_En_Baba/z_en_baba.h b/src/overlays/actors/ovl_En_Baba/z_en_baba.h index 2335dcb70..7da0ed054 100644 --- a/src/overlays/actors/ovl_En_Baba/z_en_baba.h +++ b/src/overlays/actors/ovl_En_Baba/z_en_baba.h @@ -58,6 +58,4 @@ typedef struct EnBaba { /* 0x43C */ s32 timePathHasReachedEnd; } EnBaba; // size = 0x440 -extern const ActorInit En_Baba_InitVars; - #endif // Z_EN_BABA_H diff --git a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c index e2496e18e..9017e0f89 100644 --- a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c +++ b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c @@ -41,7 +41,7 @@ typedef enum { /* 0x1 */ NEJIRON_DIRECTION_LEFT } NejironRollDirection; -const ActorInit En_Baguo_InitVars = { +ActorInit En_Baguo_InitVars = { ACTOR_EN_BAGUO, ACTORCAT_ENEMY, FLAGS, @@ -299,7 +299,7 @@ void EnBaguo_RetreatUnderground(EnBaguo* this, PlayState* play) { void EnBaguo_PostDetonation(EnBaguo* this, PlayState* play) { if (this->timer == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (this->timer >= 26) { diff --git a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.h b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.h index 6c98eeaeb..d6eb2173c 100644 --- a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.h +++ b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.h @@ -44,6 +44,4 @@ typedef struct EnBaguo { /* 0x23C */ NejironEffect effects[EN_BAGUO_EFFECT_COUNT]; } EnBaguo; // size = 0x8CC -extern const ActorInit En_Baguo_InitVars; - #endif // Z_EN_BAGUO_H diff --git a/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c b/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c index 3555f0998..5716c27d5 100644 --- a/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c +++ b/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c @@ -23,7 +23,7 @@ void func_80BE895C(EnBaisen* this, PlayState* play); void func_80BE8AAC(EnBaisen* this, PlayState* play); void func_80BE89D8(EnBaisen* this, PlayState* play); -const ActorInit En_Baisen_InitVars = { +ActorInit En_Baisen_InitVars = { ACTOR_EN_BAISEN, ACTORCAT_NPC, FLAGS, @@ -73,7 +73,7 @@ void EnBaisen_Init(Actor* thisx, PlayState* play) { this->unk290 = true; if (!(gSaveContext.save.weekEventReg[63] & 0x80) && ((gSaveContext.save.day != 3) || !gSaveContext.save.isNight)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { this->collider.dim.radius = 30; @@ -81,7 +81,7 @@ void EnBaisen_Init(Actor* thisx, PlayState* play) { this->collider.dim.yShift = 0; if ((gSaveContext.save.weekEventReg[63] & 0x80) || ((gSaveContext.save.day == 3) && (gSaveContext.save.isNight))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } this->actor.targetMode = 6; @@ -249,7 +249,7 @@ void EnBaisen_Update(Actor* thisx, PlayState* play) { } this->actor.shape.rot.y = this->actor.world.rot.y; if ((this->paramCopy != 0) && (gSaveContext.save.day == 3) && gSaveContext.save.isNight) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_En_Baisen/z_en_baisen.h b/src/overlays/actors/ovl_En_Baisen/z_en_baisen.h index 3fb45f70a..4c0ced24f 100644 --- a/src/overlays/actors/ovl_En_Baisen/z_en_baisen.h +++ b/src/overlays/actors/ovl_En_Baisen/z_en_baisen.h @@ -32,6 +32,4 @@ typedef struct EnBaisen { /* 0x2B0 */ ColliderCylinder collider; } EnBaisen; // size = 0x2FC -extern const ActorInit En_Baisen_InitVars; - #endif // Z_EN_BAISEN_H diff --git a/src/overlays/actors/ovl_En_Bal/z_en_bal.c b/src/overlays/actors/ovl_En_Bal/z_en_bal.c index dec839006..779373a9d 100644 --- a/src/overlays/actors/ovl_En_Bal/z_en_bal.c +++ b/src/overlays/actors/ovl_En_Bal/z_en_bal.c @@ -16,7 +16,7 @@ void EnBal_Update(Actor* thisx, PlayState* play); void EnBal_Draw(Actor* thisx, PlayState* play); #if 0 -const ActorInit En_Bal_InitVars = { +ActorInit En_Bal_InitVars = { ACTOR_EN_BAL, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Bal/z_en_bal.h b/src/overlays/actors/ovl_En_Bal/z_en_bal.h index 7f64293db..a64ef195d 100644 --- a/src/overlays/actors/ovl_En_Bal/z_en_bal.h +++ b/src/overlays/actors/ovl_En_Bal/z_en_bal.h @@ -15,6 +15,4 @@ typedef struct EnBal { /* 0x190 */ char unk_190[0x224]; } EnBal; // size = 0x3B4 -extern const ActorInit En_Bal_InitVars; - #endif // Z_EN_BAL_H diff --git a/src/overlays/actors/ovl_En_Bat/z_en_bat.c b/src/overlays/actors/ovl_En_Bat/z_en_bat.c index 5bec14e3e..cee109c70 100644 --- a/src/overlays/actors/ovl_En_Bat/z_en_bat.c +++ b/src/overlays/actors/ovl_En_Bat/z_en_bat.c @@ -28,7 +28,7 @@ void EnBat_DiveAttack(EnBat* this, PlayState* play); void EnBat_Die(EnBat* this, PlayState* play); void EnBat_Stunned(EnBat* this, PlayState* play); -const ActorInit En_Bat_InitVars = { +ActorInit En_Bat_InitVars = { ACTOR_EN_BAT, ACTORCAT_ENEMY, FLAGS, @@ -142,10 +142,10 @@ void EnBat_Init(Actor* thisx, PlayState* play) { Actor_SetFocus(thisx, 20.0f); if (sAlreadySpawned) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } else if (EnBat_IsGraveyardOnSecondDay(play)) { if (Flags_GetSwitch(play, this->switchFlag)) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } else { this->actor.room = -1; } @@ -369,7 +369,7 @@ void EnBat_Die(EnBat* this, PlayState* play) { func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, 100, 0, 0); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 11, NA_SE_EN_EXTINCT); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if (this->actor.room == -1) { Actor* enemy = NULL; diff --git a/src/overlays/actors/ovl_En_Bat/z_en_bat.h b/src/overlays/actors/ovl_En_Bat/z_en_bat.h index 4f4ada810..479cfa24d 100644 --- a/src/overlays/actors/ovl_En_Bat/z_en_bat.h +++ b/src/overlays/actors/ovl_En_Bat/z_en_bat.h @@ -40,6 +40,4 @@ typedef struct EnBat { /* 0x184 */ ColliderSphere collider; } EnBat; // size = 0x1DC -extern const ActorInit En_Bat_InitVars; - #endif // Z_EN_BAT_H diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index a66c28a89..c5657e385 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -35,7 +35,7 @@ typedef enum { /* 1 */ BB_BODY_PART_DRAW_STATUS_DEAD, } EnBbBodyPartDrawStatus; -const ActorInit En_Bb_InitVars = { +ActorInit En_Bb_InitVars = { ACTOR_EN_BB, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.h b/src/overlays/actors/ovl_En_Bb/z_en_bb.h index e6171065a..c852397d4 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.h +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.h @@ -37,6 +37,4 @@ typedef struct EnBb { /* 0x2F4 */ ColliderSphere collider; } EnBb; // size = 0x34C -extern const ActorInit En_Bb_InitVars; - #endif // Z_EN_BB_H 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 8398a69ed..067a4da8b 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 @@ -28,7 +28,7 @@ void EnBba01_Walk(EnHy* this, PlayState* play); void EnBba01_FaceFoward(EnHy* this, PlayState* play); void EnBba01_Talk(EnHy* this, PlayState* play); -const ActorInit En_Bba_01_InitVars = { +ActorInit En_Bba_01_InitVars = { ACTOR_EN_BBA_01, ACTORCAT_NPC, FLAGS, @@ -220,7 +220,7 @@ void EnBba01_Init(Actor* thisx, PlayState* play) { if ((this->enHy.animObjIndex < 0) || (this->enHy.headObjIndex < 0) || (this->enHy.skelUpperObjIndex < 0) || (this->enHy.skelLowerObjIndex < 0)) { - Actor_MarkForDeath(&this->enHy.actor); + Actor_Kill(&this->enHy.actor); } this->enHy.actor.draw = NULL; Collider_InitCylinder(play, &this->enHy.collider); diff --git a/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.h b/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.h index c9030f112..7160594d8 100644 --- a/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.h +++ b/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.h @@ -14,6 +14,4 @@ typedef struct EnBba01 { /* 0x3EC */ UNK_TYPE1 unk_3EC[0x230]; } EnBba01; // size = 0x61C -extern const ActorInit En_Bba_01_InitVars; - #endif // Z_EN_BBA_01_H diff --git a/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c b/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c index 875a5a079..1dfc74a22 100644 --- a/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c +++ b/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c @@ -35,7 +35,7 @@ typedef enum { /* 1 */ BBFALL_BODY_PART_DRAW_STATUS_DEAD, } EnBbfallBodyPartDrawStatus; -const ActorInit En_Bbfall_InitVars = { +ActorInit En_Bbfall_InitVars = { ACTOR_EN_BBFALL, ACTORCAT_ENEMY, FLAGS, @@ -466,12 +466,13 @@ void EnBbfall_Dead(EnBbfall* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->bodyPartsPos[i], 11, NA_SE_EN_EXTINCT); } - Actor_MarkForDeath(&this->actor); - } else { - for (i = 0; i < ARRAY_COUNT(this->bodyPartsPos); i++) { - Math_Vec3f_Sum(&this->bodyPartsPos[i], &this->bodyPartsVelocity[i], &this->bodyPartsPos[i]); - this->bodyPartsVelocity[i].y += this->actor.gravity; - } + Actor_Kill(&this->actor); + return; + } + + for (i = 0; i < ARRAY_COUNT(this->bodyPartsPos); i++) { + Math_Vec3f_Sum(&this->bodyPartsPos[i], &this->bodyPartsVelocity[i], &this->bodyPartsPos[i]); + this->bodyPartsVelocity[i].y += this->actor.gravity; } } diff --git a/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.h b/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.h index e835015e1..19c643ea7 100644 --- a/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.h +++ b/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.h @@ -33,6 +33,4 @@ typedef struct EnBbfall { /* 0x3A4 */ ColliderJntSphElement colliderElements[3]; } EnBbfall; // size = 0x464 -extern const ActorInit En_Bbfall_InitVars; - #endif // Z_EN_BBFALL_H diff --git a/src/overlays/actors/ovl_En_Bee/z_en_bee.c b/src/overlays/actors/ovl_En_Bee/z_en_bee.c index 7d40e9931..cf8c5f68a 100644 --- a/src/overlays/actors/ovl_En_Bee/z_en_bee.c +++ b/src/overlays/actors/ovl_En_Bee/z_en_bee.c @@ -22,7 +22,7 @@ void EnBee_Attack(EnBee* this, PlayState* play); s32 sNumLoadedBees = 0; -const ActorInit En_Bee_InitVars = { +ActorInit En_Bee_InitVars = { ACTOR_EN_BEE, ACTORCAT_ENEMY, FLAGS, @@ -243,7 +243,7 @@ void EnBee_UpdateDamage(EnBee* this, PlayState* play) { this->actor.colChkInfo.health = 0; SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EN_EXTINCT); func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, 100, 0, 2); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Bee/z_en_bee.h b/src/overlays/actors/ovl_En_Bee/z_en_bee.h index 851a0a216..09d9ef931 100644 --- a/src/overlays/actors/ovl_En_Bee/z_en_bee.h +++ b/src/overlays/actors/ovl_En_Bee/z_en_bee.h @@ -31,6 +31,4 @@ typedef struct EnBee { /* 0x23C */ ColliderCylinder collider; } EnBee; // size = 0x288 -extern const ActorInit En_Bee_InitVars; - #endif // Z_EN_BEE_H diff --git a/src/overlays/actors/ovl_En_Bh/z_en_bh.c b/src/overlays/actors/ovl_En_Bh/z_en_bh.c index b18bedfc9..2aff9891d 100644 --- a/src/overlays/actors/ovl_En_Bh/z_en_bh.c +++ b/src/overlays/actors/ovl_En_Bh/z_en_bh.c @@ -17,7 +17,7 @@ void EnBh_Draw(Actor* thisx, PlayState* play); void func_80C22DEC(EnBh* this, PlayState* play); -const ActorInit En_Bh_InitVars = { +ActorInit En_Bh_InitVars = { ACTOR_EN_BH, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_En_Bh/z_en_bh.h b/src/overlays/actors/ovl_En_Bh/z_en_bh.h index b5e8a7c0c..a3c88fb58 100644 --- a/src/overlays/actors/ovl_En_Bh/z_en_bh.h +++ b/src/overlays/actors/ovl_En_Bh/z_en_bh.h @@ -22,6 +22,4 @@ typedef struct EnBh { /* 0x1E8 */ EnBhActionFunc actionFunc; } EnBh; // size = 0x1EC -extern const ActorInit En_Bh_InitVars; - #endif // Z_EN_BH_H diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index ba7273f59..3792c09c7 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -30,7 +30,7 @@ void EnBigokuta_PlayDeathCutscene(EnBigokuta* this, PlayState* play); void EnBigokuta_SetupDeathEffects(EnBigokuta* this); void EnBigokuta_PlayDeathEffects(EnBigokuta* this, PlayState* play); -const ActorInit En_Bigokuta_InitVars = { +ActorInit En_Bigokuta_InitVars = { ACTOR_EN_BIGOKUTA, ACTORCAT_BOSS, FLAGS, @@ -106,7 +106,7 @@ void EnBigokuta_Init(Actor* thisx, PlayState* play) { if (gSaveContext.save.weekEventReg[20] & 2 || ((this->picto.actor.params != 0xFF) && Flags_GetSwitch(play, this->picto.actor.params))) { - Actor_MarkForDeath(&this->picto.actor); + Actor_Kill(&this->picto.actor); } else { this->picto.actor.world.pos.y -= 99.0f; EnBigokuta_SetupIdle(this); @@ -381,7 +381,7 @@ void EnBigokuta_PlayDeathCutscene(EnBigokuta* this, PlayState* play) { func_800B724C(play, &this->picto.actor, 7); } else { player = GET_PLAYER(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; } if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { @@ -451,14 +451,14 @@ void EnBigokuta_PlayDeathEffects(EnBigokuta* this, PlayState* play) { } ActorCutscene_Stop(this->cutscene); - Actor_MarkForDeath(&this->picto.actor); + Actor_Kill(&this->picto.actor); if (!(gSaveContext.eventInf[4] & 2) && !(gSaveContext.eventInf[3] & 0x20)) { func_800B724C(play, &this->picto.actor, 6); } else { Player* player = GET_PLAYER(play); - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } } @@ -517,7 +517,7 @@ void EnBigokuta_Update(Actor* thisx, PlayState* play) { EnBigokuta* this = THIS; if (!EnBigokuta_IsInWater(this, play)) { - Actor_MarkForDeath(&this->picto.actor); + Actor_Kill(&this->picto.actor); return; } diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h index fdb9d561d..6bcfa79fb 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h @@ -31,6 +31,4 @@ typedef struct EnBigokuta { /* 0x3AC */ ColliderCylinder bodyCollider; } EnBigokuta; // size = 0x3F8 -extern const ActorInit En_Bigokuta_InitVars; - #endif // Z_EN_BIGOKUTA_H diff --git a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c index bf6e46e36..2c27a1801 100644 --- a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c +++ b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c @@ -46,7 +46,7 @@ void func_80A28A28(EnBigpamet* this); void func_80A28D80(EnBigpamet* this); void func_80A28ED4(EnBigpamet* this); -const ActorInit En_Bigpamet_InitVars = { +ActorInit En_Bigpamet_InitVars = { ACTOR_EN_BIGPAMET, ACTORCAT_BOSS, FLAGS, @@ -710,7 +710,7 @@ void func_80A28EE8(EnBigpamet* this, PlayState* play) { func_800B0DE0(play, &pos, &gZeroVec3f, &gZeroVec3f, &D_80A29788, &D_80A2978C, 800, 50); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EN_NPC_FADEAWAY); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actor.scale.y = this->actor.scale.x; diff --git a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.h b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.h index 07d3265c0..bb9d29280 100644 --- a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.h +++ b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.h @@ -40,6 +40,4 @@ typedef struct EnBigpamet { /* 0x2FC */ EnBigpametStruct unk_2FC[20]; } EnBigpamet; // size = 0x5CC -extern const ActorInit En_Bigpamet_InitVars; - #endif // Z_EN_BIGPAMET_H diff --git a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c index 57dae0368..63c77b625 100644 --- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c +++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c @@ -82,9 +82,7 @@ void EnBigpo_DrawLantern(Actor* thisx, PlayState* play); void EnBigpo_DrawCircleFlames(Actor* thisx, PlayState* play); void EnBigpo_RevealedFire(Actor* thisx, PlayState* play); -extern const ActorInit En_Bigpo_InitVars; - -const ActorInit En_Bigpo_InitVars = { +ActorInit En_Bigpo_InitVars = { ACTOR_EN_BIGPO, ACTORCAT_ENEMY, FLAGS, @@ -185,11 +183,12 @@ void EnBigpo_Init(Actor* thisx, PlayState* play2) { thisx->params &= 0xFF; if (thisx->params == ENBIGPO_POSSIBLEFIRE) { if (Flags_GetSwitch(play, this->switchFlags)) { - Actor_MarkForDeath(&this->actor); - } else { - thisx->update = Actor_Noop; - EnBigpo_InitHiddenFire(this); + Actor_Kill(&this->actor); + return; } + + thisx->update = Actor_Noop; + EnBigpo_InitHiddenFire(this); return; } @@ -215,7 +214,7 @@ void EnBigpo_Init(Actor* thisx, PlayState* play2) { this->mainColor.a = 0; // fully invisible if ((this->switchFlags != 0xFF) && (Flags_GetSwitch(play, this->switchFlags))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (thisx->params == ENBIGPO_REGULAR) { // the well poe, starts immediately @@ -819,8 +818,11 @@ void EnBigpo_SetupScoopSoulIdle(EnBigpo* this) { void EnBigpo_ScoopSoulIdle(EnBigpo* this, PlayState* play) { DECR(this->idleTimer); if (Actor_HasParent(&this->actor, play)) { - Actor_MarkForDeath(&this->actor); - } else if (this->idleTimer == 0) { + Actor_Kill(&this->actor); + return; + } + + if (this->idleTimer == 0) { // took too long, soul is leaving Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH); EnBigpo_SetupScoopSoulLeaving(this); @@ -838,7 +840,7 @@ void EnBigpo_SetupScoopSoulLeaving(EnBigpo* this) { void EnBigpo_ScoopSoulFadingAway(EnBigpo* this, PlayState* play) { EnBigpo_AdjustPoAlpha(this, -13); if (this->mainColor.a == 0) { // fully invisible - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -981,7 +983,7 @@ void EnBigpo_WaitingForDampe(EnBigpo* this, PlayState* play) { } void EnBigpo_Die(EnBigpo* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void EnBigpo_SetupFireRevealed(EnBigpo* this) { @@ -1045,7 +1047,7 @@ void EnBigpo_FlameCircleCutscene(EnBigpo* this, PlayState* play) { EnBigpo* parentPoh = (EnBigpo*)this->actor.parent; Flags_SetSwitch(play, this->switchFlags); Math_Vec3f_Copy(&parentPoh->fires[this->unk20C].pos, &this->actor.world.pos); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if (this->unk20C == 0) { parentPoh->actor.draw = EnBigpo_DrawCircleFlames; Actor_SetScale(&parentPoh->actor, 0.01f); diff --git a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c index f65172093..5dc33095a 100644 --- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c +++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c @@ -211,7 +211,7 @@ static EnBigslimeTri sBigslimeTri[BIGSLIME_NUM_FACES] = { { 142, 126, 127 }, { 130, 111, 145 }, }; -const ActorInit En_Bigslime_InitVars = { +ActorInit En_Bigslime_InitVars = { ACTOR_EN_BIGSLIME, ACTORCAT_BOSS, FLAGS, @@ -341,7 +341,7 @@ void EnBigslime_Init(Actor* thisx, PlayState* play2) { this->actor.params = CLAMP(this->actor.params, 1, 4); if (Flags_GetClear(play, play->roomCtx.curRoom.num)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if (!(gSaveContext.save.weekEventReg[isFrogReturnedFlags[this->actor.params - 1] >> 8] & (u8)isFrogReturnedFlags[this->actor.params - 1])) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_MINIFROG, this->actor.world.pos.x, this->actor.world.pos.y, @@ -360,10 +360,10 @@ void EnBigslime_Init(Actor* thisx, PlayState* play2) { ACTOR_EN_MINISLIME, 0.0f, 0.0f, 0.0f, 0, 0, 0, i); if (this->minislime[i] == NULL) { for (i = i - 1; i >= 0; i--) { - Actor_MarkForDeath(&this->minislime[i]->actor); + Actor_Kill(&this->minislime[i]->actor); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -728,7 +728,7 @@ void EnBigslime_SetMinislimeBreakLocation(EnBigslime* this) { void EnBigslime_SetPlayerParams(EnBigslime* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (player->stateFlags2 & 0x80) { + if (player->stateFlags2 & PLAYER_STATE2_80) { player->actor.parent = NULL; player->unk_AE8 = 100; func_800B8D98(play, &this->actor, 10.0f, this->actor.world.rot.y, 10.0f); @@ -1709,7 +1709,7 @@ void EnBigslime_WindupThrowPlayer(EnBigslime* this, PlayState* play) { scale = 0.5f - cos_rad(-this->windupPunchTimer * (M_PI / 5)) * 0.5f; if (this->windupPunchTimer == -5) { - if (player->stateFlags2 & 0x80) { + if (player->stateFlags2 & PLAYER_STATE2_80) { player->actor.parent = NULL; player->unk_AE8 = 100; } @@ -2509,7 +2509,7 @@ void EnBigslime_Despawn(EnBigslime* this, PlayState* play) { this->minislime[i]->actor.params = MINISLIME_DESPAWN; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.h b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.h index c66dd7850..52a29013c 100644 --- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.h +++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.h @@ -125,6 +125,4 @@ typedef struct EnBigslime { /* 0x0A54 */ EnBigslimeIceShardEffect iceShardEffect[BIGSLIME_NUM_ICE_SHARD]; // 312 = 162 (bigslime) + 10 * 15 (minislime) } EnBigslime; // size = 0x3634 -extern const ActorInit En_Bigslime_InitVars; - #endif // Z_EN_BIGSLIME_H 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 e49b743b8..41bd94894 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 @@ -29,7 +29,7 @@ void func_809CD77C(EnBji01* this, PlayState* play); s32 EnBji01_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); void EnBji01_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); -const ActorInit En_Bji_01_InitVars = { +ActorInit En_Bji_01_InitVars = { ACTOR_EN_BJI_01, ACTORCAT_NPC, FLAGS, @@ -357,7 +357,7 @@ void EnBji01_Init(Actor* thisx, PlayState* play) { func_809CCE98(this, play); break; default: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; } } diff --git a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.h b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.h index 8ab601e1b..29afaf533 100644 --- a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.h +++ b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.h @@ -35,6 +35,4 @@ typedef struct EnBji01 { /* 0x2B0 */ ObjMoonStone* moonsTear; } EnBji01; // size = 0x2B4 -extern const ActorInit En_Bji_01_InitVars; - #endif // Z_EN_BJI_01_H 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 788759e3c..a8bcfdc88 100644 --- a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c +++ b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c @@ -46,7 +46,7 @@ static u8 sMsgEventScript[] = { 0x10, 0x2C, 0x29, 0x49, 0x0C, 0x2F, 0x00, 0x00, 0x0C, 0x2D, 0x00, 0x0D, 0x12, 0x10, 0x2D, 0x00, 0x0D, 0x12, 0x10, }; -const ActorInit En_Bjt_InitVars = { +ActorInit En_Bjt_InitVars = { ACTOR_EN_BJT, ACTORCAT_NPC, FLAGS, @@ -361,8 +361,7 @@ s32 EnBjt_ChooseAnimation(EnBjt* this, PlayState* play) { void EnBjt_Talk(EnBjt* this, PlayState* play) { s16 yaw = this->actor.yawTowardsPlayer; - // TODO: Casting to remove warning for now - if (func_8010BF58(&this->actor, play, (s32)sMsgEventScript, this->msgEventCallback, &this->msgEventArg4)) { + if (func_8010BF58(&this->actor, play, sMsgEventScript, this->msgEventCallback, &this->msgEventArg4)) { this->actor.flags &= ~ACTOR_FLAG_100; SubS_UpdateFlags(&this->stateFlags, 3, 7); this->stateFlags &= ~TOILET_HAND_STATE_TALKING; diff --git a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.h b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.h index f26be4d22..9ce5adf0e 100644 --- a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.h +++ b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.h @@ -32,6 +32,4 @@ typedef struct EnBjt { } EnBjt; // size = 0x25C -extern const ActorInit En_Bjt_InitVars; - #endif // Z_EN_BJT_H diff --git a/src/overlays/actors/ovl_En_Boj_01/z_en_boj_01.c b/src/overlays/actors/ovl_En_Boj_01/z_en_boj_01.c index 29510c9d7..bd4b0e499 100644 --- a/src/overlays/actors/ovl_En_Boj_01/z_en_boj_01.c +++ b/src/overlays/actors/ovl_En_Boj_01/z_en_boj_01.c @@ -15,7 +15,7 @@ void EnBoj01_Destroy(Actor* thisx, PlayState* play); void EnBoj01_Update(Actor* thisx, PlayState* play); void EnBoj01_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Boj_01_InitVars = { +ActorInit En_Boj_01_InitVars = { ACTOR_EN_BOJ_01, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Boj_01/z_en_boj_01.h b/src/overlays/actors/ovl_En_Boj_01/z_en_boj_01.h index cfee748df..78f4968c2 100644 --- a/src/overlays/actors/ovl_En_Boj_01/z_en_boj_01.h +++ b/src/overlays/actors/ovl_En_Boj_01/z_en_boj_01.h @@ -10,6 +10,4 @@ typedef struct EnBoj01 { /* 0x144 */ char unk_144[0x1D0]; } EnBoj01; // size = 0x314 -extern const ActorInit En_Boj_01_InitVars; - #endif // Z_EN_BOJ_01_H diff --git a/src/overlays/actors/ovl_En_Boj_02/z_en_boj_02.c b/src/overlays/actors/ovl_En_Boj_02/z_en_boj_02.c index d68f44bd5..89f6ba0cb 100644 --- a/src/overlays/actors/ovl_En_Boj_02/z_en_boj_02.c +++ b/src/overlays/actors/ovl_En_Boj_02/z_en_boj_02.c @@ -15,7 +15,7 @@ void EnBoj02_Destroy(Actor* thisx, PlayState* play); void EnBoj02_Update(Actor* thisx, PlayState* play); void EnBoj02_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Boj_02_InitVars = { +ActorInit En_Boj_02_InitVars = { ACTOR_EN_BOJ_02, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Boj_02/z_en_boj_02.h b/src/overlays/actors/ovl_En_Boj_02/z_en_boj_02.h index 1ef9785ef..c27d05d38 100644 --- a/src/overlays/actors/ovl_En_Boj_02/z_en_boj_02.h +++ b/src/overlays/actors/ovl_En_Boj_02/z_en_boj_02.h @@ -10,6 +10,4 @@ typedef struct EnBoj02 { /* 0x144 */ char unk_144[0x4D8]; } EnBoj02; // size = 0x61C -extern const ActorInit En_Boj_02_InitVars; - #endif // Z_EN_BOJ_02_H diff --git a/src/overlays/actors/ovl_En_Boj_03/z_en_boj_03.c b/src/overlays/actors/ovl_En_Boj_03/z_en_boj_03.c index 46477ec33..0c55b79a6 100644 --- a/src/overlays/actors/ovl_En_Boj_03/z_en_boj_03.c +++ b/src/overlays/actors/ovl_En_Boj_03/z_en_boj_03.c @@ -15,7 +15,7 @@ void EnBoj03_Destroy(Actor* thisx, PlayState* play); void EnBoj03_Update(Actor* thisx, PlayState* play); void EnBoj03_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Boj_03_InitVars = { +ActorInit En_Boj_03_InitVars = { ACTOR_EN_BOJ_03, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Boj_03/z_en_boj_03.h b/src/overlays/actors/ovl_En_Boj_03/z_en_boj_03.h index eac4fc691..12776093d 100644 --- a/src/overlays/actors/ovl_En_Boj_03/z_en_boj_03.h +++ b/src/overlays/actors/ovl_En_Boj_03/z_en_boj_03.h @@ -10,6 +10,4 @@ typedef struct EnBoj03 { /* 0x144 */ char unk_144[0x4D8]; } EnBoj03; // size = 0x61C -extern const ActorInit En_Boj_03_InitVars; - #endif // Z_EN_BOJ_03_H diff --git a/src/overlays/actors/ovl_En_Boj_04/z_en_boj_04.c b/src/overlays/actors/ovl_En_Boj_04/z_en_boj_04.c index 2e080483d..7fe308520 100644 --- a/src/overlays/actors/ovl_En_Boj_04/z_en_boj_04.c +++ b/src/overlays/actors/ovl_En_Boj_04/z_en_boj_04.c @@ -15,7 +15,7 @@ void EnBoj04_Destroy(Actor* thisx, PlayState* play); void EnBoj04_Update(Actor* thisx, PlayState* play); void EnBoj04_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Boj_04_InitVars = { +ActorInit En_Boj_04_InitVars = { ACTOR_EN_BOJ_04, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Boj_04/z_en_boj_04.h b/src/overlays/actors/ovl_En_Boj_04/z_en_boj_04.h index 9681073e8..4b05014fb 100644 --- a/src/overlays/actors/ovl_En_Boj_04/z_en_boj_04.h +++ b/src/overlays/actors/ovl_En_Boj_04/z_en_boj_04.h @@ -10,6 +10,4 @@ typedef struct EnBoj04 { /* 0x144 */ char unk_144[0x4D8]; } EnBoj04; // size = 0x61C -extern const ActorInit En_Boj_04_InitVars; - #endif // Z_EN_BOJ_04_H diff --git a/src/overlays/actors/ovl_En_Boj_05/z_en_boj_05.c b/src/overlays/actors/ovl_En_Boj_05/z_en_boj_05.c index 3b1508b7b..da6816840 100644 --- a/src/overlays/actors/ovl_En_Boj_05/z_en_boj_05.c +++ b/src/overlays/actors/ovl_En_Boj_05/z_en_boj_05.c @@ -15,7 +15,7 @@ void EnBoj05_Destroy(Actor* thisx, PlayState* play); void EnBoj05_Update(Actor* thisx, PlayState* play); void EnBoj05_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Boj_05_InitVars = { +ActorInit En_Boj_05_InitVars = { ACTOR_EN_BOJ_05, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Boj_05/z_en_boj_05.h b/src/overlays/actors/ovl_En_Boj_05/z_en_boj_05.h index bed1ad78e..b2e5e7c7e 100644 --- a/src/overlays/actors/ovl_En_Boj_05/z_en_boj_05.h +++ b/src/overlays/actors/ovl_En_Boj_05/z_en_boj_05.h @@ -10,6 +10,4 @@ typedef struct EnBoj05 { /* 0x144 */ char unk_144[0x4D8]; } EnBoj05; // size = 0x61C -extern const ActorInit En_Boj_05_InitVars; - #endif // Z_EN_BOJ_05_H diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c index d4fe409cd..42baf77bf 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -32,7 +32,7 @@ typedef struct { static PowderKegFuseSegment sPowderKegFuseSegments[16]; -const ActorInit En_Bom_InitVars = { +ActorInit En_Bom_InitVars = { ACTOR_EN_BOM, ACTORCAT_EXPLOSIVES, FLAGS, @@ -377,7 +377,7 @@ void func_808715B8(EnBom* this, PlayState* play) { if (this->timer == 0) { func_80123590(play, &this->actor); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if ((this->timer & 1) == 0) { @@ -433,12 +433,12 @@ void EnBom_Update(Actor* thisx, PlayState* play) { s32 pad; Player* player = GET_PLAYER(play); - if (player->stateFlags1 & 2) { + if (player->stateFlags1 & PLAYER_STATE1_2) { return; } if (Player_GetMask(play) == PLAYER_MASK_GIANT) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } @@ -451,7 +451,7 @@ void EnBom_Update(Actor* thisx, PlayState* play) { if (this->isPowderKeg) { gSaveContext.powderKegTimer = 0; } - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } } else { thisx->gravity = -1.2f; diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.h b/src/overlays/actors/ovl_En_Bom/z_en_bom.h index fe8eaadf1..23218a183 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.h +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.h @@ -31,6 +31,4 @@ typedef struct EnBom { /* 0x200 */ EnBomActionFunc actionFunc; } EnBom; // size = 0x204 -extern const ActorInit En_Bom_InitVars; - #endif // Z_EN_BOM_H 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 21fc9901f..9dc36ff6c 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 @@ -37,7 +37,7 @@ s32 D_809C6100 = 0; s32 D_809C6104 = 0; -const ActorInit En_Bom_Bowl_Man_InitVars = { +ActorInit En_Bom_Bowl_Man_InitVars = { ACTOR_EN_BOM_BOWL_MAN, ACTORCAT_NPC, FLAGS, @@ -101,11 +101,11 @@ void EnBomBowlMan_Init(Actor* thisx, PlayState* play) { !CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) { this->unk_2D6 = this->actor.cutscene; if (this->unk_2D6 == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } func_809C52B4(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -158,7 +158,7 @@ void func_809C4B50(EnBomBowlMan* this) { void func_809C4B6C(EnBomBowlMan* this) { if ((this->unk_29A != ENBOMBOWLMAN_FF00_MINUS1) && (this->path != NULL)) { if (!SubS_CopyPointFromPath(this->path, this->unk_298, &this->unk_2A0)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -369,7 +369,7 @@ void func_809C5310(EnBomBowlMan* this, PlayState* play) { func_809C53A4(this); } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -486,10 +486,11 @@ void func_809C5738(EnBomBowlMan* this, PlayState* play) { gSaveContext.save.weekEventReg[84] |= 0x80; gSaveContext.save.weekEventReg[83] &= (u8)~4; ActorCutscene_Stop(this->unk_2D6); - Actor_MarkForDeath(&this->actor); - } else { - func_809C4B6C(this); + Actor_Kill(&this->actor); + return; } + + func_809C4B6C(this); } } } diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h index 5f630e4e6..fc911dd04 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h @@ -57,6 +57,4 @@ typedef struct EnBomBowlMan { /* 0x02F8 */ s32 unk_2F8; } EnBomBowlMan; // size = 0x2FC -extern const ActorInit En_Bom_Bowl_Man_InitVars; - #endif // Z_EN_BOM_BOWL_MAN_H diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c index b1b9f8d14..cbcc40211 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c @@ -25,7 +25,7 @@ void EnBomChu_Move(EnBomChu* this, PlayState* play); void EnBomChu_Explode(EnBomChu* this, PlayState* play); void EnBomChu_WaitForDeath(EnBomChu* this, PlayState* play); -const ActorInit En_Bom_Chu_InitVars = { +ActorInit En_Bom_Chu_InitVars = { ACTOR_EN_BOM_CHU, ACTORCAT_EXPLOSIVES, FLAGS, @@ -350,7 +350,7 @@ void EnBomChu_Explode(EnBomChu* this, PlayState* play) { void EnBomChu_WaitForDeath(EnBomChu* this, PlayState* play) { if (this->timer == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h index 35998aeac..686bbb384 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h @@ -25,6 +25,4 @@ typedef struct EnBomChu { /* 0x188 */ ColliderSphere collider; } EnBomChu; // size = 0x1E0 -extern const ActorInit En_Bom_Chu_InitVars; - #endif // Z_EN_BOM_CHU_H diff --git a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c index a4fc5d484..91e7fbd4c 100644 --- a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c +++ b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c @@ -25,7 +25,7 @@ void EnBombal_InitEffects(EnBombal* this, Vec3f* pos, s16 fadeDelay); void EnBombal_UpdateEffects(EnBombal* this, PlayState* play); void EnBombal_DrawEffects(EnBombal*, PlayState*); -const ActorInit En_Bombal_InitVars = { +ActorInit En_Bombal_InitVars = { ACTOR_EN_BOMBAL, ACTORCAT_PROP, FLAGS, @@ -149,8 +149,11 @@ void func_80C05DE8(EnBombal* this, PlayState* play) { !(gSaveContext.save.weekEventReg[85] & 2)) { ActorCutscene_Stop(this->cutscene); } - Actor_MarkForDeath(&this->actor); - } else if (this->timer < 10) { + Actor_Kill(&this->actor); + return; + } + + if (this->timer < 10) { this->actor.colChkInfo.health = 0; } } diff --git a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.h b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.h index a678fe1d8..7c72f3eea 100644 --- a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.h +++ b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.h @@ -30,6 +30,4 @@ typedef struct EnBombal { /* 0x1A4 */ EnBombalEffect effects[200]; } EnBombal; // size = 0x2A44 -extern const ActorInit En_Bombal_InitVars; - #endif // Z_EN_BOMBAL_H diff --git a/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c b/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c index 7d4fbbafb..1d4d646f8 100644 --- a/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c +++ b/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c @@ -25,7 +25,7 @@ void func_80C042F8(EnBombers* this); void func_80C04354(EnBombers* this, PlayState* play); void func_80C043C8(EnBombers* this, PlayState* play); -const ActorInit En_Bombers_InitVars = { +ActorInit En_Bombers_InitVars = { ACTOR_EN_BOMBERS, ACTORCAT_NPC, FLAGS, @@ -105,11 +105,12 @@ void EnBombers_Init(Actor* thisx, PlayState* play) { if (this->unk_2BC == ENBOMBERS_F0_0) { if ((gSaveContext.save.weekEventReg[73] & 0x10) || (gSaveContext.save.weekEventReg[85] & 2)) { - Actor_MarkForDeath(&this->actor); - } else { - this->unk_2BE++; - func_80C03ACC(this); + Actor_Kill(&this->actor); + return; } + + this->unk_2BE++; + func_80C03ACC(this); } else if (((gSaveContext.save.weekEventReg[73] & 0x10) || (gSaveContext.save.weekEventReg[85] & 2)) && (((this->unk_2BE == ENBOMBERS_F_0) && (gSaveContext.save.weekEventReg[76] & 1)) || ((this->unk_2BE == ENBOMBERS_F_1) && (gSaveContext.save.weekEventReg[76] & 2)) || @@ -137,12 +138,13 @@ void EnBombers_Init(Actor* thisx, PlayState* play) { gSaveContext.save.weekEventReg[76] &= (u8)~0x10; } } - Actor_MarkForDeath(&this->actor); - } else { - func_80C042F8(this); + Actor_Kill(&this->actor); + return; } + + func_80C042F8(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Bombers/z_en_bombers.h b/src/overlays/actors/ovl_En_Bombers/z_en_bombers.h index 538b0d8b5..85c5ecdb3 100644 --- a/src/overlays/actors/ovl_En_Bombers/z_en_bombers.h +++ b/src/overlays/actors/ovl_En_Bombers/z_en_bombers.h @@ -50,6 +50,4 @@ typedef struct EnBombers { /* 0x2C8 */ ColliderCylinder collider; } EnBombers; // size = 0x314 -extern const ActorInit En_Bombers_InitVars; - #endif // Z_EN_BOMBERS_H diff --git a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c index 9f70629e6..632ff3b67 100644 --- a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c +++ b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c @@ -23,7 +23,7 @@ void EnBombers2_ChangeAnim(EnBombers2* this, s32 animIndex, f32 playSpeed); void func_80C04D00(EnBombers2* this); void func_80C050B8(EnBombers2* this, PlayState* play); -const ActorInit En_Bombers2_InitVars = { +ActorInit En_Bombers2_InitVars = { ACTOR_EN_BOMBERS2, ACTORCAT_NPC, FLAGS, @@ -102,7 +102,7 @@ void EnBombers2_Init(Actor* thisx, PlayState* play) { } this->cutscene = this->actor.cutscene; if (this->cutscene == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } func_80C04B40(this); } diff --git a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.h b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.h index 0a62fd704..4a79e6615 100644 --- a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.h +++ b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.h @@ -41,6 +41,4 @@ typedef struct EnBombers2 { /* 0x2D0 */ ColliderCylinder collider; } EnBombers2; // size = 0x31C -extern const ActorInit En_Bombers2_InitVars; - #endif // Z_EN_BOMBERS2_H diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index 4eb0ea456..fd5ce0bf6 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -24,7 +24,7 @@ void func_808AEE3C(EnBombf* this, PlayState* play); void func_808AEF68(EnBombf* this, PlayState* play); void func_808AEFD4(EnBombf* this, PlayState* play); -const ActorInit En_Bombf_InitVars = { +ActorInit En_Bombf_InitVars = { ACTOR_EN_BOMBF, ACTORCAT_PROP, FLAGS, @@ -163,7 +163,7 @@ void func_808AEAE0(EnBombf* this, PlayState* play) { player->heldActor = NULL; player->interactRangeActor = NULL; this->actor.parent = NULL; - player->stateFlags1 &= ~0x800; + player->stateFlags1 &= ~PLAYER_STATE1_800; } } else if ((this->colliderCylinder.base.acFlags & AC_HIT) && ((this->colliderCylinder.info.acHitInfo->toucher.dmgFlags & 0x13828) || @@ -200,7 +200,7 @@ void func_808AEAE0(EnBombf* this, PlayState* play) { player->heldActor = NULL; player->interactRangeActor = NULL; this->actor.parent = NULL; - player->stateFlags1 &= ~0x800; + player->stateFlags1 &= ~PLAYER_STATE1_800; this->actor.world.pos = this->actor.home.pos; } } @@ -217,7 +217,7 @@ void func_808AEAE0(EnBombf* this, PlayState* play) { player->heldActor = NULL; player->interactRangeActor = NULL; this->actor.parent = NULL; - player->stateFlags1 &= ~0x800; + player->stateFlags1 &= ~PLAYER_STATE1_800; this->actor.world.pos = this->actor.home.pos; } } @@ -299,13 +299,13 @@ void func_808AEFD4(EnBombf* this, PlayState* play) { if (this->timer == 0) { Player* player = GET_PLAYER(play); - if ((player->stateFlags1 & 0x800) && (&this->actor == player->heldActor)) { + if ((player->stateFlags1 & PLAYER_STATE1_800) && (&this->actor == player->heldActor)) { player->actor.child = NULL; player->heldActor = NULL; player->interactRangeActor = NULL; - player->stateFlags1 &= ~0x800; + player->stateFlags1 &= ~PLAYER_STATE1_800; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -439,8 +439,11 @@ void EnBombf_Update(Actor* thisx, PlayState* play) { if ((this->actor.scale.x >= 0.01f) && (ENBOMBF_GET(&this->actor) != ENBOMBF_1)) { if (this->actor.depthInWater >= 20.0f) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 30, NA_SE_IT_BOMB_UNEXPLOSION); - Actor_MarkForDeath(&this->actor); - } else if (this->actor.bgCheckFlags & 0x40) { + Actor_Kill(&this->actor); + return; + } + + if (this->actor.bgCheckFlags & 0x40) { this->actor.bgCheckFlags &= ~0x40; Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMB_DROP_WATER); } diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h index 18a2a32ed..55b7f7bae 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h @@ -26,6 +26,4 @@ typedef struct EnBombf { /* 0x204 */ f32 unk_204; } EnBombf; // size = 0x208 -extern const ActorInit En_Bombf_InitVars; - #endif // Z_EN_BOMBF_H diff --git a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c index 48b953ffe..a9d81c10b 100644 --- a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c +++ b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c @@ -53,7 +53,7 @@ typedef enum EN_BOMJIMA_ACTION { static s32 D_80C009F0 = 0; static s32 D_80C009F4 = 0; -const ActorInit En_Bomjima_InitVars = { +ActorInit En_Bomjima_InitVars = { ACTOR_EN_BOMJIMA, ACTORCAT_NPC, FLAGS, @@ -152,7 +152,7 @@ void EnBomjima_Init(Actor* thisx, PlayState* play) { if ((gSaveContext.save.weekEventReg[75] & 0x40) || (gSaveContext.save.weekEventReg[73] & 0x10) || (gSaveContext.save.weekEventReg[85] & 2)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -471,7 +471,7 @@ void func_80BFF03C(EnBomjima* this, PlayState* play) { } else if (!ActorCutscene_GetCanPlayNext(this->cutscenes[0])) { ActorCutscene_SetIntentToPlay(this->cutscenes[0]); } else { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; gSaveContext.save.weekEventReg[83] &= (u8)~4; this->actor.world.rot.y = Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)); this->unk_2DC = Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)); @@ -935,8 +935,8 @@ void func_80C00284(EnBomjima* this, PlayState* play) { if ((this->action == EN_BOMJIMA_ACTION_4) || (this->unk_2CA == 1) || ((this->unk_2CA == 3) && (this->unk_2C8 >= 2))) { this->unk_28E = 0; - if (player->stateFlags1 & 0x20) { - player->stateFlags1 &= ~0x20; + if (player->stateFlags1 & PLAYER_STATE1_20) { + player->stateFlags1 &= ~PLAYER_STATE1_20; } if ((this->bombal == 0) || (this->bombal->actor.update == NULL) || diff --git a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.h b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.h index 046e8813c..6a434be42 100644 --- a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.h +++ b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.h @@ -56,6 +56,4 @@ typedef struct EnBomjima { /* 0x2F8 */ ColliderCylinder collider; } EnBomjima; // size = 0x344 -extern const ActorInit En_Bomjima_InitVars; - #endif // Z_EN_BOMJIMA_H diff --git a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c index 300d83958..0e3a6f431 100644 --- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c +++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c @@ -40,7 +40,7 @@ void func_80C02DAC(EnBomjimb* this, PlayState* play); static Actor* D_80C03170 = NULL; -const ActorInit En_Bomjimb_InitVars = { +ActorInit En_Bomjimb_InitVars = { ACTOR_EN_BOMJIMB, ACTORCAT_NPC, FLAGS, @@ -119,35 +119,35 @@ void EnBomjimb_Init(Actor* thisx, PlayState* play) { switch (this->unk_2C8) { case ENBOMJIMB_F_0: if (gSaveContext.save.weekEventReg[11] & 1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; case ENBOMJIMB_F_1: if (gSaveContext.save.weekEventReg[11] & 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; case ENBOMJIMB_F_2: if (gSaveContext.save.weekEventReg[11] & 4) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; case ENBOMJIMB_F_3: if (gSaveContext.save.weekEventReg[11] & 8) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; case ENBOMJIMB_F_4: if (gSaveContext.save.weekEventReg[11] & 0x10) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; @@ -156,7 +156,7 @@ void EnBomjimb_Init(Actor* thisx, PlayState* play) { if ((!(gSaveContext.save.weekEventReg[73] & 0x10) && !(gSaveContext.save.weekEventReg[85] & 2)) || (gSaveContext.save.weekEventReg[75] & 0x40)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -333,7 +333,7 @@ void func_80C014E4(EnBomjimb* this, PlayState* play) { break; } - if (player->stateFlags3 != 0x1000000) { + if (player->stateFlags3 != PLAYER_STATE3_1000000) { phi_f0 = 200.0f; abs = ABS_ALT(BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.world.rot.y)); @@ -538,7 +538,7 @@ void func_80C0217C(EnBomjimb* this, PlayState* play) { return; } - if (player->stateFlags3 == 0x1000000) { + if (player->stateFlags3 == PLAYER_STATE3_1000000) { Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 3000, 0); func_80C01494(this); return; @@ -631,7 +631,7 @@ void func_80C02570(EnBomjimb* this, PlayState* play) { this->unk_2D6 = BINANG_ROT180(this->actor.yawTowardsPlayer); func_80C0113C(this, 19, 2.0f); this->actionFunc = func_80C0217C; - } else if ((player->stateFlags3 == 0x1000000) || (this->actor.xzDistToPlayer > 410.0f)) { + } else if ((player->stateFlags3 == PLAYER_STATE3_1000000) || (this->actor.xzDistToPlayer > 410.0f)) { Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 3000, 0); func_80C01494(this); } @@ -666,7 +666,7 @@ void func_80C02740(EnBomjimb* this, PlayState* play) { if ((player->transformation != PLAYER_FORM_DEKU) && (player->transformation != PLAYER_FORM_HUMAN)) { func_80C0113C(this, 17, 1.0f); Message_StartTextbox(play, 0x72E, &this->actor); - player->stateFlags1 |= 0x10000000; + player->stateFlags1 |= PLAYER_STATE1_10000000; player->actor.freezeTimer = 3; func_80C012E0(this); this->unk_2CA = 9; @@ -678,7 +678,7 @@ void func_80C02740(EnBomjimb* this, PlayState* play) { ((player->transformation == PLAYER_FORM_HUMAN) && !(gSaveContext.save.weekEventReg[85] & 2))) { func_80C0113C(this, 17, 1.0f); Message_StartTextbox(play, 0x72E, &this->actor); - player->stateFlags1 |= 0x10000000; + player->stateFlags1 |= PLAYER_STATE1_10000000; player->actor.freezeTimer = 3; func_80C012E0(this); this->unk_2CA = 9; @@ -726,7 +726,7 @@ void func_80C02740(EnBomjimb* this, PlayState* play) { if (!Play_InCsMode(play)) { Player* player = GET_PLAYER(play); - player->stateFlags1 |= 0x10000000; + player->stateFlags1 |= PLAYER_STATE1_10000000; player->actor.freezeTimer = 3; } this->unk_2CA = 8; @@ -765,7 +765,7 @@ void func_80C02A14(EnBomjimb* this, PlayState* play) { func_80C02CA4(this, play); } else { if (this->unk_2CA == 8) { - player->stateFlags1 &= ~0x10000000; + player->stateFlags1 &= ~PLAYER_STATE1_10000000; } func_80C01FD4(this); } @@ -781,7 +781,7 @@ void func_80C02BCC(EnBomjimb* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { func_801477B4(play); this->unk_2C0 = 1; - player->stateFlags1 &= ~0x10000000; + player->stateFlags1 &= ~PLAYER_STATE1_10000000; } } else if (this->actor.xzDistToPlayer > 200.0f) { func_80C01494(this); diff --git a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.h b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.h index 8b73ef972..f411f21a2 100644 --- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.h +++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.h @@ -61,6 +61,4 @@ typedef struct EnBomjimb { /* 0x2E8 */ ColliderCylinder collider; } EnBomjimb; // size = 0x334 -extern const ActorInit En_Bomjimb_InitVars; - #endif // Z_EN_BOMJIMB_H diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index 2c68e20f8..33af85b3e 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -19,7 +19,7 @@ void EnBoom_Draw(Actor* thisx, PlayState* play); void EnBoom_SetupAction(EnBoom* this, EnBoomActionFunc actionFunc); void func_808A2918(EnBoom* this, PlayState* play); -const ActorInit En_Boom_InitVars = { +ActorInit En_Boom_InitVars = { ACTOR_EN_BOOM, ACTORCAT_ITEMACTION, FLAGS, @@ -155,10 +155,10 @@ void EnBoom_Destroy(Actor* thisx, PlayState* play) { temp->child = NULL; } else { player->boomerangActor = NULL; - player->stateFlags1 &= ~0x2000000; + player->stateFlags1 &= ~PLAYER_STATE1_2000000; } } - player->stateFlags3 |= 0x800000; + player->stateFlags3 |= PLAYER_STATE3_800000; } } @@ -267,7 +267,7 @@ void func_808A2918(EnBoom* this, PlayState* play) { sp7C->flags &= ~ACTOR_FLAG_2000; } } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -286,7 +286,7 @@ void EnBoom_Update(Actor* thisx, PlayState* play) { Player* player = GET_PLAYER(play); Actor* actor; - if (!(player->stateFlags1 & 0x20000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_20000000)) { this->actionFunc(this, play); if (((actor = this->actor.child) != NULL) || ((actor = this->actor.parent) != NULL)) { diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.h b/src/overlays/actors/ovl_En_Boom/z_en_boom.h index 45e3618ed..e5e3fa2b3 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.h +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.h @@ -21,6 +21,4 @@ typedef struct EnBoom { /* 0x1F0 */ EnBoomActionFunc actionFunc; } EnBoom; // size = 0x1F4 -extern const ActorInit En_Boom_InitVars; - #endif // Z_EN_BOOM_H diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index bc33adc0c..0c345aa50 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -56,7 +56,7 @@ void EnBox_Open(EnBox* this, PlayState* play); void func_80867FBC(func_80867BDC_a0* arg0, PlayState* play, s32 arg2); void func_80867FE4(func_80867BDC_a0* arg0, PlayState* play); -const ActorInit En_Box_InitVars = { +ActorInit En_Box_InitVars = { ACTOR_EN_BOX, ACTORCAT_CHEST, FLAGS, diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.h b/src/overlays/actors/ovl_En_Box/z_en_box.h index cd164c924..432025f14 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.h +++ b/src/overlays/actors/ovl_En_Box/z_en_box.h @@ -66,7 +66,5 @@ typedef struct EnBox { /* 0x220 */ s32 collectableFlag; } EnBox; // size = 0x224 -extern const ActorInit En_Box_InitVars; - #endif // Z_EN_BOX_H diff --git a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c index 4ad558a0a..6c6e832c8 100644 --- a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c +++ b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c @@ -112,7 +112,7 @@ static DamageTable D_80C0F9E0 = { /* Powder Keg */ DMG_ENTRY(1, 0xD), }; -const ActorInit En_Bsb_InitVars = { +ActorInit En_Bsb_InitVars = { ACTOR_EN_BSB, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.h b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.h index 38ec4078f..f3cd4b7d6 100644 --- a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.h +++ b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.h @@ -11,9 +11,9 @@ typedef struct EnBsb { /* 0x0000 */ Actor actor; /* 0x0144 */ char unk_144[0x140]; /* 0x0284 */ EnBsbActionFunc actionFunc; - /* 0x0288 */ char unk_288[0xED0]; + /* 0x0288 */ char unk_288[0x54]; + /* 0x02DC */ s32 unk2DC; + /* 0x02E0 */ char unk2E0[0xE78]; } EnBsb; // size = 0x1158 -extern const ActorInit En_Bsb_InitVars; - #endif // Z_EN_BSB_H diff --git a/src/overlays/actors/ovl_En_Bu/z_en_bu.c b/src/overlays/actors/ovl_En_Bu/z_en_bu.c index fb8c119da..043f1ebb7 100644 --- a/src/overlays/actors/ovl_En_Bu/z_en_bu.c +++ b/src/overlays/actors/ovl_En_Bu/z_en_bu.c @@ -17,7 +17,7 @@ void EnBu_Draw(Actor* thisx, PlayState* play); void EnBu_DoNothing(EnBu* this, PlayState* play); -const ActorInit En_Bu_InitVars = { +ActorInit En_Bu_InitVars = { ACTOR_EN_BU, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Bu/z_en_bu.h b/src/overlays/actors/ovl_En_Bu/z_en_bu.h index 0f828477c..05149742f 100644 --- a/src/overlays/actors/ovl_En_Bu/z_en_bu.h +++ b/src/overlays/actors/ovl_En_Bu/z_en_bu.h @@ -14,6 +14,4 @@ typedef struct EnBu { /* 0x18C */ Gfx* displayListPtr; } EnBu; // size = 0x190 -extern const ActorInit En_Bu_InitVars; - #endif // Z_EN_BU_H diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 06c5c33b1..cbf9e9f3c 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -19,7 +19,7 @@ void EnBubble_Wait(EnBubble* this, PlayState* play); void EnBubble_Pop(EnBubble* this, PlayState* play); void EnBubble_Regrow(EnBubble* this, PlayState* play); -const ActorInit En_Bubble_InitVars = { +ActorInit En_Bubble_InitVars = { ACTOR_EN_BUBBLE, ACTORCAT_ENEMY, FLAGS, @@ -366,7 +366,7 @@ void EnBubble_Wait(EnBubble* this, PlayState* play) { void EnBubble_Pop(EnBubble* this, PlayState* play) { if (EnBubble_Explosion(this, play) > -1) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 60, NA_SE_EN_AWA_BREAK); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h index 7affed807..86e2358b4 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h @@ -32,6 +32,4 @@ typedef struct EnBubble { /* 0x254 */ f32 yVelocity; } EnBubble; // size = 0x258 -extern const ActorInit En_Bubble_InitVars; - #endif // Z_EN_BUBBLE_H 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 93bc67792..17c7e5802 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -53,7 +53,7 @@ static ColliderJntSphInit sJntSphInit = { sJntSphElementsInit, }; -const ActorInit En_Butte_InitVars = { +ActorInit En_Butte_InitVars = { ACTOR_EN_BUTTE, ACTORCAT_ITEMACTION, FLAGS, @@ -396,7 +396,7 @@ void func_8091D070(EnButte* this) { void func_8091D090(EnButte* this, PlayState* play) { if (this->unk_24C <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.h b/src/overlays/actors/ovl_En_Butte/z_en_butte.h index 2d7a6a0bc..4bcaf440c 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.h +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.h @@ -33,6 +33,4 @@ typedef struct EnButte { /* 0x25C */ f32 unk_25C; } EnButte; // size = 0x260 -extern const ActorInit En_Butte_InitVars; - #endif // Z_EN_BUTTE_H diff --git a/src/overlays/actors/ovl_En_Cha/z_en_cha.c b/src/overlays/actors/ovl_En_Cha/z_en_cha.c index 0fb85a756..edf68582f 100644 --- a/src/overlays/actors/ovl_En_Cha/z_en_cha.c +++ b/src/overlays/actors/ovl_En_Cha/z_en_cha.c @@ -18,7 +18,7 @@ void EnCha_Draw(Actor* thisx, PlayState* play); void EnCha_Idle(EnCha* this, PlayState* play); -const ActorInit En_Cha_InitVars = { +ActorInit En_Cha_InitVars = { ACTOR_EN_CHA, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_En_Cha/z_en_cha.h b/src/overlays/actors/ovl_En_Cha/z_en_cha.h index b3cfe7312..845ebc163 100644 --- a/src/overlays/actors/ovl_En_Cha/z_en_cha.h +++ b/src/overlays/actors/ovl_En_Cha/z_en_cha.h @@ -13,6 +13,4 @@ typedef struct EnCha { /* 0x190 */ EnChaActionFunc actionFunc; } EnCha; // size = 0x194 -extern const ActorInit En_Cha_InitVars; - #endif // Z_EN_CHA_H diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index c457a623e..40bc4aeb6 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -31,7 +31,7 @@ void EnClearTag_Draw(Actor* thisx, PlayState* play); void EnClearTag_UpdateEffects(EnClearTag* this, PlayState* play); void EnClearTag_DrawEffects(Actor* thisx, PlayState* play); -const ActorInit En_Clear_Tag_InitVars = { +ActorInit En_Clear_Tag_InitVars = { ACTOR_EN_CLEAR_TAG, ACTORCAT_ITEMACTION, FLAGS, @@ -615,7 +615,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play) { } else if (this->activeTimer != 0) { EnClearTag_UpdateEffects(this, play); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h index c14cc36fd..677fcc698 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h @@ -41,6 +41,4 @@ typedef struct EnClearTag { /* 0x2E78 */ Vec3f subCamAt; } EnClearTag; // size = 0x2E84 -extern const ActorInit En_Clear_Tag_InitVars; - #endif // Z_EN_CLEAR_TAG_H 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 993076ba8..ed3483150 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 @@ -20,7 +20,7 @@ void EnCne01_Walk(EnHy* this, PlayState* play); void EnCne01_FaceForward(EnHy* this, PlayState* play); void EnCne01_Talk(EnHy* this, PlayState* play); -const ActorInit En_Cne_01_InitVars = { +ActorInit En_Cne_01_InitVars = { ACTOR_EN_CNE_01, ACTORCAT_NPC, FLAGS, @@ -210,7 +210,7 @@ void EnCne01_Init(Actor* thisx, PlayState* play) { if ((this->enHy.animObjIndex < 0) || (this->enHy.headObjIndex < 0) || (this->enHy.skelUpperObjIndex < 0) || (this->enHy.skelLowerObjIndex < 0)) { - Actor_MarkForDeath(&this->enHy.actor); + Actor_Kill(&this->enHy.actor); } this->enHy.actor.draw = NULL; Collider_InitCylinder(play, &this->enHy.collider); diff --git a/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.h b/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.h index 0b9e1e08b..253025760 100644 --- a/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.h +++ b/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.h @@ -14,6 +14,4 @@ typedef struct EnCne01 { /* 0x3EC */ UNK_TYPE1 unk_3EC[0x230]; } EnCne01; // size = 0x61C -extern const ActorInit En_Cne_01_InitVars; - #endif // Z_EN_CNE_01_H diff --git a/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c b/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c index 0b909d61f..7170ebdc8 100644 --- a/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c +++ b/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c @@ -47,7 +47,7 @@ static ColliderCylinderInit sCylinderInit = { { 10, 11, 1, { 0, 0, 0 } }, }; -const ActorInit En_Col_Man_InitVars = { +ActorInit En_Col_Man_InitVars = { ACTOR_EN_COL_MAN, ACTORCAT_MISC, FLAGS, @@ -140,7 +140,7 @@ void func_80AFDE00(EnColMan* this, PlayState* play) { void EnColMan_SetHeartPieceCollectedAndKill(EnColMan* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { gSaveContext.save.weekEventReg[56] |= 2; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -183,7 +183,7 @@ void func_80AFDFB4(EnColMan* this, PlayState* play) { Rand_ZeroFloat(50.0f) + 60.0f, 30, Rand_ZeroFloat(5.0f) + 20.0f); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -211,7 +211,7 @@ void func_80AFE25C(EnColMan* this, PlayState* play) { } Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.h b/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.h index 1e8f540dc..977bf2473 100644 --- a/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.h +++ b/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.h @@ -24,6 +24,4 @@ typedef enum { /* 4 */ EN_COL_MAN_GAMEPLAY_BOMB, } EnColManType; -extern const ActorInit En_Col_Man_InitVars; - #endif // Z_EN_COL_MAN_H diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index df6093690..778a358a8 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -27,7 +27,7 @@ void EnCow_DoTail(EnCow* this, PlayState* play); void EnCow_UpdateTail(Actor* thisx, PlayState* play); void EnCow_DrawTail(Actor* thisx, PlayState* play); -const ActorInit En_Cow_InitVars = { +ActorInit En_Cow_InitVars = { ACTOR_EN_COW, ACTORCAT_NPC, FLAGS, @@ -118,7 +118,7 @@ void EnCow_Init(Actor* thisx, PlayState* play) { if (!(gSaveContext.save.weekEventReg[22] & 1) && (CURRENT_DAY != 1) && (EN_COW_TYPE(thisx) == EN_COW_TYPE_ABDUCTED)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.h b/src/overlays/actors/ovl_En_Cow/z_en_cow.h index 1fd6a36a9..3c73b747f 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.h +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.h @@ -32,6 +32,4 @@ typedef struct EnCow { /* 0x0274 */ EnCowActionFunc actionFunc; } EnCow; // size = 0x278 -extern const ActorInit En_Cow_InitVars; - #endif // Z_EN_COW_H diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index c04462c44..b9e1071fe 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -27,7 +27,7 @@ void EnCrow_SetupRespawn(EnCrow* this); void EnCrow_TurnAway(EnCrow* this, PlayState* play); void EnCrow_Respawn(EnCrow* this, PlayState* play); -const ActorInit En_Crow_InitVars = { +ActorInit En_Crow_InitVars = { ACTOR_EN_CROW, ACTORCAT_ENEMY, FLAGS, @@ -349,7 +349,7 @@ void EnCrow_Damaged(EnCrow* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 11, NA_SE_EN_EXTINCT); if (this->actor.parent != NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } EnCrow_SetupDie(this); diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.h b/src/overlays/actors/ovl_En_Crow/z_en_crow.h index 86ffba903..527f822f6 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.h +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.h @@ -31,6 +31,4 @@ typedef struct EnCrow { /* 0x298 */ f32 drawDmgEffScale; } EnCrow; // size = 0x29C -extern const ActorInit En_Crow_InitVars; - #endif // Z_EN_CROW_H 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 6abf4da13..7b758ca74 100644 --- a/src/overlays/actors/ovl_En_Dai/z_en_dai.c +++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.c @@ -19,7 +19,7 @@ void EnDai_Draw(Actor* thisx, PlayState* play); void func_80B3F00C(EnDai* this, PlayState* play); void func_80B3EF90(EnDai* this, PlayState* play); -const ActorInit En_Dai_InitVars = { +ActorInit En_Dai_InitVars = { ACTOR_EN_DAI, ACTORCAT_NPC, FLAGS, @@ -415,7 +415,7 @@ void func_80B3EEDC(EnDai* this, PlayState* play) { (play->msgCtx.lastPlayedSong == OCARINA_SONG_GORON_LULLABY)) { func_80B3E5DC(this, 1); this->actionFunc = func_80B3EE8C; - } else if (!(player->stateFlags2 & 0x08000000)) { + } else if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) { func_80B3E96C(this, play); this->unk_A6C = 0; } else if (this->unk_A6C == 0) { @@ -531,7 +531,7 @@ void EnDai_Init(Actor* thisx, PlayState* play) { } if (gSaveContext.save.weekEventReg[30] & 1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -557,7 +557,7 @@ void EnDai_Update(Actor* thisx, PlayState* play) { func_80B3E460(this); } else { this->actionFunc(this, play); - if (!(player->stateFlags2 & 0x8000000)) { + if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) { SkelAnime_Update(&this->skelAnime); func_80B3E834(this); if (!(this->unk_1CE & 0x200)) { diff --git a/src/overlays/actors/ovl_En_Dai/z_en_dai.h b/src/overlays/actors/ovl_En_Dai/z_en_dai.h index 0b0316d05..4dc059c39 100644 --- a/src/overlays/actors/ovl_En_Dai/z_en_dai.h +++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.h @@ -46,6 +46,4 @@ typedef struct EnDai { /* 0xA70 */ s32 unk_A70; } EnDai; // size = 0xA74 -extern const ActorInit En_Dai_InitVars; - #endif // Z_EN_DAI_H diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index 45777c681..d9039ad59 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -21,7 +21,7 @@ void func_80943BC0(EnDaiku* this); void func_80943BDC(EnDaiku* this, PlayState* play); void func_809438F8(EnDaiku* this, PlayState* play); -const ActorInit En_Daiku_InitVars = { +ActorInit En_Daiku_InitVars = { ACTOR_EN_DAIKU, ACTORCAT_NPC, FLAGS, @@ -90,10 +90,10 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) { this->actor.flags |= ACTOR_FLAG_8000000; if ((gSaveContext.save.weekEventReg[63] & 0x80) || ((gSaveContext.save.day == 3) && gSaveContext.save.isNight)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if ((gSaveContext.save.day == 3) && gSaveContext.save.isNight) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Math_Vec3f_Copy(&this->unk_26C, &this->actor.world.pos); @@ -137,7 +137,7 @@ void func_8094373C(EnDaiku* this, s32 arg1) { void func_809437C8(EnDaiku* this) { if ((this->unk_288 != -1) && (this->unk_258 != 0)) { if (!SubS_CopyPointFromPath(this->unk_258, this->unk_25C, &this->unk_26C)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -259,7 +259,7 @@ void EnDaiku_Update(Actor* thisx, PlayState* play) { } if ((this->unk_278 == ENDAIKU_PARAMS_FF_0) && (gSaveContext.save.day == 3) && (gSaveContext.save.isNight)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h index 4f93b3ea1..fa161e9fd 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h @@ -45,6 +45,4 @@ typedef struct EnDaiku { /* 0x29C */ ColliderCylinder collider; } EnDaiku; // size = 0x2E8 -extern const ActorInit En_Daiku_InitVars; - #endif // Z_EN_DAIKU_H diff --git a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c index b7b46b5af..711943659 100644 --- a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c +++ b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c @@ -32,7 +32,7 @@ void func_80BE71D8(EnDaiku2* this, PlayState* play); void func_80BE7504(EnDaiku2* this, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4, s16 arg5); void func_80BE7718(EnDaiku2* this, PlayState* play); -const ActorInit En_Daiku2_InitVars = { +ActorInit En_Daiku2_InitVars = { ACTOR_EN_DAIKU2, ACTORCAT_NPC, FLAGS, @@ -71,7 +71,7 @@ static ColliderCylinderInit sCylinderInit = { void func_80BE61D0(EnDaiku2* this) { if ((this->unk_27A != -1) && (this->unk_258 != 0)) { if (!SubS_CopyPointFromPath(this->unk_258, this->unk_25C, &this->unk_268)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -93,7 +93,7 @@ void EnDaiku2_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); if (!this->unk_280) { if (day == 3) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -105,7 +105,7 @@ void EnDaiku2_Init(Actor* thisx, PlayState* play) { Math_Vec3f_Copy(&this->actor.world.pos, &this->unk_268); } } else if (day != 3) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.h b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.h index dab4096c0..f13b89611 100644 --- a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.h +++ b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.h @@ -53,6 +53,4 @@ typedef struct EnDaiku2 { /* 0xD7C */ ColliderCylinder collider; } EnDaiku2; // size = 0xDC8 -extern const ActorInit En_Daiku2_InitVars; - #endif // Z_EN_DAIKU2_H diff --git a/src/overlays/actors/ovl_En_Death/z_en_death.c b/src/overlays/actors/ovl_En_Death/z_en_death.c index b0f03af7c..dd05c2d48 100644 --- a/src/overlays/actors/ovl_En_Death/z_en_death.c +++ b/src/overlays/actors/ovl_En_Death/z_en_death.c @@ -38,7 +38,7 @@ void func_808C7D34(EnDeath* this, PlayState* play); void func_808C7DCC(EnDeath* this, PlayState* play); #if 0 -const ActorInit En_Death_InitVars = { +ActorInit En_Death_InitVars = { ACTOR_EN_DEATH, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Death/z_en_death.h b/src/overlays/actors/ovl_En_Death/z_en_death.h index bc4e326bb..16863cf83 100644 --- a/src/overlays/actors/ovl_En_Death/z_en_death.h +++ b/src/overlays/actors/ovl_En_Death/z_en_death.h @@ -14,6 +14,4 @@ typedef struct EnDeath { /* 0x18C */ char unk_18C[0x7AC]; } EnDeath; // size = 0x938 -extern const ActorInit En_Death_InitVars; - #endif // Z_EN_DEATH_H diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index d05ac1003..93d495267 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -32,7 +32,7 @@ void func_808B3DA8(EnDekubaba* this, PlayState* play); void func_808B3EE8(EnDekubaba* this, PlayState* play); #if 0 -const ActorInit En_Dekubaba_InitVars = { +ActorInit En_Dekubaba_InitVars = { ACTOR_EN_DEKUBABA, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h index 923f336aa..848f056bf 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h @@ -14,6 +14,4 @@ typedef struct EnDekubaba { /* 0x18C */ char unk_18C[0x290]; } EnDekubaba; // size = 0x41C -extern const ActorInit En_Dekubaba_InitVars; - #endif // Z_EN_DEKUBABA_H diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 0f37266e2..6bc0fd8d1 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -39,7 +39,7 @@ void func_808BE4D4(EnDekunuts* this, PlayState* play); void func_808BE680(EnDekunuts* this); void func_808BE6C4(EnDekunuts* this, PlayState* play); -const ActorInit En_Dekunuts_InitVars = { +ActorInit En_Dekunuts_InitVars = { ACTOR_EN_DEKUNUTS, ACTORCAT_ENEMY, FLAGS, @@ -544,7 +544,7 @@ void func_808BE4D4(EnDekunuts* this, PlayState* play) { DEKU_FLOWER_PARAMS(DEKU_FLOWER_TYPE_PINK_WITH_INITIAL_BOUNCE)); EffectSsHahen_SpawnBurst(play, &this->actor.home.pos, 6.0f, 0, 6, 2, 15, OBJECT_DEKUNUTS, 10, gDekuScrubFlowerFragmentDL); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h index 596369c62..c6672b06e 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h @@ -36,6 +36,4 @@ typedef struct EnDekunuts { /* 0x27C */ ColliderCylinder collider; } EnDekunuts; // size = 0x2C8 -extern const ActorInit En_Dekunuts_InitVars; - #endif // Z_EN_DEKUNUTS_H diff --git a/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.c b/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.c index 47e11a2e8..2a4eb1553 100644 --- a/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.c +++ b/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.c @@ -30,7 +30,7 @@ typedef enum { /* 4 */ DEMOHEISHI_ANIM_STAND_UP } EnDemoheishiAnimation; -const ActorInit En_Demo_heishi_InitVars = { +ActorInit En_Demo_heishi_InitVars = { ACTOR_EN_DEMO_HEISHI, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.h b/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.h index c14fa5326..181198e0f 100644 --- a/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.h +++ b/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.h @@ -28,6 +28,4 @@ typedef struct EnDemoheishi { /* 0x274 */ ColliderCylinder colliderCylinder; } EnDemoheishi; //size = 0x2C0 -extern const ActorInit En_Demo_heishi_InitVars; - #endif // Z_EN_DEMO_HEISHI_H diff --git a/src/overlays/actors/ovl_En_Dg/z_en_dg.c b/src/overlays/actors/ovl_En_Dg/z_en_dg.c index de2c586e9..bd2c1e603 100644 --- a/src/overlays/actors/ovl_En_Dg/z_en_dg.c +++ b/src/overlays/actors/ovl_En_Dg/z_en_dg.c @@ -36,7 +36,7 @@ void EnDg_Thrown(EnDg* this, PlayState* play); void EnDg_SetupTalk(EnDg* this, PlayState* play); void EnDg_Talk(EnDg* this, PlayState* play); -const ActorInit En_Dg_InitVars = { +ActorInit En_Dg_InitVars = { ACTOR_EN_DG, ACTORCAT_ENEMY, FLAGS, @@ -347,7 +347,7 @@ void EnDg_MoveAlongPath(EnDg* this, PlayState* play) { Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f); } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -430,7 +430,7 @@ void EnDg_UpdateTextId(EnDg* this) { 0x3538 + (gSaveContext.save.weekEventReg[42 + (this->index / 2)] & 0x0F); } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } // As a sanity check, this makes sure the text ID is something in the expected range of 0x3538 to 0x3546. @@ -547,7 +547,7 @@ s32 EnDg_FindFollowerForBremenMask(PlayState* play) { void EnDg_CheckForBremenMaskMarch(EnDg* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (player->stateFlags3 & 0x20000000) { // bremen mask march + if (player->stateFlags3 & PLAYER_STATE3_20000000) { if (sBremenMaskFollowerIndex == ENDG_INDEX_NO_BREMEN_MASK_FOLLOWER) { EnDg_FindFollowerForBremenMask(play); } @@ -865,7 +865,7 @@ void EnDg_SitNextToPlayer(EnDg* this, PlayState* play) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xC00); this->actor.world.rot.y = this->actor.shape.rot.y; } else { - if (player->stateFlags3 & 0x20000000) { // bremen mask march + if (player->stateFlags3 & PLAYER_STATE3_20000000) { EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK); } else { EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); @@ -992,7 +992,7 @@ void EnDg_ApproachPlayer(EnDg* this, PlayState* play) { if (this->actor.xzDistToPlayer < 40.0f) { EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_SIT_DOWN); this->actionFunc = EnDg_SitNextToPlayer; - } else if (player->stateFlags3 & 0x20000000) { // bremen mask march + } else if (player->stateFlags3 & PLAYER_STATE3_20000000) { if ((this->actor.xzDistToPlayer > 40.0f) && (player->linearVelocity == 0.0f)) { Math_ApproachF(&this->actor.speedXZ, 1.5f, 0.2f, 1.0f); } else { @@ -1340,7 +1340,7 @@ void EnDg_Update(Actor* thisx, PlayState* play) { Vec3f floorRot = { 0.0f, 0.0f, 0.0f }; this->selectedDogIndex = sSelectedRacetrackDogInfo.index; - if (!(player->stateFlags1 & 0x20) || (play->sceneId != SCENE_CLOCKTOWER)) { + if (!(player->stateFlags1 & PLAYER_STATE1_20) || (play->sceneId != SCENE_CLOCKTOWER)) { if (EnDg_ShouldReactToNonHumanPlayer(this, play)) { EnDg_ChooseActionForForm(this, play); } else if (this->behavior != DOG_BEHAVIOR_DEFAULT) { diff --git a/src/overlays/actors/ovl_En_Dg/z_en_dg.h b/src/overlays/actors/ovl_En_Dg/z_en_dg.h index 2b2bdd7cb..62c01a011 100644 --- a/src/overlays/actors/ovl_En_Dg/z_en_dg.h +++ b/src/overlays/actors/ovl_En_Dg/z_en_dg.h @@ -65,6 +65,4 @@ typedef struct EnDg { /* 0x294 */ Vec3f curRot; } EnDg; // size = 0x2A0 -extern const ActorInit En_Dg_InitVars; - #endif // Z_EN_DG_H diff --git a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c index 506e5eb47..e2ad9433c 100644 --- a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c +++ b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c @@ -57,7 +57,7 @@ void func_8089C398(EnDinofos* this); void func_8089C164(EnDinofos* this); void func_8089C244(EnDinofos* this); -const ActorInit En_Dinofos_InitVars = { +ActorInit En_Dinofos_InitVars = { ACTOR_EN_DINOFOS, ACTORCAT_ENEMY, FLAGS, @@ -1145,7 +1145,7 @@ void func_8089D018(EnDinofos* this, PlayState* play) { } if (temp_v0 <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); this->unk_288 = 0; } else { this->unk_288 = temp_v0; diff --git a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.h b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.h index fcdf48c32..4284d5595 100644 --- a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.h +++ b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.h @@ -39,6 +39,4 @@ typedef struct EnDinofos { /* 0x5C4 */ ColliderQuad colliderQuad; } EnDinofos; // size = 0x644 -extern const ActorInit En_Dinofos_InitVars; - #endif // Z_EN_DINOFOS_H diff --git a/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c b/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c index b9bc34d99..615383a27 100644 --- a/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c +++ b/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c @@ -21,7 +21,7 @@ s32 func_80A507C0(EnDnbUnkStruct* arg0, Vec3f arg1, Vec3f arg2, u8 arg3, f32 arg s32 func_80A5086C(EnDnbUnkStruct* arg0); s32 func_80A50950(EnDnbUnkStruct* arg0, PlayState* play2); -const ActorInit En_Dnb_InitVars = { +ActorInit En_Dnb_InitVars = { ACTOR_EN_DNB, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_En_Dnb/z_en_dnb.h b/src/overlays/actors/ovl_En_Dnb/z_en_dnb.h index 17ee19abe..aa17663bf 100644 --- a/src/overlays/actors/ovl_En_Dnb/z_en_dnb.h +++ b/src/overlays/actors/ovl_En_Dnb/z_en_dnb.h @@ -41,6 +41,4 @@ typedef struct EnDnb { /* 0x0D38 */ EnDnbUnkStruct unk_0D38[256]; } EnDnb; // size = 0x3538 -extern const ActorInit En_Dnb_InitVars; - #endif // Z_EN_DNB_H diff --git a/src/overlays/actors/ovl_En_Dnh/z_en_dnh.c b/src/overlays/actors/ovl_En_Dnh/z_en_dnh.c index f1b78f25d..9413b046c 100644 --- a/src/overlays/actors/ovl_En_Dnh/z_en_dnh.c +++ b/src/overlays/actors/ovl_En_Dnh/z_en_dnh.c @@ -19,7 +19,7 @@ void func_80A50F38(EnDnh* this, PlayState* play); void func_80A50F9C(EnDnh* this, PlayState* play); #if 0 -const ActorInit En_Dnh_InitVars = { +ActorInit En_Dnh_InitVars = { ACTOR_EN_DNH, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Dnh/z_en_dnh.h b/src/overlays/actors/ovl_En_Dnh/z_en_dnh.h index e26b9a7c0..c2331d777 100644 --- a/src/overlays/actors/ovl_En_Dnh/z_en_dnh.h +++ b/src/overlays/actors/ovl_En_Dnh/z_en_dnh.h @@ -13,6 +13,4 @@ typedef struct EnDnh { /* 0x148 */ char unk_148[0x74]; } EnDnh; // size = 0x1BC -extern const ActorInit En_Dnh_InitVars; - #endif // Z_EN_DNH_H diff --git a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c index 346246f86..ee035f06b 100644 --- a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c +++ b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c @@ -24,7 +24,7 @@ void func_80A52134(EnDnk* this, PlayState* play); static s16 D_80A521A0 = 0; -const ActorInit En_Dnk_InitVars = { +ActorInit En_Dnk_InitVars = { ACTOR_EN_DNK, ACTORCAT_NPC, FLAGS, @@ -242,7 +242,7 @@ void EnDnk_Init(Actor* thisx, PlayState* play) { if (this->unk_28E >= 0) { this->actionFunc = func_80A51648; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->unk_2A2 = D_80A521A0; diff --git a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.h b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.h index 9b6913548..f0665f1b5 100644 --- a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.h +++ b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.h @@ -40,6 +40,4 @@ typedef struct EnDnk { /* 0x2A2 */ s16 unk_2A2; } EnDnk; // size = 0x2A4 -extern const ActorInit En_Dnk_InitVars; - #endif // Z_EN_DNK_H 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 685c3a511..3c97b8377 100644 --- a/src/overlays/actors/ovl_En_Dno/z_en_dno.c +++ b/src/overlays/actors/ovl_En_Dno/z_en_dno.c @@ -89,7 +89,7 @@ static AnimationSpeedInfo sAnimations[] = { { &gDekuButlerGrieveAnim, 1.0f, ANIMMODE_LOOP, 0.0f }, }; -const ActorInit En_Dno_InitVars = { +ActorInit En_Dno_InitVars = { ACTOR_EN_DNO, ACTORCAT_NPC, FLAGS, @@ -222,7 +222,7 @@ void EnDno_Init(Actor* thisx, PlayState* play) { actor = SubS_FindActor(play, actor, ACTORCAT_NPC, ACTOR_EN_DNO); if (actor != NULL) { if (actor != thisx) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); break; } actor = actor->next; @@ -250,7 +250,7 @@ void EnDno_Init(Actor* thisx, PlayState* play) { case EN_DNO_GET_C000_0: func_80A71788(this, play); if (!(gSaveContext.save.weekEventReg[23] & 0x20) || (gSaveContext.save.weekEventReg[93] & 2)) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } else { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, EN_DNO_ANIM_IDLE_WITH_CANDLE, &this->animIndex); @@ -265,13 +265,13 @@ void EnDno_Init(Actor* thisx, PlayState* play) { case EN_DNO_GET_C000_1: if (gSaveContext.save.weekEventReg[23] & 0x20) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } else { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, EN_DNO_ANIM_IDLE, &this->animIndex); this->unk_460 = SubS_FindActor(play, NULL, ACTORCAT_NPC, ACTOR_EN_DNQ); if (this->unk_460 == NULL) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } else { this->actionFunc = func_80A71B68; } diff --git a/src/overlays/actors/ovl_En_Dno/z_en_dno.h b/src/overlays/actors/ovl_En_Dno/z_en_dno.h index db07a969b..470c82ee8 100644 --- a/src/overlays/actors/ovl_En_Dno/z_en_dno.h +++ b/src/overlays/actors/ovl_En_Dno/z_en_dno.h @@ -50,6 +50,4 @@ typedef struct EnDno { /* 0x468 */ u8 unk_468; } EnDno; // size = 0x46C -extern const ActorInit En_Dno_InitVars; - #endif // Z_EN_DNO_H 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 63371ee2f..594ddd3d7 100644 --- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c +++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c @@ -8,7 +8,6 @@ */ #include "z_en_dnp.h" -#include "objects/object_dnq/object_dnq.h" #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10) @@ -25,7 +24,15 @@ void func_80B3D338(EnDnp* this, PlayState* play); void func_80B3D3F8(EnDnp* this, PlayState* play); void func_80B3D558(EnDnp* this, PlayState* play); -const ActorInit En_Dnp_InitVars = { +typedef enum { + /* 0 */ EN_DNP_EYE_OPEN, + /* 1 */ EN_DNP_EYE_HALF, + /* 2 */ EN_DNP_EYE_CLOSED, + /* 3 */ EN_DNP_EYE_ANGRY, + /* 4 */ EN_DNP_EYE_MAX, +} EnDnpEyeIndex; + +ActorInit En_Dnp_InitVars = { ACTOR_EN_DNP, ACTORCAT_NPC, FLAGS, @@ -59,33 +66,63 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; +typedef enum { + /* -1 */ EN_DNP_ANIM_NONE = -1, + /* 0 */ EN_DNP_ANIM_JUMP_KICK, // Can be triggered by a cutscene, but no cutscene in the final game does so + /* 1 */ EN_DNP_ANIM_HURRY, + /* 2 */ EN_DNP_ANIM_CUTSCENE_HURRY, + /* 3 */ EN_DNP_ANIM_HURRY_END, + /* 4 */ EN_DNP_ANIM_SCOLD, // Unused + /* 5 */ EN_DNP_ANIM_LAUGH_START, + /* 6 */ EN_DNP_ANIM_LAUGH_LOOP, + /* 7 */ EN_DNP_ANIM_TURN_AROUND, + /* 8 */ EN_DNP_ANIM_BOW, + /* 9 */ EN_DNP_ANIM_RUN, // Unused + /* 10 */ EN_DNP_ANIM_THINK_START, + /* 11 */ EN_DNP_ANIM_THINK_LOOP, + /* 12 */ EN_DNP_ANIM_ARMS_TOGETHER_START, + /* 13 */ EN_DNP_ANIM_ARMS_TOGETHER_LOOP, + /* 14 */ EN_DNP_ANIM_GREETING, + /* 15 */ EN_DNP_ANIM_IDLE, + /* 16 */ EN_DNP_ANIM_CUTSCENE_IDLE, + /* 17 */ EN_DNP_ANIM_UNUSED_WALK, // Unused + /* 18 */ EN_DNP_ANIM_WALK, // Can be triggered by a cutscene, but no cutscene in the final game does so + /* 19 */ EN_DNP_ANIM_ANGRY_START, + /* 20 */ EN_DNP_ANIM_ANGRY_LOOP, + /* 21 */ EN_DNP_ANIM_JUMP, + /* 22 */ EN_DNP_ANIM_BOUNCE_START, + /* 23 */ EN_DNP_ANIM_BOUNCE_LOOP, + /* 24 */ EN_DNP_ANIM_GLARE_START, + /* 25 */ EN_DNP_ANIM_GLARE_LOOP +} EnDnpAnimation; + static AnimationInfoS sAnimationInfo[] = { - { &object_dnq_Anim_0007D8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_dnq_Anim_0021DC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnq_Anim_0021DC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dnq_Anim_0026B8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_dnq_Anim_004D08, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_dnq_Anim_0071F4, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_dnq_Anim_007960, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dnq_Anim_008588, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnq_Anim_00A900, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dnq_Anim_00AEB8, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dnq_Anim_00B754, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_dnq_Anim_00674C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dnq_Anim_00BAD8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_dnq_Anim_006B74, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dnq_Anim_012428, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dnq_Anim_00B324, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnq_Anim_00B324, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dnq_Anim_0115B8, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dnq_Anim_0115B8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnq_Anim_00923C, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_dnq_Anim_009AA0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dnq_Anim_00125C, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_dnq_Anim_0017F8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnq_Anim_001C1C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dnq_Anim_0057AC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnq_Anim_00625C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuPrincessJumpKickAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &gDekuPrincessHurryAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gDekuPrincessHurryAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuPrincessHurryEndAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &gDekuPrincessScoldAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &gDekuPrincessLaughStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &gDekuPrincessLaughLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuPrincessTurnAroundAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gDekuPrincessBowAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuPrincessRunAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuPrincessThinkStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &gDekuPrincessThinkLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuPrincessArmsTogetherStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &gDekuPrincessArmsTogetherLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuPrincessGreetingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuPrincessIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gDekuPrincessIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuPrincessWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuPrincessWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gDekuPrincessAngryStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &gDekuPrincessAngryLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuPrincessJumpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &gDekuPrincessBounceStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gDekuPrincessBounceLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuPrincessGlareStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gDekuPrincessGlareLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, }; static s32 D_80B3DE58[] = { @@ -93,38 +130,38 @@ static s32 D_80B3DE58[] = { }; s32 func_80B3CA20(EnDnp* this) { - if ((this->unk_340 == 2) || (this->unk_340 == 9)) { + if ((this->animIndex == EN_DNP_ANIM_CUTSCENE_HURRY) || (this->animIndex == EN_DNP_ANIM_RUN)) { if (Animation_OnFrame(&this->skelAnime, 1.0f) || Animation_OnFrame(&this->skelAnime, 5.0f) || Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 13.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_TURN); } - } else if ((this->unk_340 == 24) || (this->unk_340 == 7)) { + } else if ((this->animIndex == EN_DNP_ANIM_GLARE_START) || (this->animIndex == EN_DNP_ANIM_TURN_AROUND)) { if (Animation_OnFrame(&this->skelAnime, 1.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_TURN); } - } else if (this->unk_340 == 14) { + } else if (this->animIndex == EN_DNP_ANIM_GREETING) { if (Animation_OnFrame(&this->skelAnime, 7.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_GREET); } if (Animation_OnFrame(&this->skelAnime, 22.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_GREET2); } - } else if (this->unk_340 == 8) { + } else if (this->animIndex == EN_DNP_ANIM_BOW) { if (Animation_OnFrame(&this->skelAnime, 9.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_GREET); } if (Animation_OnFrame(&this->skelAnime, 18.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_GREET2); } - } else if ((this->unk_340 == 17) && (this->unk_340 == 18)) { + } else if ((this->animIndex == EN_DNP_ANIM_UNUSED_WALK) && (this->animIndex == EN_DNP_ANIM_WALK)) { if (Animation_OnFrame(&this->skelAnime, 7.0f) || Animation_OnFrame(&this->skelAnime, 15.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_WALK); } - } else if (this->unk_340 == 21) { + } else if (this->animIndex == EN_DNP_ANIM_JUMP) { if (Animation_OnFrame(&this->skelAnime, 17.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_WALK); } - } else if (this->unk_340 == 23) { + } else if (this->animIndex == EN_DNP_ANIM_BOUNCE_LOOP) { if (Animation_OnFrame(&this->skelAnime, 3.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_WALK); } @@ -133,12 +170,12 @@ s32 func_80B3CA20(EnDnp* this) { return 0; } -s32 func_80B3CC38(EnDnp* this, s32 arg1) { +s32 EnDnp_ChangeAnim(EnDnp* this, s32 animIndex) { s32 ret = false; - if (arg1 != this->unk_340) { - this->unk_340 = arg1; - ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg1); + if (animIndex != this->animIndex) { + this->animIndex = animIndex; + ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); } return ret; @@ -154,11 +191,11 @@ void func_80B3CC80(EnDnp* this, PlayState* play) { } void func_80B3CD1C(EnDnp* this) { - if ((this->unk_322 & 0x80) && (DECR(this->unk_334) == 0)) { - this->unk_336++; - if (this->unk_336 >= 4) { - this->unk_334 = Rand_S16Offset(30, 30); - this->unk_336 = 0; + if ((this->unk_322 & 0x80) && (DECR(this->blinkTimer) == 0)) { + this->eyeIndex++; + if (this->eyeIndex >= EN_DNP_EYE_MAX) { + this->blinkTimer = Rand_S16Offset(30, 30); + this->eyeIndex = EN_DNP_EYE_OPEN; } } } @@ -244,8 +281,12 @@ s32 func_80B3D044(EnDnp* this, PlayState* play) { } void func_80B3D11C(EnDnp* this, PlayState* play) { - static s32 D_80B3DE74[] = { - 0, 16, 14, 10, 18, 12, 5, 7, 2, 19, 21, 22, 24, 8, + static s32 sCsAnimations[] = { + EN_DNP_ANIM_JUMP_KICK, EN_DNP_ANIM_CUTSCENE_IDLE, EN_DNP_ANIM_GREETING, + EN_DNP_ANIM_THINK_START, EN_DNP_ANIM_WALK, EN_DNP_ANIM_ARMS_TOGETHER_START, + EN_DNP_ANIM_LAUGH_START, EN_DNP_ANIM_TURN_AROUND, EN_DNP_ANIM_CUTSCENE_HURRY, + EN_DNP_ANIM_ANGRY_START, EN_DNP_ANIM_JUMP, EN_DNP_ANIM_BOUNCE_START, + EN_DNP_ANIM_GLARE_START, EN_DNP_ANIM_BOW, }; s32 temp_v0; s32 val; @@ -260,29 +301,30 @@ void func_80B3D11C(EnDnp* this, PlayState* play) { temp_v0 = Cutscene_GetActorActionIndex(play, 101); val = play->csCtx.actorActions[temp_v0]->action; if (this->unk_324 != (u8)val) { - func_80B3CC38(this, D_80B3DE74[val]); - if (this->unk_340 == 16) { + EnDnp_ChangeAnim(this, sCsAnimations[val]); + if (this->animIndex == EN_DNP_ANIM_CUTSCENE_IDLE) { this->unk_322 |= 8; } else { this->unk_322 &= ~8; } - if (this->unk_340 == 19) { + if (this->animIndex == EN_DNP_ANIM_ANGRY_START) { Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_DHVO04); } - if (this->unk_340 == 24) { + if (this->animIndex == EN_DNP_ANIM_GLARE_START) { this->unk_322 &= ~0x80; - this->unk_336 = 3; - this->unk_334 = 0; + this->eyeIndex = EN_DNP_EYE_ANGRY; + this->blinkTimer = 0; } } this->unk_324 = val; - if (((this->unk_340 == 10) || (this->unk_340 == 12) || (this->unk_340 == 5) || (this->unk_340 == 19) || - (this->unk_340 == 22) || (this->unk_340 == 24)) && + if (((this->animIndex == EN_DNP_ANIM_THINK_START) || (this->animIndex == EN_DNP_ANIM_ARMS_TOGETHER_START) || + (this->animIndex == EN_DNP_ANIM_LAUGH_START) || (this->animIndex == EN_DNP_ANIM_ANGRY_START) || + (this->animIndex == EN_DNP_ANIM_BOUNCE_START) || (this->animIndex == EN_DNP_ANIM_GLARE_START)) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - func_80B3CC38(this, this->unk_340 + 1); + EnDnp_ChangeAnim(this, this->animIndex + 1); } Cutscene_ActorTranslateAndYaw(&this->actor, play, temp_v0); } @@ -300,8 +342,11 @@ void func_80B3D338(EnDnp* this, PlayState* play) { Player* player = GET_PLAYER(play); if ((this->unk_32E != 0) && (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING)) { - Actor_MarkForDeath(&this->actor); - } else if (this->unk_32E == 0) { + Actor_Kill(&this->actor); + return; + } + + if (this->unk_32E == 0) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->unk_32E = 1; } else { @@ -350,16 +395,17 @@ void EnDnp_Init(Actor* thisx, PlayState* play) { EnDnp* this = THIS; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 16.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &object_dnq_Skel_010D60, NULL, this->jointTable, this->morphTable, 26); - this->unk_340 = -1; - func_80B3CC38(this, 15); + SkelAnime_InitFlex(play, &this->skelAnime, &gDekuPrincessSkel, NULL, this->jointTable, this->morphTable, + DEKU_PRINCESS_LIMB_MAX); + this->animIndex = EN_DNP_ANIM_NONE; + EnDnp_ChangeAnim(this, EN_DNP_ANIM_IDLE); Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); this->unk_322 = 0; this->actor.targetMode = 0; this->unk_322 |= (0x100 | 0x80 | 0x10); this->actor.gravity = -1.0f; - if (ENDNP_GET_7(&this->actor) == ENDNP_GET_7_1) { + if (EN_DNP_GET_TYPE(&this->actor) == EN_DNP_TYPE_RELEASED_FROM_BOTTLE) { this->actor.flags &= ~ACTOR_FLAG_1; Actor_SetScale(&this->actor, 0.00085000007f); SubS_UpdateFlags(&this->unk_322, 0, 7); @@ -367,19 +413,20 @@ void EnDnp_Init(Actor* thisx, PlayState* play) { this->actor.world.rot.x = this->actor.shape.rot.x; this->actor.cutscene = 0x10; this->actionFunc = func_80B3D47C; - } else if (((ENDNP_GET_7(&this->actor) == ENDNP_GET_7_0) && !Inventory_HasItemInBottle(ITEM_DEKU_PRINCESS) && - !(gSaveContext.save.weekEventReg[23] & 0x20)) || - ((ENDNP_GET_7(&this->actor) == ENDNP_GET_7_2) && (gSaveContext.save.weekEventReg[23] & 0x20))) { + } else if (((EN_DNP_GET_TYPE(&this->actor) == EN_DNP_TYPE_WOODFALL_TEMPLE) && + !Inventory_HasItemInBottle(ITEM_DEKU_PRINCESS) && !(gSaveContext.save.weekEventReg[23] & 0x20)) || + ((EN_DNP_GET_TYPE(&this->actor) == EN_DNP_TYPE_DEKU_KINGS_CHAMBER) && + (gSaveContext.save.weekEventReg[23] & 0x20))) { Actor_SetScale(&this->actor, 0.0085f); SubS_UpdateFlags(&this->unk_322, 3, 7); this->unk_322 |= 0x400; if ((play->sceneId == SCENE_MITURIN) && (gSaveContext.save.weekEventReg[29] & 0x40)) { this->unk_322 |= 0x20; - func_80B3CC38(this, 1); + EnDnp_ChangeAnim(this, EN_DNP_ANIM_HURRY); } this->actionFunc = func_80B3D2D4; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -467,7 +514,7 @@ void EnDnp_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) { } } - if (limbIndex == 12) { + if (limbIndex == DEKU_PRINCESS_LIMB_HEAD) { func_80B3D974(this->unk_330 + 0x4000, this->unk_332 + this->actor.shape.rot.y + 0x4000, &this->unk_1D8, &this->unk_1E4, phi_v1, phi_v0); Matrix_Pop(); @@ -481,11 +528,11 @@ void EnDnp_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) { } void EnDnp_Draw(Actor* thisx, PlayState* play) { - static TexturePtr D_80B3DEAC[] = { - object_dnq_Tex_0103D0, - object_dnq_Tex_0105D0, - object_dnq_Tex_0107D0, - object_dnq_Tex_0109D0, + static TexturePtr sEyeTextures[] = { + gDekuPrincessEyeOpenTex, + gDekuPrincessEyeHalfTex, + gDekuPrincessEyeClosedTex, + gDekuPrincessEyeAngryTex, }; EnDnp* this = THIS; @@ -494,7 +541,7 @@ void EnDnp_Draw(Actor* thisx, PlayState* play) { func_8012C28C(play->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B3DEAC[this->unk_336])); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeIndex])); SkelAnime_DrawTransformFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL, EnDnp_PostLimbDraw, EnDnp_TransformLimbDraw, diff --git a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.h b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.h index e76180afe..a41a63615 100644 --- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.h +++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.h @@ -2,18 +2,19 @@ #define Z_EN_DNP_H #include "global.h" +#include "objects/object_dnq/object_dnq.h" struct EnDnp; typedef void (*EnDnpActionFunc)(struct EnDnp*, PlayState*); -#define ENDNP_GET_7(thisx) ((thisx)->params & 7) +#define EN_DNP_GET_TYPE(thisx) ((thisx)->params & 7) -enum { - /* 0x0 */ ENDNP_GET_7_0, - /* 0x1 */ ENDNP_GET_7_1, - /* 0x2 */ ENDNP_GET_7_2, -}; +typedef enum { + /* 0x0 */ EN_DNP_TYPE_WOODFALL_TEMPLE, + /* 0x1 */ EN_DNP_TYPE_RELEASED_FROM_BOTTLE, + /* 0x2 */ EN_DNP_TYPE_DEKU_KINGS_CHAMBER, +} EnDnpType; typedef struct EnDnp { /* 0x000 */ Actor actor; @@ -22,8 +23,8 @@ typedef struct EnDnp { /* 0x18C */ ColliderCylinder collider; /* 0x1D8 */ Vec3f unk_1D8; /* 0x1E4 */ Vec3s unk_1E4; - /* 0x1EA */ Vec3s jointTable[26]; - /* 0x286 */ Vec3s morphTable[26]; + /* 0x1EA */ Vec3s jointTable[DEKU_PRINCESS_LIMB_MAX]; + /* 0x286 */ Vec3s morphTable[DEKU_PRINCESS_LIMB_MAX]; /* 0x322 */ u16 unk_322; /* 0x324 */ u8 unk_324; /* 0x328 */ s32 unk_328; @@ -31,13 +32,11 @@ typedef struct EnDnp { /* 0x32E */ s16 unk_32E; /* 0x330 */ s16 unk_330; /* 0x332 */ s16 unk_332; - /* 0x334 */ s16 unk_334; - /* 0x336 */ s16 unk_336; + /* 0x334 */ s16 blinkTimer; + /* 0x336 */ s16 eyeIndex; /* 0x338 */ s16 unk_338; /* 0x33A */ UNK_TYPE1 unk_33A[0x6]; - /* 0x340 */ s32 unk_340; + /* 0x340 */ s32 animIndex; } EnDnp; // size = 0x344 -extern const ActorInit En_Dnp_InitVars; - #endif // Z_EN_DNP_H diff --git a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c index 3e252c034..6ae6c665c 100644 --- a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c +++ b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c @@ -8,7 +8,6 @@ */ #include "z_en_dnq.h" -#include "objects/object_dno/object_dno.h" #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8) @@ -26,7 +25,7 @@ static s32 D_80A53400[] = { 0x0C0E089D, 0x0C0F089E, 0x0C111202, 0x100E089F, 0x0C100000, 0x0E08A10C, 0x0F08A20C, 0x10000000, }; -const ActorInit En_Dnq_InitVars = { +ActorInit En_Dnq_InitVars = { ACTOR_EN_DNQ, ACTORCAT_NPC, FLAGS, @@ -61,26 +60,26 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE }; static AnimationInfoS sAnimationInfo[] = { - { &object_dno_Anim_008328, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dno_Anim_008328, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dno_Anim_007528, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_dno_Anim_0006F0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dno_Anim_000BF8, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dno_Anim_002690, 0.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dno_Anim_002690, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_dno_Anim_003408, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dno_Anim_006984, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_dno_Anim_005E18, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_dno_Anim_005A14, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_dno_Anim_005284, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_dno_Anim_001AEC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dno_Anim_001100, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dno_Anim_004EA0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dno_Anim_00F504, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dno_Anim_0047B8, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dno_Anim_003DBC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, - { &object_dno_Anim_005A14, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dno_Anim_003DBC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuKingIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gDekuKingIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuKingSurpriseAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &gDekuKingJumpedOnStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gDekuKingJumpedOnLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuKingJumpedOnEndAnim, 0.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gDekuKingJumpedOnEndAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &gDekuKingLyingDownTwitchAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuKingWailLoopAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &gDekuKingFootStampStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &gDekuKingFootStampLoopAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &gDekuKingWailStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &gDekuKingMarchAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gDekuKingSpinScepterAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gDekuKingIntimidateAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuKingPointScepterAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuKingJumpAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuKingLaughAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, + { &gDekuKingFootStampLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gDekuKingLaughAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, }; s32 EnDnq_ValidatePictograph(PlayState* play, Actor* thisx) { @@ -260,7 +259,7 @@ s32 func_80A52B68(EnDnq* this, PlayState* play) { Player* player = GET_PLAYER(play); u16 temp = play->msgCtx.currentTextId; - if ((player->stateFlags1 & 0x40) && (player->targetActor == &this->picto.actor)) { + if ((player->stateFlags1 & PLAYER_STATE1_40) && (player->targetActor == &this->picto.actor)) { switch (temp) { case 0x89B: func_80A5257C(this, 18); @@ -420,7 +419,8 @@ void EnDnq_Init(Actor* thisx, PlayState* play) { EnDnq* this = THIS; ActorShape_Init(&this->picto.actor.shape, 0.0f, NULL, 14.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &object_dno_Skel_00EB48, NULL, this->jointTable, this->morphTable, 33); + SkelAnime_InitFlex(play, &this->skelAnime, &gDekuKingSkel, NULL, this->jointTable, this->morphTable, + DEKU_KING_LIMB_MAX); this->unk_398 = -1; func_80A5257C(this, 0); Collider_InitAndSetCylinder(play, &this->collider, &this->picto.actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.h b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.h index 9e4bbd52a..5afb8bdf8 100644 --- a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.h +++ b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.h @@ -2,6 +2,7 @@ #define Z_EN_DNQ_H #include "global.h" +#include "objects/object_dno/object_dno.h" #include "z64snap.h" struct EnDnq; @@ -15,8 +16,8 @@ typedef struct EnDnq { /* 0x190 */ ColliderCylinder collider; /* 0x1DC */ u8 unk_1DC; /* 0x1E0 */ s32 unk_1E0; - /* 0x1E4 */ Vec3s jointTable[33]; - /* 0x2AA */ Vec3s morphTable[33]; + /* 0x1E4 */ Vec3s jointTable[DEKU_KING_LIMB_MAX]; + /* 0x2AA */ Vec3s morphTable[DEKU_KING_LIMB_MAX]; /* 0x370 */ Vec3f unk_370; /* 0x37C */ u16 unk_37C; /* 0x37E */ s16 unk_37E; @@ -34,6 +35,4 @@ typedef struct EnDnq { /* 0x3A4 */ s32 unk_3A4; } EnDnq; // size = 0x3A8 -extern const ActorInit En_Dnq_InitVars; - #endif // Z_EN_DNQ_H 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 f8588614f..05189cadf 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -39,7 +39,7 @@ static s32 D_8092DCB0[] = { 0x0E08330C, 0x09000015, 0x1C014016, 0x10000000, 0x0E082E0C, 0x10000000, }; -const ActorInit En_Dns_InitVars = { +ActorInit En_Dns_InitVars = { ACTOR_EN_DNS, ACTORCAT_NPC, FLAGS, @@ -398,7 +398,7 @@ void func_8092D1B8(EnDns* this, PlayState* play) { if (!ENDNS_GET_4000(&this->actor) || (this->unk_2D2 != 0)) { if (!(gSaveContext.save.weekEventReg[23] & 0x20) && !(gSaveContext.eventInf[1] & 0x20) && func_8092CC68(play)) { - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->unk_2C6 |= 0x100; SubS_UpdateFlags(&this->unk_2C6, 4, 7); play_sound(NA_SE_SY_FOUND); @@ -502,7 +502,7 @@ void EnDns_Init(Actor* thisx, PlayState* play) { EnDns* this = THIS; if (!func_8092D068(this)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.h b/src/overlays/actors/ovl_En_Dns/z_en_dns.h index 3a382c192..b54e49a6a 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.h +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.h @@ -57,6 +57,4 @@ typedef struct EnDns { /* 0x2FC */ s32 unk_2FC; } EnDns; // size = 0x300 -extern const ActorInit En_Dns_InitVars; - #endif // Z_EN_DNS_H diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index cd3710a3b..d1ec4ea70 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -35,7 +35,7 @@ void func_808786C8(EnDodongo* this, PlayState* play); void func_80878724(EnDodongo* this); void func_808787B0(EnDodongo* this, PlayState* play); -const ActorInit En_Dodongo_InitVars = { +ActorInit En_Dodongo_InitVars = { ACTOR_EN_DODONGO, ACTORCAT_ENEMY, FLAGS, @@ -587,7 +587,7 @@ void func_80877500(EnDodongo* this, PlayState* play) { Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x1F4); if (this->actor.xzDistToPlayer < (100.0f * this->unk_334)) { if ((ABS_ALT(temp_v1) < 0x1388) && (this->actor.playerHeightRel < 60.0f) && - !(player->stateFlags1 & 0x800000)) { + !(player->stateFlags1 & PLAYER_STATE1_800000)) { func_808777A8(this); } } @@ -729,7 +729,7 @@ void func_80877E60(EnDodongo* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 28.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_EAT); if (this->actor.child != NULL) { - Actor_MarkForDeath(this->actor.child); + Actor_Kill(this->actor.child); this->actor.child = NULL; } this->actor.flags &= ~ACTOR_FLAG_10; @@ -823,7 +823,7 @@ void func_80878424(EnDodongo* this, PlayState* play) { this->timer++; if (SkelAnime_Update(&this->skelAnime)) { - if (!(player->stateFlags1 & 0x800000) && (Player_GetMask(play) != PLAYER_MASK_STONE)) { + if (!(player->stateFlags1 & PLAYER_STATE1_800000) && (Player_GetMask(play) != PLAYER_MASK_STONE)) { this->collider1.base.atFlags &= ~AT_ON; func_808777A8(this); } else { @@ -931,7 +931,7 @@ void func_808787B0(EnDodongo* this, PlayState* play) { } else { Item_DropCollectible(play, &this->actor.world.pos, ITEM00_RUPEE_PURPLE); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h index a196b1f8c..3cc80b0d1 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h @@ -36,6 +36,4 @@ typedef struct EnDodongo { /* 0x754 */ ColliderJntSphElement collider3Elements[3]; } EnDodongo; // size = 0x814 -extern const ActorInit En_Dodongo_InitVars; - #endif // Z_EN_DODONGO_H diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index 5d2822d78..6230bd066 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -277,7 +277,7 @@ u8* D_8086778C[] = { D_80867734, D_8086773C, D_80867744, D_8086775C, D_80867778, D_8086777C, D_80867780, D_80867784, }; -const ActorInit En_Door_InitVars = { +ActorInit En_Door_InitVars = { ACTOR_EN_DOOR, ACTORCAT_DOOR, FLAGS, @@ -420,7 +420,7 @@ void EnDoor_Init(Actor* thisx, PlayState* play2) { objectInfo = &sObjInfo[15]; objectBankIndex = Object_GetIndex(&play->objectCtx, objectInfo->objectId); if (objectBankIndex != 0) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } } @@ -480,7 +480,7 @@ void func_80866B20(EnDoor* this, PlayState* play) { if (this->unk_1A1 != 0) { this->actionFunc = func_80867144; Animation_PlayOnceSetSpeed(&this->skelAnime, sAnimations[this->animIndex], - (player->stateFlags1 & 0x8000000) ? 0.75f : 1.5f); + (player->stateFlags1 & PLAYER_STATE1_8000000) ? 0.75f : 1.5f); if (this->unk_1A6 != 0) { gSaveContext.save.inventory.dungeonKeys[gSaveContext.mapIndex]--; Flags_SetSwitch(play, this->switchFlag); diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.h b/src/overlays/actors/ovl_En_Door/z_en_door.h index 359f34cd2..bea44a122 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.h +++ b/src/overlays/actors/ovl_En_Door/z_en_door.h @@ -26,6 +26,4 @@ typedef struct EnDoor { /* 0x1C8 */ EnDoorActionFunc actionFunc; } EnDoor; -extern const ActorInit En_Door_InitVars; - #endif // Z_EN_DOOR_H diff --git a/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.c b/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.c index a17ce6193..8959dde7a 100644 --- a/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.c +++ b/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.c @@ -20,7 +20,7 @@ void func_80AC21A0(EnDoorEtc* this, PlayState* play); void func_80AC2354(EnDoorEtc* this, PlayState* play); void EnDoorEtc_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Door_Etc_InitVars = { +ActorInit En_Door_Etc_InitVars = { ACTOR_EN_DOOR_ETC, ACTORCAT_DOOR, FLAGS, @@ -106,7 +106,7 @@ void EnDoorEtc_Init(Actor* thisx, PlayState* play2) { } objectIndex = Object_GetIndex(&play->objectCtx, objectInfo->objectId); if (objectIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->objectIndex = objectIndex; this->dListIndex = objectInfo->dListIndex; @@ -214,7 +214,7 @@ void func_80AC2354(EnDoorEtc* this, PlayState* play) { this->actor.world.pos.z = door->world.pos.z; this->actor.shape.rot.y = door->shape.rot.y; this->actor.world.rot.y = door->world.rot.y; - Actor_MarkForDeath(door); + Actor_Kill(door); this->actionFunc = func_80AC21A0; this->actor.textId = 0x239B; Actor_SetFocus(&this->actor, 70.0f); diff --git a/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.h b/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.h index cbcdf2f54..49ca83f2a 100644 --- a/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.h +++ b/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.h @@ -22,6 +22,4 @@ typedef struct EnDoorEtc { /* 0x1F8 */ EnDoorEtcActionFunc actionFunc; } EnDoorEtc; // size = 0x1FC -extern const ActorInit En_Door_Etc_InitVars; - #endif // Z_EN_DOOR_ETC_H diff --git a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c index 76264b8df..1540e5778 100644 --- a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c +++ b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c @@ -50,7 +50,7 @@ typedef enum { static s32 sNumPythonsDead = 0; -const ActorInit En_Dragon_InitVars = { +ActorInit En_Dragon_InitVars = { ACTOR_EN_DRAGON, ACTORCAT_ENEMY, FLAGS, @@ -612,13 +612,13 @@ void EnDragon_Attack(EnDragon* this, PlayState* play) { } if (((this->state != DEEP_PYTHON_ATTACK_STATE_START) && (this->endFrame <= currentFrame)) || - (!(player->stateFlags2 & 0x80)) || ((this->collider.elements[0].info.bumperFlags & BUMP_HIT)) || + (!(player->stateFlags2 & PLAYER_STATE2_80)) || ((this->collider.elements[0].info.bumperFlags & BUMP_HIT)) || (this->collider.elements[1].info.bumperFlags & BUMP_HIT) || (this->collider.elements[2].info.bumperFlags & BUMP_HIT)) { player->actor.parent = NULL; this->grabWaitTimer = 30; ActorCutscene_Stop(this->grabCutsceneIndex); - if (player->stateFlags2 & 0x80) { + if (player->stateFlags2 & PLAYER_STATE2_80) { player->unk_AE8 = 100; } @@ -720,7 +720,7 @@ void EnDragon_Dead(EnDragon* this, PlayState* play) { } } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void EnDragon_UpdateDamage(EnDragon* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.h b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.h index 321d0ad95..cb2ab9490 100644 --- a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.h +++ b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.h @@ -61,6 +61,4 @@ typedef struct EnDragon { /* 0x2FC */ ColliderJntSphElement colliderElements[8]; } EnDragon; // size = 0x4FC -extern const ActorInit En_Dragon_InitVars; - #endif // Z_EN_DRAGON_H diff --git a/src/overlays/actors/ovl_En_Drs/z_en_drs.c b/src/overlays/actors/ovl_En_Drs/z_en_drs.c index 5ecab4fd4..75d493b41 100644 --- a/src/overlays/actors/ovl_En_Drs/z_en_drs.c +++ b/src/overlays/actors/ovl_En_Drs/z_en_drs.c @@ -17,7 +17,7 @@ void EnDrs_Draw(Actor* thisx, PlayState* play); void EnDrs_Idle(EnDrs* this, PlayState* play); -const ActorInit En_Drs_InitVars = { +ActorInit En_Drs_InitVars = { ACTOR_EN_DRS, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_En_Drs/z_en_drs.h b/src/overlays/actors/ovl_En_Drs/z_en_drs.h index d86121efb..d811ae780 100644 --- a/src/overlays/actors/ovl_En_Drs/z_en_drs.h +++ b/src/overlays/actors/ovl_En_Drs/z_en_drs.h @@ -19,6 +19,4 @@ typedef struct EnDrs { /* 0x208 */ s8 moonMaskObjBankIndex; } EnDrs; // size = 0x20C */ -extern const ActorInit En_Drs_InitVars; - #endif // Z_EN_DRS_H diff --git a/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c b/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c index 7e517ce09..67dff9c41 100644 --- a/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c +++ b/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c @@ -20,7 +20,7 @@ void EnDs2n_Draw(Actor* thisx, PlayState* play); void EnDs2n_Idle(EnDs2n* this, PlayState* play); -const ActorInit En_Ds2n_InitVars = { +ActorInit En_Ds2n_InitVars = { ACTOR_EN_DS2N, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.h b/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.h index c7155ed74..f2a6c0725 100644 --- a/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.h +++ b/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.h @@ -22,6 +22,4 @@ typedef struct EnDs2n { } EnDs2n; // size = 0x234 -extern const ActorInit En_Ds2n_InitVars; - #endif // Z_EN_DS2N_H diff --git a/src/overlays/actors/ovl_En_Dt/z_en_dt.c b/src/overlays/actors/ovl_En_Dt/z_en_dt.c index d4b809027..0ac7dcb4b 100644 --- a/src/overlays/actors/ovl_En_Dt/z_en_dt.c +++ b/src/overlays/actors/ovl_En_Dt/z_en_dt.c @@ -16,7 +16,7 @@ void EnDt_Update(Actor* thisx, PlayState* play); void EnDt_Draw(Actor* thisx, PlayState* play); #if 0 -const ActorInit En_Dt_InitVars = { +ActorInit En_Dt_InitVars = { ACTOR_EN_DT, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Dt/z_en_dt.h b/src/overlays/actors/ovl_En_Dt/z_en_dt.h index 78b098789..6afbf8cd2 100644 --- a/src/overlays/actors/ovl_En_Dt/z_en_dt.h +++ b/src/overlays/actors/ovl_En_Dt/z_en_dt.h @@ -14,6 +14,4 @@ typedef struct EnDt { /* 0x240 */ char unk_240[0xA0]; } EnDt; // size = 0x2E0 -extern const ActorInit En_Dt_InitVars; - #endif // Z_EN_DT_H diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c index 7770cc3ec..dfd97196a 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c @@ -19,7 +19,7 @@ void EnDyExtra_Draw(Actor* thisx, PlayState* play); void func_80A61334(EnDyExtra* this, PlayState* play); void func_80A613C8(EnDyExtra* this, PlayState* play); -const ActorInit En_Dy_Extra_InitVars = { +ActorInit En_Dy_Extra_InitVars = { ACTOR_EN_DY_EXTRA, ACTORCAT_PROP, FLAGS, @@ -65,7 +65,7 @@ void func_80A613C8(EnDyExtra* this, PlayState* play) { Math_ApproachF(&this->actor.gravity, 0.0f, 0.1f, 0.005f); if (this->unk14C == 0 || this->unk150 < 0.02f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h index 6d5d93ec4..0e5d8614b 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h @@ -19,6 +19,4 @@ typedef struct EnDyExtra { /* 0x160 */ Vec3f unk160; } EnDyExtra; // size = 0x16C -extern const ActorInit En_Dy_Extra_InitVars; - #endif // Z_EN_DY_EXTRA_H diff --git a/src/overlays/actors/ovl_En_Egblock/z_en_egblock.c b/src/overlays/actors/ovl_En_Egblock/z_en_egblock.c index 4607e2909..2a1a976f5 100644 --- a/src/overlays/actors/ovl_En_Egblock/z_en_egblock.c +++ b/src/overlays/actors/ovl_En_Egblock/z_en_egblock.c @@ -16,7 +16,7 @@ void EnEgblock_Update(Actor* thisx, PlayState* play); void EnEgblock_Draw(Actor* thisx, PlayState* play); #if 0 -const ActorInit En_Egblock_InitVars = { +ActorInit En_Egblock_InitVars = { ACTOR_EN_EGBLOCK, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_En_Egblock/z_en_egblock.h b/src/overlays/actors/ovl_En_Egblock/z_en_egblock.h index d1222a5eb..88abf1efe 100644 --- a/src/overlays/actors/ovl_En_Egblock/z_en_egblock.h +++ b/src/overlays/actors/ovl_En_Egblock/z_en_egblock.h @@ -14,6 +14,4 @@ typedef struct EnEgblock { /* 0x1A4 */ char unk_1A4[0xC10]; } EnEgblock; // size = 0xDB4 -extern const ActorInit En_Egblock_InitVars; - #endif // Z_EN_EGBLOCK_H diff --git a/src/overlays/actors/ovl_En_Egol/z_en_egol.c b/src/overlays/actors/ovl_En_Egol/z_en_egol.c index 373d06583..6b8185249 100644 --- a/src/overlays/actors/ovl_En_Egol/z_en_egol.c +++ b/src/overlays/actors/ovl_En_Egol/z_en_egol.c @@ -107,7 +107,7 @@ static DamageTable D_80A80DAC = { /* Powder Keg */ DMG_ENTRY(1, 0xF), }; -const ActorInit En_Egol_InitVars = { +ActorInit En_Egol_InitVars = { ACTOR_EN_EGOL, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Egol/z_en_egol.h b/src/overlays/actors/ovl_En_Egol/z_en_egol.h index 9e0097152..bfcc53231 100644 --- a/src/overlays/actors/ovl_En_Egol/z_en_egol.h +++ b/src/overlays/actors/ovl_En_Egol/z_en_egol.h @@ -14,6 +14,4 @@ typedef struct EnEgol { /* 0x02AC */ char unk_2AC[0x1BC4]; } EnEgol; // size = 0x1E70 -extern const ActorInit En_Egol_InitVars; - #endif // Z_EN_EGOL_H diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index aa4768a76..6d21e23e5 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -33,7 +33,7 @@ void func_8088F5F4(EnElf* this, PlayState* play, s32 sparkleLife); void func_8089010C(Actor* thisx, PlayState* play); void func_808908D0(Vec3f* vec, PlayState* play, u32 action); -const ActorInit En_Elf_InitVars = { +ActorInit En_Elf_InitVars = { ACTOR_EN_ELF, ACTORCAT_ITEMACTION, FLAGS, @@ -297,7 +297,7 @@ void func_8088CC48(EnElf* this, PlayState* play) { this->unk_25C = 0; this->disappearTimer = 240; if ((this->fairyFlags & 0x400) && Flags_GetCollectible(play, this->unk_260)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -358,7 +358,7 @@ void EnElf_Init(Actor* thisx, PlayState* play2) { if ((gSaveContext.save.playerData.tatlTimer >= 25800) || (gSaveContext.save.playerData.tatlTimer < 3000)) { gSaveContext.save.playerData.tatlTimer = 0; } - this->unk_266 = ElfMessage_GetFirstCycleHint(play); + this->unk_266 = QuestHint_GetTatlTextId(play); break; case 1: @@ -420,7 +420,7 @@ void EnElf_Init(Actor* thisx, PlayState* play2) { break; case 8: - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; case 3: @@ -627,7 +627,7 @@ s32 func_8088DCA4(EnElf* this) { if (this->disappearTimer > -10) { Actor_SetScale(&this->actor, (this->disappearTimer + 10) * 0.008f * 0.1f); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } } @@ -658,7 +658,7 @@ void func_8088DD34(EnElf* this, PlayState* play) { if (this->fairyFlags & 0x400) { Flags_SetCollectible(play, this->unk_260); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -717,7 +717,7 @@ void func_8088E018(EnElf* this, PlayState* play) { parentPos.y += (1500.0f * this->actor.scale.y) + 40.0f; func_8088D660(this, &parentPos, 0.2f); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->unk_258 = Math_FAtan2F(this->actor.velocity.z, this->actor.velocity.x); } @@ -762,7 +762,7 @@ void func_8088E0F0(EnElf* this, PlayState* play) { } if (this->unk_224.y < -10.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -776,7 +776,7 @@ void func_8088E304(EnElf* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (this->unk_224.y > 200.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -844,13 +844,13 @@ void func_8088E60C(EnElf* this, PlayState* play) { s16 glowLightRadius; Player* player = GET_PLAYER(play); - if (player->stateFlags1 & 0x400) { + if (player->stateFlags1 & PLAYER_STATE1_400) { glowLightRadius = 200; } else { glowLightRadius = 100; } - if ((this->unk_244 == 6) || (player->stateFlags1 & 2) || (this->fairyFlags & 0x8000)) { + if ((this->unk_244 == 6) || (player->stateFlags1 & PLAYER_STATE1_2) || (this->fairyFlags & 0x8000)) { glowLightRadius = 0; } @@ -967,7 +967,7 @@ void func_8088E850(EnElf* this, PlayState* play) { default: arrowPointedActor = play->actorCtx.targetContext.arrowPointedActor; - if ((player->stateFlags1 & 0x40) && (player->targetActor != NULL)) { + if ((player->stateFlags1 & PLAYER_STATE1_40) && (player->targetActor != NULL)) { Math_Vec3f_Copy(&nextPos, &player->targetActor->focus.pos); } else { Math_Vec3f_Copy(&nextPos, &play->actorCtx.targetContext.unk0); @@ -1133,13 +1133,13 @@ void func_8088F214(EnElf* this, PlayState* play) { func_800B9010(&this->actor, NA_SE_EV_BELL_ANGER - SFX_FLAG); } else { arrowPointedActor = play->actorCtx.targetContext.arrowPointedActor; - if (player->stateFlags1 & 0x400) { + if (player->stateFlags1 & PLAYER_STATE1_400) { sp34 = 10; this->unk_25C = 100; } else if ((arrowPointedActor == NULL) || (arrowPointedActor->category == 4)) { if (arrowPointedActor != NULL) { this->unk_25C = 100; - player->stateFlags2 |= 0x100000; + player->stateFlags2 |= PLAYER_STATE2_100000; sp34 = 0; } else { switch (this->unk_244) { @@ -1147,7 +1147,7 @@ void func_8088F214(EnElf* this, PlayState* play) { if (this->unk_25C != 0) { this->unk_25C--; sp34 = 0; - } else if (!(player->stateFlags1 & 0x40)) { + } else if (!(player->stateFlags1 & PLAYER_STATE1_40)) { if (this->unk_269 == 0) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_NAVY_VANISH); } @@ -1163,7 +1163,7 @@ void func_8088F214(EnElf* this, PlayState* play) { this->unk_24A--; sp34 = 5; } else { - player->stateFlags2 |= 0x100000; + player->stateFlags2 |= PLAYER_STATE2_100000; sp34 = 0; } } else { @@ -1195,7 +1195,7 @@ void func_8088F214(EnElf* this, PlayState* play) { switch (sp34) { case 0: - if (!(player->stateFlags2 & 0x100000)) { + if (!(player->stateFlags2 & PLAYER_STATE2_100000)) { sp34 = 5; if (this->unk_269 == 0) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_NAVY_VANISH); @@ -1204,25 +1204,25 @@ void func_8088F214(EnElf* this, PlayState* play) { break; case 6: - if (player->stateFlags2 & 0x100000) { + if (player->stateFlags2 & PLAYER_STATE2_100000) { sp34 = 9; this->unk_25C = 0x2A; if (this->unk_269 == 0) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_DASH_NORMAL); } - } else if (player->stateFlags1 & 0x40) { - player->stateFlags2 |= 0x100000; + } else if (player->stateFlags1 & PLAYER_STATE1_40) { + player->stateFlags2 |= PLAYER_STATE2_100000; sp34 = 0; this->unk_25C = 0; } break; case 5: - player->stateFlags2 &= ~0x100000; + player->stateFlags2 &= ~PLAYER_STATE2_100000; break; default: - player->stateFlags2 |= 0x100000; + player->stateFlags2 |= PLAYER_STATE2_100000; break; } } @@ -1449,7 +1449,7 @@ void func_8089010C(Actor* thisx, PlayState* play) { s32 pad; EnElf* this = THIS; Player* player = GET_PLAYER(play); - u16 temp_v0 = ElfMessage_GetFirstCycleHint(play); + u16 temp_v0 = QuestHint_GetTatlTextId(play); if (temp_v0 != this->unk_266) { this->unk_266 = temp_v0; @@ -1458,7 +1458,7 @@ void func_8089010C(Actor* thisx, PlayState* play) { if ((player->tatlTextId == 0) && (player->unk_730 == NULL)) { if ((gSaveContext.save.playerData.tatlTimer >= 600) && (gSaveContext.save.playerData.tatlTimer <= 3000)) { - player->tatlTextId = ElfMessage_GetFirstCycleHint(play); + player->tatlTextId = QuestHint_GetTatlTextId(play); } } @@ -1470,7 +1470,7 @@ void func_8089010C(Actor* thisx, PlayState* play) { func_8019FDC8(&gSfxDefaultPos, NA_SE_VO_NA_LISTEN, 0x20); thisx->focus.pos = thisx->world.pos; - if (thisx->textId == ElfMessage_GetFirstCycleHint(play)) { + if (thisx->textId == QuestHint_GetTatlTextId(play)) { this->fairyFlags |= 0x80; gSaveContext.save.playerData.tatlTimer = 3001; } @@ -1578,7 +1578,7 @@ void EnElf_Draw(Actor* thisx, PlayState* play) { if (!(this->fairyFlags & 8) && (!Cutscene_CheckActorAction(play, 201) || (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 201)]->action != 6)) && - (!(player->stateFlags1 & 0x100000) || (kREG(90) < this->actor.projectedPos.z))) { + (!(player->stateFlags1 & PLAYER_STATE1_100000) || (kREG(90) < this->actor.projectedPos.z))) { Gfx* dListHead = GRAPH_ALLOC(play->state.gfxCtx, sizeof(Gfx) * 4); f32 alphaScale; s32 envAlpha; diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.h b/src/overlays/actors/ovl_En_Elf/z_en_elf.h index 64d53744f..680d59158 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.h +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.h @@ -60,6 +60,4 @@ typedef enum { /* 0x07 */ ENELF_TYPE_7 } FairyType; -extern const ActorInit En_Elf_InitVars; - #endif // Z_EN_ELF_H diff --git a/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c b/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c index 42a4a06d8..12026b8b9 100644 --- a/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c +++ b/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c @@ -20,7 +20,7 @@ void EnElfbub_Draw(Actor* thisx, PlayState* play2); void EnElfbub_Pop(EnElfbub* this, PlayState* play); void EnElfbub_Idle(EnElfbub* this, PlayState* play); -const ActorInit En_Elfbub_InitVars = { +ActorInit En_Elfbub_InitVars = { ACTOR_EN_ELFBUB, ACTORCAT_MISC, FLAGS, @@ -57,7 +57,7 @@ void EnElfbub_Init(Actor* thisx, PlayState* play) { Actor* childActor; if (Flags_GetSwitch(play, ENELFBUB_GET_SWITCHFLAG(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -117,7 +117,7 @@ void EnElfbub_Pop(EnElfbub* this, PlayState* play) { } SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 60, NA_SE_EN_AWA_BREAK); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.h b/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.h index cab77c8a4..50c6bd672 100644 --- a/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.h +++ b/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.h @@ -21,6 +21,4 @@ typedef struct EnElfbub { /* 0x1A0 */ EnElfbubActionFunc actionFunc; } EnElfbub; // size = 0x1A4 -extern const ActorInit En_Elfbub_InitVars; - #endif // Z_EN_ELFBUB_H diff --git a/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c b/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c index 897641a9e..b90d3978f 100644 --- a/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c +++ b/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c @@ -33,7 +33,7 @@ void func_80A3A77C(EnElfgrp* this, PlayState* play); void func_80A3A7FC(EnElfgrp* this, PlayState* play); void func_80A3A8F8(EnElfgrp* this, PlayState* play); -const ActorInit En_Elfgrp_InitVars = { +ActorInit En_Elfgrp_InitVars = { ACTOR_EN_ELFGRP, ACTORCAT_PROP, FLAGS, @@ -483,11 +483,11 @@ void func_80A3A610(EnElfgrp* this, PlayState* play) { if (this->unk_144 > 0) { player->actor.freezeTimer = 100; - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_20000000; Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_GROUP_HEAL - SFX_FLAG); } else { player->actor.freezeTimer = 0; - player->stateFlags1 &= ~0x20000000; + player->stateFlags1 &= ~PLAYER_STATE1_20000000; this->actionFunc = func_80A3A600; this->unk_14A |= 8; } @@ -499,7 +499,7 @@ void func_80A3A6F4(EnElfgrp* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { player->actor.freezeTimer = 100; - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_20000000; this->unk_144 = func_80A39FBC(play); this->actionFunc = func_80A3A610; this->unk_14A &= ~8; @@ -510,7 +510,7 @@ void func_80A3A77C(EnElfgrp* this, PlayState* play) { Player* player = GET_PLAYER(play); player->actor.freezeTimer = 100; - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_20000000; if (Actor_TextboxIsClosing(&this->actor, play)) { this->unk_144 = func_80A39FBC(play); this->actionFunc = func_80A3A610; @@ -558,7 +558,7 @@ void func_80A3A8F8(EnElfgrp* this, PlayState* play) { if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) { this->actor.flags &= ~ACTOR_FLAG_10000; player->actor.freezeTimer = 100; - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_20000000; Message_StartTextbox(play, this->actor.textId, &this->actor); this->actionFunc = func_80A3A77C; gSaveContext.save.weekEventReg[9] |= this->unk_146; diff --git a/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.h b/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.h index 8536b806e..975b08c2c 100644 --- a/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.h +++ b/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.h @@ -28,6 +28,4 @@ typedef struct EnElfgrp { /* 0x14C */ EnElfgrpActionFunc actionFunc; } EnElfgrp; // size = 0x150 -extern const ActorInit En_Elfgrp_InitVars; - #endif // Z_EN_ELFGRP_H diff --git a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c index 12d804fba..60c5b3364 100644 --- a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c +++ b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c @@ -22,7 +22,7 @@ void EnElforg_FreeFloating(EnElforg* this, PlayState* play); void EnElforg_SetupTrappedByEnemy(EnElforg* this, PlayState* play); void EnElforg_HiddenByCollider(EnElforg* this, PlayState* play); -const ActorInit En_Elforg_InitVars = { +ActorInit En_Elforg_InitVars = { ACTOR_EN_ELFORG, ACTORCAT_ITEMACTION, FLAGS, @@ -81,21 +81,21 @@ void EnElforg_Init(Actor* thisx, PlayState* play) { switch (STRAY_FAIRY_TYPE(thisx)) { case STRAY_FAIRY_TYPE_CLOCK_TOWN: if (gSaveContext.save.weekEventReg[8] & 0x80) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } break; case STRAY_FAIRY_TYPE_COLLECTIBLE: if (Flags_GetCollectible(play, STRAY_FAIRY_FLAG(thisx))) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } break; default: if (Flags_GetSwitch(play, STRAY_FAIRY_FLAG(thisx))) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } break; @@ -374,7 +374,7 @@ void EnElforg_FreeFloatingFairyFountain(EnElforg* this, PlayState* play) { Actor_SetScale(&this->actor, this->actor.scale.x * 0.9f); if (this->actor.scale.x < 0.001f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -400,7 +400,7 @@ void EnElforg_CirclePlayer(EnElforg* this, PlayState* play) { void EnElforg_FairyCollected(EnElforg* this, PlayState* play) { EnElforg_CirclePlayer(this, play); if (this->timer > 80) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -425,21 +425,22 @@ void EnElforg_ClockTownFairyCollected(EnElforg* this, PlayState* play) { EnElforg_CirclePlayer(this, play); player->actor.freezeTimer = 100; - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_20000000; if (Actor_TextboxIsClosing(&this->actor, play)) { player->actor.freezeTimer = 0; - player->stateFlags1 &= ~0x20000000; - Actor_MarkForDeath(&this->actor); + player->stateFlags1 &= ~PLAYER_STATE1_20000000; + Actor_Kill(&this->actor); gSaveContext.save.weekEventReg[8] |= 0x80; ActorCutscene_Stop(0x7C); - } else { - func_800B9010(&this->actor, NA_SE_PL_CHIBI_FAIRY_HEAL - SFX_FLAG); - if (ActorCutscene_GetCurrentIndex() != 0x7C) { - if (ActorCutscene_GetCanPlayNext(0x7C)) { - ActorCutscene_Start(0x7C, &this->actor); - } else { - ActorCutscene_SetIntentToPlay(0x7C); - } + return; + } + + func_800B9010(&this->actor, NA_SE_PL_CHIBI_FAIRY_HEAL - SFX_FLAG); + if (ActorCutscene_GetCurrentIndex() != 0x7C) { + if (ActorCutscene_GetCanPlayNext(0x7C)) { + ActorCutscene_Start(0x7C, &this->actor); + } else { + ActorCutscene_SetIntentToPlay(0x7C); } } } @@ -480,7 +481,7 @@ void EnElforg_FreeFloating(EnElforg* this, PlayState* play) { if (STRAY_FAIRY_TYPE(&this->actor) == STRAY_FAIRY_TYPE_CLOCK_TOWN) { player->actor.freezeTimer = 100; - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_20000000; // Bring me back to North Clock Town! Message_StartTextbox(play, 0x579, NULL); this->actionFunc = EnElforg_ClockTownFairyCollected; diff --git a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.h b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.h index 5de48e955..798982b09 100644 --- a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.h +++ b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.h @@ -55,6 +55,4 @@ typedef struct EnElforg { /* 0x22C */ EnElforgActionFunc actionFunc; } EnElforg; // size = 0x230 -extern const ActorInit En_Elforg_InitVars; - #endif // Z_EN_ELFORG_H diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index 0305af8ef..2e6a44b64 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -15,7 +15,7 @@ void EnEncount1_Update(Actor* thisx, PlayState* play); void func_808E0954(EnEncount1* this, PlayState* play); -const ActorInit En_Encount1_InitVars = { +ActorInit En_Encount1_InitVars = { ACTOR_EN_ENCOUNT1, ACTORCAT_PROP, FLAGS, @@ -40,7 +40,7 @@ void EnEncount1_Init(Actor* thisx, PlayState* play) { EnEncount1* this = THIS; if (this->actor.params <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -128,7 +128,7 @@ void func_808E0954(EnEncount1* this, PlayState* play) { case EN_ENCOUNT1_SKULLFISH_2: if ((this->path != NULL) && (!SubS_CopyPointFromPath(this->path, 0, &spawnPos))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; } diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h index 8906d523e..52e0fb30c 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h @@ -34,6 +34,4 @@ typedef struct EnEncount1 { /* 0x160 */ f32 unk_160; } EnEncount1; // size = 0x164 -extern const ActorInit En_Encount1_InitVars; - #endif // Z_EN_ENCOUNT1_H diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index 506f14790..656ec7936 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -25,7 +25,7 @@ void EnEncount2_InitEffects(EnEncount2* this, Vec3f* pos, s16 fadeDelay); void EnEncount2_UpdateEffects(EnEncount2* this, PlayState* play); void EnEncount2_DrawEffects(EnEncount2* this, PlayState* play); -const ActorInit En_Encount2_InitVars = { +ActorInit En_Encount2_InitVars = { ACTOR_EN_ENCOUNT2, ACTORCAT_PROP, FLAGS, @@ -121,7 +121,7 @@ void EnEncount2_Init(Actor* thisx, PlayState* play) { } if ((this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -181,7 +181,7 @@ void EnEncount2_Die(EnEncount2* this, PlayState* play) { if (this->switchFlag >= 0) { Flags_SetSwitch(play, this->switchFlag); } - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h index 9927653e2..0a9cb1394 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h @@ -35,6 +35,4 @@ typedef struct EnEncount2 { #define ENCOUNT2_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x7F) -extern const ActorInit En_Encount2_InitVars; - #endif // Z_EN_ENCOUNT2_H diff --git a/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c b/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c index ead07b294..869d8681e 100644 --- a/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c +++ b/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c @@ -20,7 +20,7 @@ void func_809AD194(EnEncount3* this, PlayState* play); void func_809AD1EC(EnEncount3* this, PlayState* play); #if 0 -const ActorInit En_Encount3_InitVars = { +ActorInit En_Encount3_InitVars = { ACTOR_EN_ENCOUNT3, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Encount3/z_en_encount3.h b/src/overlays/actors/ovl_En_Encount3/z_en_encount3.h index 2b0bb59d8..9ebc87303 100644 --- a/src/overlays/actors/ovl_En_Encount3/z_en_encount3.h +++ b/src/overlays/actors/ovl_En_Encount3/z_en_encount3.h @@ -13,6 +13,4 @@ typedef struct EnEncount3 { /* 0x148 */ char unk_148[0x84]; } EnEncount3; // size = 0x1CC -extern const ActorInit En_Encount3_InitVars; - #endif // Z_EN_ENCOUNT3_H diff --git a/src/overlays/actors/ovl_En_Encount4/z_en_encount4.c b/src/overlays/actors/ovl_En_Encount4/z_en_encount4.c index a244d6d0a..ccb9d16b5 100644 --- a/src/overlays/actors/ovl_En_Encount4/z_en_encount4.c +++ b/src/overlays/actors/ovl_En_Encount4/z_en_encount4.c @@ -20,8 +20,7 @@ void func_809C42A8(EnEncount4* this, PlayState* play); void func_809C4598(EnEncount4* this, PlayState* play); void func_809C464C(EnEncount4* this, PlayState* play); -#if 0 -const ActorInit En_Encount4_InitVars = { +ActorInit En_Encount4_InitVars = { ACTOR_EN_ENCOUNT4, ACTORCAT_PROP, FLAGS, @@ -33,20 +32,180 @@ const ActorInit En_Encount4_InitVars = { (ActorFunc)NULL, }; -#endif +s16 D_809C46D0[] = { + 0x4000, 0xC000, 0x4000, 0, 0xC000, +}; +f32 D_809C46DC[] = { + 200.0f, 200.0f, 100.0f, 0.0f, 100.0f, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Encount4/EnEncount4_Init.s") +void EnEncount4_Init(Actor* thisx, PlayState* play) { + s32 pad; + EnEncount4* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Encount4/EnEncount4_Destroy.s") + this->unk_148 = ENENCOUNT4_GET_F000(thisx); + this->switchFlag = ENENCOUNT4_GET_FLAG(thisx); + if (this->switchFlag == 0x7F) { + this->switchFlag = -1; + } + if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + Actor_Kill(&this->actor); + return; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Encount4/func_809C3FD8.s") + this->actor.flags &= ~ACTOR_FLAG_1; + this->actionFunc = func_809C3FD8; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Encount4/func_809C4078.s") +void EnEncount4_Destroy(Actor* thisx, PlayState* play) { +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Encount4/func_809C42A8.s") +void func_809C3FD8(EnEncount4* this, PlayState* play) { + Actor* actor; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Encount4/func_809C4598.s") + this->unk_14E = 0; + if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + this->timer = 100; + this->actionFunc = func_809C464C; + } else { + actor = play->actorCtx.actorLists[ACTORCAT_BOSS].first; + while (actor != NULL) { + if (actor->id != ACTOR_EN_BSB) { + actor = actor->next; + } else { + this->captainKeeta = (EnBsb*)actor; + this->actionFunc = func_809C4078; + break; + } + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Encount4/func_809C464C.s") +void func_809C4078(EnEncount4* this, PlayState* play) { + s16 rotY; + Vec3f pos; + s32 fireWallParams; + s32 i; + EnBsb* captainKeeta = this->captainKeeta; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Encount4/EnEncount4_Update.s") + if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + this->timer = 100; + this->actionFunc = func_809C464C; + } else if (BREG(1) == 0) { + if ((this->captainKeeta->actor.id != ACTOR_EN_BSB) || (captainKeeta->actor.update == NULL)) { + Actor_Kill(&this->actor); + return; + } + + if ((this->unk_148 != 0) || (this->actor.xzDistToPlayer < 240.0f)) { + if ((this->unk_148 == 0) && (captainKeeta->unk2DC != 0)) { + Actor_Kill(&this->actor); + return; + } + + fireWallParams = BGFIREWALL_PARAMS_0; + if ((this->unk_148 == 0) || (captainKeeta->unk2DC != 0)) { + i = 0; + if (this->unk_148 != 0) { + fireWallParams = BGFIREWALL_PARAMS_1; + i = 2; + } + while (i < ARRAY_COUNT(D_809C46DC)) { + rotY = D_809C46D0[i] + this->actor.world.rot.y; + pos.x = Math_SinS(rotY) * D_809C46DC[i] + this->actor.world.pos.x; + pos.y = this->actor.world.pos.y; + pos.z = Math_CosS(rotY) * D_809C46DC[i] + this->actor.world.pos.z; + Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_BG_FIRE_WALL, pos.x, pos.y, pos.z, 0, + this->actor.world.rot.y, 0, fireWallParams); + i++; + } + this->actionFunc = func_809C42A8; + } + } + } +} + +void func_809C42A8(EnEncount4* this, PlayState* play) { + Player* actor = GET_PLAYER(play); + EnBsb* captainKeeta = this->captainKeeta; + Vec3f pos; + f32 yIntersect; + s16 yRot; + CollisionPoly* colPoly; + s32 bgId; + + if ((this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag))) { + this->timer = 100; + this->actionFunc = func_809C464C; + + return; + } + + if (this->unk_148 == 1) { + if ((this->captainKeeta->actor.id != ACTOR_EN_BSB) || (captainKeeta->actor.update == NULL)) { + Actor_Kill(&this->actor); + } + + return; + } else if (this->unk_14E >= 2) { + this->timer = 100; + this->actionFunc = func_809C464C; + + return; + } else if ((gSaveContext.save.weekEventReg[85] & 0x40) || (this->unk_14C >= 2) || + (this->actor.xzDistToPlayer > 240.0f)) { + return; + } + + pos.x = (Math_SinS(this->actor.world.rot.y) * 30.0f) + this->actor.world.pos.x; + pos.y = actor->actor.floorHeight + 120.0f; + pos.z = (Math_CosS(this->actor.world.rot.y) * 30.0f) + this->actor.world.pos.z; + yIntersect = BgCheck_EntityRaycastFloor5(&play->colCtx, &colPoly, &bgId, &this->actor, &pos); + if ((yIntersect <= BGCHECK_Y_MIN) || ((actor->actor.depthInWater != BGCHECK_Y_MIN) && + (yIntersect < (actor->actor.world.pos.y - actor->actor.depthInWater)))) { + return; + } + + pos.y = yIntersect; + yRot = (s32)Rand_ZeroFloat(512.0f) + this->actor.world.rot.y + 0x3800; + if (this->unk_14C != 0) { + yRot += 0x8000; + } + pos.x += Math_SinS(yRot) * (40.0f + randPlusMinusPoint5Scaled(40.0f)); + pos.z += Math_CosS(yRot) * (40.0f + randPlusMinusPoint5Scaled(40.0f)); + if (Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_SKB, pos.x, pos.y, pos.z, 0, 0, 0, + ENSKB_PARAMS_0) != NULL) { + this->unk_14C++; + if (this->unk_14C >= 2) { + this->actionFunc = func_809C4598; + } + } +} + +void func_809C4598(EnEncount4* this, PlayState* play) { + if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + this->timer = 100; + this->actionFunc = func_809C464C; + } else if (this->unk_14E >= 2) { + this->timer = 100; + if (this->switchFlag >= 0) { + Flags_SetSwitch(play, this->switchFlag); + } + this->actionFunc = func_809C464C; + } else if (this->unk_14C == 0) { + this->actionFunc = func_809C42A8; + } +} + +void func_809C464C(EnEncount4* this, PlayState* play) { + if (this->timer == 0) { + Actor_Kill(&this->actor); + } +} + +void EnEncount4_Update(Actor* thisx, PlayState* play) { + EnEncount4* this = THIS; + + DECR(this->timer); + this->actionFunc(this, play); +} diff --git a/src/overlays/actors/ovl_En_Encount4/z_en_encount4.h b/src/overlays/actors/ovl_En_Encount4/z_en_encount4.h index 499da9663..a692f796a 100644 --- a/src/overlays/actors/ovl_En_Encount4/z_en_encount4.h +++ b/src/overlays/actors/ovl_En_Encount4/z_en_encount4.h @@ -2,21 +2,26 @@ #define Z_EN_ENCOUNT4_H #include "global.h" +#include "overlays/actors/ovl_Bg_Fire_Wall/z_bg_fire_wall.h" +#include "overlays/actors/ovl_En_Bsb/z_en_bsb.h" +#include "overlays/actors/ovl_En_Skb/z_en_skb.h" struct EnEncount4; typedef void (*EnEncount4ActionFunc)(struct EnEncount4*, PlayState*); +#define ENENCOUNT4_GET_FLAG(thisx) ((thisx)->params & 0x7F) +#define ENENCOUNT4_GET_F000(thisx) (((thisx)->params >> 0xC) & 0xF) + typedef struct EnEncount4 { - /* 0x0000 */ Actor actor; - /* 0x0144 */ EnEncount4ActionFunc actionFunc; - /* 0x0148 */ char unk_148[0x4]; - /* 0x014C */ s16 unk_14C; - /* 0x014E */ s16 unk_14E; - /* 0x0150 */ s16 unk_150; - /* 0x0152 */ char unk_152[0x6]; + /* 0x000 */ Actor actor; + /* 0x144 */ EnEncount4ActionFunc actionFunc; + /* 0x148 */ s16 unk_148; + /* 0x14A */ s16 switchFlag; + /* 0x14C */ s16 unk_14C; + /* 0x14E */ s16 unk_14E; + /* 0x150 */ s16 timer; + /* 0x154 */ EnBsb* captainKeeta; } EnEncount4; // size = 0x158 -extern const ActorInit En_Encount4_InitVars; - #endif // Z_EN_ENCOUNT4_H diff --git a/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.c b/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.c index 946c19c99..6cdf54d70 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.c +++ b/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.c @@ -19,7 +19,7 @@ void EnEndingHero_Draw(Actor* thisx, PlayState* play); void func_80C1E748(EnEndingHero* this); void func_80C1E764(EnEndingHero* this, PlayState* play); -const ActorInit En_Ending_Hero_InitVars = { +ActorInit En_Ending_Hero_InitVars = { ACTOR_EN_ENDING_HERO, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.h b/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.h index 098f2ffe0..6049e3449 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.h +++ b/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.h @@ -18,6 +18,4 @@ typedef struct EnEndingHero { /* 0x244 */ u16 unk244; } EnEndingHero; // size = 0x248 -extern const ActorInit En_Ending_Hero_InitVars; - #endif // Z_EN_ENDING_HERO_H diff --git a/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c b/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c index f33c9d682..2650ad156 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c +++ b/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c @@ -19,7 +19,7 @@ void EnEndingHero2_Draw(Actor* thisx, PlayState* play); void func_80C232E8(EnEndingHero2* this); void func_80C23304(EnEndingHero2* this, PlayState* play); -const ActorInit En_Ending_Hero2_InitVars = { +ActorInit En_Ending_Hero2_InitVars = { ACTOR_EN_ENDING_HERO2, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.h b/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.h index 80ee813fa..2ad3b4914 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.h +++ b/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.h @@ -16,6 +16,4 @@ typedef struct EnEndingHero2 { /* 0x27C */ u16 unk27C; } EnEndingHero2; // size = 0x280 -extern const ActorInit En_Ending_Hero2_InitVars; - #endif // Z_EN_ENDING_HERO2_H diff --git a/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.c b/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.c index 6cd6de0f9..8dcc12199 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.c +++ b/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.c @@ -19,7 +19,7 @@ void EnEndingHero3_Draw(Actor* thisx, PlayState* play); void func_80C23518(EnEndingHero3* this); void func_80C23534(EnEndingHero3* this, PlayState* play); -const ActorInit En_Ending_Hero3_InitVars = { +ActorInit En_Ending_Hero3_InitVars = { ACTOR_EN_ENDING_HERO3, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.h b/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.h index 2a30f1d9c..0887df1ab 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.h +++ b/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.h @@ -16,6 +16,4 @@ typedef struct EnEndingHero3 { /* 0x258 */ u16 unk258; } EnEndingHero3; // size = 0x25C -extern const ActorInit En_Ending_Hero3_InitVars; - #endif // Z_EN_ENDING_HERO3_H diff --git a/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c b/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c index 716237321..333bbc918 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c +++ b/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c @@ -19,7 +19,7 @@ void EnEndingHero4_Draw(Actor* thisx, PlayState* play); void func_80C23748(EnEndingHero4* this); void func_80C23764(EnEndingHero4* this, PlayState* play); -const ActorInit En_Ending_Hero4_InitVars = { +ActorInit En_Ending_Hero4_InitVars = { ACTOR_EN_ENDING_HERO4, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.h b/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.h index 2f050f2df..4cada4183 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.h +++ b/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.h @@ -16,6 +16,4 @@ typedef struct EnEndingHero4 { /* 0x258 */ u16 unk258; } EnEndingHero4; // size = 0x25C -extern const ActorInit En_Ending_Hero4_InitVars; - #endif // Z_EN_ENDING_HERO4_H diff --git a/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.c b/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.c index 4d87fe0ed..ee62798f1 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.c +++ b/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.c @@ -19,7 +19,7 @@ void EnEndingHero5_Draw(Actor* thisx, PlayState* play); void func_80C23980(EnEndingHero5* this); void func_80C2399C(EnEndingHero5* this, PlayState* play); -const ActorInit En_Ending_Hero5_InitVars = { +ActorInit En_Ending_Hero5_InitVars = { ACTOR_EN_ENDING_HERO5, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.h b/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.h index 4b26b03db..9e3dab09e 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.h +++ b/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.h @@ -17,6 +17,4 @@ typedef struct EnEndingHero5 { /* 0x25C */ s32 unk25C; } EnEndingHero5; // size = 0x260 -extern const ActorInit En_Ending_Hero5_InitVars; - #endif // Z_EN_ENDING_HERO5_H diff --git a/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c b/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c index d6da2f978..8f19fe9f8 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c +++ b/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c @@ -24,7 +24,7 @@ void EnEndingHero6_InitSkelAnime(EnEndingHero6* this, s32 npcIndex); void EnEndingHero6_SetupIdle(EnEndingHero6* this); void EnEndingHero6_Idle(EnEndingHero6* this, PlayState* play); -const ActorInit En_Ending_Hero6_InitVars = { +ActorInit En_Ending_Hero6_InitVars = { ACTOR_EN_ENDING_HERO6, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.h b/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.h index f30d09a7a..76af1d67f 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.h +++ b/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.h @@ -23,6 +23,4 @@ typedef struct EnEndingHero6 { /* 0x290 */ s16 isIdle; } EnEndingHero6; // size = 0x294 -extern const ActorInit En_Ending_Hero6_InitVars; - #endif // Z_EN_ENDING_HERO6_H diff --git a/src/overlays/actors/ovl_En_Estone/z_en_estone.c b/src/overlays/actors/ovl_En_Estone/z_en_estone.c index 006166e4b..67a3042ee 100644 --- a/src/overlays/actors/ovl_En_Estone/z_en_estone.c +++ b/src/overlays/actors/ovl_En_Estone/z_en_estone.c @@ -19,7 +19,7 @@ void func_80A9A1DC(EnEstone* this, PlayState* play); void func_80A9A4B0(EnEstone* this, PlayState* play); #if 0 -const ActorInit En_Estone_InitVars = { +ActorInit En_Estone_InitVars = { ACTOR_EN_ESTONE, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_En_Estone/z_en_estone.h b/src/overlays/actors/ovl_En_Estone/z_en_estone.h index b265bf4de..8e4fa075d 100644 --- a/src/overlays/actors/ovl_En_Estone/z_en_estone.h +++ b/src/overlays/actors/ovl_En_Estone/z_en_estone.h @@ -13,6 +13,4 @@ typedef struct EnEstone { /* 0x0148 */ char unk_148[0x2C2C]; } EnEstone; // size = 0x2D74 -extern const ActorInit En_Estone_InitVars; - #endif // Z_EN_ESTONE_H diff --git a/src/overlays/actors/ovl_En_Fall/z_en_fall.c b/src/overlays/actors/ovl_En_Fall/z_en_fall.c index 508090fd5..aaf3958cb 100644 --- a/src/overlays/actors/ovl_En_Fall/z_en_fall.c +++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.c @@ -62,7 +62,7 @@ typedef struct { EnFallDebrisEffect debrisEffects[EN_FALL_DEBRIS_EFFECT_COUNT]; -const ActorInit En_Fall_InitVars = { +ActorInit En_Fall_InitVars = { ACTOR_EN_FALL, ACTORCAT_ITEMACTION, FLAGS, @@ -178,7 +178,7 @@ void EnFall_Init(Actor* thisx, PlayState* play) { } if (objectIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->objIndex = objectIndex; @@ -221,7 +221,7 @@ void EnFall_Setup(EnFall* this, PlayState* play) { this->actionFunc = EnFall_StoppedClosedMouthMoon_PerformCutsceneActions; Actor_SetScale(&this->actor, this->scale * 3.0f); if (!(gSaveContext.save.weekEventReg[25] & 2)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; @@ -230,7 +230,7 @@ void EnFall_Setup(EnFall* this, PlayState* play) { Actor_SetScale(&this->actor, this->scale * 3.0f); this->actor.draw = EnFall_Moon_Draw; if (gSaveContext.save.weekEventReg[25] & 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; @@ -280,12 +280,12 @@ void EnFall_Setup(EnFall* this, PlayState* play) { this->actionFunc = EnFall_MoonsTear_Fall; Actor_SetScale(&this->actor, 0.02f); if (!(play->actorCtx.flags & ACTORCTX_FLAG_1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } moon = EnFall_MoonsTear_GetTerminaFieldMoon(play); this->actor.child = moon; if (moon == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; diff --git a/src/overlays/actors/ovl_En_Fall/z_en_fall.h b/src/overlays/actors/ovl_En_Fall/z_en_fall.h index 21746b683..c9eaaf44f 100644 --- a/src/overlays/actors/ovl_En_Fall/z_en_fall.h +++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.h @@ -50,6 +50,4 @@ typedef struct EnFall { /* 0x160 */ EnFallActionFunc actionFunc; } EnFall; // size = 0x164 -extern const ActorInit En_Fall_InitVars; - #endif // Z_EN_FALL_H diff --git a/src/overlays/actors/ovl_En_Fall2/z_en_fall2.c b/src/overlays/actors/ovl_En_Fall2/z_en_fall2.c index 58ab4e591..e2eaefe26 100644 --- a/src/overlays/actors/ovl_En_Fall2/z_en_fall2.c +++ b/src/overlays/actors/ovl_En_Fall2/z_en_fall2.c @@ -21,7 +21,7 @@ void func_80C1B9D4(EnFall2* this, PlayState* play); void func_80C1B8F0(EnFall2* this); void func_80C1B9D4(EnFall2* this, PlayState* play); -const ActorInit En_Fall2_InitVars = { +ActorInit En_Fall2_InitVars = { ACTOR_EN_FALL2, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_En_Fall2/z_en_fall2.h b/src/overlays/actors/ovl_En_Fall2/z_en_fall2.h index 5ac33b27d..41f064498 100644 --- a/src/overlays/actors/ovl_En_Fall2/z_en_fall2.h +++ b/src/overlays/actors/ovl_En_Fall2/z_en_fall2.h @@ -20,6 +20,4 @@ typedef struct EnFall2 { /* 0x2E8 */ EnFall2ActionFunc actionFunc; } EnFall2; // size = 0x2EC -extern const ActorInit En_Fall2_InitVars; - #endif // Z_EN_FALL2_H diff --git a/src/overlays/actors/ovl_En_Famos/z_en_famos.c b/src/overlays/actors/ovl_En_Famos/z_en_famos.c index b6b93aded..27dcabc23 100644 --- a/src/overlays/actors/ovl_En_Famos/z_en_famos.c +++ b/src/overlays/actors/ovl_En_Famos/z_en_famos.c @@ -51,7 +51,7 @@ void EnFamos_SetupDeathFade(EnFamos* this); void EnFamos_DeathFade(EnFamos* this, PlayState* play); void EnFamos_DrawDebris(EnFamos* this, PlayState* play); -const ActorInit En_Famos_InitVars = { +ActorInit En_Famos_InitVars = { ACTOR_EN_FAMOS, ACTORCAT_ENEMY, FLAGS, @@ -723,7 +723,7 @@ void EnFamos_DeathFade(EnFamos* this, PlayState* play) { if (enBom != NULL) { enBom->parent = NULL; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Fg/z_en_fg.c b/src/overlays/actors/ovl_En_Fg/z_en_fg.c index cacc2e728..6a4c357d9 100644 --- a/src/overlays/actors/ovl_En_Fg/z_en_fg.c +++ b/src/overlays/actors/ovl_En_Fg/z_en_fg.c @@ -24,7 +24,7 @@ void EnFg_AddDust(EnFgEffectDust* dustEffect, Vec3f* worldPos); void EnFg_UpdateDust(EnFgEffectDust* dustEffect); void EnFg_DrawDust(PlayState* play, EnFgEffectDust* dustEffect); -const ActorInit En_Fg_InitVars = { +ActorInit En_Fg_InitVars = { ACTOR_EN_FG, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c index da1c94559..90801ef44 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c @@ -15,7 +15,7 @@ void EnFireRock_Destroy(Actor* thisx, PlayState* play); void EnFireRock_Update(Actor* thisx, PlayState* play); void EnFireRock_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Fire_Rock_InitVars = { +ActorInit En_Fire_Rock_InitVars = { ACTOR_EN_FIRE_ROCK, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h index 84c437ac1..e2b32aaf9 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h @@ -10,6 +10,4 @@ typedef struct EnFireRock { /* 0x144 */ char unk_144[0x94]; } EnFireRock; // size = 0x1D8 -extern const ActorInit En_Fire_Rock_InitVars; - #endif // Z_EN_FIRE_ROCK_H diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index ba43ec2a4..5cdcd99fe 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -44,7 +44,7 @@ typedef enum { /* 2 */ KEESE_AURA_ICE } KeeseAuraType; -const ActorInit En_Firefly_InitVars = { +ActorInit En_Firefly_InitVars = { ACTOR_EN_FIREFLY, ACTORCAT_ENEMY, FLAGS, @@ -411,7 +411,7 @@ void EnFirefly_Die(EnFirefly* this, PlayState* play) { if (this->timer == 0) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xA0); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h index ffb295e6a..6ac9fb008 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h @@ -38,6 +38,4 @@ typedef struct EnFirefly { /* 0x31C */ ColliderSphere collider; } EnFirefly; // size = 0x374 -extern const ActorInit En_Firefly_InitVars; - #endif // Z_EN_FIREFLY_H diff --git a/src/overlays/actors/ovl_En_Firefly2/z_en_firefly2.c b/src/overlays/actors/ovl_En_Firefly2/z_en_firefly2.c index b3b446ef3..6c105caa2 100644 --- a/src/overlays/actors/ovl_En_Firefly2/z_en_firefly2.c +++ b/src/overlays/actors/ovl_En_Firefly2/z_en_firefly2.c @@ -15,7 +15,7 @@ void EnFirefly2_Destroy(Actor* thisx, PlayState* play); void EnFirefly2_Update(Actor* thisx, PlayState* play); void EnFirefly2_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Firefly2_InitVars = { +ActorInit En_Firefly2_InitVars = { ACTOR_EN_FIREFLY2, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Firefly2/z_en_firefly2.h b/src/overlays/actors/ovl_En_Firefly2/z_en_firefly2.h index c60f26ae2..b1e8179e1 100644 --- a/src/overlays/actors/ovl_En_Firefly2/z_en_firefly2.h +++ b/src/overlays/actors/ovl_En_Firefly2/z_en_firefly2.h @@ -10,6 +10,4 @@ typedef struct EnFirefly2 { /* 0x144 */ char unk_144[0x228]; } EnFirefly2; // size = 0x36C -extern const ActorInit En_Firefly2_InitVars; - #endif // Z_EN_FIREFLY2_H diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/src/overlays/actors/ovl_En_Fish/z_en_fish.c index 0479ba261..5f9bbb2da 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -68,7 +68,7 @@ static Color_RGB8 D_8091FA94[] = { { 215, 97, 7 }, }; -const ActorInit En_Fish_InitVars = { +ActorInit En_Fish_InitVars = { ACTOR_EN_FISH, ACTORCAT_ITEMACTION, FLAGS, @@ -520,7 +520,7 @@ void func_8091E880(Actor* thisx, PlayState* play) { } } else if ((this->unk_240 <= 0) && (this->actor.params == ENFISH_0) && (this->actor.floorHeight < BGCHECK_Y_MIN + 10)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -582,8 +582,11 @@ void func_8091EAF0(Actor* thisx, PlayState* play) { } if (this->unk_240 <= 0) { - Actor_MarkForDeath(&this->actor); - } else if (this->unk_240 <= 60) { + Actor_Kill(&this->actor); + return; + } + + if (this->unk_240 <= 60) { if (sp40 & 4) { this->actor.draw = EnFish_Draw; } else { @@ -655,7 +658,7 @@ void func_8091ED70(Actor* thisx, PlayState* play) { } if (this->unk_240 <= 0) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } } @@ -688,7 +691,7 @@ void func_8091EFE8(Actor* thisx, PlayState* play) { s16 sp2E; if (sp3C == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -878,10 +881,11 @@ void func_8091F5A4(Actor* thisx, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actor.parent = NULL; if (this->actor.params == ENFISH_0) { - Actor_MarkForDeath(&this->actor); - } else { - func_8091D904(this); + Actor_Kill(&this->actor); + return; } + + func_8091D904(this); } else if (func_8091DDF4(this, play)) { Actor_PickUp(&this->actor, play, GI_MAX, 80.0f, 25.0f); } @@ -892,7 +896,7 @@ void func_8091F830(Actor* thisx, PlayState* play) { EnFish* this = THIS; if (this->actor.params == ENFISH_1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.h b/src/overlays/actors/ovl_En_Fish/z_en_fish.h index 4596c79b1..528eeb40c 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.h +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.h @@ -48,6 +48,4 @@ typedef struct EnFish { /* 0x279 */ s8 unk_279; } EnFish; // size = 0x27C -extern const ActorInit En_Fish_InitVars; - #endif // Z_EN_FISH_H diff --git a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c index a0575eb9a..fc469da81 100644 --- a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c +++ b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c @@ -49,7 +49,7 @@ static s32 D_80B2B2EC = 0; static s32 D_80B2B2F0 = 0; static Actor* D_80B2B2F4 = NULL; -const ActorInit En_Fish2_InitVars = { +ActorInit En_Fish2_InitVars = { ACTOR_EN_FISH2, ACTORCAT_PROP, FLAGS, @@ -527,7 +527,7 @@ void func_80B2951C(EnFish2* this) { this->unk_2B4 = 10; this->actor.speedXZ = 3.0f; - Actor_MarkForDeath(this->unk_350); + Actor_Kill(this->unk_350); this->unk_350 = NULL; D_80B2B2F4 = &this->actor; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_M_EAT); @@ -806,7 +806,7 @@ void func_80B2A094(EnFish2* this, PlayState* play) { if (D_80B2B2EC != 0) { D_80B2B2EC++; if (D_80B2B2EC > 200) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); ActorCutscene_Stop(this->unk_2BA[0]); return; } @@ -863,7 +863,7 @@ void func_80B2A23C(EnFish2* this, PlayState* play) { D_80B2B2E0 = D_80B2B2EC = D_80B2B2E4 = 0; D_80B2B2F4 = NULL; ActorCutscene_Stop(this->unk_2BA[0]); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.h b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.h index 67dfa98f7..49941d67e 100644 --- a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.h +++ b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.h @@ -60,6 +60,4 @@ typedef struct EnFish2 { /* 0x03F8 */ EnFish2UnkStruct unk_3F8[200]; } EnFish2; // size = 0x2018 -extern const ActorInit En_Fish2_InitVars; - #endif // Z_EN_FISH2_H diff --git a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c index d940a0959..62ffba4d0 100644 --- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c +++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c @@ -201,7 +201,7 @@ s16 D_80917272; u8 D_80917274; Vec3f D_80917278; -const ActorInit En_Fishing_InitVars = { +ActorInit En_Fishing_InitVars = { ACTOR_EN_FISHING, ACTORCAT_NPC, FLAGS, @@ -2151,7 +2151,7 @@ void EnFishing_UpdateLure(EnFishing* this, PlayState* play) { Math_ApproachF(&D_809101C0, 195.0f, 1.0f, 1.0f); - if (player->stateFlags1 & 0x8000000) { + if (player->stateFlags1 & PLAYER_STATE1_8000000) { D_80917204 = 0; player->unk_B28 = 0; } @@ -3865,7 +3865,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { D_8090CCF0 = this->unk_1A4; D_809171D0 = this->unk_148; D_809171D2 = D_80917206; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if ((this->unk_148 == 0) && (D_809171D0 == 0) && ((s16)this->unk_1A4 < (s16)D_8090CCF0)) { this->unk_1CD = 1; diff --git a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.h b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.h index 5af536dbb..a3dcb3a95 100644 --- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.h +++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.h @@ -61,6 +61,4 @@ typedef struct EnFishing { /* 0x248 */ ColliderJntSphElement colliderElements[12]; } EnFishing; // size = 0x548 -extern const ActorInit En_Fishing_InitVars; - #endif // Z_EN_FISHING_H diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 92330d25a..4fd3c46d8 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -59,7 +59,7 @@ void func_808D2D30(EnFloormas* this, PlayState* play); void func_808D2DC0(EnFloormas* this, PlayState* play); void func_808D3754(Actor* thisx, PlayState* play); -const ActorInit En_Floormas_InitVars = { +ActorInit En_Floormas_InitVars = { ACTOR_EN_FLOORMAS, ACTORCAT_ENEMY, FLAGS, @@ -178,7 +178,7 @@ void EnFloormas_Init(Actor* thisx, PlayState* play2) { &play->actorCtx, play, ACTOR_EN_FLOORMAS, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, params + 0x10, -1, this->actor.unk20, NULL); if (this->actor.parent == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -186,8 +186,8 @@ void EnFloormas_Init(Actor* thisx, PlayState* play2) { this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, params + 0x10, -1, this->actor.unk20, NULL); if (this->actor.child == NULL) { - Actor_MarkForDeath(this->actor.parent); - Actor_MarkForDeath(&this->actor); + Actor_Kill(this->actor.parent); + Actor_Kill(&this->actor); return; } @@ -745,7 +745,7 @@ void func_808D22C8(EnFloormas* this, PlayState* play) { Math_Vec3f_Sum(&player->actor.world.pos, &this->actor.home.pos, &this->actor.world.pos); - if (!(player->stateFlags2 & 0x80) || (player->invincibilityTimer < 0)) { + if (!(player->stateFlags2 & PLAYER_STATE2_80) || (player->invincibilityTimer < 0)) { EnFloormas* parent = (EnFloormas*)this->actor.parent; EnFloormas* child = (EnFloormas*)this->actor.child; @@ -898,7 +898,7 @@ void func_808D2A20(EnFloormas* this) { if ((parent->actionFunc == func_808D2AA8) && (child->actionFunc == func_808D2AA8)) { func_808D2AB8(parent); func_808D2AB8(child); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->actor.draw = NULL; this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_10); @@ -917,7 +917,7 @@ void func_808D2AB8(EnFloormas* this) { } void func_808D2AF4(EnFloormas* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_808D2B18(EnFloormas* this) { diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h index c4500973f..002f9e67c 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h @@ -36,6 +36,4 @@ typedef struct EnFloormas { /* 0x354 */ ColliderCylinder collider; } EnFloormas; // size = 0x3A0 -extern const ActorInit En_Floormas_InitVars; - #endif // Z_EN_FLOORMAS_H diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index a8276e649..0b645b302 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -14,7 +14,7 @@ void EnFr_Init(Actor* thisx, PlayState* play); void EnFr_Destroy(Actor* thisx, PlayState* play); void EnFr_Update(Actor* thisx, PlayState* play); -const ActorInit En_Fr_InitVars = { +ActorInit En_Fr_InitVars = { ACTOR_EN_FR, ACTORCAT_ITEMACTION, FLAGS, @@ -30,10 +30,11 @@ void EnFr_Init(Actor* thisx, PlayState* play) { EnFr* this = THIS; if (Flags_GetSwitch(play, ENFR_GET_SWITCHFLAG(&this->actor))) { - Actor_MarkForDeath(&this->actor); - } else { - this->actor.targetMode = ENFR_GET_TARGETMODE(&this->actor); + Actor_Kill(&this->actor); + return; } + + this->actor.targetMode = ENFR_GET_TARGETMODE(&this->actor); } void EnFr_Destroy(Actor* thisx, PlayState* play) { @@ -43,8 +44,11 @@ void EnFr_Update(Actor* thisx, PlayState* play) { EnFr* this = THIS; if (Flags_GetSwitch(play, ENFR_GET_SWITCHFLAG(&this->actor))) { - Actor_MarkForDeath(&this->actor); - } else if (this->actor.xyzDistToPlayerSq < SQ(IREG(29))) { + Actor_Kill(&this->actor); + return; + } + + if (this->actor.xyzDistToPlayerSq < SQ(IREG(29))) { this->actor.flags &= ~ACTOR_FLAG_40000000; } else { this->actor.flags |= ACTOR_FLAG_40000000; diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.h b/src/overlays/actors/ovl_En_Fr/z_en_fr.h index f0de1936d..27682ce40 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.h +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.h @@ -12,6 +12,4 @@ typedef struct EnFr { /* 0x000 */ Actor actor; } EnFr; // size = 0x144 -extern const ActorInit En_Fr_InitVars; - #endif // Z_EN_FR_H 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 45206159e..ec85119e8 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -69,7 +69,7 @@ typedef enum { /* 13 */ FSN_ANIM_MAX } FsnAnimation; -const ActorInit En_Fsn_InitVars = { +ActorInit En_Fsn_InitVars = { ACTOR_EN_FSN, ACTORCAT_NPC, FLAGS, @@ -1417,7 +1417,7 @@ void EnFsn_Init(Actor* thisx, PlayState* play) { EnFsn_InitShop(this, play); } else { if ((gSaveContext.save.weekEventReg[33] & 8) || (gSaveContext.save.weekEventReg[79] & 0x40)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } Collider_InitCylinder(play, &this->collider); diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h index 6bf337be7..35b654c3d 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h @@ -68,6 +68,4 @@ typedef struct EnFsn { /* 0x44E */ u16 flags; } EnFsn; // size = 0x450 -extern const ActorInit En_Fsn_InitVars; - #endif // Z_EN_FSN_H 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 c0be81361..8b035faed 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -55,7 +55,7 @@ void func_80964694(EnFu* this, EnFuUnkStruct* ptr, Vec3f* arg2, s32 len); void func_809647EC(PlayState* play, EnFuUnkStruct* ptr, s32 len); void func_80964950(PlayState* play, EnFuUnkStruct* ptr, s32 len); -const ActorInit En_Fu_InitVars = { +ActorInit En_Fu_InitVars = { ACTOR_EN_FU, ACTORCAT_NPC, FLAGS, @@ -274,7 +274,7 @@ void func_80961E88(PlayState* play) { Actor* explosive = play->actorCtx.actorLists[ACTORCAT_EXPLOSIVES].first; while (explosive != NULL) { - Actor_MarkForDeath(explosive); + Actor_Kill(explosive); explosive = explosive->next; } } @@ -410,7 +410,7 @@ void func_80962340(EnFu* this, PlayState* play) { this->unk_552 = 0x2889; } this->actor.flags &= ~ACTOR_FLAG_10000; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->unk_54A = 1; } else { Message_StartTextbox(play, 0x283C, &this->actor); @@ -535,7 +535,7 @@ void func_80962660(EnFu* this, PlayState* play) { gSaveContext.save.weekEventReg[63] |= 1; gSaveContext.save.weekEventReg[63] &= (u8)~2; func_801477B4(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->unk_53C = 0; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); func_801A2BB8(NA_BGM_TIMED_MINI_GAME); @@ -644,7 +644,7 @@ void func_80962A10(EnFu* this, PlayState* play) { } play_sound(NA_SE_SY_FOUND); - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; Interface_StartTimer(TIMER_ID_MINIGAME_2, 60); if (this->unk_546 == 1) { func_809616E0(this, play); @@ -680,8 +680,8 @@ void func_80962BCC(EnFu* this, PlayState* play) { } play_sound(NA_SE_SY_FOUND); - player->stateFlags1 &= ~0x20; - player->stateFlags3 |= 0x400000; + player->stateFlags1 &= ~PLAYER_STATE1_20; + player->stateFlags3 |= PLAYER_STATE3_400000; Interface_StartTimer(TIMER_ID_MINIGAME_2, 60); if (this->unk_546 == 1) { @@ -711,8 +711,8 @@ void func_80962D60(EnFu* this, PlayState* play) { } play_sound(NA_SE_SY_FOUND); - player->stateFlags1 &= ~0x20; - player->stateFlags3 |= 0x400000; + player->stateFlags1 &= ~PLAYER_STATE1_20; + player->stateFlags3 |= PLAYER_STATE3_400000; Interface_StartTimer(TIMER_ID_MINIGAME_2, 60); if (this->unk_546 == 1) { @@ -748,7 +748,7 @@ void func_80962F4C(EnFu* this, PlayState* play) { switch (this->unk_542) { case 0: if (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) { - player->stateFlags3 |= 0x400; + player->stateFlags3 |= PLAYER_STATE3_400; } break; @@ -778,9 +778,9 @@ void func_80962F4C(EnFu* this, PlayState* play) { if ((!DynaPolyActor_IsInRidingRotatingState((DynaPolyActor*)this->actor.child) && (player->actor.bgCheckFlags & 1)) || (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] <= SECONDS_TO_TIMER(0)) || (this->unk_548 == this->unk_54C)) { - player->stateFlags3 &= ~0x400000; + player->stateFlags3 &= ~PLAYER_STATE3_400000; func_80961E88(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; if (this->unk_548 < this->unk_54C) { if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] == SECONDS_TO_TIMER(0)) { Message_StartTextbox(play, 0x2885, &this->actor); @@ -932,7 +932,7 @@ void func_80963630(EnFu* this, PlayState* play) { break; } } - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } else { this->actor.child->freezeTimer = 10; func_800B85E0(&this->actor, play, 500.0f, PLAYER_AP_MINUS1); @@ -1174,7 +1174,7 @@ void func_80963F88(EnFu* this, PlayState* play) { void func_80963FF8(EnFu* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (player->stateFlags1 & 0x100000) { + if (player->stateFlags1 & PLAYER_STATE1_100000) { play->actorCtx.unk268 = 1; play->actorCtx.unk_26C.press.button = 0x8000; } else { diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.h b/src/overlays/actors/ovl_En_Fu/z_en_fu.h index e35c961e7..44f769a8c 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.h +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.h @@ -52,6 +52,4 @@ typedef struct EnFu { /* 0x552 */ u16 unk_552; } EnFu; // size = 0x554 -extern const ActorInit En_Fu_InitVars; - #endif // Z_EN_FU_H diff --git a/src/overlays/actors/ovl_En_Fu_Kago/z_en_fu_kago.c b/src/overlays/actors/ovl_En_Fu_Kago/z_en_fu_kago.c index a2fc00b22..b232210f5 100644 --- a/src/overlays/actors/ovl_En_Fu_Kago/z_en_fu_kago.c +++ b/src/overlays/actors/ovl_En_Fu_Kago/z_en_fu_kago.c @@ -28,7 +28,7 @@ void func_80AD0028(EnFuKago* this, PlayState* play); void func_80AD0274(EnFuKago* this); void func_80AD0288(EnFuKago* this, PlayState* play); -const ActorInit En_Fu_Kago_InitVars = { +ActorInit En_Fu_Kago_InitVars = { ACTOR_EN_FU_KAGO, ACTORCAT_BG, FLAGS, @@ -100,7 +100,7 @@ void EnFuKago_Init(Actor* thisx, PlayState* play) { } if (npc == NULL) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -342,7 +342,7 @@ void func_80AD0288(EnFuKago* this, PlayState* play) { scale->z = scale->x; scale->y = scale->x; if (scale->x == 0.0f) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_En_Fu_Kago/z_en_fu_kago.h b/src/overlays/actors/ovl_En_Fu_Kago/z_en_fu_kago.h index 909e7b24d..48bd69a27 100644 --- a/src/overlays/actors/ovl_En_Fu_Kago/z_en_fu_kago.h +++ b/src/overlays/actors/ovl_En_Fu_Kago/z_en_fu_kago.h @@ -27,6 +27,4 @@ typedef struct EnFuKago { /* 0x33C */ s16 unk_33C; } EnFuKago; // size = 0x340 -extern const ActorInit En_Fu_Kago_InitVars; - #endif // Z_EN_FU_KAGO_H diff --git a/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.c b/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.c index 19aa9dd2a..6f9706a2b 100644 --- a/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.c +++ b/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.c @@ -27,7 +27,7 @@ void func_80ACECFC(EnFuMato* this, PlayState* play); void func_80ACEFC4(EnFuMato* this); void func_80ACEFD8(EnFuMato* this, PlayState* play); -const ActorInit En_Fu_Mato_InitVars = { +ActorInit En_Fu_Mato_InitVars = { ACTOR_EN_FU_MATO, ACTORCAT_BG, FLAGS, @@ -92,7 +92,7 @@ void EnFuMato_Init(Actor* thisx, PlayState* play) { } if (actor == NULL) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -192,7 +192,7 @@ void func_80ACE718(EnFuMato* this, PlayState* play) { Vec3f sp30 = { 0.0f, 2.0f, 0.0f }; func_800B3030(play, &this->dyna.actor.world.pos, &sp3C, &sp30, 20, 40, 2); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } @@ -352,7 +352,7 @@ void func_80ACEFD8(EnFuMato* this, PlayState* play) { Math_SmoothStepToF(&scale->x, 0.0f, 0.1f, 0.005f, 0.005f); scale->y = scale->z = scale->x; if (scale->x == 0.0f) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.h b/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.h index d24ac91d5..2065784d7 100644 --- a/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.h +++ b/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.h @@ -34,6 +34,4 @@ typedef struct EnFuMato { /* 0x30A */ s16 unk_30A; } EnFuMato; // size = 0x30C -extern const ActorInit En_Fu_Mato_InitVars; - #endif // Z_EN_FU_MATO_H diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index 58d5a6f5f..04ae61b72 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -49,7 +49,7 @@ void func_809340BC(EnFz* this, Vec3f* a, Vec3f* b, Vec3f* c, f32 arg4, f32 arg5, void func_80934178(EnFz* this, PlayState* play); void func_80934464(EnFz* this, PlayState* play); -const ActorInit En_Fz_InitVars = { +ActorInit En_Fz_InitVars = { ACTOR_EN_FZ, ACTORCAT_ENEMY, FLAGS, @@ -663,7 +663,7 @@ void func_809336C0(EnFz* this, PlayState* play) { void func_80933760(EnFz* this, PlayState* play) { if (this->unk_BCA == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.h b/src/overlays/actors/ovl_En_Fz/z_en_fz.h index 58d1fb6d4..539560c88 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.h +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.h @@ -70,6 +70,4 @@ typedef struct EnFz { /* 0xBD9 */ u8 unk_BD9; } EnFz; /* size = 0xBDC */ -extern const ActorInit En_Fz_InitVars; - #endif // Z_EN_FZ_H diff --git a/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.c b/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.c index 9b4836637..f6a227015 100644 --- a/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.c +++ b/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.c @@ -25,7 +25,7 @@ void EnGakufu_GiveReward(EnGakufu* this, PlayState* play); void EnGakufu_PlayRewardCutscene(EnGakufu* this, PlayState* play); void EnGakufu_WaitForSong(EnGakufu* this, PlayState* play); -const ActorInit En_Gakufu_InitVars = { +ActorInit En_Gakufu_InitVars = { ACTOR_EN_GAKUFU, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.h b/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.h index c9db31b75..04d9c7159 100644 --- a/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.h +++ b/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.h @@ -21,6 +21,4 @@ typedef struct EnGakufu { /* 0x150 */ EnGakufuActionFunc actionFunc; } EnGakufu; // size = 0x154 -extern const ActorInit En_Gakufu_InitVars; - #endif // Z_EN_GAKUFU_H diff --git a/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c b/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c index e01193378..40c3d5c05 100644 --- a/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c +++ b/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c @@ -23,7 +23,7 @@ void func_80AF6944(EnGamelupy* this); void func_80AF6994(EnGamelupy* this); void func_80AF6A38(EnGamelupy* this); -const ActorInit En_Gamelupy_InitVars = { +ActorInit En_Gamelupy_InitVars = { ACTOR_EN_GAMELUPY, ACTORCAT_PROP, FLAGS, @@ -149,7 +149,7 @@ void func_80AF6A78(EnGamelupy* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->unk_19C > 30) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk_19C++; this->actor.world.pos = player->actor.world.pos; diff --git a/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.h b/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.h index 4ee6a5b11..5d45f3168 100644 --- a/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.h +++ b/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.h @@ -18,6 +18,4 @@ typedef struct EnGamelupy { /* 0x1A0 */ s16 unk_1A0; } EnGamelupy; // size = 0x1A4 -extern const ActorInit En_Gamelupy_InitVars; - #endif // Z_EN_GAMELUPY_H diff --git a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c index 45d6661eb..6effae85c 100644 --- a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c +++ b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c @@ -36,7 +36,7 @@ void func_80B111AC(EnGb2* this, PlayState* play); void func_80B11268(EnGb2* this, PlayState* play); void func_80B11344(EnGb2* this, PlayState* play); -const ActorInit En_Gb2_InitVars = { +ActorInit En_Gb2_InitVars = { ACTOR_EN_GB2, ACTORCAT_NPC, FLAGS, @@ -652,25 +652,26 @@ void func_80B10A48(EnGb2* this, PlayState* play) { switch (ENGB2_GET_7(&this->actor)) { case ENGB2_7_0: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; case ENGB2_7_1: ActorCutscene_Stop(this->unk_282[this->unk_290]); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; case ENGB2_7_2: ActorCutscene_Stop(this->unk_282[this->unk_290]); if (this->unk_26E == 0x14FB) { Flags_SetSwitch(play, ENGB2_GET_7F8(&this->actor)); - Actor_MarkForDeath(&this->actor); - } else { - this->actor.draw = NULL; - this->unk_26C |= 0x100; - this->actor.flags &= ~ACTOR_FLAG_1; - this->actionFunc = func_80B111AC; + Actor_Kill(&this->actor); + return; } + + this->actor.draw = NULL; + this->unk_26C |= 0x100; + this->actor.flags &= ~ACTOR_FLAG_1; + this->actionFunc = func_80B111AC; break; } } @@ -869,7 +870,7 @@ void EnGb2_Init(Actor* thisx, PlayState* play) { EnGb2* this = THIS; if (func_80B0F660(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -885,9 +886,9 @@ void EnGb2_Init(Actor* thisx, PlayState* play) { switch (ENGB2_GET_7(&this->actor)) { case ENGB2_7_0: if (gSaveContext.save.weekEventReg[54] & 0x80) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if (gSaveContext.save.weekEventReg[52] & 0x20) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (gSaveContext.save.entrance == ENTRANCE(GHOST_HUT, 1)) { @@ -910,12 +911,12 @@ void EnGb2_Init(Actor* thisx, PlayState* play) { case ENGB2_7_1: if ((play->curSpawn == 1) || (gSaveContext.save.weekEventReg[80] & 0x80)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (Flags_GetSwitch(play, ENGB2_GET_7F8(thisx))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -929,13 +930,13 @@ void EnGb2_Init(Actor* thisx, PlayState* play) { this->unk_290 = 0; this->unk_282[0] = this->actor.cutscene; if (Flags_GetSwitch(play, ENGB2_GET_7F8(thisx))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (Flags_GetClear(play, 2) && Flags_GetClear(play, 3) && Flags_GetClear(play, 4) && Flags_GetClear(play, 5)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -952,7 +953,7 @@ void EnGb2_Init(Actor* thisx, PlayState* play) { break; default: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } diff --git a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.h b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.h index cb53ada3b..ec3b379a1 100644 --- a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.h +++ b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.h @@ -38,6 +38,4 @@ typedef struct EnGb2 { /* 0x290 */ s16 unk_290; } EnGb2; // size = 0x294 -extern const ActorInit En_Gb2_InitVars; - #endif // Z_EN_GB2_H diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index c8e85a3ac..cbc8511b7 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -15,7 +15,7 @@ void EnGe1_Destroy(Actor* thisx, PlayState* play); void EnGe1_Update(Actor* thisx, PlayState* play); void EnGe1_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Ge1_InitVars = { +ActorInit En_Ge1_InitVars = { ACTOR_EN_GE1, ACTORCAT_NPC, FLAGS, @@ -308,7 +308,7 @@ void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play) { break; case 7: - Actor_MarkForDeath(&this->picto.actor); + Actor_Kill(&this->picto.actor); break; // Twister cutscene diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h index ae6cc601e..5388a1186 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h @@ -40,6 +40,4 @@ typedef struct EnGe1 { /* 0x2C8 */ EnGe1ActionFunc actionFunc; } EnGe1; // size = 0x2CC -extern const ActorInit En_Ge1_InitVars; - #endif // Z_EN_GE1_H diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index c05db47fd..4659c4aa9 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -27,7 +27,7 @@ void func_80B8C644(EnGe2* this, PlayState* play); void func_80B8C9B8(EnGe2* this, PlayState* play); #if 0 -const ActorInit En_Ge2_InitVars = { +ActorInit En_Ge2_InitVars = { ACTOR_EN_GE2, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h index f0d97869d..0558166db 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h @@ -13,6 +13,4 @@ typedef struct EnGe2 { /* 0x308 */ EnGe2ActionFunc actionFunc; } EnGe2; // size = 0x30C -extern const ActorInit En_Ge2_InitVars; - #endif // Z_EN_GE2_H diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index 50e4ed613..1f680e9e8 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -16,7 +16,7 @@ void EnGe3_Update(Actor* thisx, PlayState* play); void EnGe3_Draw(Actor* thisx, PlayState* play); #if 0 -const ActorInit En_Ge3_InitVars = { +ActorInit En_Ge3_InitVars = { ACTOR_EN_GE3, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h index 10912aae0..909ed7599 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h @@ -13,6 +13,4 @@ typedef struct EnGe3 { /* 0x31C */ EnGe3ActionFunc actionFunc; } EnGe3; // size = 0x320 -extern const ActorInit En_Ge3_InitVars; - #endif // Z_EN_GE3_H diff --git a/src/overlays/actors/ovl_En_Geg/z_en_geg.c b/src/overlays/actors/ovl_En_Geg/z_en_geg.c index 1766b8e32..f88aab950 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.c +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.c @@ -37,7 +37,7 @@ void func_80BB32AC(EnGeg* this, PlayState* play); void func_80BB3318(EnGeg* this, PlayState* play); void func_80BB347C(EnGeg* this, PlayState* play); -const ActorInit En_Geg_InitVars = { +ActorInit En_Geg_InitVars = { ACTOR_EN_GEG, ACTORCAT_NPC, FLAGS, @@ -658,7 +658,7 @@ void func_80BB2B1C(EnGeg* this, PlayState* play) { if (ActorCutscene_GetCanPlayNext(this->unk_498)) { gSaveContext.save.weekEventReg[37] |= 8; if (this->actor.child != NULL) { - Actor_MarkForDeath(this->actor.child); + Actor_Kill(this->actor.child); } this->unk_230 |= 0x10; ActorCutscene_StartAndSetFlag(this->unk_498, &this->actor); @@ -839,7 +839,7 @@ void func_80BB3318(EnGeg* this, PlayState* play) { if (ActorCutscene_GetCurrentIndex() != this->unk_49C[7]) { func_800AEF44(Effect_GetByIndex(this->unk_4DC)); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { Math_ApproachF(&this->actor.speedXZ, 10.0f, 0.2f, 1.0f); Actor_MoveWithGravity(&this->actor); @@ -862,7 +862,7 @@ void EnGeg_Init(Actor* thisx, PlayState* play) { s32 sp34[] = { 0x3E, 0xF64 }; if (gSaveContext.save.weekEventReg[61] & 1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -879,7 +879,7 @@ void EnGeg_Init(Actor* thisx, PlayState* play) { if (this->actor.update != NULL) { this->unk_248 = Object_GetIndex(&play->objectCtx, OBJECT_OF1D_MAP); if (this->unk_248 < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Geg/z_en_geg.h b/src/overlays/actors/ovl_En_Geg/z_en_geg.h index 4a20068bd..ea29fd6cf 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.h +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.h @@ -46,6 +46,4 @@ typedef struct EnGeg { /* 0x4E4 */ Vec3f unk_4E4; } EnGeg; // size = 0x4F0 -extern const ActorInit En_Geg_InitVars; - #endif // Z_EN_GEG_H diff --git a/src/overlays/actors/ovl_En_Gg/z_en_gg.c b/src/overlays/actors/ovl_En_Gg/z_en_gg.c index e2ebab0d5..8b2f8d091 100644 --- a/src/overlays/actors/ovl_En_Gg/z_en_gg.c +++ b/src/overlays/actors/ovl_En_Gg/z_en_gg.c @@ -26,7 +26,7 @@ void func_80B359DC(EnGg* this, PlayState* play); void func_80B363E8(EnGgStruct* ptr, PlayState* play, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3); void func_80B364D4(EnGgStruct* ptr, PlayState* play); -const ActorInit En_Gg_InitVars = { +ActorInit En_Gg_InitVars = { ACTOR_EN_GG, ACTORCAT_NPC, FLAGS, @@ -319,7 +319,7 @@ void func_80B35634(EnGg* this, PlayState* play) { break; case 8: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; default: @@ -390,11 +390,11 @@ void func_80B359DC(EnGg* this, PlayState* play) { if (this->actor.xzDistToPlayer < 200.0f) { if (this->unk_306 == 0) { - if (player->stateFlags2 & 0x8000000) { + if (player->stateFlags2 & PLAYER_STATE2_8000000) { this->unk_306 = 1; play_sound(NA_SE_SY_TRE_BOX_APPEAR); } - } else if (!(player->stateFlags2 & 0x8000000)) { + } else if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) { this->unk_306 = 0; } @@ -647,7 +647,7 @@ void EnGg_Init(Actor* thisx, PlayState* play) { EnGg* this = THIS; if (INV_CONTENT(ITEM_MASK_GORON) == ITEM_MASK_GORON) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Gg/z_en_gg.h b/src/overlays/actors/ovl_En_Gg/z_en_gg.h index 421168e99..cb9f9e7cb 100644 --- a/src/overlays/actors/ovl_En_Gg/z_en_gg.h +++ b/src/overlays/actors/ovl_En_Gg/z_en_gg.h @@ -57,6 +57,4 @@ typedef struct EnGg { /* 0x344 */ EnGgStruct unk_344; } EnGg; // size = 0x390 -extern const ActorInit En_Gg_InitVars; - #endif // Z_EN_GG_H diff --git a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c index 47eac3051..acec19c76 100644 --- a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c +++ b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c @@ -27,7 +27,7 @@ void func_80B3B5D4(EnGg2* this, PlayState* play); s32 func_80B3B648(EnGg2* this, Path* path, s32 arg2_); f32 func_80B3B7E4(Path* path, s32 arg1, Vec3f* arg2, Vec3s* arg3); -const ActorInit En_Gg2_InitVars = { +ActorInit En_Gg2_InitVars = { ACTOR_EN_GG2, ACTORCAT_NPC, FLAGS, @@ -356,12 +356,12 @@ void EnGg2_Init(Actor* thisx, PlayState* play2) { EnGg2* this = THIS; if (INV_CONTENT(ITEM_MASK_GORON) == ITEM_MASK_GORON) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (gSaveContext.save.weekEventReg[91] & 0x10) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -395,7 +395,7 @@ void EnGg2_Init(Actor* thisx, PlayState* play2) { Actor_ChangeAnimationByInfo(&this->skelAnime, D_80B3BF00, 0); this->actionFunc = func_80B3B05C; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (play->sceneId == SCENE_10YUKIYAMANOMURA) { if (!(gSaveContext.save.weekEventReg[20] & 4) && (gSaveContext.save.weekEventReg[20] & 8) && @@ -405,13 +405,13 @@ void EnGg2_Init(Actor* thisx, PlayState* play2) { Actor_ChangeAnimationByInfo(&this->skelAnime, D_80B3BF00, 0); this->actionFunc = func_80B3B05C; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { gSaveContext.save.weekEventReg[20] &= (u8)~4; gSaveContext.save.weekEventReg[20] &= (u8)~8; gSaveContext.save.weekEventReg[20] &= (u8)~0x10; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.h b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.h index 21c1f8441..f91310775 100644 --- a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.h +++ b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.h @@ -35,6 +35,4 @@ typedef struct EnGg2 { /* 0x304 */ Vec3f unk_304; } EnGg2; // size = 0x310 -extern const ActorInit En_Gg2_InitVars; - #endif // Z_EN_GG2_H diff --git a/src/overlays/actors/ovl_En_Giant/z_en_giant.c b/src/overlays/actors/ovl_En_Giant/z_en_giant.c index 10951f76d..d44306b09 100644 --- a/src/overlays/actors/ovl_En_Giant/z_en_giant.c +++ b/src/overlays/actors/ovl_En_Giant/z_en_giant.c @@ -72,7 +72,7 @@ typedef enum { /* 15 */ GIANT_CS_ACTION_HOLDING_UP_MOON_IN_CLOCK_TOWER } GiantCsActionIndex; -const ActorInit En_Giant_InitVars = { +ActorInit En_Giant_InitVars = { ACTOR_EN_GIANT, ACTORCAT_NPC, FLAGS, @@ -184,7 +184,7 @@ void EnGiant_Init(Actor* thisx, PlayState* play) { if (GIANT_TYPE_IS_CLOCK_TOWER_SUCCESS(type)) { if (!(gSaveContext.save.weekEventReg[25] & 2)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -210,7 +210,7 @@ void EnGiant_Init(Actor* thisx, PlayState* play) { this->actor.terminalVelocity = 0.0f; this->actor.gravity = 0.0f; if (EnGiant_IsImprisoned(this)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Giant/z_en_giant.h b/src/overlays/actors/ovl_En_Giant/z_en_giant.h index 3b2cac192..9ce182a98 100644 --- a/src/overlays/actors/ovl_En_Giant/z_en_giant.h +++ b/src/overlays/actors/ovl_En_Giant/z_en_giant.h @@ -58,6 +58,4 @@ typedef struct EnGiant { /* 0x298 */ EnGiantActionFunc actionFunc; } EnGiant; // size = 0x29C -extern const ActorInit En_Giant_InitVars; - #endif // Z_EN_GIANT_H 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 758d3eae0..fa555bc3a 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 @@ -30,7 +30,7 @@ void EnGinkoMan_Stamp(EnGinkoMan* this, PlayState* play); void EnGinkoMan_Dialogue(EnGinkoMan* this, PlayState* play); void EnGinkoMan_SwitchAnimation(EnGinkoMan* this, PlayState* play); -const ActorInit En_Ginko_Man_InitVars = { +ActorInit En_Ginko_Man_InitVars = { ACTOR_EN_GINKO_MAN, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.h b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.h index 808ea7c2f..b8a19d0f3 100644 --- a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.h +++ b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.h @@ -24,8 +24,6 @@ typedef struct EnGinkoMan { /* 0x264 */ s16 animTimer; } EnGinkoMan; // size = 0x268 -extern const ActorInit En_Ginko_Man_InitVars; - #define GINKOMAN_CHOICE_DEPOSIT 0 #define GINKOMAN_CHOICE_WITHDRAWL 1 #define GINKOMAN_CHOICE_CANCEL 2 diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 74486b30c..0c6ad8a41 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -51,7 +51,7 @@ void EnGirlA_BuyShieldMirror(PlayState* play, EnGirlA* this); void EnGirlA_BuyFanfare(PlayState* play, EnGirlA* this); -const ActorInit En_GirlA_InitVars = { +ActorInit En_GirlA_InitVars = { ACTOR_EN_GIRLA, ACTORCAT_PROP, FLAGS, @@ -160,14 +160,14 @@ void EnGirlA_InitObjIndex(EnGirlA* this, PlayState* play) { s16 params = this->actor.params; //! @bug: Condition is impossible, && should be an || - if (params >= SI_MAX && params < SI_POTION_RED_1) { - Actor_MarkForDeath(&this->actor); + if ((params >= SI_MAX) && (params < SI_POTION_RED_1)) { + Actor_Kill(&this->actor); return; } this->objIndex = Object_GetIndex(&play->objectCtx, sShopItemEntries[params].objectId); if (this->objIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h index cb48f591d..f61b50b5a 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h @@ -107,8 +107,6 @@ typedef enum { /* 0x2B */ SI_MAX } EnGirlAShopItemId; -extern const ActorInit En_GirlA_InitVars; - /* * Shopkeeper Common Defines */ diff --git a/src/overlays/actors/ovl_En_Gk/z_en_gk.c b/src/overlays/actors/ovl_En_Gk/z_en_gk.c index 601faff4b..627c8d369 100644 --- a/src/overlays/actors/ovl_En_Gk/z_en_gk.c +++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.c @@ -33,7 +33,7 @@ void func_80B5253C(EnGk* this, PlayState* play); void func_80B525E0(EnGk* this, PlayState* play); void func_80B52654(EnGk* this, PlayState* play); -const ActorInit En_Gk_InitVars = { +ActorInit En_Gk_InitVars = { ACTOR_EN_GK, ACTORCAT_NPC, FLAGS, @@ -247,11 +247,11 @@ s32 func_80B50854(EnGk* this, PlayState* play) { Player* player = GET_PLAYER(play); if (!(this->unk_1E4 & 0x40)) { - if (player->stateFlags2 & 0x8000000) { + if (player->stateFlags2 & PLAYER_STATE2_8000000) { this->unk_1E4 |= 0x40; play_sound(NA_SE_SY_TRE_BOX_APPEAR); } - } else if (!(player->stateFlags2 & 0x8000000)) { + } else if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) { this->unk_1E4 &= ~0x40; } @@ -810,7 +810,7 @@ void func_80B51EA4(EnGk* this, PlayState* play) { if (func_80B50C78(this, this->path, this->unk_1EC)) { if (this->unk_1EC >= (this->path->count - 1)) { ActorCutscene_Stop(this->unk_318); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk_1EC++; } @@ -1020,7 +1020,7 @@ void EnGk_Init(Actor* thisx, PlayState* play) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); if (play->sceneId == SCENE_17SETUGEN2) { if (Flags_GetSwitch(play, ENGK_GET_3F00(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk_318 = this->actor.cutscene; this->path = SubS_GetPathByIndex(play, ENGK_GET_F0(&this->actor), 0xF); @@ -1036,10 +1036,10 @@ void EnGk_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80B51760; } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (ENGK_GET_F(&this->actor) == ENGK_F_2) { if (!(gSaveContext.save.weekEventReg[22] & 4)) { @@ -1048,7 +1048,7 @@ void EnGk_Init(Actor* thisx, PlayState* play) { this->actor.flags |= ACTOR_FLAG_10; this->actor.flags &= ~ACTOR_FLAG_1; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (!(gSaveContext.save.weekEventReg[22] & 4)) { this->unk_2E4 = 0; diff --git a/src/overlays/actors/ovl_En_Gk/z_en_gk.h b/src/overlays/actors/ovl_En_Gk/z_en_gk.h index 61610d684..bebe6c6c9 100644 --- a/src/overlays/actors/ovl_En_Gk/z_en_gk.h +++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.h @@ -56,6 +56,4 @@ typedef struct EnGk { /* 0x354 */ f32 unk_354; } EnGk; // size = 0x358 -extern const ActorInit En_Gk_InitVars; - #endif // Z_EN_GK_H 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 c85815ee7..b64edb3ae 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -155,7 +155,7 @@ static s32 D_80951C2C[] = { 0x0E295A2D, 0x000A0C10 }; static s32 D_80951C34[] = { 0x0E29622D, 0x000A0C10 }; -const ActorInit En_Gm_InitVars = { +ActorInit En_Gm_InitVars = { ACTOR_EN_GM, ACTORCAT_NPC, FLAGS, @@ -892,7 +892,7 @@ s32 func_8094F53C(EnGm* this, PlayState* play) { Actor* al = func_8094DEE0(this, play, ACTORCAT_NPC, ACTOR_EN_AL); Actor* toto = func_8094DEE0(this, play, ACTORCAT_NPC, ACTOR_EN_TOTO); - if (player->stateFlags1 & 0x440) { + if (player->stateFlags1 & (PLAYER_STATE1_40 | PLAYER_STATE1_400)) { this->unk_3A4 |= 0x400; if (this->unk_3A6 != sp32) { switch (sp32) { @@ -1412,7 +1412,7 @@ s32 func_80950690(EnGm* this, PlayState* play) { al = func_8094DEE0(this, play, ACTORCAT_NPC, ACTOR_EN_AL); toto = func_8094DEE0(this, play, ACTORCAT_NPC, ACTOR_EN_TOTO); if ((al != NULL) && (al->update != NULL) && (toto != NULL) && (toto->update != NULL) && - !(player->stateFlags1 & 0x40)) { + !(player->stateFlags1 & PLAYER_STATE1_40)) { if (DECR(this->unk_3B8) == 0) { if (al == this->unk_268) { this->unk_268 = toto; @@ -1665,7 +1665,7 @@ void EnGm_Init(Actor* thisx, PlayState* play) { EnGm* this = THIS; if (func_8094DEE0(this, play, ACTORCAT_NPC, ACTOR_EN_GM)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.h b/src/overlays/actors/ovl_En_Gm/z_en_gm.h index 0f74de16b..3bed5335a 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.h +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.h @@ -76,6 +76,4 @@ typedef struct EnGm { /* 0x400 */ s32 unk_400; } EnGm; // size = 0x404 -extern const ActorInit En_Gm_InitVars; - #endif // Z_EN_GM_H 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 8692fbba1..86b0b1b41 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -78,7 +78,7 @@ static s32 D_80A163EC[4] = { 0x100060E, 0xE040C12, 0x100E0E05, 0xC121000 }; static s32 D_80A163FC[4] = { 0x100060E, 0xE060C12, 0x100E0E07, 0xC121000 }; static s32 D_80A1640C[2] = { 0xE023A0C, 0x12100000 }; -const ActorInit En_Go_InitVars = { +ActorInit En_Go_InitVars = { ACTOR_EN_GO, ACTORCAT_NPC, FLAGS, @@ -525,7 +525,7 @@ void func_80A1213C(EnGo* this, PlayState* play) { s32 func_80A121F4(PlayState* play) { Player* player = GET_PLAYER(play); - if ((player->transformation == PLAYER_FORM_GORON) && (player->stateFlags3 & 0x2000000)) { + if ((player->transformation == PLAYER_FORM_GORON) && (player->stateFlags3 & PLAYER_STATE3_2000000)) { return false; } return true; @@ -637,7 +637,7 @@ void func_80A12660(EnGo* this, PlayState* play) { void func_80A126BC(EnGo* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags2 & 0x4000)) { + if (!(player->stateFlags2 & PLAYER_STATE2_4000)) { if (this->unk_3C6 != 0) { this->unk_3C6--; } @@ -830,7 +830,7 @@ s32 func_80A12E80(EnGo* this, PlayState* play) { return false; } - if (player->stateFlags1 & 0x40) { + if (player->stateFlags1 & PLAYER_STATE1_40) { if (this->unk_392 != temp) { switch (temp) { case 0xE1A: @@ -1380,7 +1380,7 @@ void func_80A14430(EnGo* this, PlayState* play) { func_80A14018(this, play); this->actionFunc = func_80A149B0; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1390,7 +1390,7 @@ void func_80A1449C(EnGo* this, PlayState* play) { func_80A14104(this, play); this->actionFunc = func_80A149B0; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1505,7 +1505,7 @@ void func_80A14798(EnGo* this, PlayState* play) { break; default: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; } } diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.h b/src/overlays/actors/ovl_En_Go/z_en_go.h index 0278a70df..fd4876430 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.h +++ b/src/overlays/actors/ovl_En_Go/z_en_go.h @@ -101,6 +101,4 @@ typedef struct EnGo { /* 0x3F8 */ EnGoStruct unk_3F8[32]; } EnGo; // size = 0xB78 -extern const ActorInit En_Go_InitVars; - #endif // Z_EN_GO_H diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 1f173114d..98d27f735 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -33,7 +33,7 @@ void func_80941FA4(EnGoroiwa* this, PlayState* play); void func_80942084(EnGoroiwa* this); void func_809420F0(EnGoroiwa* this, PlayState* play); -const ActorInit En_Goroiwa_InitVars = { +ActorInit En_Goroiwa_InitVars = { ACTOR_EN_GOROIWA, ACTORCAT_PROP, FLAGS, @@ -965,12 +965,12 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { func_8093E9B0(this, play); if (sp28 == 0x7F8) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (sp2C->count < 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -1134,7 +1134,7 @@ void func_80941A10(EnGoroiwa* this, PlayState* play) { s32 pad2; if (!func_8094156C(this, play)) { - if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & 0x80000)) { + if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & PLAYER_STATE3_80000)) { s32 sp34 = this->actor.home.rot.z & 3; if (sp34 == 2) { @@ -1264,7 +1264,7 @@ void func_80941FA4(EnGoroiwa* this, PlayState* play) { Player* player = GET_PLAYER(play); if (func_8094156C(this, play) == 0) { - if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & 0x80000)) { + if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & PLAYER_STATE3_80000)) { func_800B8D50(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 0); func_800B8E58(player, NA_SE_PL_BODY_HIT); if (((this->actor.home.rot.z & 3) == 1) || ((this->actor.home.rot.z & 3) == 2)) { @@ -1292,7 +1292,7 @@ void func_809420F0(EnGoroiwa* this, PlayState* play) { Player* player = GET_PLAYER(play); if (func_8094156C(this, play) == 0) { - if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & 0x80000)) { + if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & PLAYER_STATE3_80000)) { func_800B8D50(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 0); func_800B8E58(player, NA_SE_PL_BODY_HIT); if (((this->actor.home.rot.z & 3) == 1) || ((this->actor.home.rot.z & 3) == 2)) { @@ -1418,7 +1418,7 @@ void func_80942604(EnGoroiwa* this, PlayState* play) { if (this->unk_1C8 > 0) { this->unk_1C8--; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1434,7 +1434,8 @@ void EnGoroiwa_Update(Actor* thisx, PlayState* play) { u32 temp_v0_2; CollisionPoly* tmp; - if (!(player->stateFlags1 & (0x30000000 | 0x80 | 0x40))) { + if (!(player->stateFlags1 & + (PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_10000000 | PLAYER_STATE1_20000000))) { if (this->unk_1CC > 0) { this->unk_1CC--; } @@ -1515,7 +1516,7 @@ void EnGoroiwa_Update(Actor* thisx, PlayState* play) { func_8093E938(this); if ((this->unk_1E5 & 1) && (this->unk_1CC <= 0) && - (!(player->stateFlags3 & 0x2000000) || (player->transformation != PLAYER_FORM_GORON) || + (!(player->stateFlags3 & PLAYER_STATE3_2000000) || (player->transformation != PLAYER_FORM_GORON) || ((params != ENGOROIWA_C000_1) && (params != ENGOROIWA_C000_2)))) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); } else { diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h index fc4f66f51..e672355e5 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h @@ -81,6 +81,4 @@ typedef struct EnGoroiwa { /* 0x248 */ s32 unk_248; } EnGoroiwa; // size = 0x24C -extern const ActorInit En_Goroiwa_InitVars; - #endif // Z_EN_GOROIWA_H diff --git a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c index aa2ce4915..cedd5c894 100644 --- a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c +++ b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c @@ -137,7 +137,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_HOOK), }; -const ActorInit En_Grasshopper_InitVars = { +ActorInit En_Grasshopper_InitVars = { ACTOR_EN_GRASSHOPPER, ACTORCAT_ENEMY, FLAGS, @@ -782,8 +782,8 @@ void EnGrasshopper_Fall(EnGrasshopper* this, PlayState* play) { s32 isUnderWater = false; this->actor.shape.rot.y += 0x1388; - if ((this->actor.floorHeight <= -32000.0f) || (this->actor.floorHeight >= 32000.0f)) { - Actor_MarkForDeath(&this->actor); + if ((this->actor.floorHeight <= BGCHECK_Y_MIN) || (this->actor.floorHeight >= BGCHECK_Y_MAX)) { + Actor_Kill(&this->actor); return; } @@ -840,7 +840,7 @@ void EnGrasshopper_Fall(EnGrasshopper* this, PlayState* play) { SoundSource_PlaySfxEachFrameAtFixedWorldPos(play, &this->actor.world.pos, 10, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG); Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0x60); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.h b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.h index d414e4100..8056253f6 100644 --- a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.h +++ b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.h @@ -75,6 +75,4 @@ typedef struct EnGrasshopper { /* 0x0570 */ EnGrasshopperEffect effects[EN_GRASSHOPPER_EFFECT_COUNT]; } EnGrasshopper; // size = 0x1870 -extern const ActorInit En_Grasshopper_InitVars; - #endif // Z_EN_GRASSHOPPER_H 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 3927305ad..5bd3826c7 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -37,7 +37,7 @@ s32 func_809995A4(EnGs* this, PlayState* play); void func_80999A8C(EnGs* this, PlayState* play); void func_80999AC0(EnGs* this); -const ActorInit En_Gs_InitVars = { +ActorInit En_Gs_InitVars = { ACTOR_EN_GS, ACTORCAT_PROP, FLAGS, @@ -871,7 +871,7 @@ s32 func_809995A4(EnGs* this, PlayState* play) { if (this->actor.playerHeightRel < -12000.0f) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.world.rot.y, 0, 0); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); sp7C = 0; } } @@ -881,7 +881,7 @@ s32 func_809995A4(EnGs* this, PlayState* play) { void func_80999A8C(EnGs* this, PlayState* play) { if (this->unk_1D4-- <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.h b/src/overlays/actors/ovl_En_Gs/z_en_gs.h index eed8d75f9..51e899fcc 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.h +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.h @@ -57,6 +57,4 @@ typedef struct EnGs { /* 0x21E */ s16 unk_21E; } EnGs; // size = 0x220 -extern const ActorInit En_Gs_InitVars; - #endif // Z_EN_GS_H diff --git a/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.c b/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.c index a08d0835f..b1d7ed422 100644 --- a/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.c +++ b/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.c @@ -25,7 +25,7 @@ void EnGuardNuts_Burrow(EnGuardNuts* this, PlayState* play); void EnGuardNuts_SetupUnburrow(EnGuardNuts* this, PlayState* play); void EnGuardNuts_Unburrow(EnGuardNuts* this, PlayState* play); -const ActorInit En_Guard_Nuts_InitVars = { +ActorInit En_Guard_Nuts_InitVars = { ACTOR_EN_GUARD_NUTS, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.h b/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.h index 6f45691ad..8cbe26f03 100644 --- a/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.h +++ b/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.h @@ -29,6 +29,4 @@ typedef struct EnGuardNuts { /* 0x244 */ ColliderCylinder collider; } EnGuardNuts; // size = 0x290 -extern const ActorInit En_Guard_Nuts_InitVars; - #endif // Z_EN_GUARD_NUTS_H 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 a57effdcc..342415fec 100644 --- a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c +++ b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c @@ -27,7 +27,7 @@ void func_80BC7520(EnGuruguru* this, PlayState* play); extern ColliderCylinderInit D_80BC79A0; -const ActorInit En_Guruguru_InitVars = { +ActorInit En_Guruguru_InitVars = { ACTOR_EN_GURUGURU, ACTORCAT_NPC, FLAGS, @@ -88,12 +88,12 @@ void EnGuruguru_Init(Actor* thisx, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_1; this->actionFunc = EnGuruguru_DoNothing; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (this->actor.params == 1) { func_80BC6E10(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -321,11 +321,11 @@ void EnGuruguru_Update(Actor* thisx, PlayState* play) { if (!gSaveContext.save.isNight) { if (this->actor.params == 1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else if (this->actor.params == 0 || this->actor.params == 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.h b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.h index 0262cd41d..0158e3ddc 100644 --- a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.h +++ b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.h @@ -30,6 +30,4 @@ typedef struct EnGuruguru { /* 0x278 */ ColliderCylinder collider; } EnGuruguru; // size = 0x2C4 -extern const ActorInit En_Guruguru_InitVars; - #endif // Z_EN_GURUGURU_H diff --git a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c index 174c507d1..0e1d2f050 100644 --- a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c +++ b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c @@ -32,7 +32,7 @@ void func_80B22750(EnHakurock* this, PlayState* play); void func_80B228F4(Actor* thisx, PlayState* play); void EnHakurock_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Hakurock_InitVars = { +ActorInit En_Hakurock_InitVars = { ACTOR_EN_HAKUROCK, ACTORCAT_ITEMACTION, FLAGS, @@ -276,7 +276,8 @@ void func_80B22500(EnHakurock* this, PlayState* play) { (this->collider.base.oc->params == EN_HAKUROCK_TYPE_UNK_2))) { func_80B21EA4(this, 3); func_80B21FFC(this); - } else if ((&player->actor == this->collider.base.oc) && ((player->stateFlags3 & 0x81000) != 0) && + } else if ((&player->actor == this->collider.base.oc) && + (player->stateFlags3 & (PLAYER_STATE3_1000 | PLAYER_STATE3_80000)) && (player->linearVelocity > 8.0f)) { player->unk_B08[0] = player->linearVelocity = -5.0f; player->unk_B08[1] += (player->linearVelocity * 0.05f); @@ -352,7 +353,7 @@ void EnHakurock_Draw(Actor* thisx, PlayState* play) { func_8012C28C(play->state.gfxCtx); Matrix_Translate(-100.0f, 0.0f, 0.0f, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, object_boss_hakugin_DL_011100); - gSPDisplayList(POLY_OPA_DISP++, object_boss_hakugin_DL_011178); + gSPDisplayList(POLY_OPA_DISP++, gGohtStalactiteMaterialDL); + gSPDisplayList(POLY_OPA_DISP++, gGohtStalactiteModelDL); CLOSE_DISPS(play->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.h b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.h index 93931e9f3..4934c7fc8 100644 --- a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.h +++ b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.h @@ -22,6 +22,4 @@ typedef struct EnHakurock { /* 0x14C */ ColliderCylinder collider; } EnHakurock; // size = 0x198 -extern const ActorInit En_Hakurock_InitVars; - #endif // Z_EN_HAKUROCK_H diff --git a/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c b/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c index 6b354dd94..507bf9deb 100644 --- a/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c +++ b/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c @@ -21,7 +21,7 @@ void func_80B23910(EnHanabi* this, PlayState* play); void func_80B23934(EnHanabi* this, PlayState* play); void EnHanabi_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Hanabi_InitVars = { +ActorInit En_Hanabi_InitVars = { ACTOR_EN_HANABI, ACTORCAT_ITEMACTION, FLAGS, @@ -305,7 +305,7 @@ void func_80B236C8(EnHanabi* this, PlayState* play) { void func_80B23894(EnHanabi* this, PlayState* play) { func_80B236C8(this, play); if (func_80B22F34(this->unk_148) == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.h b/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.h index a219ab2ba..4c0c2e216 100644 --- a/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.h +++ b/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.h @@ -32,6 +32,4 @@ typedef struct EnHanabi { /* 0x4654 */ EnHanabiActionFunc actionFunc; } EnHanabi; // size = 0x4658 -extern const ActorInit En_Hanabi_InitVars; - #endif // Z_EN_HANABI_H diff --git a/src/overlays/actors/ovl_En_Hata/z_en_hata.c b/src/overlays/actors/ovl_En_Hata/z_en_hata.c index 5eb2292fc..4a01b663e 100644 --- a/src/overlays/actors/ovl_En_Hata/z_en_hata.c +++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.c @@ -16,7 +16,7 @@ void EnHata_Destroy(Actor* thisx, PlayState* play); void EnHata_Update(Actor* thisx, PlayState* play2); void EnHata_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Hata_InitVars = { +ActorInit En_Hata_InitVars = { ACTOR_EN_HATA, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_En_Hata/z_en_hata.h b/src/overlays/actors/ovl_En_Hata/z_en_hata.h index fc96f302a..155460f60 100644 --- a/src/overlays/actors/ovl_En_Hata/z_en_hata.h +++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.h @@ -17,6 +17,4 @@ typedef struct EnHata { /* 0x2A4 */ Vec3f unk_2A4; } EnHata; /* size = 0x2B0 */ -extern const ActorInit En_Hata_InitVars; - #endif // Z_EN_HATA_H diff --git a/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c b/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c index b69429d1a..c7fc4eea8 100644 --- a/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c +++ b/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c @@ -28,7 +28,7 @@ typedef enum { /* 4 */ HEISHI_ANIM_STAND_UP } EnHeishiAnimation; -const ActorInit En_Heishi_InitVars = { +ActorInit En_Heishi_InitVars = { ACTOR_EN_HEISHI, ACTORCAT_NPC, FLAGS, @@ -74,7 +74,7 @@ void EnHeishi_Init(Actor* thisx, PlayState* play) { this->shouldSetHeadRotation = 1; if (!(gSaveContext.save.weekEventReg[63] & 0x80) && !((gSaveContext.save.day == 3) && gSaveContext.save.isNight)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { this->colliderCylinder.dim.radius = 30; @@ -82,7 +82,7 @@ void EnHeishi_Init(Actor* thisx, PlayState* play) { this->colliderCylinder.dim.yShift = 0; if ((gSaveContext.save.weekEventReg[63] & 0x80) || ((gSaveContext.save.day == 3) && gSaveContext.save.isNight)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -152,22 +152,23 @@ void EnHeishi_Update(Actor* thisx, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; if ((this->paramsCopy != 0) && (gSaveContext.save.day == 3) && gSaveContext.save.isNight) { - Actor_MarkForDeath(&this->actor); - } else { - this->actionFunc(this, play); - Actor_MoveWithGravity(&this->actor); - Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 50.0f, 29); - Actor_SetScale(&this->actor, 0.01f); - if (this->shouldSetHeadRotation) { - EnHeishi_SetHeadRotation(this); - } - - Actor_SetFocus(&this->actor, 60.0f); - Math_SmoothStepToS(&this->headRotX, this->headRotXTarget, 1, 3000, 0); - Math_SmoothStepToS(&this->headRotY, this->headRotYTarget, 1, 1000, 0); - Collider_UpdateCylinder(&this->actor, &this->colliderCylinder); - CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinder.base); + Actor_Kill(&this->actor); + return; } + + this->actionFunc(this, play); + Actor_MoveWithGravity(&this->actor); + Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 50.0f, 29); + Actor_SetScale(&this->actor, 0.01f); + if (this->shouldSetHeadRotation) { + EnHeishi_SetHeadRotation(this); + } + + Actor_SetFocus(&this->actor, 60.0f); + Math_SmoothStepToS(&this->headRotX, this->headRotXTarget, 1, 3000, 0); + Math_SmoothStepToS(&this->headRotY, this->headRotYTarget, 1, 1000, 0); + Collider_UpdateCylinder(&this->actor, &this->colliderCylinder); + CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinder.base); } s32 EnHeishi_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { diff --git a/src/overlays/actors/ovl_En_Hg/z_en_hg.c b/src/overlays/actors/ovl_En_Hg/z_en_hg.c index 07b256487..38062e995 100644 --- a/src/overlays/actors/ovl_En_Hg/z_en_hg.c +++ b/src/overlays/actors/ovl_En_Hg/z_en_hg.c @@ -15,21 +15,38 @@ void EnHg_Destroy(Actor* thisx, PlayState* play); void EnHg_Update(Actor* thisx, PlayState* play); void EnHg_Draw(Actor* thisx, PlayState* play); -void func_80BCF354(EnHg* this); -void func_80BCF398(EnHg* this, PlayState* play); -void func_80BCF468(EnHg* this); -void func_80BCF468(EnHg* this); -void func_80BCF4AC(EnHg* this, PlayState* play); -void func_80BCF5F0(EnHg* this); -void func_80BCF634(EnHg* this, PlayState* play); -void func_80BCF68C(EnHg* this); -void func_80BCF6D0(EnHg* this, PlayState* play); -void func_80BCF8A0(EnHg* this, PlayState* play); -void func_80BCF93C(EnHg* this); -void func_80BCF95C(EnHg* this, PlayState* play); +void EnHg_SetupWait(EnHg* this); +void EnHg_Wait(EnHg* this, PlayState* play); +void EnHg_SetupChasePlayer(EnHg* this); +void EnHg_ChasePlayer(EnHg* this, PlayState* play); +void EnHg_SetupChasePlayerWait(EnHg* this); +void EnHg_ChasePlayerWait(EnHg* this, PlayState* play); +void EnHg_SetupReactToHit(EnHg* this); +void EnHg_ReactToHit(EnHg* this, PlayState* play); +void EnHg_PlayCutscene(EnHg* this, PlayState* play); +void EnHg_SetupCsAction(EnHg* this); +void EnHg_HandleCsAction(EnHg* this, PlayState* play); s32 EnHg_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); void EnHg_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); +typedef enum { + /* 0 */ HG_ANIM_IDLE, + /* 1 */ HG_ANIM_LURCH_FORWARD, + /* 2 */ HG_ANIM_RECOIL, + /* 3 */ HG_ANIM_LEAN_FORWARD, + /* 4 */ HG_ANIM_REACH_FORWARD, + /* 5 */ HG_ANIM_CURL_UP, + /* 6 */ HG_ANIM_CROUCHED_PANIC, + /* 7 */ HG_ANIM_PANIC, +} HgAnimation; + +typedef enum { + /* 0 */ HG_CS_FIRST_ENCOUNTER, + /* 1 */ HG_CS_GET_MASK, + /* 2 */ HG_CS_SUBSEQUENT_ENCOUNTER, + /* 3 */ HG_CS_SONG_OF_HEALING, +} HgCsIndex; + const ActorInit En_Hg_InitVars = { ACTOR_EN_HG, ACTORCAT_PROP, @@ -102,17 +119,17 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = { }; static AnimationInfo sAnimationInfo[] = { - { &object_harfgibud_Anim_00260C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, - { &object_harfgibud_Anim_009D44, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, - { &object_harfgibud_Anim_00A164, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, - { &object_harfgibud_Anim_000370, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, - { &object_harfgibud_Anim_001138, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_harfgibud_Anim_0015D4, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, - { &object_harfgibud_Anim_001960, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_harfgibud_Anim_00AE1C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gPamelasFatherIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &gPamelasFatherLurchForwardAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &gPamelasFatherRecoilFromHitAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &gPamelasFatherLeanForwardAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, + { &gPamelasFatherReachForwardAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gPamelasFatherCurlUpAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, + { &gPamelasFatherCrouchedPanicAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gPamelasFatherPanicAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, }; -static u32 D_80BD00C8 = false; +static u32 sHasSoundPlayed = false; void EnHg_Init(Actor* thisx, PlayState* play) { EnHg* this = THIS; @@ -120,13 +137,13 @@ void EnHg_Init(Actor* thisx, PlayState* play) { s32 i; ActorShape_Init(&this->actor.shape, 0.0f, NULL, 36.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gHarfgibudGibdoSkel, &object_harfgibud_Anim_00260C, this->jointTable, - this->morphTable, HARFGIBUD_GIBDO_LIMB_MAX); + SkelAnime_InitFlex(play, &this->skelAnime, &gPamelasFatherGibdoSkel, &gPamelasFatherIdleAnim, this->jointTable, + this->morphTable, PAMELAS_FATHER_GIBDO_LIMB_MAX); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2); if ((gSaveContext.save.weekEventReg[75] & 0x20) || (gSaveContext.save.weekEventReg[52] & 0x20)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actor.targetMode = 1; this->actor.colChkInfo.health = 0; @@ -138,7 +155,7 @@ void EnHg_Init(Actor* thisx, PlayState* play) { this->cutscenes[i] = currentCutscene; currentCutscene = ActorCutscene_GetAdditionalCutscene(currentCutscene); } - func_80BCF354(this); + EnHg_SetupWait(this); } void EnHg_Destroy(Actor* thisx, PlayState* play) { @@ -147,16 +164,16 @@ void EnHg_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->collider); } -void func_80BCF354(EnHg* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); - this->actionFunc = func_80BCF398; +void EnHg_SetupWait(EnHg* this) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, HG_ANIM_IDLE); + this->actionFunc = EnHg_Wait; } -void func_80BCF398(EnHg* this, PlayState* play) { +void EnHg_Wait(EnHg* this, PlayState* play) { if (this->actor.colChkInfo.health == 1) { if ((this->actor.xzDistToPlayer < 200.0f && this->actor.playerHeightRel < 40.0f) && !Cutscene_CheckActorAction(play, 0x1E3)) { - func_80BCF468(this); + EnHg_SetupChasePlayer(this); } if ((gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 0) && ((play->csCtx.frames == 20) || (play->csCtx.frames == 60))) { @@ -165,17 +182,17 @@ void func_80BCF398(EnHg* this, PlayState* play) { } } -void func_80BCF468(EnHg* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); - this->actionFunc = func_80BCF4AC; +void EnHg_SetupChasePlayer(EnHg* this) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, HG_ANIM_LURCH_FORWARD); + this->actionFunc = EnHg_ChasePlayer; } -void func_80BCF4AC(EnHg* this, PlayState* play) { +void EnHg_ChasePlayer(EnHg* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 pad; this->actor.speedXZ = 1.6f; - if (!(player->stateFlags2 & 0x08000000) && Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) { + if (!(player->stateFlags2 & PLAYER_STATE2_8000000) && Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) { if (((this->skelAnime.curFrame > 9.0f) && (this->skelAnime.curFrame < 16.0f)) || ((this->skelAnime.curFrame > 44.0f) && (this->skelAnime.curFrame < 51.0f))) { Actor_MoveWithGravity(&this->actor); @@ -184,38 +201,39 @@ void func_80BCF4AC(EnHg* this, PlayState* play) { } if ((Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) > 200.0f) && (Math_Vec3f_DistXZ(&player->actor.world.pos, &this->actor.home.pos) > 200.0f)) { - func_80BCF5F0(this); + EnHg_SetupChasePlayerWait(this); } } } -void func_80BCF5F0(EnHg* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); - this->actionFunc = func_80BCF634; +void EnHg_SetupChasePlayerWait(EnHg* this) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, HG_ANIM_IDLE); + this->actionFunc = EnHg_ChasePlayerWait; } -void func_80BCF634(EnHg* this, PlayState* play) { +void EnHg_ChasePlayerWait(EnHg* this, PlayState* play) { Player* player = GET_PLAYER(play); if (Math_Vec3f_DistXZ(&player->actor.world.pos, &this->actor.home.pos) < 200.0f) { - func_80BCF468(this); + EnHg_SetupChasePlayer(this); } } -void func_80BCF68C(EnHg* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); - this->actionFunc = func_80BCF6D0; +void EnHg_SetupReactToHit(EnHg* this) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, HG_ANIM_RECOIL); + this->actionFunc = EnHg_ReactToHit; } -void func_80BCF6D0(EnHg* this, PlayState* play) { +void EnHg_ReactToHit(EnHg* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - func_80BCF5F0(this); + EnHg_SetupChasePlayerWait(this); } } -void func_80BCF710(EnHg* this, PlayState* play) { +void EnHg_HandleTatlDialog(EnHg* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { + // "...Sort of looks different..." Message_StartTextbox(play, 0x24F, &this->actor); } else { func_800B8614(&this->actor, play, 80.0f); @@ -223,53 +241,53 @@ void func_80BCF710(EnHg* this, PlayState* play) { } } -void func_80BCF778(EnHg* this, PlayState* play) { +void EnHg_PlayRedeadSfx(EnHg* this, PlayState* play) { if (this->actor.colChkInfo.health == 1) { - if (this->actionFunc == func_80BCF4AC || this->actionFunc == func_80BCF6D0 || - this->actionFunc == func_80BCF634) { + if ((this->actionFunc == EnHg_ChasePlayer) || (this->actionFunc == EnHg_ReactToHit) || + (this->actionFunc == EnHg_ChasePlayerWait)) { func_800B9010(&this->actor, NA_SE_EN_HALF_REDEAD_LOOP - SFX_FLAG); } } } -void func_80BCF7D8(EnHg* this, PlayState* play) { - if (this->actor.colChkInfo.health) { +void EnHg_UpdateCollision(EnHg* this, PlayState* play) { + if (this->actor.colChkInfo.health != 0) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - func_80BCF68C(this); + EnHg_SetupReactToHit(this); } Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - if (this->actionFunc != func_80BCF6D0 && this->actionFunc != func_80BCF8A0 && - this->actionFunc != func_80BCF95C) { + if ((this->actionFunc != EnHg_ReactToHit) && (this->actionFunc != EnHg_PlayCutscene) && + (this->actionFunc != EnHg_HandleCsAction)) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } } } -void func_80BCF88C(EnHg* this) { - this->actionFunc = func_80BCF8A0; +void EnHg_SetupCutscene(EnHg* this) { + this->actionFunc = EnHg_PlayCutscene; } -void func_80BCF8A0(EnHg* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->cutscenes[this->unk218])) { - ActorCutscene_Start(this->cutscenes[this->unk218], &this->actor); - func_80BCF93C(this); +void EnHg_PlayCutscene(EnHg* this, PlayState* play) { + if (ActorCutscene_GetCanPlayNext(this->cutscenes[this->cutsceneIndex])) { + ActorCutscene_Start(this->cutscenes[this->cutsceneIndex], &this->actor); + EnHg_SetupCsAction(this); } else { if (ActorCutscene_GetCurrentIndex() == 0x7C) { ActorCutscene_Stop(0x7C); } - ActorCutscene_SetIntentToPlay(this->cutscenes[this->unk218]); + ActorCutscene_SetIntentToPlay(this->cutscenes[this->cutsceneIndex]); } } -void func_80BCF93C(EnHg* this) { +void EnHg_SetupCsAction(EnHg* this) { this->cutscenes[3] = 0x63; this->cutscenes[2] = 0; - this->actionFunc = func_80BCF95C; + this->actionFunc = EnHg_HandleCsAction; } -void func_80BCF95C(EnHg* this, PlayState* play) { +void EnHg_HandleCsAction(EnHg* this, PlayState* play) { if (Cutscene_CheckActorAction(play, 484)) { s32 actionIndex = Cutscene_GetActorActionIndex(play, 484); @@ -278,109 +296,129 @@ void func_80BCF95C(EnHg* this, PlayState* play) { switch (play->csCtx.actorActions[actionIndex]->action) { case 1: this->animIndex = 0; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, HG_ANIM_IDLE); break; + case 2: this->cutscenes[2] = 0; - this->animIndex = 3; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); + this->animIndex = HG_ANIM_LEAN_FORWARD; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, HG_ANIM_LEAN_FORWARD); break; + case 3: this->cutscenes[2] = 0; - this->animIndex = 5; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); + this->animIndex = HG_ANIM_CURL_UP; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, HG_ANIM_CURL_UP); break; + case 4: this->cutscenes[2] = 0; - this->animIndex = 7; - if ((this->unk218 == 1) || (this->unk218 == 3)) { + this->animIndex = HG_ANIM_PANIC; + if ((this->cutsceneIndex == HG_CS_GET_MASK) || (this->cutsceneIndex == HG_CS_SONG_OF_HEALING)) { func_8019F128(NA_SE_EN_HALF_REDEAD_TRANS); } - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 7); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, HG_ANIM_PANIC); break; + case 5: - this->animIndex = 1; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); + this->animIndex = HG_ANIM_LURCH_FORWARD; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, HG_ANIM_LURCH_FORWARD); break; + case 6: gSaveContext.save.weekEventReg[75] |= 0x20; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; } - } else { - if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - switch (this->animIndex) { - case 3: - this->animIndex = 4; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); - break; - case 5: - this->animIndex = 6; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6); - break; - } + } else if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { + switch (this->animIndex) { + case HG_ANIM_LEAN_FORWARD: + this->animIndex = HG_ANIM_REACH_FORWARD; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, HG_ANIM_REACH_FORWARD); + break; + + case HG_ANIM_CURL_UP: + this->animIndex = HG_ANIM_CROUCHED_PANIC; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, HG_ANIM_CROUCHED_PANIC); + break; } } + switch (this->animIndex) { - case 3: - case 4: + case HG_ANIM_LEAN_FORWARD: + case HG_ANIM_REACH_FORWARD: func_800B9010(&this->actor, NA_SE_EN_HALF_REDEAD_LOOP - SFX_FLAG); break; - case 5: - case 6: + + case HG_ANIM_CURL_UP: + case HG_ANIM_CROUCHED_PANIC: func_800B9010(&this->actor, NA_SE_EN_HALF_REDEAD_SCREAME - SFX_FLAG); break; - case 7: - if ((this->unk218 == 0) || (this->unk218 == 2)) { + + case HG_ANIM_PANIC: + if ((this->cutsceneIndex == HG_CS_FIRST_ENCOUNTER) || + (this->cutsceneIndex == HG_CS_SUBSEQUENT_ENCOUNTER)) { func_800B9010(&this->actor, NA_SE_EN_HALF_REDEAD_SCREAME - SFX_FLAG); } break; } + Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); return; + } else if (play->csCtx.state == 0) { - func_80BCF354(this); + EnHg_SetupWait(this); } + this->cutscenes[3] = 0x63; } -void func_80BCFC0C(EnHg* this, PlayState* play) { +void EnHg_WaitForPlayerAction(EnHg* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (this->actor.colChkInfo.health == 1 && !(fabsf(this->actor.playerHeightRel) >= 80.0f)) { - if (player->stateFlags2 & 0x08000000) { - if (!D_80BD00C8) { - play_sound(NA_SE_SY_TRE_BOX_APPEAR); - } - D_80BD00C8 = true; - } else { - D_80BD00C8 = false; + // If the player has gone upstairs this interaction will not trigger + if ((this->actor.colChkInfo.health != 1) || (fabsf(this->actor.playerHeightRel) >= 80.0f)) { + return; + } + + if (player->stateFlags2 & PLAYER_STATE2_8000000) { + if (!sHasSoundPlayed) { + play_sound(NA_SE_SY_TRE_BOX_APPEAR); } - if (play->msgCtx.ocarinaMode == 3) { - if (play->msgCtx.lastPlayedSong == OCARINA_SONG_HEALING && - gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) { - if (INV_CONTENT(ITEM_MASK_GIBDO) == ITEM_MASK_GIBDO) { - this->unk218 = 3; + sHasSoundPlayed = true; + } else { + sHasSoundPlayed = false; + } + + if (play->msgCtx.ocarinaMode == 3) { + if ((play->msgCtx.lastPlayedSong == OCARINA_SONG_HEALING) && + (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN)) { + if (INV_CONTENT(ITEM_MASK_GIBDO) == ITEM_MASK_GIBDO) { + this->cutsceneIndex = HG_CS_SONG_OF_HEALING; + } else { + this->cutsceneIndex = HG_CS_GET_MASK; + } + + EnHg_SetupCutscene(this); + } + + } else { + if ((this->actor.xzDistToPlayer < 60.0f) && (fabsf(this->actor.playerHeightRel) < 40.0f)) { + if ((this->actionFunc != EnHg_PlayCutscene) && (this->actionFunc != EnHg_HandleCsAction)) { + + if (!(gSaveContext.save.weekEventReg[61] & 2)) { + gSaveContext.save.weekEventReg[61] |= 2; + this->cutsceneIndex = HG_CS_FIRST_ENCOUNTER; } else { - this->unk218 = 1; + this->cutsceneIndex = HG_CS_SUBSEQUENT_ENCOUNTER; } - func_80BCF88C(this); + + EnHg_SetupCutscene(this); + return; } - } else { - if (this->actor.xzDistToPlayer < 60.0f && fabsf(this->actor.playerHeightRel) < 40.0f) { - if ((this->actionFunc != func_80BCF8A0) && (this->actionFunc != func_80BCF95C)) { - if (!(gSaveContext.save.weekEventReg[61] & 2)) { - gSaveContext.save.weekEventReg[61] |= 2; - this->unk218 = 0; - } else { - this->unk218 = 2; - } - func_80BCF88C(this); - return; - } - } - func_80BCF710(this, play); } + + EnHg_HandleTatlDialog(this, play); } } @@ -389,10 +427,10 @@ void EnHg_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); SkelAnime_Update(&this->skelAnime); - func_80BCF7D8(this, play); - func_80BCFC0C(this, play); + EnHg_UpdateCollision(this, play); + EnHg_WaitForPlayerAction(this, play); Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 25.0f, 0.0f, 5); - func_80BCF778(this, play); + EnHg_PlayRedeadSfx(this, play); } s32 EnHg_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { @@ -401,9 +439,9 @@ s32 EnHg_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po void EnHg_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { EnHg* this = THIS; - if (limbIndex == HARFGIBUD_GIBDO_LIMB_EYEBROWS) { - Matrix_Get(&this->unk1D8); - } else if (limbIndex == HARFGIBUD_GIBDO_LIMB_HEAD) { + if (limbIndex == PAMELAS_FATHER_GIBDO_LIMB_EYEBROWS) { + Matrix_Get(&this->mf); + } else if (limbIndex == PAMELAS_FATHER_GIBDO_LIMB_HEAD) { Matrix_MultZero(&this->actor.focus.pos); } } @@ -415,8 +453,8 @@ void EnHg_Draw(Actor* thisx, PlayState* play) { func_8012C28C(play->state.gfxCtx); SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnHg_OverrideLimbDraw, EnHg_PostLimbDraw, &this->actor); - Matrix_Put(&this->unk1D8); + Matrix_Put(&this->mf); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, gHarfgibudGibdoEyebrowsDL); + gSPDisplayList(POLY_OPA_DISP++, gPamelasFatherGibdoEyebrowsDL); CLOSE_DISPS(play->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Hg/z_en_hg.h b/src/overlays/actors/ovl_En_Hg/z_en_hg.h index c81d61d49..1211a4cf3 100644 --- a/src/overlays/actors/ovl_En_Hg/z_en_hg.h +++ b/src/overlays/actors/ovl_En_Hg/z_en_hg.h @@ -14,15 +14,13 @@ typedef struct EnHg { /* 0x144 */ ColliderCylinder collider; /* 0x190 */ SkelAnime skelAnime; /* 0x1D4 */ EnHgActionFunc actionFunc; - /* 0x1D8 */ MtxF unk1D8; - /* 0x218 */ s32 unk218; + /* 0x1D8 */ MtxF mf; + /* 0x218 */ s32 cutsceneIndex; /* 0x21C */ s32 animIndex; - /* 0x220 */ Vec3s jointTable[HARFGIBUD_GIBDO_LIMB_MAX]; - /* 0x292 */ Vec3s morphTable[HARFGIBUD_GIBDO_LIMB_MAX]; + /* 0x220 */ Vec3s jointTable[PAMELAS_FATHER_GIBDO_LIMB_MAX]; + /* 0x292 */ Vec3s morphTable[PAMELAS_FATHER_GIBDO_LIMB_MAX]; /* 0x304 */ UNK_TYPE1 pad304[0xC]; /* 0x310 */ u16 cutscenes[4]; } EnHg; // size = 0x318 -extern const ActorInit En_Hg_InitVars; - #endif // Z_EN_HG_H diff --git a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c index 53e4e91c3..56a88e45b 100644 --- a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c +++ b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c @@ -15,18 +15,39 @@ void EnHgo_Destroy(Actor* thisx, PlayState* play); void EnHgo_Update(Actor* thisx, PlayState* play); void EnHgo_Draw(Actor* thisx, PlayState* play); -void func_80BD03EC(EnHgo* this); -void func_80BD0410(EnHgo* this, PlayState* play); -void func_80BD0434(EnHgo* this, PlayState* play); -void func_80BD049C(EnHgo* this); -void func_80BD04E0(EnHgo* this, PlayState* play); +void EnHgo_SetupDoNothing(EnHgo* this); +void EnHgo_DoNothing(EnHgo* this, PlayState* play); +void EnHgo_UpdateCollision(EnHgo* this, PlayState* play); +void EnHgo_SetupTalk(EnHgo* this); +void EnHgo_Talk(EnHgo* this, PlayState* play); void EnHgo_SetupDialogueHandler(EnHgo* this); void EnHgo_DefaultDialogueHandler(EnHgo* this, PlayState* play); -void func_80BD06FC(EnHgo* this, PlayState* play); -s32 func_80BD0898(EnHgo* this, PlayState* play); +void EnHgo_HandlePlayerChoice(EnHgo* this, PlayState* play); +s32 EnHgo_HandleCsAction(EnHgo* this, PlayState* play); s32 EnHgo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); void EnHgo_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* pos, Actor* thisx); +#define TALK_FLAG_NONE 0 +#define TALK_FLAG_HAS_SPOKEN_WITH_HUMAN (1 << 0) +#define TALK_FLAG_HAS_SPOKEN_WITH_OTHER_MASK_FORM (1 << 1) +#define TALK_FLAG_HAS_SPOKEN_WITH_GIBDO_MASK (1 << 2) + +typedef enum { + /* 0 */ HGO_EYE_OPEN, + /* 1 */ HGO_EYE_HALF, + /* 2 */ HGO_EYE_CLOSED +} EyeState; + +typedef enum { + /* 0 */ HGO_ANIM_ARMS_FOLDED, + /* 1 */ HGO_ANIM_ASTONISHED, + /* 2 */ HGO_ANIM_KNEEL_DOWN_AND_HUG, + /* 3 */ HGO_ANIM_CONSOLE, + /* 4 */ HGO_ANIM_CONSOLE_HEAD_UP, + /* 5 */ HGO_ANIM_REACH_DOWN_TO_LIFT, + /* 6 */ HGO_ANIM_TOSS, +} HgoAnimation; + const ActorInit En_Hgo_InitVars = { ACTOR_EN_HGO, ACTORCAT_NPC, @@ -40,13 +61,13 @@ const ActorInit En_Hgo_InitVars = { }; static AnimationInfo sAnimationInfo[] = { - { &object_harfgibud_Anim_00B644, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, - { &object_harfgibud_Anim_013684, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_harfgibud_Anim_0152EC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, - { &object_harfgibud_Anim_015C70, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_harfgibud_Anim_0165F0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_harfgibud_Anim_014220, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, - { &object_harfgibud_Anim_014A9C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gPamelasFatherArmsFoldedAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &gPamelasFatherAstonishedAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gPamelasFatherKneelDownAndHugAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, + { &gPamelasFatherConsoleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gPamelasFatherConsoleHeadUpAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gPamelasFatherReachDownToLiftAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, + { &gPamelasFatherTossAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, }; static ColliderCylinderInit sCylinderInit = { @@ -71,33 +92,27 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static TexturePtr sEyeTextures[] = { - object_harfgibud_Tex_011138, - object_harfgibud_Tex_011938, - object_harfgibud_Tex_012138, -}; - void EnHgo_Init(Actor* thisx, PlayState* play) { - EnHgo* this = THIS; s32 pad; + EnHgo* this = THIS; ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 36.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gHarfgibudHumanSkel, &object_harfgibud_Anim_00B644, this->jointTable, - this->morphTable, HARFGIBUD_HUMAN_LIMB_MAX); + SkelAnime_InitFlex(play, &this->skelAnime, &gPamelasFatherHumanSkel, &gPamelasFatherArmsFoldedAnim, + this->jointTable, this->morphTable, PAMELAS_FATHER_HUMAN_LIMB_MAX); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&thisx->colChkInfo, NULL, &sColChkInfoInit); thisx->targetMode = 6; - this->unk_30C = 0; - this->unk_30E = 0; - this->unk_314 = 0; - this->unk_310 = 0; - this->unk_312 = 0; + this->eyeIndex = 0; + this->blinkTimer = 0; + this->textId = 0; + this->talkFlags = TALK_FLAG_NONE; + this->isInCutscene = false; if ((gSaveContext.save.weekEventReg[75] & 0x20) || (gSaveContext.save.weekEventReg[52] & 0x20)) { - func_80BD049C(this); + EnHgo_SetupTalk(this); } else { thisx->draw = NULL; - func_80BD03EC(this); + EnHgo_SetupDoNothing(this); } } @@ -107,59 +122,59 @@ void EnHgo_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->collider); } -void func_80BD03EC(EnHgo* this) { +void EnHgo_SetupDoNothing(EnHgo* this) { this->actor.flags &= ~ACTOR_FLAG_1; - this->actionFunc = func_80BD0410; + this->actionFunc = EnHgo_DoNothing; } -void func_80BD0410(EnHgo* this, PlayState* play) { +void EnHgo_DoNothing(EnHgo* this, PlayState* play) { } -void func_80BD0420(EnHgo* this) { - this->actionFunc = func_80BD0434; +void EnHgo_SetupInitCollision(EnHgo* this) { + this->actionFunc = EnHgo_UpdateCollision; } -void func_80BD0434(EnHgo* this, PlayState* play) { +void EnHgo_UpdateCollision(EnHgo* this, PlayState* play) { this->collider.dim.pos.x = this->actor.focus.pos.x; this->collider.dim.pos.y = this->actor.world.pos.y; this->collider.dim.pos.z = this->actor.focus.pos.z; CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } -void func_80BD049C(EnHgo* this) { +void EnHgo_SetupTalk(EnHgo* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); - this->actionFunc = func_80BD04E0; + this->actionFunc = EnHgo_Talk; } -void func_80BD04E0(EnHgo* this, PlayState* play) { +void EnHgo_Talk(EnHgo* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { if (Player_GetMask(play) == PLAYER_MASK_GIBDO) { - if (!(this->unk_310 & 4)) { - this->unk_310 |= 4; + if (!(this->talkFlags & TALK_FLAG_HAS_SPOKEN_WITH_GIBDO_MASK)) { + this->talkFlags |= TALK_FLAG_HAS_SPOKEN_WITH_GIBDO_MASK; Message_StartTextbox(play, 0x15A5, &this->actor); - this->unk_314 = 0x15A5; // That mask is a gibdo + this->textId = 0x15A5; // That mask is a gibdo } else { Message_StartTextbox(play, 0x15A7, &this->actor); - this->unk_314 = 0x15A7; // can I research that mask + this->textId = 0x15A7; // can I research that mask } } else if (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) { - if (!(this->unk_310 & 1)) { - this->unk_310 |= 1; + if (!(this->talkFlags & TALK_FLAG_HAS_SPOKEN_WITH_HUMAN)) { + this->talkFlags |= TALK_FLAG_HAS_SPOKEN_WITH_HUMAN; Message_StartTextbox(play, 0x158F, &this->actor); - this->unk_314 = 0x158F; // Isn't this a fairy + this->textId = 0x158F; // Isn't this a fairy } else { Message_StartTextbox(play, 0x1593, &this->actor); - this->unk_314 = 0x1593; // Never seen a fairy this lively + this->textId = 0x1593; // Never seen a fairy this lively } } else { - if (!(this->unk_310 & 2)) { - this->unk_310 |= 2; + if (!(this->talkFlags & TALK_FLAG_HAS_SPOKEN_WITH_OTHER_MASK_FORM)) { + this->talkFlags |= TALK_FLAG_HAS_SPOKEN_WITH_OTHER_MASK_FORM; Message_StartTextbox(play, 0x1595, &this->actor); - this->unk_314 = 0x1595; // ghost radar is reacting + this->textId = 0x1595; // ghost radar is reacting } else { Message_StartTextbox(play, 0x1598, &this->actor); - this->unk_314 = 0x1598; // you seem to be similar to a ghost + this->textId = 0x1598; // you seem to be similar to a ghost } } EnHgo_SetupDialogueHandler(this); @@ -182,12 +197,12 @@ void EnHgo_DefaultDialogueHandler(EnHgo* this, PlayState* play) { break; case TEXT_STATE_5: - func_80BD06FC(this, play); + EnHgo_HandlePlayerChoice(this, play); break; case TEXT_STATE_DONE: if (Message_ShouldAdvance(play)) { - func_80BD049C(this); + EnHgo_SetupTalk(this); } break; } @@ -196,109 +211,128 @@ void EnHgo_DefaultDialogueHandler(EnHgo* this, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; } -void func_80BD06FC(EnHgo* this, PlayState* play) { +// Handles the next dialogue based on player's selection +void EnHgo_HandlePlayerChoice(EnHgo* this, PlayState* play) { if (Message_ShouldAdvance(play)) { - switch (this->unk_314) { + switch (this->textId) { case 0x158F: Message_StartTextbox(play, 0x1590, &this->actor); - this->unk_314 = 0x1590; + this->textId = 0x1590; break; + case 0x1590: if (gSaveContext.save.weekEventReg[14] & 4) { Message_StartTextbox(play, 0x1591, &this->actor); - this->unk_314 = 0x1591; + this->textId = 0x1591; break; } + Message_StartTextbox(play, 0x1592, &this->actor); - this->unk_314 = 0x1592; + this->textId = 0x1592; break; + case 0x1591: Message_StartTextbox(play, 0x1592, &this->actor); - this->unk_314 = 0x1592; + this->textId = 0x1592; break; + case 0x1593: Message_StartTextbox(play, 0x1594, &this->actor); - this->unk_314 = 0x1594; + this->textId = 0x1594; break; + case 0x1595: Message_StartTextbox(play, 0x1596, &this->actor); - this->unk_314 = 0x1596; + this->textId = 0x1596; break; + case 0x1596: Message_StartTextbox(play, 0x1597, &this->actor); - this->unk_314 = 0x1597; + this->textId = 0x1597; break; + case 0x1598: Message_StartTextbox(play, 0x1599, &this->actor); - this->unk_314 = 0x1599; + this->textId = 0x1599; break; + case 0x15A5: Message_StartTextbox(play, 0x15A6, &this->actor); - this->unk_314 = 0x15A6; + this->textId = 0x15A6; break; + case 0x15A6: Message_StartTextbox(play, 0x15A7, &this->actor); - this->unk_314 = 0x15A7; + this->textId = 0x15A7; break; + case 0x15A7: func_801477B4(play); - func_80BD049C(this); + EnHgo_SetupTalk(this); break; } } } -s32 func_80BD0898(EnHgo* this, PlayState* play) { +s32 EnHgo_HandleCsAction(EnHgo* this, PlayState* play) { s32 actionIndex; if (Cutscene_CheckActorAction(play, 486)) { actionIndex = Cutscene_GetActorActionIndex(play, 486); - if (this->unk_316 != play->csCtx.actorActions[actionIndex]->action) { - this->unk_316 = play->csCtx.actorActions[actionIndex]->action; + if (this->csAction != play->csCtx.actorActions[actionIndex]->action) { + this->csAction = play->csCtx.actorActions[actionIndex]->action; switch (play->csCtx.actorActions[actionIndex]->action) { case 1: - this->unk_218 = 0; + this->animIndex = HGO_ANIM_ARMS_FOLDED; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); break; + case 2: this->actor.draw = EnHgo_Draw; - this->unk_218 = 1; + this->animIndex = HGO_ANIM_ASTONISHED; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); break; + case 3: - this->unk_218 = 2; + this->animIndex = HGO_ANIM_KNEEL_DOWN_AND_HUG; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); break; + case 4: - this->unk_218 = 3; + this->animIndex = HGO_ANIM_CONSOLE; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); break; + case 5: - this->unk_218 = 4; + this->animIndex = HGO_ANIM_CONSOLE_HEAD_UP; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); break; + case 6: - this->unk_218 = 5; + this->animIndex = HGO_ANIM_REACH_DOWN_TO_LIFT; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); break; } } else if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - switch (this->unk_218) { - case 1: - if ((Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) && (this->unk_312 == 0)) { - this->unk_312 = 1; + switch (this->animIndex) { + case HGO_ANIM_ASTONISHED: + if ((Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) && + (this->isInCutscene == false)) { + this->isInCutscene = true; if ((gSaveContext.sceneLayer == 0) && ((play->csCtx.currentCsIndex == 2) || (play->csCtx.currentCsIndex == 4))) { Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_GBVO02); } } break; - case 2: - this->unk_218 = 3; + + case HGO_ANIM_KNEEL_DOWN_AND_HUG: + this->animIndex = HGO_ANIM_CONSOLE; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); break; - case 5: - this->unk_218 = 6; + + case HGO_ANIM_REACH_DOWN_TO_LIFT: + this->animIndex = HGO_ANIM_TOSS; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6); } } @@ -306,30 +340,32 @@ s32 func_80BD0898(EnHgo* this, PlayState* play) { Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); return true; } + if ((play->csCtx.state == 0) && (((gSaveContext.save.weekEventReg[75]) & 0x20)) && - (this->actionFunc == func_80BD0410)) { + (this->actionFunc == EnHgo_DoNothing)) { this->actor.shape.rot.y = this->actor.world.rot.y; Actor_Spawn(&play->actorCtx, play, ACTOR_ELF_MSG2, this->actor.focus.pos.x, this->actor.focus.pos.y, this->actor.focus.pos.z, 7, 0, 0, 0x7F5A); - func_80BD0420(this); + EnHgo_SetupInitCollision(this); } - this->unk_316 = 0x63; + + this->csAction = 0x63; return false; } -void func_80BD0B8C(EnHgo* this, PlayState* play) { +void EnHgo_UpdateModel(EnHgo* this, PlayState* play) { Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); - if (this->unk_30E > 2) { - this->unk_30E--; - } else if (this->unk_30E == 2) { - this->unk_30C = 1; - this->unk_30E = 1; - } else if (this->unk_30E == 1) { - this->unk_30C = 2; - this->unk_30E = 0; + if (this->blinkTimer > 2) { + this->blinkTimer--; + } else if (this->blinkTimer == 2) { + this->eyeIndex = HGO_EYE_HALF; + this->blinkTimer = 1; + } else if (this->blinkTimer == 1) { + this->eyeIndex = HGO_EYE_CLOSED; + this->blinkTimer = 0; } else { - this->unk_30C = 0; - this->unk_30E = 60; + this->eyeIndex = HGO_EYE_OPEN; + this->blinkTimer = 60; } } @@ -339,13 +375,13 @@ void EnHgo_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); SkelAnime_Update(&this->skelAnime); - if (func_80BD0898(this, play)) { + if (EnHgo_HandleCsAction(this, play)) { Actor_TrackNone(&this->headRot, &this->torsoRot); - } else if (this->actionFunc != func_80BD0410) { - if (this->actionFunc != func_80BD0434) { + } else if (this->actionFunc != EnHgo_DoNothing) { + if (this->actionFunc != EnHgo_UpdateCollision) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - func_80BD0B8C(this, play); + EnHgo_UpdateModel(this, play); } } } @@ -353,7 +389,7 @@ void EnHgo_Update(Actor* thisx, PlayState* play) { s32 EnHgo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { EnHgo* this = THIS; - if (limbIndex == HARFGIBUD_HUMAN_LIMB_HEAD) { + if (limbIndex == PAMELAS_FATHER_HUMAN_LIMB_HEAD) { rot->x += this->headRot.y; rot->z += this->headRot.x; } @@ -363,22 +399,28 @@ s32 EnHgo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p void EnHgo_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* pos, Actor* thisx) { EnHgo* this = THIS; - if (limbIndex == HARFGIBUD_HUMAN_LIMB_HEAD) { - Matrix_Get(&this->unk_1D8); + if (limbIndex == PAMELAS_FATHER_HUMAN_LIMB_HEAD) { + Matrix_Get(&this->mf); Matrix_MultZero(&this->actor.focus.pos); } } +static TexturePtr sEyeTextures[] = { + gPamelasFatherHumanEyeOpenTex, + gPamelasFatherHumanEyeHalfTex, + gPamelasFatherHumanEyeClosedTex, +}; + void EnHgo_Draw(Actor* thisx, PlayState* play) { EnHgo* this = THIS; OPEN_DISPS(play->state.gfxCtx); func_8012C28C(play->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->unk_30C])); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeIndex])); SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnHgo_OverrideLimbDraw, &EnHgo_PostLimbDraw, &this->actor); - Matrix_Put(&this->unk_1D8); + Matrix_Put(&this->mf); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, gHarfgibudHumanEyebrowsDL); + gSPDisplayList(POLY_OPA_DISP++, gPamelasFatherHumanEyebrowsDL); CLOSE_DISPS(play->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.h b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.h index 34e4ebdc4..6882c1127 100644 --- a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.h +++ b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.h @@ -13,20 +13,18 @@ typedef struct EnHgo { /* 0x144 */ ColliderCylinder collider; /* 0x190 */ SkelAnime skelAnime; /* 0x1D4 */ EnHgoActionFunc actionFunc; - /* 0x1D8 */ MtxF unk_1D8; - /* 0x218 */ s32 unk_218; - /* 0x21C */ Vec3s jointTable[HARFGIBUD_HUMAN_LIMB_MAX]; - /* 0x28E */ Vec3s morphTable[HARFGIBUD_HUMAN_LIMB_MAX]; + /* 0x1D8 */ MtxF mf; + /* 0x218 */ s32 animIndex; + /* 0x21C */ Vec3s jointTable[PAMELAS_FATHER_HUMAN_LIMB_MAX]; + /* 0x28E */ Vec3s morphTable[PAMELAS_FATHER_HUMAN_LIMB_MAX]; /* 0x300 */ Vec3s headRot; /* 0x306 */ Vec3s torsoRot; // Set, but not used - /* 0x30C */ s16 unk_30C; - /* 0x30E */ s16 unk_30E; - /* 0x310 */ s16 unk_310; - /* 0x312 */ s16 unk_312; - /* 0x314 */ u16 unk_314; - /* 0x316 */ u16 unk_316; + /* 0x30C */ s16 eyeIndex; + /* 0x30E */ s16 blinkTimer; + /* 0x310 */ s16 talkFlags; + /* 0x312 */ s16 isInCutscene; + /* 0x314 */ u16 textId; + /* 0x316 */ u16 csAction; } EnHgo; // size = 0x318 -extern const ActorInit En_Hgo_InitVars; - #endif // Z_EN_HGO_H diff --git a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c index 81cb9850c..d8df99887 100644 --- a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c +++ b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c @@ -31,7 +31,7 @@ void func_80BDBB48(EnHiddenNuts* this, PlayState* play); void func_80BDBE70(EnHiddenNuts* this, PlayState* play); void func_80BDBED4(EnHiddenNuts* this, PlayState* play); -const ActorInit En_Hidden_Nuts_InitVars = { +ActorInit En_Hidden_Nuts_InitVars = { ACTOR_EN_HIDDEN_NUTS, ACTORCAT_PROP, FLAGS, @@ -95,12 +95,12 @@ void EnHiddenNuts_Init(Actor* thisx, PlayState* play) { } if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (this->unk_21E == 0x1F) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -147,7 +147,7 @@ void func_80BDB2B8(EnHiddenNuts* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NEMURI_SLEEP - SFX_FLAG); - if (player->stateFlags2 & 0x8000000) { + if (player->stateFlags2 & PLAYER_STATE2_8000000) { if (this->unk_20A == 0) { play_sound(NA_SE_SY_TRE_BOX_APPEAR); this->unk_20A = 1; @@ -313,7 +313,7 @@ void func_80BDBA28(EnHiddenNuts* this, PlayState* play) { this->unk_208 = 1; if ((this->path != NULL) && !SubS_CopyPointFromPath(this->path, this->unk_208, &this->unk_20C)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actor.speedXZ = 2.0f; @@ -377,7 +377,7 @@ void func_80BDBB48(EnHiddenNuts* this, PlayState* play) { if (this->unk_208 >= this->path->count) { func_80BDBE70(this, play); } else if ((this->path != NULL) && !SubS_CopyPointFromPath(this->path, this->unk_208, &this->unk_20C)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -402,7 +402,7 @@ void func_80BDBED4(EnHiddenNuts* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); EffectSsHahen_SpawnBurst(play, &sp38, 4.0f, 0, 10, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.h b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.h index a8edd1d75..e40a89193 100644 --- a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.h +++ b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.h @@ -33,6 +33,4 @@ typedef struct EnHiddenNuts { /* 0x234 */ ColliderCylinder collider; } EnHiddenNuts; // size = 0x280 -extern const ActorInit En_Hidden_Nuts_InitVars; - #endif // Z_EN_HIDDEN_NUTS_H diff --git a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c index 46a52a9fa..c07bbc5da 100644 --- a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c +++ b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c @@ -39,7 +39,7 @@ s32 func_80C21414(EnHintSkb* this); void func_80C21468(EnHintSkb* this, PlayState* play); void func_80C215E4(PlayState* play, EnHintSkb* this, Vec3f* arg2); -const ActorInit En_Hint_Skb_InitVars = { +ActorInit En_Hint_Skb_InitVars = { ACTOR_EN_HINT_SKB, ACTORCAT_NPC, FLAGS, @@ -330,7 +330,7 @@ void func_80C204F0(EnHintSkb* this, PlayState* play) { } Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x10); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_80C20540(EnHintSkb* this) { diff --git a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.h b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.h index 44fd8c4ef..22f72084d 100644 --- a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.h +++ b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.h @@ -32,6 +32,4 @@ typedef struct EnHintSkb { /* 0x3E9 */ u8 drawDmgEffType; } EnHintSkb; // size = 0x3EC -extern const ActorInit En_Hint_Skb_InitVars; - #endif // Z_EN_HINT_SKB_H diff --git a/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.c b/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.c index 17dfeb34e..c76d92106 100644 --- a/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.c +++ b/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.c @@ -16,7 +16,7 @@ void EnHitTag_Update(Actor* thisx, PlayState* play); void EnHitTag_WaitForHit(EnHitTag* this, PlayState* play); -const ActorInit En_Hit_Tag_InitVars = { +ActorInit En_Hit_Tag_InitVars = { ACTOR_EN_HIT_TAG, ACTORCAT_ITEMACTION, FLAGS, @@ -57,7 +57,7 @@ void EnHitTag_Init(Actor* thisx, PlayState* play) { Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); Collider_UpdateCylinder(&this->actor, &this->collider); if (Flags_GetSwitch(play, ENHITTAG_GET_SWITCHFLAG(thisx))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -73,7 +73,7 @@ void EnHitTag_WaitForHit(EnHitTag* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { play_sound(NA_SE_SY_GET_RUPY); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); dropLocation.x = this->actor.world.pos.x; dropLocation.y = this->actor.world.pos.y; dropLocation.z = this->actor.world.pos.z; diff --git a/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.h b/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.h index 0a1383e0a..e2effa078 100644 --- a/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.h +++ b/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.h @@ -15,6 +15,4 @@ typedef struct EnHitTag { /* 0x190 */ EnHitTagActionFunc actionFunc; } EnHitTag; // size = 0x194 -extern const ActorInit En_Hit_Tag_InitVars; - #endif // Z_EN_HIT_TAG_H diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.c b/src/overlays/actors/ovl_En_Holl/z_en_holl.c index 0e58e2b85..e7615d25f 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c @@ -57,7 +57,7 @@ void EnHoll_TransparentIdle(EnHoll* this, PlayState* play); void EnHoll_VerticalBgCoverIdle(EnHoll* this, PlayState* play); void EnHoll_RoomTransitionIdle(EnHoll* this, PlayState* play); -const ActorInit En_Holl_InitVars = { +ActorInit En_Holl_InitVars = { ACTOR_EN_HOLL, ACTORCAT_DOOR, FLAGS, @@ -155,7 +155,7 @@ void EnHoll_VisibleIdle(EnHoll* this, PlayState* play) { u32 zActorBitmask = D_801AED48[EN_HOLL_GET_Z_ACTOR_BITMASK_INDEX(&this->actor)]; if (!(actorCtxBitmask & zActorBitmask)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (this == sInstancePlayingSound) { @@ -310,7 +310,7 @@ void EnHoll_Update(Actor* thisx, PlayState* play) { Player* player = GET_PLAYER(play); if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF) && - !(player->stateFlags1 & 0x200)) { + !(player->stateFlags1 & PLAYER_STATE1_200)) { this->actionFunc(this, play); } } diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.h b/src/overlays/actors/ovl_En_Holl/z_en_holl.h index 39c35220c..e4d8791ba 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.h +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.h @@ -71,6 +71,4 @@ typedef struct EnHoll { #define EN_HOLL_SCALE_ALPHA(playerDistFromCentralPlane) ((playerDistFromCentralPlane - sTransparencyPlaneDistance) * (255 / (sTranslucencyPlaneDistance - sTransparencyPlaneDistance))) #define EN_HOLL_SCALE_BG_COVER_ALPHA(playerDistFromCentralPlane) ((EN_HOLL_ACTIVATION_PLANE_DISTANCE_VERTICAL - playerDistFromCentralPlane) * (255 / (EN_HOLL_ACTIVATION_PLANE_DISTANCE_VERTICAL - EN_HOLL_LOADING_PLANE_DISTANCE_VERTICAL))) -extern const ActorInit En_Holl_InitVars; - #endif // Z_EN_HOLL_H diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c index 9f6b6b98a..d57fb078b 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c @@ -31,7 +31,7 @@ void func_8092F7BC(EnHonotrap* this, PlayState* play); void func_8092F878(EnHonotrap* this, PlayState* play); #if 0 -const ActorInit En_Honotrap_InitVars = { +ActorInit En_Honotrap_InitVars = { ACTOR_EN_HONOTRAP, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h index bf4b08fd7..570269fe2 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h @@ -13,6 +13,4 @@ typedef struct EnHonotrap { /* 0x148 */ char unk_148[0x17C]; } EnHonotrap; // size = 0x2C4 -extern const ActorInit En_Honotrap_InitVars; - #endif // Z_EN_HONOTRAP_H diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index d822ba674..f8fff70fc 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -144,7 +144,7 @@ static SkeletonHeader* sSkeletonHeaders[] = { NULL, NULL, &object_horse_link_child_Skel_00A480, NULL, NULL, }; -const ActorInit En_Horse_InitVars = { +ActorInit En_Horse_InitVars = { ACTOR_EN_HORSE, ACTORCAT_BG, FLAGS, @@ -721,7 +721,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { this->unk_528 = 80.0f; this->boostSpeed = 12; if ((this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_HA)) < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->unk_1EC |= 1; @@ -743,7 +743,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { this->type = HORSE_TYPE_BANDIT; this->boostSpeed = 12; if ((this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_HA)) < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->unk_1EC |= 1; @@ -751,7 +751,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { } else { this->type = HORSE_TYPE_EPONA; this->boostSpeed = 15; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actor.params &= ~(ENHORSE_PARAM_DONKEY | ENHORSE_PARAM_4000 | ENHORSE_PARAM_BANDIT); @@ -879,7 +879,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { } else if (thisx->params == ENHORSE_14) { func_808846F0(this, play); if ((play->sceneId == SCENE_LOST_WOODS) && !Cutscene_IsPlaying(play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (thisx->params == ENHORSE_16) { func_8087C9F8(this); @@ -3271,7 +3271,7 @@ void func_80884604(EnHorse* this, PlayState* play, CsCmdActorAction* action) { } void func_808846B4(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_808846DC(EnHorse* this, PlayState* play, CsCmdActorAction* action) { diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c index 99d4eca14..7b2e349e7 100644 --- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c +++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c @@ -35,7 +35,7 @@ s32 func_808F99B0(EnHorseGameCheck* this, PlayState* play); s32 func_808F99C4(EnHorseGameCheck* this, PlayState* play); s32 func_808F99D8(EnHorseGameCheck* this, PlayState* play); -const ActorInit En_Horse_Game_Check_InitVars = { +ActorInit En_Horse_Game_Check_InitVars = { ACTOR_EN_HORSE_GAME_CHECK, ACTORCAT_BG, FLAGS, @@ -60,7 +60,7 @@ s32 func_808F8AA0(EnHorseGameCheck* this, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); if (GET_RACE_FLAGS != RACE_FLAG_START) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return false; } @@ -117,7 +117,7 @@ s32 func_808F8CCC(EnHorseGameCheck* this, PlayState* play2) { this->unk_174 = 0; if (GET_RACE_FLAGS != RACE_FLAG_START) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return false; } @@ -169,7 +169,7 @@ s32 func_808F8EB0(EnHorseGameCheck* this, PlayState* play) { } D_801BDA9C = 0; - if (player->stateFlags1 & 0x800000) { + if (player->stateFlags1 & PLAYER_STATE1_800000) { D_801BDAA0 = 1; } play->nextEntrance = ENTRANCE(GORMAN_TRACK, 2); diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h index f07aafc1d..52cdc2b64 100644 --- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h +++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h @@ -55,6 +55,4 @@ typedef struct EnHorseGameCheck { /* 0x180 */ UNK_TYPE1 pad180[0x38]; } EnHorseGameCheck; // size = 0x1B8 -extern const ActorInit En_Horse_Game_Check_InitVars; - #endif // Z_EN_HORSE_GAME_CHECK_H diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c index d5b23bdae..c02558a84 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c @@ -26,7 +26,7 @@ void func_808DF620(EnHorseLinkChild* this, PlayState* play); void func_808DF788(EnHorseLinkChild* this); void func_808DF838(EnHorseLinkChild* this, PlayState* play); -const ActorInit En_Horse_Link_Child_InitVars = { +ActorInit En_Horse_Link_Child_InitVars = { ACTOR_EN_HORSE_LINK_CHILD, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h index 660261ca2..62fac6a63 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h @@ -23,6 +23,4 @@ typedef struct EnHorseLinkChild { /* 0x298 */ UNK_TYPE1 unk298[4]; } EnHorseLinkChild; // size = 0x29C -extern const ActorInit En_Horse_Link_Child_InitVars; - #endif // Z_EN_HORSE_LINK_CHILD_H 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 5fec47594..cb6e58759 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -23,7 +23,7 @@ void EnHs_SceneTransitToBunnyHoodDialogue(EnHs* this, PlayState* play); void func_80953354(EnHs* this, PlayState* play); void func_8095345C(EnHs* this, PlayState* play); -const ActorInit En_Hs_InitVars = { +ActorInit En_Hs_InitVars = { ACTOR_EN_HS, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.h b/src/overlays/actors/ovl_En_Hs/z_en_hs.h index d72c72d15..79f94fd4b 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.h +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.h @@ -34,6 +34,4 @@ typedef struct EnHs { /* 0x394 */ EnHsActionFunc actionFunc; } EnHs; // size = 0x398 -extern const ActorInit En_Hs_InitVars; - #endif // Z_EN_HS_H diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c index a251dd113..8273d8789 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c @@ -17,7 +17,7 @@ void EnHs2_Draw(Actor* thisx, PlayState* play); void EnHs2_DoNothing(EnHs2* this, PlayState* play); -const ActorInit En_Hs2_InitVars = { +ActorInit En_Hs2_InitVars = { ACTOR_EN_HS2, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h index 2c7568235..69836605d 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h @@ -13,6 +13,4 @@ typedef struct EnHs2 { /* 0x394 */ EnHs2ActionFunc actionFunc; } EnHs2; // size = 0x398 -extern const ActorInit En_Hs2_InitVars; - #endif // Z_EN_HS2_H diff --git a/src/overlays/actors/ovl_En_Ig/z_en_ig.c b/src/overlays/actors/ovl_En_Ig/z_en_ig.c index bc1ca559b..af614450d 100644 --- a/src/overlays/actors/ovl_En_Ig/z_en_ig.c +++ b/src/overlays/actors/ovl_En_Ig/z_en_ig.c @@ -89,7 +89,7 @@ static s32 D_80BF33F0[] = { 0x10000000, }; -const ActorInit En_Ig_InitVars = { +ActorInit En_Ig_InitVars = { ACTOR_EN_IG, ACTORCAT_NPC, FLAGS, @@ -469,7 +469,7 @@ s32 func_80BF1B40(EnIg* this, PlayState* play) { u16 temp = play->msgCtx.currentTextId; s32 pad; - if (player->stateFlags1 & 0xC40) { + if (player->stateFlags1 & (PLAYER_STATE1_40 | PLAYER_STATE1_400 | PLAYER_STATE1_800)) { this->unk_3D0 |= 0x400; if (this->unk_3D2 != temp) { if ((this->unk_3FC == 2) || (this->unk_3FC == 3)) { diff --git a/src/overlays/actors/ovl_En_Ig/z_en_ig.h b/src/overlays/actors/ovl_En_Ig/z_en_ig.h index 5ff18dfef..c3fd0c3fb 100644 --- a/src/overlays/actors/ovl_En_Ig/z_en_ig.h +++ b/src/overlays/actors/ovl_En_Ig/z_en_ig.h @@ -62,6 +62,4 @@ typedef struct EnIg { /* 0x408 */ s32 unk_408; } EnIg; // size = 0x40C -extern const ActorInit En_Ig_InitVars; - #endif // Z_EN_IG_H diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 92f73dac5..4188f44c4 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -74,7 +74,7 @@ static Gfx* sIronKnuckleArmorType[3][3] = { { gIronKnuckleWhiteArmorMaterialDL, gIronKnuckleGoldArmorMaterialDL, gIronKnuckleGoldArmorMaterialDL }, }; -const ActorInit En_Ik_InitVars = { +ActorInit En_Ik_InitVars = { ACTOR_EN_IK, ACTORCAT_ENEMY, FLAGS, @@ -694,7 +694,7 @@ void EnIk_Die(EnIk* this, PlayState* play) { if (this->timer == 0) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0); ActorCutscene_Stop(this->actor.cutscene); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } else if (Animation_OnFrame(&this->skelAnime, 23.0f)) { diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.h b/src/overlays/actors/ovl_En_Ik/z_en_ik.h index a02c4845e..3489329b1 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.h +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.h @@ -48,6 +48,4 @@ typedef struct EnIk { /* 0x0550 */ IronKnuckleEffect effects[7]; } EnIk; // size = 0x668 -extern const ActorInit En_Ik_InitVars; - #endif // Z_EN_IK_H 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 e5f56d857..ba51fb858 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -22,7 +22,7 @@ void func_808F3690(EnIn* this, PlayState* play); void func_808F5A34(EnIn* this, PlayState* play); s32 func_808F5994(EnIn* this, PlayState* play, Vec3f* arg2, s16 arg3); -const ActorInit En_In_InitVars = { +ActorInit En_In_InitVars = { ACTOR_EN_IN, ACTORCAT_NPC, FLAGS, @@ -1421,7 +1421,7 @@ void EnIn_Init(Actor* thisx, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_KANBAN, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, 0xF); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_0); this->actionFunc = func_808F5A94; @@ -1429,14 +1429,14 @@ void EnIn_Init(Actor* thisx, PlayState* play) { } } else { if (gSaveContext.save.weekEventReg[52] & 1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { EnIn_ChangeAnim(&this->skelAnime, ENIN_ANIM_7); this->actionFunc = func_808F5B58; } } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } else { diff --git a/src/overlays/actors/ovl_En_In/z_en_in.h b/src/overlays/actors/ovl_En_In/z_en_in.h index 9221c94ce..dd32ac9c6 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.h +++ b/src/overlays/actors/ovl_En_In/z_en_in.h @@ -83,6 +83,4 @@ typedef struct EnIn { /* 0x4C0 */ s32 prevTalkState; } EnIn; // size = 0x4CC -extern const ActorInit En_In_InitVars; - #endif // Z_EN_IN_H diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index e985f6b5c..9eae19437 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -32,7 +32,7 @@ void func_8091B984(EnInsect* this, PlayState* play); s16 D_8091BD60 = 0; -const ActorInit En_Insect_InitVars = { +ActorInit En_Insect_InitVars = { ACTOR_EN_INSECT, ACTORCAT_ITEMACTION, FLAGS, @@ -310,7 +310,7 @@ void func_8091B2D8(EnInsect* this, PlayState* play) { this->actor.draw = EnInsect_Draw; } else if (this->unk_312 == 0) { if (this->unk_30C & 4) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -355,7 +355,7 @@ void func_8091B440(EnInsect* this, PlayState* play) { } if (this->unk_312 <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -436,7 +436,7 @@ void func_8091B984(EnInsect* this, PlayState* play) { } if (this->unk_312 <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.h b/src/overlays/actors/ovl_En_Insect/z_en_insect.h index ae8304cae..ea4025414 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.h +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.h @@ -25,6 +25,4 @@ typedef struct EnInsect { /* 0x316 */ s16 unk_316; } EnInsect; // size = 0x318 -extern const ActorInit En_Insect_InitVars; - #endif // Z_EN_INSECT_H 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 a0dbf7ca2..e669102a3 100644 --- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c +++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c @@ -178,7 +178,7 @@ void func_80B45B1C(EnInvadePohStruct* s, unkstructInvadepoh4** u); extern s32 D_801BDA9C; -const ActorInit En_Invadepoh_InitVars = { +ActorInit En_Invadepoh_InitVars = { ACTOR_EN_INVADEPOH, ACTORCAT_PROP, FLAGS, @@ -1688,7 +1688,7 @@ void EnInvadepoh_InitAlien(EnInvadepoh* this, PlayState* play) { } this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_UCH); if (this->bankIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1698,7 +1698,7 @@ void EnInvadepoh_InitParentCow(EnInvadepoh* this, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_INVADEPOH, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0x30); this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_COW); if (this->bankIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1707,7 +1707,7 @@ void EnInvadepoh_InitChildCow(EnInvadepoh* this, PlayState* play) { this->actor.update = func_80B481C4; this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_COW); if (this->bankIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1743,27 +1743,27 @@ void EnInvadepoh_InitRomani(EnInvadepoh* this, PlayState* play) { this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_MA1); if (this->bankIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (temp == 5) { if (gSaveContext.save.weekEventReg[22] & 1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else if (temp == 7) { if (gSaveContext.save.time < CLOCK_TIME(6, 0) && gSaveContext.save.time >= CLOCK_TIME(2, 15)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else if (temp != 8) { if (temp == 9) { if (gSaveContext.save.entrance != ENTRANCE(ROMANI_RANCH, 6)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else if (temp == 0xC) { if (!(gSaveContext.save.weekEventReg[22] & 1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } D_80B503F4 = this; } @@ -1784,7 +1784,7 @@ void func_80B468B4(EnInvadepoh* this, PlayState* play) { this->actor.world.pos.y += 1500.0f; func_80B49628(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1799,7 +1799,7 @@ void EnInvadepoh_InitDog(EnInvadepoh* this, PlayState* play) { ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 24.0f); this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_DOG); if (this->bankIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1815,10 +1815,10 @@ void EnInvadepoh_InitCremia(EnInvadepoh* this, PlayState* play) { ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 18.0f); this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_MA2); if (this->bankIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (!(gSaveContext.save.weekEventReg[22] & 1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } D_80B503F8 = this; } @@ -2297,7 +2297,7 @@ void func_80B47BAC(Actor* thisx, PlayState* play) { func_80B47568(this); } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -2313,7 +2313,7 @@ void func_80B47D30(Actor* thisx, PlayState* play) { thisx->gravity = 0.0f; func_80B47830(this); } else if ((this->actionFunc == func_80B474DC) || (this->actionFunc == func_80B473E4)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else if (this->collider.base.acFlags & AC_HIT) { @@ -2376,7 +2376,7 @@ void func_80B48060(Actor* thisx, PlayState* play) { MtxF unkMtx; if (D_80B503F0 == NULL || this->actor.parent == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -2416,7 +2416,7 @@ void func_80B4827C(Actor* thisx, PlayState* play) { EnInvadepoh* this = THIS; if (D_80B503F0 == NULL || this->actor.parent == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -2534,7 +2534,7 @@ void func_80B4873C(Actor* thisx, PlayState* play) { AlienBehaviorInfo* substruct = &this->behaviorInfo; if (this->actor.parent == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc(this, play); @@ -2940,7 +2940,7 @@ void func_80B4994C(EnInvadepoh* this, PlayState* play) { if (this->actionTimer > 0) { this->actionTimer--; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -3030,7 +3030,7 @@ void func_80B49C38(EnInvadepoh* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); } if (this->clockTime >= 0.9999f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -3103,7 +3103,7 @@ void func_80B49F88(Actor* thisx, PlayState* play) { this->actor.draw = func_80B4E324; func_80B49BD0(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -3654,7 +3654,7 @@ void func_80B4B8BC(Actor* thisx, PlayState* play) { } else if (D_80B4E940 == 1) { this->actor.update = func_80B4BA30; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if (!this) {} } } @@ -3788,7 +3788,7 @@ void func_80B4BC4C(EnInvadepoh* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); } if (gSaveContext.save.time > CLOCK_TIME(20, 15)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if ((temp_t6 != NULL) && (temp_t6->actionFunc == func_80B4CB0C)) { func_80B4C1BC(this); } @@ -3892,7 +3892,7 @@ void func_80B4C3A0(Actor* thisx, PlayState* play) { this->actor.draw = func_80B4E7BC; func_80B4BBE0(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -4003,7 +4003,7 @@ void func_80B4C730(EnInvadepoh* this, PlayState* play) { } if (this->clockTime >= 0.9999f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -4101,7 +4101,7 @@ void func_80B4CE54(Actor* thisx, PlayState* play) { this->actor.draw = func_80B4E324; func_80B4C6C8(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -4168,7 +4168,7 @@ void func_80B4D290(EnInvadepoh* this, PlayState* play) { f32 sp28; if (D_80B503F0 == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -4190,7 +4190,7 @@ void func_80B4D290(EnInvadepoh* this, PlayState* play) { } if (sp28 < 5.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -4257,7 +4257,7 @@ void func_80B4D480(EnInvadepoh* this, PlayState* play) { } if ((this->actionTimer <= 0) || sp2C) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.h b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.h index cafae5f23..061d9c326 100644 --- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.h +++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.h @@ -152,6 +152,4 @@ typedef struct EnInvadepoh { /* 0x3BC */ s8 unk3BC; } EnInvadepoh; // size = 0x3C0 -extern const ActorInit En_Invadepoh_InitVars; - #endif // Z_EN_INVADEPOH_H diff --git a/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c b/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c index 4391beecd..6a73eceec 100644 --- a/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c +++ b/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c @@ -23,7 +23,7 @@ void func_80C19EC0(EnInvadepohDemo* this, PlayState* play); void func_80C19F7C(EnInvadepohDemo* this, PlayState* play); #if 0 -const ActorInit En_Invadepoh_Demo_InitVars = { +ActorInit En_Invadepoh_Demo_InitVars = { ACTOR_EN_INVADEPOH_DEMO, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.h b/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.h index 35cbb4da9..ff13ca668 100644 --- a/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.h +++ b/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.h @@ -13,6 +13,4 @@ typedef struct EnInvadepohDemo { /* 0x148 */ char unk_148[0x180]; } EnInvadepohDemo; // size = 0x2C8 -extern const ActorInit En_Invadepoh_Demo_InitVars; - #endif // Z_EN_INVADEPOH_DEMO_H diff --git a/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.c b/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.c index d7bda5180..70f77b18a 100644 --- a/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.c +++ b/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.c @@ -18,7 +18,7 @@ void func_80C258A0(EnInvisibleRuppe* this, PlayState* play); void func_80C2590C(EnInvisibleRuppe* this, PlayState* play); void func_80C259E8(EnInvisibleRuppe* this, PlayState* play); -const ActorInit En_Invisible_Ruppe_InitVars = { +ActorInit En_Invisible_Ruppe_InitVars = { ACTOR_EN_INVISIBLE_RUPPE, ACTORCAT_NPC, FLAGS, @@ -86,7 +86,7 @@ void func_80C2590C(EnInvisibleRuppe* this, PlayState* play) { } void func_80C259E8(EnInvisibleRuppe* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void EnInvisibleRuppe_Init(Actor* thisx, PlayState* play) { @@ -100,7 +100,7 @@ void EnInvisibleRuppe_Init(Actor* thisx, PlayState* play) { } if ((this->unk_190 >= 0) && Flags_GetSwitch(play, this->unk_190)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.h b/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.h index 49d9bd6ef..5b6f6ca64 100644 --- a/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.h +++ b/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.h @@ -18,6 +18,4 @@ typedef struct EnInvisibleRuppe { /* 0x194 */ EnInvisibleRuppeActionFunc actionFunc; } EnInvisibleRuppe; // size = 0x198 -extern const ActorInit En_Invisible_Ruppe_InitVars; - #endif // Z_EN_INVISIBLE_RUPPE_H diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 5ebc15a02..f0d7f380a 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -44,7 +44,7 @@ static s16 D_8095F690 = 0; static s16 D_8095F694 = 0; -const ActorInit En_Ishi_InitVars = { +ActorInit En_Ishi_InitVars = { ACTOR_EN_ISHI, ACTORCAT_PROP, FLAGS, @@ -398,7 +398,7 @@ void EnIshi_Init(Actor* thisx, PlayState* play) { func_8095D6E0(&this->actor, play); if ((sp34 == 1) && Flags_GetSwitch(play, ENISHI_GET_FE00(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -415,7 +415,7 @@ void EnIshi_Init(Actor* thisx, PlayState* play) { this->actor.shape.yOffset = D_8095F6C0[sp34]; if ((sp30 == 0) && !func_8095D758(this, play, 0)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -425,7 +425,7 @@ void EnIshi_Init(Actor* thisx, PlayState* play) { this->unk_196 = Object_GetIndex(&play->objectCtx, D_8095F6E8[ENISHI_GET_8(&this->actor)]); if (this->unk_196 < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -490,7 +490,7 @@ void func_8095E660(EnIshi* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, D_8095F6D4[sp38], D_8095F6D0[sp38]); D_8095F6D8[sp38](&this->actor, play); D_8095F6E0[sp38](this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -604,7 +604,7 @@ void func_8095EBDC(EnIshi* this, PlayState* play) { Rumble_Request(this->actor.xyzDistToPlayerSq, 255, 20, 150); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -682,9 +682,9 @@ void func_8095F180(EnIshi* this) { void func_8095F194(EnIshi* this, PlayState* play) { if (this->actor.cutscene < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if (ActorCutscene_GetCurrentIndex() != this->actor.cutscene) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h index 080abbf4a..65381f638 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h @@ -28,6 +28,4 @@ typedef struct EnIshi { /* 0x197 */ u8 unk_197; } EnIshi; // size = 0x198 -extern const ActorInit En_Ishi_InitVars; - #endif // Z_EN_ISHI_H 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 f615c05fe..2a1e7f725 100644 --- a/src/overlays/actors/ovl_En_Ja/z_en_ja.c +++ b/src/overlays/actors/ovl_En_Ja/z_en_ja.c @@ -50,7 +50,7 @@ s32 D_80BC366C[] = { 0x0E29440C, 0x170E2945, 0x0C180E29, 0x460C170E, 0x29470C09, 0x0000180E, 0x293B0C09, 0x00001000, }; -const ActorInit En_Ja_InitVars = { +ActorInit En_Ja_InitVars = { ACTOR_EN_JA, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Ja/z_en_ja.h b/src/overlays/actors/ovl_En_Ja/z_en_ja.h index e2fd8287f..00746ec63 100644 --- a/src/overlays/actors/ovl_En_Ja/z_en_ja.h +++ b/src/overlays/actors/ovl_En_Ja/z_en_ja.h @@ -60,6 +60,4 @@ typedef struct EnJa { /* 0x374 */ s32 prevTalkState; } EnJa; // size = 0x378 -extern const ActorInit En_Ja_InitVars; - #endif // Z_EN_JA_H diff --git a/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c b/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c index ced184e68..181b88e4f 100644 --- a/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c +++ b/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c @@ -20,7 +20,7 @@ s32 EnJcMato_CheckForHit(EnJcMato* this, PlayState* play); void EnJcMato_SetupIdle(EnJcMato* this); void EnJcMato_Idle(EnJcMato* this, PlayState* play); -const ActorInit En_Jc_Mato_InitVars = { +ActorInit En_Jc_Mato_InitVars = { ACTOR_EN_JC_MATO, ACTORCAT_PROP, FLAGS, @@ -111,7 +111,7 @@ void EnJcMato_SetupIdle(EnJcMato* this) { void EnJcMato_Idle(EnJcMato* this, PlayState* play) { if (this->hitFlag) { if (DECR(this->despawnTimer) == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } diff --git a/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.h b/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.h index 165a768e2..f2c64c37c 100644 --- a/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.h +++ b/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.h @@ -16,6 +16,4 @@ typedef struct EnJcMato { /* 0x1A4 */ Vec3f pos; } EnJcMato; // size = 0x1B0 -extern const ActorInit En_Jc_Mato_InitVars; - #endif // Z_EN_JC_MATO_H diff --git a/src/overlays/actors/ovl_En_Jg/z_en_jg.c b/src/overlays/actors/ovl_En_Jg/z_en_jg.c index 60ebb2474..259d58b18 100644 --- a/src/overlays/actors/ovl_En_Jg/z_en_jg.c +++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.c @@ -64,7 +64,7 @@ typedef enum { /* 0x3 */ EN_JG_ACTION_LULLABY_INTRO_CS, } EnJgAction; -const ActorInit En_Jg_InitVars = { +ActorInit En_Jg_InitVars = { ACTOR_EN_JG, ACTORCAT_NPC, FLAGS, @@ -632,7 +632,7 @@ void EnJg_LullabyIntroCutsceneAction(EnJg* this, PlayState* play) { case 1: this->cutsceneAnimIndex = EN_JG_ANIM_CUTSCENE_IDLE; if (this->drum != NULL) { - Actor_MarkForDeath(this->drum); + Actor_Kill(this->drum); this->drum = NULL; } break; diff --git a/src/overlays/actors/ovl_En_Jg/z_en_jg.h b/src/overlays/actors/ovl_En_Jg/z_en_jg.h index 8564f8ad1..757a8bd86 100644 --- a/src/overlays/actors/ovl_En_Jg/z_en_jg.h +++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.h @@ -40,6 +40,4 @@ typedef struct EnJg { /* 0x3D0 */ u8 focusedShrineGoronParam; } EnJg; // size = 0x3D4 -extern const ActorInit En_Jg_InitVars; - #endif // Z_EN_JG_H diff --git a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c index f88e7c074..6f313f0d2 100644 --- a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c +++ b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c @@ -36,7 +36,7 @@ void func_80C147B4(EnJgameTsn* this, PlayState* play); s32 func_80C149B0(PlayState* play, EnJgameTsnStruct* arg1); s32 func_80C14BCC(EnJgameTsn* this, PlayState* play); -const ActorInit En_Jgame_Tsn_InitVars = { +ActorInit En_Jgame_Tsn_InitVars = { ACTOR_EN_JGAME_TSN, ACTORCAT_NPC, FLAGS, @@ -112,7 +112,7 @@ void func_80C13A2C(EnJgameTsn* this, PlayState* play) { s32 i; if (path == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } for (i = 0; i < ARRAY_COUNT(this->unk_1D8); i++) { @@ -121,7 +121,7 @@ void func_80C13A2C(EnJgameTsn* this, PlayState* play) { path = &play->setupPathList[path->unk1]; if (path == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -130,7 +130,7 @@ void func_80C13A2C(EnJgameTsn* this, PlayState* play) { path = &play->setupPathList[path->unk1]; if (path == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->unk_200.points = Lib_SegmentedToVirtual(path->points); @@ -189,7 +189,7 @@ void func_80C13BB8(EnJgameTsn* this, PlayState* play) { func_800B8614(&this->actor, play, 80.0f); } - if ((player->actor.bgCheckFlags & 1) && !(player->stateFlags1 & 0x2000) && (this->unk_2FE == 0) && + if ((player->actor.bgCheckFlags & 1) && !(player->stateFlags1 & PLAYER_STATE1_2000) && (this->unk_2FE == 0) && (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) && func_80C149B0(play, &this->unk_1F8)) { this->unk_2FE = 1; func_80C13E6C(this); @@ -282,7 +282,7 @@ void func_80C14044(EnJgameTsn* this, PlayState* play) { void func_80C1410C(EnJgameTsn* this, PlayState* play) { Player* player = GET_PLAYER(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; func_801A2BB8(0x25); play->interfaceCtx.unk_280 = 1; func_80112AFC(play); @@ -296,7 +296,7 @@ void func_80C1418C(EnJgameTsn* this, PlayState* play) { if (play->interfaceCtx.unk_280 == 8) { func_80C141DC(this); - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } } @@ -338,7 +338,7 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); Message_StartTextbox(play, 0x109F, &this->actor); this->unk_300 = 0x109F; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; *this->unk_208[this->unk_218] &= ~OBJLUPYGAMELIFT_IGNITE_FIRE; func_801A2C20(); func_80C14030(this); @@ -346,7 +346,7 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); Message_StartTextbox(play, 0x10A0, &this->actor); this->unk_300 = 0x10A0; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; *this->unk_208[this->unk_218] &= ~OBJLUPYGAMELIFT_IGNITE_FIRE; func_801A2C20(); func_80C14030(this); @@ -355,7 +355,7 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) { if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] == SECONDS_TO_TIMER(0)) { Message_StartTextbox(play, 0x10A1, &this->actor); this->unk_300 = 0x10A1; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; *this->unk_208[this->unk_218] &= ~OBJLUPYGAMELIFT_IGNITE_FIRE; func_801A2C20(); func_80C14030(this); diff --git a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.h b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.h index 5fdf911cc..c32a51565 100644 --- a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.h +++ b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.h @@ -37,6 +37,4 @@ typedef struct EnJgameTsn { /* 0x300 */ u16 unk_300; } EnJgameTsn; // size = 0x304 -extern const ActorInit En_Jgame_Tsn_InitVars; - #endif // Z_EN_JGAME_TSN_H 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 457f62d77..51296413e 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -27,7 +27,7 @@ void func_8096A104(EnJs* this, PlayState* play); void func_8096A38C(EnJs* this, PlayState* play); void func_8096A6F4(EnJs* this, PlayState* play); -const ActorInit En_Js_InitVars = { +ActorInit En_Js_InitVars = { ACTOR_EN_JS, ACTORCAT_NPC, FLAGS, @@ -60,7 +60,7 @@ static ColliderCylinderInit sCylinderInit = { }; static Gfx* D_8096ABCC[] = { - gMoonChildMajorasMaskDL, gMoonChildOdalwasMaskDL, gMoonChildGohtsMaskDL, + gMoonChildMajorasMaskDL, gMoonChildOdolwasMaskDL, gMoonChildGohtsMaskDL, gMoonChildGyorgsMaskDL, gMoonChildTwinmoldsMaskDL, }; @@ -126,7 +126,7 @@ void EnJs_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80969B5C; func_80968A5C(this); if (func_809692A8(ENJS_GET_TYPE(&this->actor) + 4)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.h b/src/overlays/actors/ovl_En_Js/z_en_js.h index 534557e66..4508e4944 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.h +++ b/src/overlays/actors/ovl_En_Js/z_en_js.h @@ -29,6 +29,4 @@ typedef struct EnJs { /* 0x2C4 */ EnJsActionFunc actionFunc; } EnJs; // size = 0x2C8 -extern const ActorInit En_Js_InitVars; - #endif // Z_EN_JS_H diff --git a/src/overlays/actors/ovl_En_Jso/z_en_jso.c b/src/overlays/actors/ovl_En_Jso/z_en_jso.c index 4baeaafa9..f36629d27 100644 --- a/src/overlays/actors/ovl_En_Jso/z_en_jso.c +++ b/src/overlays/actors/ovl_En_Jso/z_en_jso.c @@ -69,7 +69,7 @@ static DamageTable D_809B0F48 = { /* Powder Keg */ DMG_ENTRY(1, 0xF), }; -const ActorInit En_Jso_InitVars = { +ActorInit En_Jso_InitVars = { ACTOR_EN_JSO, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Jso/z_en_jso.h b/src/overlays/actors/ovl_En_Jso/z_en_jso.h index e2961c3ae..7f5db0757 100644 --- a/src/overlays/actors/ovl_En_Jso/z_en_jso.h +++ b/src/overlays/actors/ovl_En_Jso/z_en_jso.h @@ -14,6 +14,4 @@ typedef struct EnJso { /* 0x27C */ char unk_27C[0xD70]; } EnJso; // size = 0xFEC -extern const ActorInit En_Jso_InitVars; - #endif // Z_EN_JSO_H diff --git a/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c b/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c index 874cac6bd..b7ad94d93 100644 --- a/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c +++ b/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c @@ -71,7 +71,7 @@ static DamageTable D_80A7B4F0 = { /* Powder Keg */ DMG_ENTRY(1, 0xF), }; -const ActorInit En_Jso2_InitVars = { +ActorInit En_Jso2_InitVars = { ACTOR_EN_JSO2, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Jso2/z_en_jso2.h b/src/overlays/actors/ovl_En_Jso2/z_en_jso2.h index 30f7872d5..274aaa284 100644 --- a/src/overlays/actors/ovl_En_Jso2/z_en_jso2.h +++ b/src/overlays/actors/ovl_En_Jso2/z_en_jso2.h @@ -14,6 +14,4 @@ typedef struct EnJso2 { /* 0x027C */ char unk_27C[0xE14]; } EnJso2; // size = 0x1090 -extern const ActorInit En_Jso2_InitVars; - #endif // Z_EN_JSO2_H diff --git a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c index 6e4130576..3057328ce 100644 --- a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c +++ b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c @@ -51,7 +51,7 @@ static DamageTable D_80B8AB3C = { /* Powder Keg */ DMG_ENTRY(1, 0xE), }; -const ActorInit En_Kaizoku_InitVars = { +ActorInit En_Kaizoku_InitVars = { ACTOR_EN_KAIZOKU, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h index 8ef208926..cc282f19f 100644 --- a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h +++ b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h @@ -17,6 +17,4 @@ typedef struct EnKaizoku { /* 0x2F6 */ char unk_2F6[0x2FA]; } EnKaizoku; // size = 0x5F0 -extern const ActorInit En_Kaizoku_InitVars; - #endif // Z_EN_KAIZOKU_H diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index 3acbece16..4203feb6b 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -67,7 +67,7 @@ static ColliderCylinderInit D_80971D80 = { { 20, 70, 0, { 0, 0, 0 } }, }; -const ActorInit En_Kakasi_InitVars = { +ActorInit En_Kakasi_InitVars = { ACTOR_EN_KAKASI, ACTORCAT_NPC, FLAGS, @@ -308,12 +308,12 @@ void EnKakasi_TimeSkipDialogue(EnKakasi* this, PlayState* play) { this->picto.actor.textId = 0x1653; gSaveContext.save.weekEventReg[83] &= (u8)~1; this->talkState = TEXT_STATE_5; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->picto.actor.flags |= ACTOR_FLAG_10000; } if (Actor_ProcessTalkRequest(&this->picto.actor, &play->state)) { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->unkState196 = 2; this->picto.actor.flags &= ~ACTOR_FLAG_10000; this->actionFunc = EnKakasi_RegularDialogue; diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h index 59ef3272a..c278ef050 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h @@ -40,8 +40,6 @@ typedef struct EnKakasi { /* 0x254 */ ColliderCylinder collider; } EnKakasi; // size = 0x2A0 -extern const ActorInit En_Kakasi_InitVars; - #define ENKAKASI_ABOVE_GROUND_TYPE 2 #define KAKASI_GET_SUMMON_DISTANCE(thisx) (((thisx)->params >> 0x8) & 0xFF) diff --git a/src/overlays/actors/ovl_En_Kame/z_en_kame.c b/src/overlays/actors/ovl_En_Kame/z_en_kame.c index c1ea3ae46..6e021186f 100644 --- a/src/overlays/actors/ovl_En_Kame/z_en_kame.c +++ b/src/overlays/actors/ovl_En_Kame/z_en_kame.c @@ -41,7 +41,7 @@ void func_80AD8364(EnKame* this); void func_80AD8388(EnKame* this, PlayState* play); void func_80AD8D64(Actor* thisx, PlayState* play); -const ActorInit En_Kame_InitVars = { +ActorInit En_Kame_InitVars = { ACTOR_EN_KAME, ACTORCAT_ENEMY, FLAGS, @@ -197,7 +197,7 @@ void func_80AD70EC(EnKame* this, PlayState* play) { this->unk_2A0 = 40; } - if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & 0x800000) && + if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & PLAYER_STATE1_800000) && (this->actor.xzDistToPlayer < 240.0f)) { func_80AD73A8(this); } else if (SkelAnime_Update(&this->skelAnime1)) { @@ -218,7 +218,7 @@ void func_80AD71B4(EnKame* this) { void func_80AD7254(EnKame* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & 0x800000) && + if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & PLAYER_STATE1_800000) && (this->actor.xzDistToPlayer < 240.0f)) { func_80AD73A8(this); return; @@ -257,7 +257,7 @@ void func_80AD7424(EnKame* this, PlayState* play) { Player* player = GET_PLAYER(play); if (SkelAnime_Update(&this->skelAnime1)) { - if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & 0x800000) && + if ((Player_GetMask(play) != PLAYER_MASK_STONE) && !(player->stateFlags1 & PLAYER_STATE1_800000) && ((this->unk_29E == 0) || (this->actor.xzDistToPlayer < 120.0f))) { func_80AD76CC(this); } else { @@ -600,7 +600,7 @@ void func_80AD8388(EnKame* this, PlayState* play) { this->actor.scale.x -= 0.001f; if (this->actor.scale.x <= 0.0f) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x60); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->actor.scale.y = this->actor.scale.x; this->actor.scale.z = this->actor.scale.x; diff --git a/src/overlays/actors/ovl_En_Kame/z_en_kame.h b/src/overlays/actors/ovl_En_Kame/z_en_kame.h index 6e0aa371b..b6ebc3a23 100644 --- a/src/overlays/actors/ovl_En_Kame/z_en_kame.h +++ b/src/overlays/actors/ovl_En_Kame/z_en_kame.h @@ -33,6 +33,4 @@ typedef struct EnKame { /* 0x340 */ ColliderCylinder collider; } EnKame; // size = 0x38C -extern const ActorInit En_Kame_InitVars; - #endif // Z_EN_KAME_H diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index 5113c1291..54df1bcd7 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -17,7 +17,7 @@ void EnKanban_Destroy(Actor* thisx, PlayState* play); void EnKanban_Update(Actor* thisx, PlayState* play); void EnKanban_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Kanban_InitVars = { +ActorInit En_Kanban_InitVars = { ACTOR_EN_KANBAN, ACTORCAT_PROP, FLAGS, @@ -277,7 +277,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { piece->partFlags = sCutFlags[this->cutType] & this->partFlags; if (piece->partFlags == 0) { - Actor_MarkForDeath(&piece->actor); + Actor_Kill(&piece->actor); return; } @@ -673,7 +673,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { signpost = (EnKanban*)this->actor.parent; if (signpost->partFlags == 0xFFFF) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } phi_f0 = 0.0f; @@ -852,7 +852,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { signpost->invincibilityTimer = 5; if (signpost->partFlags == 0xFFFF) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Matrix_RotateYS(signpost->actor.shape.rot.y, MTXMODE_NEW); @@ -876,7 +876,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { (this->floorRot.z == 0.0f)) { signpost->partFlags |= this->partFlags; signpost->actor.flags |= ACTOR_FLAG_1; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h index 201364bc0..e54bb3fad 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h @@ -105,6 +105,4 @@ typedef struct EnKanban { #define ENKANBAN_PIECE ((s16)0xFFDD) #define ENKANBAN_FISHING 0x300 -extern const ActorInit En_Kanban_InitVars; - #endif // Z_EN_KANBAN_H diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index 61c1c5b3c..46ad2c30b 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -40,7 +40,7 @@ void func_808F238C(EnKarebaba* this); void func_808F241C(EnKarebaba* this, PlayState* play); void func_808F254C(EnKarebaba* this, PlayState* play); -const ActorInit En_Karebaba_InitVars = { +ActorInit En_Karebaba_InitVars = { ACTOR_EN_KAREBABA, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h index 9d41245e6..5063a8dbe 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h @@ -30,6 +30,4 @@ typedef struct EnKarebaba { /* 0x27C */ ColliderCylinder collider2; } EnKarebaba; // size = 0x2C8 -extern const ActorInit En_Karebaba_InitVars; - #endif // Z_EN_KAREBABA_H diff --git a/src/overlays/actors/ovl_En_Kbt/z_en_kbt.c b/src/overlays/actors/ovl_En_Kbt/z_en_kbt.c index 78d903207..d2847a39d 100644 --- a/src/overlays/actors/ovl_En_Kbt/z_en_kbt.c +++ b/src/overlays/actors/ovl_En_Kbt/z_en_kbt.c @@ -22,7 +22,7 @@ Actor* func_80B3403C(PlayState* play); void func_80B34314(EnKbt* this, PlayState* play); void func_80B34598(EnKbt* this, PlayState* play); -const ActorInit En_Kbt_InitVars = { +ActorInit En_Kbt_InitVars = { ACTOR_EN_KBT, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Kbt/z_en_kbt.h b/src/overlays/actors/ovl_En_Kbt/z_en_kbt.h index dbbb96e76..eb491bf28 100644 --- a/src/overlays/actors/ovl_En_Kbt/z_en_kbt.h +++ b/src/overlays/actors/ovl_En_Kbt/z_en_kbt.h @@ -23,6 +23,4 @@ typedef struct EnKbt { /* 0x288 */ EnKbtActionFunc actionFunc; } EnKbt; // size = 0x28C -extern const ActorInit En_Kbt_InitVars; - #endif // Z_EN_KBT_H diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index d90bdf93d..8a3176bad 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -37,7 +37,7 @@ s32 func_80B278C4(PlayState* play, Vec3f arg1); void func_80B279F0(EnKendoJs* this, PlayState* play, s32 arg2); void func_80B27A90(EnKendoJs* this, PlayState* play); -const ActorInit En_Kendo_Js_InitVars = { +ActorInit En_Kendo_Js_InitVars = { ACTOR_EN_KENDO_JS, ACTORCAT_NPC, FLAGS, @@ -117,12 +117,12 @@ void EnKendoJs_Init(Actor* thisx, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_KANBAN, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z - 10.0f, this->actor.home.rot.x, this->actor.home.rot.y, this->actor.home.rot.z, 0x10); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); } } else if (ENKENDOJS_GET_FF(&this->actor) == ENKENDOJS_FF_1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 4); @@ -281,7 +281,7 @@ void func_80B269A4(EnKendoJs* this, PlayState* play) { case 0x2719: func_801477B4(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; func_80B2701C(this); break; @@ -298,7 +298,7 @@ void func_80B269A4(EnKendoJs* this, PlayState* play) { case 0x273B: func_801477B4(play); func_80112AFC(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; func_80B273D0(this); break; @@ -337,7 +337,7 @@ void func_80B26AFC(EnKendoJs* this, PlayState* play) { gSaveContext.minigameState = 3; } - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; func_80B26538(this); } @@ -358,18 +358,18 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) { return 0; } - if ((player->meleeWeaponState != 0) || (player->stateFlags3 & 0x8000000) || - (player->stateFlags2 & 0x80000)) { + if ((player->meleeWeaponState != 0) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + (player->stateFlags2 & PLAYER_STATE2_80000)) { return 1; } break; case 1: - if ((player->stateFlags3 & 0x8000000)) { + if ((player->stateFlags3 & PLAYER_STATE3_8000000)) { return 0; } - if ((player->meleeWeaponState != 0) || (player->stateFlags2 & 0x80000)) { + if ((player->meleeWeaponState != 0) || (player->stateFlags2 & PLAYER_STATE2_80000)) { return 1; } break; @@ -379,8 +379,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) { return 0; } - if ((player->meleeWeaponState != 0) || (player->stateFlags3 & 0x8000000) || - (player->stateFlags2 & 0x80000)) { + if ((player->meleeWeaponState != 0) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + (player->stateFlags2 & PLAYER_STATE2_80000)) { return 1; } this->unk_28E = 0; @@ -393,7 +393,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) { return 0; } - if ((this->unk_28E == 1) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) { + if ((this->unk_28E == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + (player->stateFlags2 & PLAYER_STATE2_80000)) { this->unk_28E = 0; return 1; } @@ -406,7 +407,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) { return 0; } - if ((this->unk_28E == 1) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) { + if ((this->unk_28E == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + (player->stateFlags2 & PLAYER_STATE2_80000)) { this->unk_28E = 0; return 1; } @@ -418,7 +420,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) { return 0; } - if ((this->unk_28E == 1) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) { + if ((this->unk_28E == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + (player->stateFlags2 & PLAYER_STATE2_80000)) { this->unk_28E = 0; return 1; } @@ -431,7 +434,8 @@ s32 func_80B26BF8(EnKendoJs* this, PlayState* play) { return 0; } - if ((this->unk_28E == 1) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) { + if ((this->unk_28E == 1) || (player->stateFlags3 & PLAYER_STATE3_8000000) || + (player->stateFlags2 & PLAYER_STATE2_80000)) { this->unk_28E = 0; return 1; } @@ -488,7 +492,7 @@ void func_80B27030(EnKendoJs* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_10000; if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actor.flags &= ~ACTOR_FLAG_10000; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; func_80B279F0(this, play, 0); Message_StartTextbox(play, 0x271A, &this->actor); this->unk_288 = 0x271A; @@ -520,7 +524,7 @@ void func_80B27188(EnKendoJs* this, PlayState* play) { } this->unk_286 = 2; func_801477B4(play); - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } } else if (this->unk_286 == 2) { this->unk_286 = 1; @@ -531,14 +535,14 @@ void func_80B27188(EnKendoJs* this, PlayState* play) { case 0: this->unk_286 = 0; Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; func_80B26EB4(this, play); break; case 1: Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_ERROR); this->unk_286 = 0; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; Message_StartTextbox(play, 0x2729, &this->actor); this->unk_288 = 0x2729; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); @@ -583,7 +587,7 @@ void func_80B2740C(EnKendoJs* this, PlayState* play) { if (func_80B278C4(play, sp18)) { this->unk_28C = 0; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->actionFunc = func_80B274BC; } } @@ -600,7 +604,7 @@ void func_80B274BC(EnKendoJs* this, PlayState* play) { Message_StartTextbox(play, 0x272E, &this->actor); this->unk_288 = 0x272E; } - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; gSaveContext.save.weekEventReg[82] &= (u8)~8; func_80B26AE8(this); return; @@ -623,7 +627,7 @@ void func_80B274BC(EnKendoJs* this, PlayState* play) { (player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_FINISH)) { play->interfaceCtx.unk_25C = 3; if (gSaveContext.minigameScore >= 27) { - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; } } else if (player->meleeWeaponAnimation == PLAYER_MWA_STAB_1H) { play->interfaceCtx.unk_25C = 2; @@ -668,7 +672,7 @@ void func_80B27774(EnKendoJs* this, PlayState* play) { this->unk_288 = 0x2730; } func_80B26AE8(this); - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } else { func_800B85E0(&this->actor, play, 1000.0f, -1); } diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h index 2d49058e8..1992f7234 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h @@ -32,6 +32,4 @@ typedef struct EnKendoJs { /* 0x292 */ u8 unk_292; } EnKendoJs; // size = 0x294 -extern const ActorInit En_Kendo_Js_InitVars; - #endif // Z_EN_KENDO_JS_H diff --git a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c index c9349b2c5..62b529b3d 100644 --- a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c +++ b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c @@ -31,7 +31,7 @@ void func_80B425A0(EnKgy* this, PlayState* play); void func_80B42714(EnKgy* this, PlayState* play); void func_80B42D28(EnKgy* this, PlayState* play); -const ActorInit En_Kgy_InitVars = { +ActorInit En_Kgy_InitVars = { ACTOR_EN_KGY, ACTORCAT_NPC, FLAGS, @@ -1149,10 +1149,10 @@ void func_80B43074(EnKgy* this, PlayState* play) { gSPMatrix(gfx, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); if (func_80B40D8C(play)) { - gSPDisplayList(&gfx[1], gameplay_keep_DL_001D00); + gSPDisplayList(&gfx[1], gRazorSwordHandleDL); gSPDisplayList(&gfx[2], object_kgy_DL_00F180); } else { - gSPDisplayList(&gfx[1], gameplay_keep_DL_0021A8); + gSPDisplayList(&gfx[1], gKokiriSwordHandleDL); gSPDisplayList(&gfx[2], object_kgy_DL_00E8F0); } POLY_OPA_DISP = &gfx[3]; diff --git a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.h b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.h index ce7deceb4..d9423783d 100644 --- a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.h +++ b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.h @@ -38,6 +38,4 @@ typedef struct EnKgy { /* 0x304 */ EnKgyActionFunc actionFunc; } EnKgy; // size = 0x308 -extern const ActorInit En_Kgy_InitVars; - #endif // Z_EN_KGY_H diff --git a/src/overlays/actors/ovl_En_Kitan/z_en_kitan.c b/src/overlays/actors/ovl_En_Kitan/z_en_kitan.c index f928c2393..c9d40c1e7 100644 --- a/src/overlays/actors/ovl_En_Kitan/z_en_kitan.c +++ b/src/overlays/actors/ovl_En_Kitan/z_en_kitan.c @@ -15,7 +15,7 @@ void EnKitan_Destroy(Actor* thisx, PlayState* play); void EnKitan_Update(Actor* thisx, PlayState* play); #if 0 -const ActorInit En_Kitan_InitVars = { +ActorInit En_Kitan_InitVars = { ACTOR_EN_KITAN, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Kitan/z_en_kitan.h b/src/overlays/actors/ovl_En_Kitan/z_en_kitan.h index 2ef14c942..9d2ae096b 100644 --- a/src/overlays/actors/ovl_En_Kitan/z_en_kitan.h +++ b/src/overlays/actors/ovl_En_Kitan/z_en_kitan.h @@ -13,6 +13,4 @@ typedef struct EnKitan { /* 0x2D8 */ EnKitanActionFunc actionFunc; } EnKitan; // size = 0x2DC -extern const ActorInit En_Kitan_InitVars; - #endif // Z_EN_KITAN_H diff --git a/src/overlays/actors/ovl_En_Knight/z_en_knight.c b/src/overlays/actors/ovl_En_Knight/z_en_knight.c index 17d0e3752..0d80d6020 100644 --- a/src/overlays/actors/ovl_En_Knight/z_en_knight.c +++ b/src/overlays/actors/ovl_En_Knight/z_en_knight.c @@ -193,7 +193,7 @@ static ColliderCylinderInit D_809BDC64 = { { 20, 40, 0, { 0, 0, 0 } }, }; -const ActorInit En_Knight_InitVars = { +ActorInit En_Knight_InitVars = { ACTOR_EN_KNIGHT, ACTORCAT_BOSS, FLAGS, diff --git a/src/overlays/actors/ovl_En_Knight/z_en_knight.h b/src/overlays/actors/ovl_En_Knight/z_en_knight.h index 167a96682..2d413fea3 100644 --- a/src/overlays/actors/ovl_En_Knight/z_en_knight.h +++ b/src/overlays/actors/ovl_En_Knight/z_en_knight.h @@ -26,6 +26,4 @@ typedef struct EnKnight { /* 0x68C */ char pad68C[0x48]; } EnKnight; // size = 0x6D4 -extern const ActorInit En_Knight_InitVars; - #endif // Z_EN_KNIGHT_H diff --git a/src/overlays/actors/ovl_En_Kujiya/z_en_kujiya.c b/src/overlays/actors/ovl_En_Kujiya/z_en_kujiya.c index df95a6988..e15d20fc8 100644 --- a/src/overlays/actors/ovl_En_Kujiya/z_en_kujiya.c +++ b/src/overlays/actors/ovl_En_Kujiya/z_en_kujiya.c @@ -34,7 +34,7 @@ void EnKujiya_TurnToOpen(EnKujiya* this, PlayState* play); void EnKujiya_SetupTurnToClosed(EnKujiya* this); void EnKujiya_TurnToClosed(EnKujiya* this, PlayState* play); -const ActorInit En_Kujiya_InitVars = { +ActorInit En_Kujiya_InitVars = { ACTOR_EN_KUJIYA, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Kujiya/z_en_kujiya.h b/src/overlays/actors/ovl_En_Kujiya/z_en_kujiya.h index 69fad156e..5d449963b 100644 --- a/src/overlays/actors/ovl_En_Kujiya/z_en_kujiya.h +++ b/src/overlays/actors/ovl_En_Kujiya/z_en_kujiya.h @@ -14,6 +14,4 @@ typedef struct EnKujiya { /* 0x14A */ s16 textId; } EnKujiya; // size = 0x14C -extern const ActorInit En_Kujiya_InitVars; - #endif // Z_EN_KUJIYA_H diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index 2ab13422a..5b0e813ab 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -57,7 +57,7 @@ s16 D_80936CDC; s16 D_80936CDE; s16 D_80936CE0; -const ActorInit En_Kusa_InitVars = { +ActorInit En_Kusa_InitVars = { ACTOR_EN_KUSA, ACTORCAT_PROP, FLAGS, @@ -385,7 +385,7 @@ void EnKusa_Init(Actor* thisx, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; } if (!EnKusa_SnapToFloor(this, play, 0.0f)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (EnKusa_GetWaterBox(this, play)) { @@ -394,7 +394,7 @@ void EnKusa_Init(Actor* thisx, PlayState* play) { this->objIndex = Object_GetIndex(&play->objectCtx, objectIds[(KUSA_GET_TYPE(&this->actor))]); if (this->objIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -470,12 +470,12 @@ void EnKusa_WaitForInteract(EnKusa* this, PlayState* play) { } } if (KUSA_GET_TYPE(&this->actor) == ENKUSA_TYPE_BUSH) { - Actor_MarkForDeath(&this->actor); - } else { - EnKusa_SetupCut(this); - this->isCut = true; + Actor_Kill(&this->actor); + return; } + EnKusa_SetupCut(this); + this->isCut = true; } else { if (!(this->collider.base.ocFlags1 & OC1_TYPE_PLAYER) && (this->actor.xzDistToPlayer > 12.0f)) { this->collider.base.ocFlags1 |= OC1_TYPE_PLAYER; @@ -560,7 +560,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) { switch (KUSA_GET_TYPE(&this->actor)) { case ENKUSA_TYPE_BUSH: case ENKUSA_TYPE_GRASS: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; case ENKUSA_TYPE_REGROWING_GRASS: diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h index eca474d5f..56f55af3e 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h @@ -25,8 +25,6 @@ typedef struct EnKusa { /* 0x198 */ u8 isInWater; } EnKusa; // size = 0x19C -extern const ActorInit En_Kusa_InitVars; - #define KUSA_GET_COLLECTIBLE_ID(thisx) (((thisx)->params >> 8) & 0x7F) #define KUSA_GET_RAND_COLLECTIBLE_ID(thisx) (((thisx)->params >> 8) & 0xF) #define KUSA_SHOULD_SPAWN_BUGS(thisx) (((thisx)->params >> 0x4) & 1) diff --git a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c index fdf3cc9ac..4b8c36c2c 100644 --- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c +++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c @@ -44,16 +44,16 @@ void func_80A5E6F0(Actor* thisx, PlayState* play); void func_80A5E9B4(Actor* thisx, PlayState* play); void func_80A5EA48(Actor* thisx, PlayState* play); -static EnKusa2UnkBssStruct D_80A5F1C0; -static u32 D_80A60900; -static MtxF D_80A60908[8]; -static s16 D_80A60B08; -static s16 D_80A60B0A; -static s16 D_80A60B0C; -static s16 D_80A60B0E; -static s16 D_80A60B10; +EnKusa2UnkBssStruct D_80A5F1C0; +u32 D_80A60900; +MtxF D_80A60908[8]; +s16 D_80A60B08; +s16 D_80A60B0A; +s16 D_80A60B0C; +s16 D_80A60B0E; +s16 D_80A60B10; -const ActorInit En_Kusa2_InitVars = { +ActorInit En_Kusa2_InitVars = { ACTOR_EN_KUSA2, ACTORCAT_PROP, FLAGS, @@ -85,11 +85,11 @@ static ColliderCylinderInit sCylinderInit = { { 6, 44, 0, { 0, 0, 0 } }, }; -static u8 D_80A5EAEC = 1; -static s16 D_80A5EAF0 = 0; -static Vec3s D_80A5EAF4 = { 0, 0, 0 }; -static Vec3s D_80A5EAFC = { 0, 0, 0 }; -static Vec3s D_80A5EB04 = { 0, 0, 0 }; +u8 D_80A5EAEC = 1; +s16 D_80A5EAF0 = 0; +Vec3s D_80A5EAF4 = { 0, 0, 0 }; +Vec3s D_80A5EAFC = { 0, 0, 0 }; +Vec3s D_80A5EB04 = { 0, 0, 0 }; void func_80A5B160(EnKusa2* this, PlayState* play) { s32 i; @@ -136,7 +136,7 @@ void func_80A5B334(EnKusa2* this, PlayState* play) { if (*ptr != NULL) { if (!Actor_HasParent(&(*ptr)->actor, play)) { - Actor_MarkForDeath(&(*ptr)->actor); + Actor_Kill(&(*ptr)->actor); } *ptr = NULL; } @@ -379,7 +379,7 @@ s32 func_80A5BFD8(EnKusa2* this, PlayState* play) { func_80A5BD14(this, play, (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1000000) ? 1 : 0); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN); func_80A5BD94(this); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } return false; @@ -878,18 +878,19 @@ void EnKusa2_Init(Actor* thisx, PlayState* play) { } else { Collider_InitCylinder(play, &this->collider); if (!func_80A5BA58(this, play)) { - Actor_MarkForDeath(&this->actor); - } else { - Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); - Collider_UpdateCylinder(&this->actor, &this->collider); - this->actor.colChkInfo.mass = MASS_IMMOVABLE; - this->unk_1CE = D_80A5EAF0 & 7; - D_80A5EAF0++; - this->actor.shape.shadowAlpha = 0; - this->unk_1CF = 255; - this->actor.shape.shadowScale = 1.0f; - func_80A5D7A4(this); + Actor_Kill(&this->actor); + return; } + + Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); + Collider_UpdateCylinder(&this->actor, &this->collider); + this->actor.colChkInfo.mass = MASS_IMMOVABLE; + this->unk_1CE = D_80A5EAF0 & 7; + D_80A5EAF0++; + this->actor.shape.shadowAlpha = 0; + this->unk_1CF = 255; + this->actor.shape.shadowScale = 1.0f; + func_80A5D7A4(this); } } @@ -1096,7 +1097,7 @@ void func_80A5DC98(EnKusa2* this, PlayState* play) { } else if (this->unk_1CA > 0) { this->unk_1CA--; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -1241,7 +1242,7 @@ void func_80A5E210(EnKusa2* this, PlayState* play) { if (this->unk_1B8 != NULL) { this->unk_1B8->unk_28 = func_80A5C718; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1273,7 +1274,7 @@ void func_80A5E4BC(EnKusa2* this, PlayState* play) { this->unk_1CF -= 15; if (this->unk_1CF <= 15) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.h b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.h index eb8276ac6..f1245dd50 100644 --- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.h +++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.h @@ -81,6 +81,4 @@ typedef struct EnKusa2 { /* 0x1D1 */ s8 unk_1D1; } EnKusa2; // size = 0x1D4 -extern const ActorInit En_Kusa2_InitVars; - #endif // Z_EN_KUSA2_H diff --git a/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c b/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c index 85e57c550..6eac82838 100644 --- a/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c +++ b/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c @@ -15,8 +15,41 @@ void EnLiftNuts_Destroy(Actor* thisx, PlayState* play); void EnLiftNuts_Update(Actor* thisx, PlayState* play); void EnLiftNuts_Draw(Actor* thisx, PlayState* play); -#if 0 -const ActorInit En_Lift_Nuts_InitVars = { +void func_80AEA910(EnLiftNuts* this, PlayState* play); + +s32 func_80AE9B8C(void); +void func_80AE9F28(EnLiftNuts* this); +void func_80AE9F70(EnLiftNuts* this, PlayState* play); +void func_80AEA044(EnLiftNuts* this, PlayState* play); +void func_80AEA0B4(EnLiftNuts* this); +void func_80AEA128(EnLiftNuts* this, PlayState* play); +void func_80AEA1A0(EnLiftNuts* this, PlayState* play); +void func_80AEABF0(EnLiftNuts* this); +void func_80AEAC64(EnLiftNuts* this, PlayState* play); +void func_80AEACF8(EnLiftNuts* this, PlayState* play); +void func_80AEAEAC(EnLiftNuts* this); +void func_80AEAF14(EnLiftNuts* this, PlayState* play); +void func_80AEAF8C(EnLiftNuts* this); +void func_80AEAFA0(EnLiftNuts* this, PlayState* play); +void func_80AEB114(EnLiftNuts* this); +void func_80AEB148(EnLiftNuts* this, PlayState* play); +void func_80AEB1C8(EnLiftNuts* this); +void func_80AEB230(EnLiftNuts* this, PlayState* play); +void func_80AEB280(EnLiftNuts* this); +void func_80AEB294(EnLiftNuts* this, PlayState* play); +void func_80AEB3E0(EnLiftNuts* this, PlayState* play); +void func_80AEB428(EnLiftNuts* this, PlayState* play); +void func_80AEB584(EnLiftNuts* this); +void func_80AEB598(EnLiftNuts* this, PlayState* play); +void func_80AEB684(EnLiftNuts* this); +void func_80AEB698(EnLiftNuts* this, PlayState* play); +void func_80AEB828(EnLiftNuts* this); +void func_80AEB8A4(EnLiftNuts* this, PlayState* play); +void func_80AEB934(EnLiftNuts* this, PlayState* play); +void func_80AEB974(EnLiftNuts* this); +void func_80AEB9E0(EnLiftNuts* this, PlayState* play); + +ActorInit En_Lift_Nuts_InitVars = { ACTOR_EN_LIFT_NUTS, ACTORCAT_NPC, FLAGS, @@ -28,111 +61,956 @@ const ActorInit En_Lift_Nuts_InitVars = { (ActorFunc)EnLiftNuts_Draw, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80AEBF28 = { - { COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, }, +static AnimationInfo sAnimations[] = { + { &object_dnt_Anim_005488, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &object_dnt_Anim_00B0B4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &object_dnt_Anim_004AA0, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &object_dnt_Anim_0029E8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &object_dnt_Anim_005CA8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, + { &object_dnt_Anim_0038CC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &object_dnt_Anim_003CC0, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, + { &object_dnt_Anim_0012F4, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &object_dnt_Anim_004700, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &object_dnt_Anim_001BC8, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &object_dnt_Anim_003438, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -2.0f }, + { &object_dnt_Anim_001E2C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &object_dnt_Anim_000994, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &object_dnt_Anim_002268, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, + { &object_dnt_Anim_002F08, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &object_dnt_Anim_00577C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &object_dnt_Anim_004E38, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &object_dnt_Anim_0029E8, 1.0f, 4.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &object_dnt_Anim_0029E8, 1.0f, 8.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, +}; + +Gfx* D_80AEBF18[] = { + object_dnt_DL_008290, + object_dnt_DL_001350, + object_dnt_DL_001420, + NULL, +}; + +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 25, 75, 0, { 0, 0, 0 } }, }; -// sColChkInfoInit -static CollisionCheckInfoInit2 D_80AEBF54 = { 0, 0, 0, 0, MASS_IMMOVABLE }; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -#endif +void func_80AE9A20(EnLiftNuts* this, PlayState* play) { + static s16 D_80AEBF60 = 0; + static s32 D_80AEBF64 = false; -extern ColliderCylinderInit D_80AEBF28; -extern CollisionCheckInfoInit2 D_80AEBF54; + if (!D_80AEBF64) { + func_800B6584(play, ACTOR_EN_GAMELUPY, &D_80AEBF60, sizeof(s16)); + D_80AEBF64 = true; + } + this->ptr_1EC = &D_80AEBF60; +} -extern UNK_TYPE D_060029E8; +void func_80AE9A80(EnLiftNuts* this, PlayState* play) { + static s16 D_80AEBF68 = false; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AE9A20.s") + if (!D_80AEBF68) { + func_800B6608(play, ACTOR_EN_GAMELUPY); + D_80AEBF68 = true; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AE9A80.s") +s32 func_80AE9AC4(EnLiftNuts* this, s32 arg1) { + static s32 D_80AEBF6C = 0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AE9AC4.s") + switch (arg1) { + case 0: + if (D_80AEBF6C == 0) { + return true; + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AE9B4C.s") + case 1: + if (D_80AEBF6C == 0) { + this->unk_34E = 1; + D_80AEBF6C = 1; + return true; + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AE9B8C.s") + case 2: + if (D_80AEBF6C == 1) { + this->unk_34E = 0; + D_80AEBF6C = 0; + return true; + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AE9BCC.s") + default: + break; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/EnLiftNuts_Init.s") +s32 func_80AE9B4C(s32 arg0, s32 arg1) { + static s32 D_80AEBF70 = 0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/EnLiftNuts_Destroy.s") + if (arg0 == 0) { + if (D_80AEBF70 == arg1) { + return true; + } + } else if (arg0 == 1) { + D_80AEBF70 = arg1; + return true; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AE9F28.s") +s32 func_80AE9B8C() { + s32 ret = 0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AE9F70.s") + if (gSaveContext.save.weekEventReg[14] & 0x10) { + ret = 1; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AE9FC8.s") + if (gSaveContext.save.weekEventReg[14] & 0x20) { + ret++; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEA044.s") + if (gSaveContext.save.weekEventReg[14] & 0x40) { + ret++; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEA0B4.s") + return ret; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEA128.s") +void func_80AE9BCC(EnLiftNuts* this, PlayState* play) { + if ((this->actionFunc != func_80AEB934) && (this->actionFunc != func_80AEB8A4) && + (this->actionFunc != func_80AEACF8) && (this->actionFunc != func_80AEAC64) && + (this->actionFunc != func_80AEA044) && (this->actionFunc != func_80AEB598) && + (this->actionFunc != func_80AEB698) && !func_80AE9B4C(0, 3) && (func_80AE9B8C() == 3) && + (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) && (this->actor.xzDistToPlayer < 150.0f)) { + func_80AEB828(this); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEA1A0.s") +void EnLiftNuts_Init(Actor* thisx, PlayState* play) { + EnLiftNuts* this = THIS; + Path* path; + Vec3s* pathPos; + s32 pad; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEA7A4.s") + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); + SkelAnime_InitFlex(play, &this->skelAnime, &object_dnt_Skel_00AC70, &object_dnt_Anim_0029E8, this->jointTable, + this->morphTable, OBJECT_DNT_LIMB_MAX); + Collider_InitCylinder(play, &this->collider); + Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); + Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 4); + if (this->actor.floorBgId != BGCHECK_SCENE) { + DynaPolyActor* bgActor = DynaPoly_GetActor(&play->colCtx, this->actor.floorBgId); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEA910.s") + if (bgActor != NULL) { + this->actor.world.pos = bgActor->actor.world.pos; + this->actor.home.pos = bgActor->actor.world.pos; + } + } + this->actor.targetMode = 0; + this->unk_354 = 0; + this->unk_34E = 0; + this->unk_356 = 0; + this->unk_1E4 = 0; + this->unk_1E8 = 0; + this->actor.gravity = -2.0f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEABF0.s") + path = &play->setupPathList[ENLIFTNUTS_GET_FF00(&this->actor)]; + pathPos = Lib_SegmentedToVirtual(path->points); + this->vec_1D8.x = pathPos->x; + this->vec_1D8.y = pathPos->y; + this->vec_1D8.z = pathPos->z; + func_80AE9A20(this, play); + if (!Flags_GetSwitch(play, 0x41)) { + func_80AE9B4C(1, 0); + func_80AE9F28(this); + } else if (func_80AE9AC4(this, 0)) { + Player* player = GET_PLAYER(play); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEAC64.s") + player->stateFlags1 |= PLAYER_STATE1_20; + func_80AE9AC4(this, 1); + func_80AE9B4C(1, 3); + func_80AEA0B4(this); + } else { + func_80AE9F28(this); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEACF8.s") +void EnLiftNuts_Destroy(Actor* thisx, PlayState* play) { + EnLiftNuts* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEAEAC.s") + Collider_DestroyCylinder(play, &this->collider); + func_80AE9A80(this, play); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEAF14.s") +void func_80AE9F28(EnLiftNuts* this) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 18); + this->actionFunc = func_80AE9F70; + this->unk_354 = 0; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEAF8C.s") +void func_80AE9F70(EnLiftNuts* this, PlayState* play) { + if (this->unk_354 < 40) { + this->unk_354++; + } else if (this->actor.xzDistToPlayer < 100.0f) { + func_80AEA0B4(this); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEAFA0.s") +void func_80AE9FC8(EnLiftNuts* this) { + if (this->actionFunc == func_80AEA1A0) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 17); + } else { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB114.s") + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + this->actionFunc = func_80AEA044; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB148.s") +void func_80AEA044(EnLiftNuts* this, PlayState* play) { + if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { + func_80AE9F28(this); + } else if (Animation_OnFrame(&this->skelAnime, 5.0f)) { + func_80AEB9E0(this, play); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB1C8.s") +void func_80AEA0B4(EnLiftNuts* this) { + if (func_80AE9B4C(0, 1)) { + this->actionFunc = func_80AEA1A0; + } else { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + this->actionFunc = func_80AEA128; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB230.s") +void func_80AEA128(EnLiftNuts* this, PlayState* play) { + if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 15); + this->actionFunc = func_80AEA1A0; + } else if (Animation_OnFrame(&this->skelAnime, 8.0f)) { + func_80AEB9E0(this, play); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB280.s") +void func_80AEA1A0(EnLiftNuts* this, PlayState* play) { + if ((func_80AE9B4C(0, 3) || func_80AE9B4C(0, 1)) && this->unk_34E == 1) { + this->actor.flags |= ACTOR_FLAG_10000; + } else if (this->actor.xzDistToPlayer > 120.0f) { + func_80AE9FC8(this); + } + if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { + if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) { + if (func_80AE9B4C(0, 0)) { + switch (CURRENT_DAY) { + case 1: + if (gSaveContext.save.time > CLOCK_TIME(23, 30) || gSaveContext.save.time <= CLOCK_TIME(6, 0)) { + Message_StartTextbox(play, 0x27F7, &this->actor); + this->textId = 0x27F7; + } else if (gSaveContext.save.weekEventReg[14] & 0x10) { + Message_StartTextbox(play, 0x27D9, &this->actor); + this->textId = 0x27D9; + } else { + Message_StartTextbox(play, 0x27DA, &this->actor); + this->textId = 0x27DA; + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB294.s") + case 2: + if (gSaveContext.save.time > CLOCK_TIME(23, 30) || gSaveContext.save.time <= CLOCK_TIME(6, 0)) { + Message_StartTextbox(play, 0x27F7, &this->actor); + this->textId = 0x27F7; + } else { + if (gSaveContext.save.weekEventReg[14] & 0x20) { + Message_StartTextbox(play, 0x27DB, &this->actor); + this->textId = 0x27DB; + break; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB3E0.s") + if (gSaveContext.save.weekEventReg[14] & 0x10) { + Message_StartTextbox(play, 0x27DC, &this->actor); + this->textId = 0x27DC; + } else { + Message_StartTextbox(play, 0x27DD, &this->actor); + this->textId = 0x27DD; + } + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB428.s") + case 3: + if (gSaveContext.save.time > CLOCK_TIME(23, 30) || gSaveContext.save.time <= CLOCK_TIME(6, 0)) { + Message_StartTextbox(play, 0x27F7, &this->actor); + this->textId = 0x27F7; + } else if (gSaveContext.save.weekEventReg[14] & 0x40) { + Message_StartTextbox(play, 0x27DE, &this->actor); + this->textId = 0x27DE; + } else if (func_80AE9B8C() == 2) { + Message_StartTextbox(play, 0x27DF, &this->actor); + this->textId = 0x27DF; + } else if (func_80AE9B8C() == 1) { + Message_StartTextbox(play, 0x27E0, &this->actor); + this->textId = 0x27E0; + } else { + Message_StartTextbox(play, 0x27E1, &this->actor); + this->textId = 0x27E1; + } + break; + } + } else if (func_80AE9B4C(0, 3)) { + if (Flags_GetSwitch(play, 0x40)) { + Flags_UnsetSwitch(play, 0x40); + Inventory_SaveDekuPlaygroundHighScore(4); + if ((gSaveContext.save.weekEventReg[14] & 0x10) && (gSaveContext.save.weekEventReg[14] & 0x20) && + CURRENT_DAY == 3) { + this->unk_354 = 0; + Message_StartTextbox(play, 0x27F4, &this->actor); + this->textId = 0x27F4; + } else { + Message_StartTextbox(play, 0x27EE, &this->actor); + this->textId = 0x27EE; + } + } else { + if (((void)0, gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2]) >= + gSaveContext.save.dekuPlaygroundHighScores[CURRENT_DAY - 1]) { + if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] < 0x2EE0) { + Message_StartTextbox(play, 0x27F9, &this->actor); + this->textId = 0x27F9; + } else { + Message_StartTextbox(play, 0x27EB, &this->actor); + this->textId = 0x27EB; + } + } else { + Message_StartTextbox(play, 0x27ED, &this->actor); + this->textId = 0x27ED; + } + } + Flags_UnsetSwitch(play, 0x41); + this->actor.flags &= ~ACTOR_FLAG_10000; + } else if (!Flags_GetSwitch(play, 0x42)) { + Flags_SetSwitch(play, 0x42); + Message_StartTextbox(play, 0x27E6, &this->actor); + this->textId = 0x27E6; + } else { + switch (CURRENT_DAY) { + case 1: + Message_StartTextbox(play, 0x27E7, &this->actor); + this->textId = 0x27E7; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB584.s") + case 2: + Message_StartTextbox(play, 0x27E8, &this->actor); + this->textId = 0x27E8; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB598.s") + case 3: + Message_StartTextbox(play, 0x27E9, &this->actor); + this->textId = 0x27E9; + break; + } + } + } else { + Message_StartTextbox(play, 0x27D8, &this->actor); + this->textId = 0x27D8; + } + func_80AEABF0(this); + } else if (func_80AE9AC4(this, 0) || this->unk_34E == 1) { + if (this->unk_34E == 1) { + func_800B8614(&this->actor, play, 200.0f); + } else if (this->actor.playerHeightRel >= -13.0f) { + func_800B8614(&this->actor, play, 100.0f); + } + } + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000, 0x500); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB684.s") +void func_80AEA7A4(EnLiftNuts* this, PlayState* play) { + Player* player = GET_PLAYER(play); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB698.s") + if (Message_ShouldAdvance(play)) { + switch (this->textId) { + case 0x27E2: + if (play->msgCtx.choiceIndex == 0) { // Yes + if (gSaveContext.save.playerData.rupees >= 10) { + func_8019F208(); + Message_StartTextbox(play, 0x27E5, &this->actor); + this->textId = 0x27E5; + Rupees_ChangeBy(-10); + } else { + play_sound(NA_SE_SY_ERROR); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Message_StartTextbox(play, 0x27E4, &this->actor); + this->textId = 0x27E4; + } + } else { + func_8019F230(); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Message_StartTextbox(play, 0x27E3, &this->actor); + this->textId = 0x27E3; + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB828.s") + case 0x238D: + if (play->msgCtx.choiceIndex == 0) { // Yes + player->stateFlags1 |= PLAYER_STATE1_20; + func_80AEB1C8(this); + } else { + func_80AE9FC8(this); + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB8A4.s") + default: + func_80AE9FC8(this); + break; + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB934.s") +void func_80AEA910(EnLiftNuts* this, PlayState* play) { + Player* player = GET_PLAYER(play); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB974.s") + if (Message_ShouldAdvance(play)) { + switch (this->textId) { + case 0x27D9: + case 0x27DA: + case 0x27DB: + case 0x27DC: + case 0x27DD: + case 0x27DE: + case 0x27DF: + case 0x27E0: + case 0x27E1: + Message_StartTextbox(play, 0x27E2, &this->actor); + this->textId = 0x27E2; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEB9E0.s") + case 0x27E3: + case 0x27E4: + func_80AE9FC8(this); + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEBB30.s") + case 0x27E5: + func_801477B4(play); + player->stateFlags1 |= PLAYER_STATE1_20; + func_80AEAEAC(this); + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/EnLiftNuts_Update.s") + case 0x27E6: + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + switch (CURRENT_DAY) { + case 1: + Message_StartTextbox(play, 0x27E7, &this->actor); + this->textId = 0x27E7; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEBC18.s") + case 2: + Message_StartTextbox(play, 0x27E8, &this->actor); + this->textId = 0x27E8; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/func_80AEBC90.s") + case 3: + Message_StartTextbox(play, 0x27E9, &this->actor); + this->textId = 0x27E9; + break; + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Lift_Nuts/EnLiftNuts_Draw.s") + case 0x27E7: + case 0x27E8: + case 0x27E9: + Message_StartTextbox(play, 0x27FA, &this->actor); + this->textId = 0x27FA; + break; + + case 0x27FA: + func_801477B4(play); + player->stateFlags1 &= ~PLAYER_STATE1_20; + func_80AEB114(this); + break; + + case 0x27EE: + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0x10); + Message_StartTextbox(play, 0x27EF, &this->actor); + this->textId = 0x27EF; + break; + + case 0x27EF: + func_801477B4(play); + func_80AEB584(this); + func_80AEB598(this, play); + break; + + case 0x27F1: + Message_StartTextbox(play, 0x27F2, &this->actor); + this->textId = 0x27F2; + break; + + case 0x27F2: + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Message_StartTextbox(play, 0x27F3, &this->actor); + this->textId = 0x27F3; + break; + + case 0x27F4: + func_801477B4(play); + func_80AEB584(this); + func_80AEB598(this, play); + break; + + case 0x27F5: + func_801477B4(play); + func_80AE9B4C(1, 0); + player->stateFlags1 &= ~PLAYER_STATE1_20; + func_80AE9FC8(this); + break; + + case 0x27F9: + Message_StartTextbox(play, 0x27ED, &this->actor); + this->textId = 0x27ED; + break; + } + } +} + +void func_80AEABF0(EnLiftNuts* this) { + this->unk_354 = 0; + + if (this->actionFunc != func_80AEB698) { + if (func_80AE9B4C(0, 0)) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + } + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 16); + } + this->actionFunc = func_80AEAC64; +} + +void func_80AEAC64(EnLiftNuts* this, PlayState* play) { + if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { + if ((this->textId == 0x27EE) || (this->textId == 0x27F4) || (this->textId == 0x27F5)) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 10); + } else { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + } + this->actionFunc = func_80AEACF8; + } +} + +void func_80AEACF8(EnLiftNuts* this, PlayState* play) { + Player* player = GET_PLAYER(play); + + switch (Message_GetState(&play->msgCtx)) { + case 0: + case 1: + case 2: + case 3: + break; + + case 4: + func_80AEA7A4(this, play); + break; + + case 5: + func_80AEA910(this, play); + break; + + case 6: + if (Message_ShouldAdvance(play)) { + player->stateFlags1 &= ~PLAYER_STATE1_20; + func_80AE9FC8(this); + func_80AE9AC4(this, 2); + if (func_80AE9B4C(0, 3)) { + func_80AE9B4C(1, 0); + } + } + break; + } + + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x2000, 0x500); + if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { + switch (this->textId) { + case 0x27EE: + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11); + break; + + case 0x27EF: + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + break; + + case 0x27F4: + if (this->unk_354 == 0) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11); + this->unk_354++; + } else if (this->unk_354 == 4) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 12); + this->unk_354 = 0; + } else { + this->unk_354++; + } + break; + } + } + func_80AEB974(this); +} + +void func_80AEAEAC(EnLiftNuts* this) { + this->actor.speedXZ = 2.0f; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + func_80AE9AC4(this, 1); + func_80AE9B4C(1, 1); + this->actionFunc = func_80AEAF14; +} + +void func_80AEAF14(EnLiftNuts* this, PlayState* play) { + f32 dist; + + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 10, 0x1000, 0x500); + dist = Math_Vec3f_StepTo(&this->actor.world.pos, &this->vec_1D8, this->actor.speedXZ); + this->actor.world.pos.y += this->actor.gravity; + + if (dist == 0.0f) { + func_80AEAF8C(this); + } +} + +void func_80AEAF8C(EnLiftNuts* this) { + this->actionFunc = func_80AEAFA0; +} + +void func_80AEAFA0(EnLiftNuts* this, PlayState* play) { + Player* player = GET_PLAYER(play); + f32 dist; + f32 temp_fv0; + s16 yaw; + s16 sp28; + s16 yawDiff; + + sp28 = this->actor.yawTowardsPlayer - 0x8000; + yaw = Math_Vec3f_Yaw(&player->actor.world.pos, &this->actor.home.pos); + yawDiff = yaw - sp28; + dist = Math_Vec3f_DistXZ(&player->actor.world.pos, &this->actor.home.pos); + + if (this->actor.xzDistToPlayer < dist) { + if (ABS_ALT(yawDiff) < 0x2000) { + yaw = (yawDiff > 0) ? (yaw + 0x2000) : (yaw - 0x2000); + } + } + if (dist < 5.0f) { + temp_fv0 = 10.0f; + } else if (dist < 30.0f) { + temp_fv0 = 40.0f; + } else { + temp_fv0 = 80.0f; + } + + play->actorCtx.unk268 = 1; + func_800B6F20(play, &play->actorCtx.unk_26C, temp_fv0, yaw); + if (dist < 5.0f) { + func_80AEA0B4(this); + } +} + +void func_80AEB114(EnLiftNuts* this) { + func_801A2BB8(NA_BGM_TIMED_MINI_GAME); + this->actionFunc = func_80AEB148; +} + +void func_80AEB148(EnLiftNuts* this, PlayState* play) { + Player* player = GET_PLAYER(play); + + if (player->stateFlags3 & PLAYER_STATE3_200) { + this->actor.speedXZ = 2.0f; + gSaveContext.eventInf[3] |= 0x10; + Interface_StartTimer(4, 0); + func_80AE9B4C(1, 2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_FOUND); + func_80AEB280(this); + } +} + +void func_80AEB1C8(EnLiftNuts* this) { + this->actor.speedXZ = 2.0f; + gSaveContext.eventInf[3] |= 0x10; + Interface_StartTimer(4, 0); + func_80AE9B4C(1, 2); + this->actionFunc = func_80AEB230; +} + +void func_80AEB230(EnLiftNuts* this, PlayState* play) { + Player* player = GET_PLAYER(play); + + if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] > 0) { + player->stateFlags1 &= ~PLAYER_STATE1_20; + func_80AEB280(this); + } +} + +void func_80AEB280(EnLiftNuts* this) { + this->actionFunc = func_80AEB294; +} + +void func_80AEB294(EnLiftNuts* this, PlayState* play) { + Player* player = GET_PLAYER(play); + + if (((player->actor.bgCheckFlags & 1) && (player->actor.floorBgId == BG_ACTOR_MAX) && + player->actor.world.pos.y < 20.0f) || + gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] >= 0x2EE0) { + player->stateFlags1 |= PLAYER_STATE1_20; + Flags_SetSwitch(play, 0x41); + func_80AEB3E0(this, play); + } + + if (*this->ptr_1EC == 300) { + player->stateFlags1 |= PLAYER_STATE1_20; + + if (((void)0, gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2]) < + gSaveContext.save.dekuPlaygroundHighScores[CURRENT_DAY - 1]) { + Flags_SetSwitch(play, 0x40); + } + Flags_SetSwitch(play, 0x41); + func_80AEB3E0(this, play); + } +} + +void func_80AEB3E0(EnLiftNuts* this, PlayState* play) { + play_sound(NA_SE_SY_FOUND); + this->unk_354 = 0; + gSaveContext.timerStates[TIMER_ID_MINIGAME_2] = TIMER_STATE_6; + this->actionFunc = func_80AEB428; +} + +void func_80AEB428(EnLiftNuts* this, PlayState* play) { + s32 pad; + + if (this->unk_354 == 10) { + if (((void)0, gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2]) > + gSaveContext.save.dekuPlaygroundHighScores[CURRENT_DAY - 1]) { + Message_StartTextbox(play, 0x27EA, &this->actor); + this->textId = 0x27EA; + } else if (*this->ptr_1EC == 300) { + Message_StartTextbox(play, 0x27F8, &this->actor); + this->textId = 0x27F8; + } else { + Message_StartTextbox(play, 0x27EC, &this->actor); + this->textId = 0x27EC; + } + } else if (this->unk_354 == 30) { + gSaveContext.eventInf[3] &= (u8)~0x10; + gSaveContext.respawn[RESPAWN_MODE_DOWN].entrance = ENTRANCE(DEKU_SCRUB_PLAYGROUND, 1); + gSaveContext.nextCutsceneIndex = 0; + func_80169EFC(&play->state); + gSaveContext.respawnFlag = -2; + play->transitionType = TRANS_TYPE_64; + gSaveContext.nextTransitionType = TRANS_TYPE_02; + } + this->unk_354++; +} + +void func_80AEB584(EnLiftNuts* this) { + this->actionFunc = func_80AEB598; +} + +void func_80AEB598(EnLiftNuts* this, PlayState* play) { + if (Actor_HasParent(&this->actor, play)) { + this->actor.parent = NULL; + if ((gSaveContext.save.weekEventReg[14] & 0x10) && (gSaveContext.save.weekEventReg[14] & 0x20) && + (CURRENT_DAY == 3) && !(gSaveContext.save.weekEventReg[14] & 0x80)) { + gSaveContext.save.weekEventReg[14] |= 0x80; + } + func_80AEB684(this); + } else if ((this->textId == 0x27F4) && !(gSaveContext.save.weekEventReg[14] & 0x80)) { + Actor_PickUp(&this->actor, play, GI_HEART_PIECE, 500.0f, 100.0f); + } else { + Actor_PickUp(&this->actor, play, GI_RUPEE_PURPLE, 500.0f, 100.0f); + } +} + +void func_80AEB684(EnLiftNuts* this) { + this->actionFunc = func_80AEB698; +} + +void func_80AEB698(EnLiftNuts* this, PlayState* play) { + if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { + if ((gSaveContext.save.weekEventReg[14] & 0x10) && (gSaveContext.save.weekEventReg[14] & 0x20) && + CURRENT_DAY == 3) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 13); + Message_StartTextbox(play, 0x27F5, &this->actor); + this->textId = 0x27F5; + } else if (func_80AE9B8C() > 0) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Message_StartTextbox(play, 0x27F0, &this->actor); + this->textId = 0x27F0; + } else { + Message_StartTextbox(play, 0x27F1, &this->actor); + this->textId = 0x27F1; + } + this->actor.flags &= ~ACTOR_FLAG_10000; + func_80AEABF0(this); + switch (CURRENT_DAY) { + case 1: + gSaveContext.save.weekEventReg[14] |= 0x10; + break; + + case 2: + gSaveContext.save.weekEventReg[14] |= 0x20; + break; + + case 3: + gSaveContext.save.weekEventReg[14] |= 0x40; + break; + + default: + break; + } + } else { + func_800B85E0(&this->actor, play, 200.0f, -1); + } +} + +void func_80AEB828(EnLiftNuts* this) { + if (!func_80AE9B4C(0, 4)) { + func_80AE9B4C(1, 4); + this->unk_356 = 1; + } + if (this->actionFunc == func_80AE9F70) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 15); + } + this->unk_354 = 0; + this->actionFunc = func_80AEB8A4; +} + +void func_80AEB8A4(EnLiftNuts* this, PlayState* play) { + if (this->unk_354 == 22) { + if (this->unk_356 == 1) { + Message_StartTextbox(play, 0x27F6, &this->actor); + this->textId = 0x27F6; + } + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 17); + this->actionFunc = func_80AEB934; + } + this->unk_354++; +} + +void func_80AEB934(EnLiftNuts* this, PlayState* play) { + if (Animation_OnFrame(&this->skelAnime, 5.0f)) { + func_80AEB9E0(this, play); + } +} + +void func_80AEB974(EnLiftNuts* this) { + s16 textId = this->textId; + + switch (textId) { + default: + this->unk_1E4 = 0; + break; + + case 0x27EE: + case 0x27EF: + this->unk_1E4 = 1; + break; + + case 0x27F5: + this->unk_1E4 = 2; + break; + + case 0x27F4: + if (this->unk_354 == 0) { + this->unk_1E4 = 2; + break; + } + this->unk_1E4 = 1; + } +} + +void func_80AEB9E0(EnLiftNuts* this, PlayState* play) { + Vec3f worldPos = this->actor.world.pos; + Vec3f velocity; + Vec3f accel; + Color_RGBA8 primColor = { 170, 130, 90, 255 }; + Color_RGBA8 envColor = { 100, 60, 20, 255 }; + s32 i; + + accel.y = 0.0f; + + for (i = 0; i < 30; i++) { + velocity.x = Rand_Centered() * 15.0f; + velocity.y = Rand_ZeroOne() * 2.0f; + velocity.z = Rand_Centered() * 15.0f; + + accel.x = -0.2f * velocity.x; + accel.z = -0.2f * velocity.z; + + func_800B0EB0(play, &worldPos, &velocity, &accel, &primColor, &envColor, 80, 25, 10); + } +} + +void func_80AEBB30(EnLiftNuts* this, PlayState* play) { + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); +} + +void EnLiftNuts_Update(Actor* thisx, PlayState* play) { + EnLiftNuts* this = THIS; + + SkelAnime_Update(&this->skelAnime); + this->actionFunc(this, play); + func_80AEBB30(this, play); + Actor_UpdateBgCheckInfo(play, thisx, 0.0f, 0.0f, 0.0f, 4); + func_80AE9BCC(this, play); + + if (func_80AE9B4C(0, 2)) { + thisx->flags &= ~ACTOR_FLAG_1; + } +} + +s32 EnLiftNuts_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + EnLiftNuts* this = THIS; + + if (limbIndex == OBJECT_DNT_LIMB_0F || limbIndex == OBJECT_DNT_LIMB_10 || limbIndex == OBJECT_DNT_LIMB_15 || + limbIndex == OBJECT_DNT_LIMB_17 || limbIndex == OBJECT_DNT_LIMB_18 || limbIndex == OBJECT_DNT_LIMB_15 || + limbIndex == OBJECT_DNT_LIMB_1B) { + *dList = NULL; + } + + if (limbIndex == OBJECT_DNT_LIMB_1A) { + *dList = D_80AEBF18[this->unk_1E4]; + } + return false; +} + +void EnLiftNuts_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + static Vec3f sFocusOffset = { 0.0f, 0.0f, 0.0f }; + + if (limbIndex == OBJECT_DNT_LIMB_19) { + Matrix_MultVec3f(&sFocusOffset, &thisx->focus.pos); + } +} + +void EnLiftNuts_Draw(Actor* thisx, PlayState* play) { + EnLiftNuts* this = THIS; + + func_8012C28C(play->state.gfxCtx); + SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, + EnLiftNuts_OverrideLimbDraw, EnLiftNuts_PostLimbDraw, thisx); +} diff --git a/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.h b/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.h index ad6014dd9..9a54132a4 100644 --- a/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.h +++ b/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.h @@ -2,18 +2,31 @@ #define Z_EN_LIFT_NUTS_H #include "global.h" +#include "objects/object_dnt/object_dnt.h" struct EnLiftNuts; typedef void (*EnLiftNutsActionFunc)(struct EnLiftNuts*, PlayState*); +#define ENLIFTNUTS_GET_FF00(thisx) (((thisx)->params & 0xFF00) >> 8) + typedef struct EnLiftNuts { /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x90]; + /* 0x144 */ ColliderCylinder collider; + /* 0x190 */ SkelAnime skelAnime; /* 0x1D4 */ EnLiftNutsActionFunc actionFunc; - /* 0x1D8 */ char unk_1D8[0x180]; + /* 0x1D8 */ Vec3f vec_1D8; + /* 0x1E4 */ s32 unk_1E4; + /* 0x1E8 */ s32 unk_1E8; + /* 0x1EC */ s16* ptr_1EC; + /* 0x1F0 */ Vec3s jointTable[OBJECT_DNT_LIMB_MAX]; + /* 0x298 */ Vec3s morphTable[OBJECT_DNT_LIMB_MAX]; + /* 0x340 */ UNK_TYPE1 unk_340[0xC]; + /* 0x34C */ s16 textId; + /* 0x34E */ s16 unk_34E; + /* 0x350 */ UNK_TYPE1 unk_350[0x4]; + /* 0x354 */ s16 unk_354; + /* 0x356 */ s16 unk_356; } EnLiftNuts; // size = 0x358 -extern const ActorInit En_Lift_Nuts_InitVars; - #endif // Z_EN_LIFT_NUTS_H diff --git a/src/overlays/actors/ovl_En_Light/z_en_light.c b/src/overlays/actors/ovl_En_Light/z_en_light.c index e50cf0da5..b988fcce3 100644 --- a/src/overlays/actors/ovl_En_Light/z_en_light.c +++ b/src/overlays/actors/ovl_En_Light/z_en_light.c @@ -18,7 +18,7 @@ void EnLight_Draw(Actor* thisx, PlayState* play); void func_80865F38(Actor* thisx, PlayState* play); -const ActorInit En_Light_InitVars = { +ActorInit En_Light_InitVars = { ACTOR_EN_LIGHT, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_En_Light/z_en_light.h b/src/overlays/actors/ovl_En_Light/z_en_light.h index b17f55fd7..17762d7fa 100644 --- a/src/overlays/actors/ovl_En_Light/z_en_light.h +++ b/src/overlays/actors/ovl_En_Light/z_en_light.h @@ -20,6 +20,4 @@ typedef struct EnLight { /* 0x14C */ LightInfo lightInfo; } EnLight; // size = 0x15C -extern const ActorInit En_Light_InitVars; - #endif // Z_EN_LIGHT_H diff --git a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c index 6fd949feb..2a667d3ad 100644 --- a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c +++ b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c @@ -24,7 +24,7 @@ void EnLookNuts_RunToPlayer(EnLookNuts* this, PlayState* play); void EnLookNuts_SetupSendPlayerToSpawn(EnLookNuts* this); void EnLookNuts_SendPlayerToSpawn(EnLookNuts* this, PlayState* play); -const ActorInit En_Look_Nuts_InitVars = { +ActorInit En_Look_Nuts_InitVars = { ACTOR_EN_LOOK_NUTS, ACTORCAT_NPC, FLAGS, @@ -120,11 +120,11 @@ void EnLookNuts_Init(Actor* thisx, PlayState* play) { this->switchFlag = -1; } if ((this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (this->pathLocation == 0x1F) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -355,7 +355,7 @@ void EnLookNuts_Update(Actor* thisx, PlayState* play) { if ((this->isPlayerDetected == true) || (this->actor.xzDistToPlayer < 20.0f)) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags3 & 0x100) && !Play_InCsMode(play)) { + if (!(player->stateFlags3 & PLAYER_STATE3_100) && !Play_InCsMode(play)) { Math_Vec3f_Copy(&this->headRotTarget, &gZeroVec3f); this->state = PALACE_GUARD_RUNNING_TO_PLAYER; play_sound(NA_SE_SY_FOUND); diff --git a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.h b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.h index 9d5a1eb24..b72215ce6 100644 --- a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.h +++ b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.h @@ -35,6 +35,4 @@ typedef struct EnLookNuts { /* 0x244 */ ColliderCylinder collider; } EnLookNuts; // size = 0x290 -extern const ActorInit En_Look_Nuts_InitVars; - #endif // Z_EN_LOOK_NUTS_H diff --git a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c index e42e70ca3..14a9c4add 100644 --- a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c +++ b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c @@ -14,7 +14,7 @@ void EnMFire1_Init(Actor* thisx, PlayState* play); void EnMFire1_Destroy(Actor* thisx, PlayState* play); void EnMFire1_Update(Actor* thisx, PlayState* play); -const ActorInit En_M_Fire1_InitVars = { +ActorInit En_M_Fire1_InitVars = { ACTOR_EN_M_FIRE1, ACTORCAT_MISC, FLAGS, @@ -68,9 +68,10 @@ void EnMFire1_Update(Actor* thisx, PlayState* play) { s32 pad; if (Math_StepToF(&this->timer, 1.0f, 0.2f)) { - Actor_MarkForDeath(&this->actor); - } else { - Collider_UpdateCylinder(&this->actor, &this->collider); - CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); + Actor_Kill(&this->actor); + return; } + + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.h b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.h index fd5504e15..144e48d4d 100644 --- a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.h +++ b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.h @@ -11,6 +11,4 @@ typedef struct EnMFire1 { /* 0x190 */ f32 timer; } EnMFire1; // size = 0x194 -extern const ActorInit En_M_Fire1_InitVars; - #endif // Z_EN_M_FIRE1_H diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index 1fa4589b5..a244c3ca8 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -29,7 +29,7 @@ void EnMThunder_UnkType_Attack(EnMThunder* this, PlayState* play); #define ENMTHUNDER_TYPE_MAX 4 -const ActorInit En_M_Thunder_InitVars = { +ActorInit En_M_Thunder_InitVars = { ACTOR_EN_M_THUNDER, ACTORCAT_ITEMACTION, FLAGS, @@ -136,7 +136,7 @@ void EnMThunder_Init(Actor* thisx, PlayState* play) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); AudioSfx_PlaySfx(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -216,9 +216,12 @@ void EnMThunder_Spin_AttackNoMagic(EnMThunder* this, PlayState* play) { AudioSfx_PlaySfx(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - Actor_MarkForDeath(&this->actor); - } else if (!(player->stateFlags1 & PLAYER_STATE1_1000)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); + return; + } + + if (!(player->stateFlags1 & PLAYER_STATE1_1000)) { + Actor_Kill(&this->actor); } } @@ -260,7 +263,7 @@ void EnMThunder_Charge(EnMThunder* this, PlayState* play) { AudioSfx_PlaySfx(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -313,7 +316,7 @@ void EnMThunder_Charge(EnMThunder* this, PlayState* play) { if (this->actor.child != NULL) { this->actor.child->parent = NULL; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -341,7 +344,7 @@ void EnMThunder_Charge(EnMThunder* this, PlayState* play) { } if (Play_InCsMode(play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -367,7 +370,7 @@ void EnMThunder_Spin_Attack(EnMThunder* this, PlayState* play) { Player* player = GET_PLAYER(play); if (Math_StepToF(&this->lightColorFrac, 0.0f, 0.0625f)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { Math_SmoothStepToF(&this->actor.scale.x, (s32)this->scaleTarget, 0.6f, 0.8f, 0.0f); Actor_SetScale(&this->actor, this->actor.scale.x); @@ -391,7 +394,7 @@ void EnMThunder_Spin_Attack(EnMThunder* this, PlayState* play) { func_808B5EEC(this, play); if (Play_InCsMode(play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -406,7 +409,7 @@ void EnMThunder_SwordBeam_Attack(EnMThunder* this, PlayState* play) { } if (Math_StepToF(&this->lightColorFrac, 0.0f, 0.05f)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { sp2C = -80.0f * Math_CosS(this->actor.world.rot.x); @@ -441,7 +444,7 @@ void EnMThunder_SwordBeam_Attack(EnMThunder* this, PlayState* play) { void EnMThunder_UnkType_Attack(EnMThunder* this, PlayState* play) { if (Math_StepToF(&this->lightColorFrac, 0.0f, 0.0625f)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { Math_SmoothStepToF(&this->actor.scale.x, (s32)this->scaleTarget, 0.6f, 0.8f, 0.0f); Actor_SetScale(&this->actor, this->actor.scale.x); diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h index 7ac851e92..9842eeb78 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h @@ -37,6 +37,4 @@ typedef struct EnMThunder { /* 0x1C2 */ u8 isCharging; } EnMThunder; // size = 0x1C4 -extern const ActorInit En_M_Thunder_InitVars; - #endif // Z_EN_M_THUNDER_H diff --git a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c index 0860857c8..c83698e6f 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c @@ -54,7 +54,7 @@ typedef enum { /* 3 */ MA4_STATE_AFTERDESCRIBETHEMCS, } EnMa4State; -const ActorInit En_Ma4_InitVars = { +ActorInit En_Ma4_InitVars = { ACTOR_EN_MA4, ACTORCAT_NPC, FLAGS, @@ -347,7 +347,7 @@ void EnMa4_Wait(EnMa4* this, PlayState* play) { EnMa4_StartDialogue(this, play); EnMa4_SetupDialogueHandler(this); } else if (this->type != MA4_TYPE_ALIENS_WON || ABS_ALT(yaw) < 0x4000) { - if (!(player->stateFlags1 & 0x800000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_800000)) { func_800B8614(&this->actor, play, 100.0f); } } @@ -596,7 +596,7 @@ void EnMa4_ChooseNextDialogue(EnMa4* this, PlayState* play) { this->textId = 0x334C; } else { func_801477B4(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; EnMa4_SetupBeginEponasSongCs(this); EnMa4_BeginEponasSongCs(this, play); } @@ -692,7 +692,7 @@ void EnMa4_InitHorsebackGame(EnMa4* this, PlayState* play) { Interface_StartTimer(TIMER_ID_MINIGAME_2, 0); gSaveContext.save.weekEventReg[8] |= 1; func_80112AFC(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->actionFunc = EnMa4_SetupHorsebackGameWait; } @@ -701,7 +701,7 @@ void EnMa4_SetupHorsebackGameWait(EnMa4* this, PlayState* play) { if (play->interfaceCtx.unk_280 == 8) { this->actionFunc = EnMa4_HorsebackGameWait; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } } @@ -709,7 +709,7 @@ void EnMa4_HorsebackGameWait(EnMa4* this, PlayState* play) { static s16 D_80AC0258 = 0; Player* player = GET_PLAYER(play); - player->stateFlags3 |= 0x400; + player->stateFlags3 |= PLAYER_STATE3_400; EnMa4_HorsebackGameCheckPlayerInteractions(this, play); if (this->poppedBalloonCounter != D_80AC0258) { @@ -736,7 +736,7 @@ void EnMa4_HorsebackGameEnd(EnMa4* this, PlayState* play) { static s32 sFrameCounter = 0; Player* player = GET_PLAYER(play); - if (player->stateFlags1 & 0x100000) { + if (player->stateFlags1 & PLAYER_STATE1_100000) { play->actorCtx.unk268 = 1; play->actorCtx.unk_26C.press.button = BTN_A; } else { @@ -827,7 +827,7 @@ void EnMa4_EponasSongCs(EnMa4* this, PlayState* play) { } else { Player* player = GET_PLAYER(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; func_800B85E0(&this->actor, play, 200.0f, PLAYER_AP_MINUS1); D_80AC0260 = 99; this->hasBow = true; @@ -844,7 +844,7 @@ void EnMa4_EndEponasSongCs(EnMa4* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_10000; if (Actor_ProcessTalkRequest(&this->actor, &play->state) != 0) { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; Message_StartTextbox(play, 0x334C, &this->actor); this->textId = 0x334C; this->actor.flags &= ~ACTOR_FLAG_10000; diff --git a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.h b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.h index 148e2ef30..3ac405b00 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.h +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.h @@ -35,6 +35,4 @@ typedef struct EnMa4 { /* 0x33E */ u16 textId; } EnMa4; // size = 0x340 -extern const ActorInit En_Ma4_InitVars; - #endif // Z_EN_MA4_H 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 49d7a06fb..bd9c39e7d 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 @@ -69,7 +69,7 @@ s32 EnMaYto_HasSpokenToPlayerToday(void); s32 EnMaYto_HasSpokenToPlayer(void); void EnMaYto_SetTalkedFlag(void); -const ActorInit En_Ma_Yto_InitVars = { +ActorInit En_Ma_Yto_InitVars = { ACTOR_EN_MA_YTO, ACTORCAT_NPC, FLAGS, @@ -163,7 +163,7 @@ void EnMaYto_Init(Actor* thisx, PlayState* play) { this->blinkTimer = 100; this->type = EN_MA_YTO_GET_TYPE(&this->actor); if (!EnMaYto_CheckValidSpawn(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.h b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.h index e21b30c29..0955cd8e8 100644 --- a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.h +++ b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.h @@ -30,8 +30,6 @@ typedef struct EnMaYto { /* 0x322 */ u16 textId; } EnMaYto; // size = 0x324 -extern const ActorInit En_Ma_Yto_InitVars; - typedef enum { /* 0 */ MA_YTO_TYPE_DEFAULT, // Strokes cow on day 1 /* 1 */ MA_YTO_TYPE_BARN, diff --git a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c index 5fcf1c7f0..ae7232406 100644 --- a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c +++ b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c @@ -29,7 +29,7 @@ void EnMaYts_SetFaceExpression(EnMaYts* this, s16 overrideEyeTexIndex, s16 mouth void EnMaYts_DrawSleeping(Actor* thisx, PlayState* play); -const ActorInit En_Ma_Yts_InitVars = { +ActorInit En_Ma_Yts_InitVars = { ACTOR_EN_MA_YTS, ACTORCAT_NPC, FLAGS, @@ -220,7 +220,7 @@ void EnMaYts_Init(Actor* thisx, PlayState* play) { this->type = EN_MA_YTS_GET_TYPE(thisx); if (!EnMaYts_CheckValidSpawn(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); diff --git a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.h b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.h index e34ef3d0e..eb700d8c2 100644 --- a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.h +++ b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.h @@ -31,8 +31,6 @@ typedef struct EnMaYts { /* 0x338 */ u16 textId; } EnMaYts; // size = 0x33C -extern const ActorInit En_Ma_Yts_InitVars; - typedef enum { /* 0 */ MA_YTS_TYPE_BARN, /* 1 */ MA_YTS_TYPE_SITTING, diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/src/overlays/actors/ovl_En_Mag/z_en_mag.c index b7199cb1d..3a72258cc 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -85,7 +85,7 @@ static s16 sZeldaEffectColorTargetIndex = 0; static s16 sTextAlphaTargetIndex = 0; static s16 sTextAlphaTimer = 20; -const ActorInit En_Mag_InitVars = { +ActorInit En_Mag_InitVars = { ACTOR_EN_MAG, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.h b/src/overlays/actors/ovl_En_Mag/z_en_mag.h index d55d63ccb..9515abc71 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.h +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.h @@ -47,6 +47,4 @@ typedef struct EnMag { /* 0x11F74 */ UNK_TYPE1 unk11F74[4]; } EnMag; // size = 0x11F78 -extern const ActorInit En_Mag_InitVars; - #endif // Z_EN_MAG_H diff --git a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c index 4c7a1ddf8..65e3d8b38 100644 --- a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c +++ b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c @@ -36,7 +36,7 @@ void func_80B38060(EnMaruta* this, Vec3f* arg1); void func_80B3828C(Vec3f* arg0, Vec3f* arg1, s16 arg2, s16 arg3, s32 arg4); void func_80B382E4(PlayState* play, Vec3f arg1); -const ActorInit En_Maruta_InitVars = { +ActorInit En_Maruta_InitVars = { ACTOR_EN_MARUTA, ACTORCAT_PROP, FLAGS, @@ -317,7 +317,7 @@ void func_80B37428(EnMaruta* this, PlayState* play) { kendoJs->unk_28C--; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -332,7 +332,7 @@ void func_80B374B8(EnMaruta* this) { void func_80B374FC(EnMaruta* this, PlayState* play) { if (this->unk_21E == 40) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -476,7 +476,7 @@ void func_80B37A8C(EnMaruta* this) { void func_80B37AA0(EnMaruta* this, PlayState* play) { if (this->actor.scale.y == 0.0f) { if (this->actor.scale.x == 0.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } Math_SmoothStepToF(&this->actor.scale.x, 0.0f, 0.2f, 0.01f, 0.001f); diff --git a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.h b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.h index 1af506c58..0216ba383 100644 --- a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.h +++ b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.h @@ -27,6 +27,4 @@ typedef struct EnMaruta { /* 0x220 */ s16 unk_220; } EnMaruta; // size = 0x224 -extern const ActorInit En_Maruta_InitVars; - #endif // Z_EN_MARUTA_H diff --git a/src/overlays/actors/ovl_En_Minideath/z_en_minideath.c b/src/overlays/actors/ovl_En_Minideath/z_en_minideath.c index fd0001166..d47992114 100644 --- a/src/overlays/actors/ovl_En_Minideath/z_en_minideath.c +++ b/src/overlays/actors/ovl_En_Minideath/z_en_minideath.c @@ -29,7 +29,7 @@ void func_808CB6D4(EnMinideath* this, PlayState* play); void func_808CB7CC(EnMinideath* this, PlayState* play); #if 0 -const ActorInit En_Minideath_InitVars = { +ActorInit En_Minideath_InitVars = { ACTOR_EN_MINIDEATH, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Minideath/z_en_minideath.h b/src/overlays/actors/ovl_En_Minideath/z_en_minideath.h index 427bafa1e..0a08318ab 100644 --- a/src/overlays/actors/ovl_En_Minideath/z_en_minideath.h +++ b/src/overlays/actors/ovl_En_Minideath/z_en_minideath.h @@ -13,6 +13,4 @@ typedef struct EnMinideath { /* 0x148 */ char unk_148[0x164]; } EnMinideath; // size = 0x2AC -extern const ActorInit En_Minideath_InitVars; - #endif // Z_EN_MINIDEATH_H 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 399a8f659..07c147690 100644 --- a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c +++ b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c @@ -26,7 +26,7 @@ void EnMinifrog_UpdateMissingFrog(Actor* thisx, PlayState* play); void EnMinifrog_YellowFrogDialog(EnMinifrog* this, PlayState* play); void EnMinifrog_SetupYellowFrogDialog(EnMinifrog* this, PlayState* play); -const ActorInit En_Minifrog_InitVars = { +ActorInit En_Minifrog_InitVars = { ACTOR_EN_MINIFROG, ACTORCAT_NPC, FLAGS, @@ -116,13 +116,14 @@ void EnMinifrog_Init(Actor* thisx, PlayState* play) { if ((this->frogIndex == MINIFROG_YELLOW) || ((gSaveContext.save.weekEventReg[isFrogReturnedFlags[this->frogIndex] >> 8] & (u8)isFrogReturnedFlags[this->frogIndex]))) { - Actor_MarkForDeath(&this->actor); - } else { - this->timer = 30; - this->actionFunc = EnMinifrog_SpawnGrowAndShrink; - this->actor.textId = 0xD81; // "Ah! Don Gero! It has been so long." - this->actor.colChkInfo.mass = 30; + Actor_Kill(&this->actor); + return; } + + this->timer = 30; + this->actionFunc = EnMinifrog_SpawnGrowAndShrink; + this->actor.textId = 0xD81; // "Ah! Don Gero! It has been so long." + this->actor.colChkInfo.mass = 30; } else { // Frogs in mountain village if (this->frogIndex == MINIFROG_YELLOW) { this->actor.textId = 0; @@ -293,7 +294,7 @@ void EnMinifrog_ReturnFrogCutscene(EnMinifrog* this, PlayState* play) { } } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } diff --git a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.h b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.h index a71caa650..9a3801d91 100644 --- a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.h +++ b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.h @@ -38,6 +38,4 @@ typedef struct EnMinifrog { /* 0x2B8 */ ColliderCylinder collider; } EnMinifrog; // size = 0x304 -extern const ActorInit En_Minifrog_InitVars; - #endif // Z_EN_MINIFROG_H diff --git a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c index cdf3ad957..1ab5f2cc6 100644 --- a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c +++ b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c @@ -41,7 +41,7 @@ void EnMinislime_MoveToGekko(EnMinislime* this, PlayState* play); void EnMinislime_SetupGekkoThrow(EnMinislime* this); void EnMinislime_GekkoThrow(EnMinislime* this, PlayState* play); -const ActorInit En_Minislime_InitVars = { +ActorInit En_Minislime_InitVars = { ACTOR_EN_MINISLIME, ACTORCAT_BOSS, FLAGS, @@ -621,7 +621,7 @@ void EnMinislime_SetupDespawn(EnMinislime* this) { } void EnMinislime_Despawn(EnMinislime* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void EnMinislime_SetupMoveToGekko(EnMinislime* this) { diff --git a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.h b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.h index 28629f464..77cabe9b6 100644 --- a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.h +++ b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.h @@ -50,6 +50,4 @@ typedef struct EnMinislime { /* 0x160 */ ColliderCylinder collider; } EnMinislime; // size = 0x1AC -extern const ActorInit En_Minislime_InitVars; - #endif // Z_EN_MINISLIME_H 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 dc5e75579..c267fb110 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -23,7 +23,7 @@ void func_80959C94(EnMk* this, PlayState* play); void func_80959D28(EnMk* this, PlayState* play); void func_80959E18(EnMk* this, PlayState* play); -const ActorInit En_Mk_InitVars = { +ActorInit En_Mk_InitVars = { ACTOR_EN_MK, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.h b/src/overlays/actors/ovl_En_Mk/z_en_mk.h index ed6cd6997..bbf126f4e 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.h +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.h @@ -21,6 +21,4 @@ typedef struct EnMk { /* 0x280 */ EnMkActionFunc actionFunc; } EnMk; // size = 0x284 -extern const ActorInit En_Mk_InitVars; - #endif // Z_EN_MK_H diff --git a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c index c8cc1abb1..cbbaffca9 100644 --- a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c +++ b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c @@ -35,7 +35,7 @@ void func_80A4E67C(EnMkk* this); void func_80A4E84C(EnMkk* this); void func_80A4EBBC(EnMkk* this, PlayState* play); -const ActorInit En_Mkk_InitVars = { +ActorInit En_Mkk_InitVars = { ACTOR_EN_MKK, ACTORCAT_ENEMY, FLAGS, @@ -487,7 +487,7 @@ void func_80A4EF74(EnMkk* this, PlayState* play) { this->actor.velocity.y = 0.0f; func_80A4EDF0(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { this->alpha = newAlpha; diff --git a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.h b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.h index a8e047284..80efcd577 100644 --- a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.h +++ b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.h @@ -29,6 +29,4 @@ typedef struct EnMkk { /* 0x17C */ ColliderSphere collider; } EnMkk; // size = 0x1D4 -extern const ActorInit En_Mkk_InitVars; - #endif // Z_EN_MKK_H diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index 8e2c5260b..0cd8f1276 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -21,7 +21,7 @@ void func_80965DB4(EnMm* this, PlayState* play); void func_8096611C(EnMm* this, PlayState* play); void EnMm_SetupAction(EnMm* this, EnMmActionFunc actionFunc); -const ActorInit En_Mm_InitVars = { +ActorInit En_Mm_InitVars = { ACTOR_EN_MM, ACTORCAT_ITEMACTION, FLAGS, @@ -76,7 +76,7 @@ void EnMm_Init(Actor* thisx, PlayState* play) { if ((this->actor.params >= 0) && ((!(gSaveContext.save.weekEventReg[37] & 0x10)) || (gSaveContext.save.weekEventReg[37] & 8) || (gSaveContext.unk_1014 != 0))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } Actor_ProcessInitChain(&this->actor, sInitChain); diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c index d049bdba0..14c8d1170 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -18,7 +18,7 @@ void EnMm2_Draw(Actor* thisx, PlayState* play); void EnMm2_Reading(EnMm2* this, PlayState* play); void EnMm2_WaitForRead(EnMm2* this, PlayState* play); -const ActorInit En_Mm2_InitVars = { +ActorInit En_Mm2_InitVars = { ACTOR_EN_MM2, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h index 1b3dcc0aa..4f961e1c0 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h @@ -14,6 +14,4 @@ typedef struct EnMm2 { /* 0x18C */ UNK_TYPE1 unk_18C[0x128]; } EnMm2; // size = 0x2B4 -extern const ActorInit En_Mm2_InitVars; - #endif // Z_EN_MM2_H diff --git a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c index ac3c8322e..a611a309e 100644 --- a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c +++ b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c @@ -29,7 +29,7 @@ void func_80A6FEEC(EnMm3* this, PlayState* play); s32 func_80A6FFAC(EnMm3* this, PlayState* play); void func_80A70084(EnMm3* this, PlayState* play); -const ActorInit En_Mm3_InitVars = { +ActorInit En_Mm3_InitVars = { ACTOR_EN_MM3, ACTORCAT_NPC, FLAGS, @@ -341,7 +341,7 @@ void func_80A6F9DC(EnMm3* this, PlayState* play) { if (this->unk_2B4 == 0x2790) { Player* player = GET_PLAYER(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; if (Player_GetMask(play) == PLAYER_MASK_BUNNY) { Interface_StartPostmanTimer(0, POSTMAN_MINIGAME_BUNNY_HOOD_ON); } else { @@ -383,7 +383,7 @@ void func_80A6FBFC(EnMm3* this, PlayState* play) { Player* player = GET_PLAYER(play); if (gSaveContext.timerStates[TIMER_ID_POSTMAN] == TIMER_STATE_POSTMAN_END) { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->actor.flags |= ACTOR_FLAG_10000; if (gSaveContext.timerCurTimes[TIMER_ID_POSTMAN] > SECONDS_TO_TIMER(15)) { gSaveContext.timerCurTimes[TIMER_ID_POSTMAN] = SECONDS_TO_TIMER(15); @@ -445,7 +445,7 @@ void func_80A6FEEC(EnMm3* this, PlayState* play) { Player* player = GET_PLAYER(play); if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; Message_StartTextbox(play, 0x2794, &this->actor); this->unk_2B4 = 0x2794; func_80151BB4(play, 0xB); diff --git a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.h b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.h index 1cc1946f5..e6b512723 100644 --- a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.h +++ b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.h @@ -30,6 +30,4 @@ typedef struct EnMm3 { /* 0x2B4 */ u16 unk_2B4; } EnMm3; // size = 0x2B8 -extern const ActorInit En_Mm3_InitVars; - #endif // Z_EN_MM3_H diff --git a/src/overlays/actors/ovl_En_Mnk/z_en_mnk.c b/src/overlays/actors/ovl_En_Mnk/z_en_mnk.c index 14c235f51..ef064969e 100644 --- a/src/overlays/actors/ovl_En_Mnk/z_en_mnk.c +++ b/src/overlays/actors/ovl_En_Mnk/z_en_mnk.c @@ -16,7 +16,7 @@ void EnMnk_Update(Actor* thisx, PlayState* play); void EnMnk_Draw(Actor* thisx, PlayState* play); #if 0 -const ActorInit En_Mnk_InitVars = { +ActorInit En_Mnk_InitVars = { ACTOR_EN_MNK, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Mnk/z_en_mnk.h b/src/overlays/actors/ovl_En_Mnk/z_en_mnk.h index 9baee87f0..e2f739ada 100644 --- a/src/overlays/actors/ovl_En_Mnk/z_en_mnk.h +++ b/src/overlays/actors/ovl_En_Mnk/z_en_mnk.h @@ -14,6 +14,4 @@ typedef struct EnMnk { /* 0x3E8 */ EnMnkActionFunc actionFunc; } EnMnk; // size = 0x3EC -extern const ActorInit En_Mnk_InitVars; - #endif // Z_EN_MNK_H 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 01b5c4bec..c3b7ac727 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -21,7 +21,7 @@ void EnMs_Talk(EnMs* this, PlayState* play); void EnMs_Sell(EnMs* this, PlayState* play); void EnMs_TalkAfterPurchase(EnMs* this, PlayState* play); -const ActorInit En_Ms_InitVars = { +ActorInit En_Ms_InitVars = { ACTOR_EN_MS, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.h b/src/overlays/actors/ovl_En_Ms/z_en_ms.h index dcff0cb58..aa46b820d 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.h +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.h @@ -16,6 +16,4 @@ typedef struct EnMs { /* 0x1F8 */ ColliderCylinder collider; } EnMs; // size = 0x244 -extern const ActorInit En_Ms_InitVars; - #endif // Z_EN_MS_H diff --git a/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c b/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c index ed67013d8..e4178997f 100644 --- a/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c +++ b/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c @@ -28,7 +28,7 @@ typedef enum { GORON_RACE_CHEAT_TRYING_TO_REACH_GOAL_FROM_BEHIND, } PlayerCheatStatus; -const ActorInit En_Mt_tag_InitVars = { +ActorInit En_Mt_tag_InitVars = { ACTOR_EN_MT_TAG, ACTORCAT_BG, FLAGS, @@ -318,7 +318,7 @@ void EnMttag_RaceStart(EnMttag* this, PlayState* play) { play->interfaceCtx.unk_280 = 1; Audio_QueueSeqCmd(NA_BGM_GORON_RACE | 0x8000); play->envCtx.unk_E4 = 0xFE; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; } else if ((this->timer < 60) && (play->interfaceCtx.unk_280 == 8)) { this->timer = 0; gSaveContext.eventInf[1] |= 1; @@ -404,7 +404,7 @@ void EnMttag_RaceFinish(EnMttag* this, PlayState* play) { EnMttag_ExitRace(play, TRANS_TYPE_02, TRANS_TYPE_02); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -443,7 +443,7 @@ void EnMttag_PotentiallyRestartRace(EnMttag* this, PlayState* play) { } else { EnMttag_ExitRace(play, TRANS_TYPE_02, TRANS_TYPE_02); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -460,16 +460,17 @@ void EnMttag_HandleCantWinChoice(EnMttag* this, PlayState* play) { EnMttag_ExitRace(play, TRANS_TYPE_02, TRANS_TYPE_02); gSaveContext.eventInf[1] &= (u8)~8; gSaveContext.eventInf[1] |= 4; - Actor_MarkForDeath(&this->actor); - } else { - // Keep racing - func_8019F208(); - func_801477B4(play); - func_800B7298(play, &this->actor, 6); - gSaveContext.eventInf[1] &= (u8)~8; - this->timer = 100; - this->actionFunc = EnMttag_Race; + Actor_Kill(&this->actor); + return; } + + // Keep racing + func_8019F208(); + func_801477B4(play); + func_800B7298(play, &this->actor, 6); + gSaveContext.eventInf[1] &= (u8)~8; + this->timer = 100; + this->actionFunc = EnMttag_Race; } } @@ -479,7 +480,7 @@ void EnMttag_Init(Actor* thisx, PlayState* play) { if (gSaveContext.save.entrance == ENTRANCE(GORON_RACETRACK, 1)) { player = GET_PLAYER(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->raceInitialized = false; this->timer = 100; @@ -496,7 +497,7 @@ void EnMttag_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnMttag_RaceStart; } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.h b/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.h index 34f86048c..19ebdb8d8 100644 --- a/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.h +++ b/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.h @@ -18,6 +18,4 @@ typedef struct EnMttag { /* 0x164 */ s32 shouldRestartRace; } EnMttag; // size = 0x168 -extern const ActorInit En_Mt_tag_InitVars; - #endif // Z_EN_MT_TAG_H diff --git a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c index 4e6c471af..d8e9d68f8 100644 --- a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c +++ b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c @@ -32,7 +32,7 @@ void func_80A6AE7C(EnMushi2* this, PlayState* play); void func_80A6B078(EnMushi2* this); void func_80A6B0D8(EnMushi2* this, PlayState* play); -const ActorInit En_Mushi2_InitVars = { +ActorInit En_Mushi2_InitVars = { ACTOR_EN_MUSHI2, ACTORCAT_ITEMACTION, FLAGS, @@ -816,8 +816,11 @@ void func_80A6A36C(EnMushi2* this, PlayState* play) { } if (sp20 && (this->unk_36A <= 0)) { - Actor_MarkForDeath(&this->actor); - } else if (this->actor.bgCheckFlags & 0x20) { + Actor_Kill(&this->actor); + return; + } + + if (this->actor.bgCheckFlags & 0x20) { func_80A6AAA4(this); } else if (this->actor.bgCheckFlags & 1) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GERUDOFT_WALK); @@ -1038,7 +1041,7 @@ void func_80A6AE7C(EnMushi2* this, PlayState* play) { } if (this->unk_368 <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1105,7 +1108,7 @@ void func_80A6B0D8(EnMushi2* this, PlayState* play) { func_80A6A094(this); func_80A6A0D8(this); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1123,7 +1126,7 @@ void EnMushi2_Update(Actor* thisx, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { func_80A6A094(this); func_80A6A0D8(this); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.h b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.h index 159116928..1a776a52a 100644 --- a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.h +++ b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.h @@ -45,6 +45,4 @@ typedef struct EnMushi2 { /* 0x370 */ s16 unk_370; } EnMushi2; // size = 0x374 -extern const ActorInit En_Mushi2_InitVars; - #endif // Z_EN_MUSHI2_H diff --git a/src/overlays/actors/ovl_En_Muto/z_en_muto.c b/src/overlays/actors/ovl_En_Muto/z_en_muto.c index 8a657ad2a..03b30a286 100644 --- a/src/overlays/actors/ovl_En_Muto/z_en_muto.c +++ b/src/overlays/actors/ovl_En_Muto/z_en_muto.c @@ -24,7 +24,7 @@ void EnMuto_SetupDialogue(EnMuto* this, PlayState* play); void EnMuto_InDialogue(EnMuto* this, PlayState* play); s32 EnMuto_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); -const ActorInit En_Muto_InitVars = { +ActorInit En_Muto_InitVars = { ACTOR_EN_MUTO, ACTORCAT_NPC, FLAGS, @@ -75,7 +75,7 @@ void EnMuto_Init(Actor* thisx, PlayState* play) { } if (gSaveContext.save.day != 3 || !gSaveContext.save.isNight) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { this->collider.dim.radius = 30; @@ -83,7 +83,7 @@ void EnMuto_Init(Actor* thisx, PlayState* play) { this->collider.dim.yShift = 0; if (gSaveContext.save.weekEventReg[63] & 0x80 || (gSaveContext.save.day == 3 && gSaveContext.save.isNight)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -255,7 +255,7 @@ void EnMuto_Update(Actor* thisx, PlayState* play2) { } if (this->isInMayorsRoom && gSaveContext.save.day == 3 && gSaveContext.save.isNight) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Muto/z_en_muto.h b/src/overlays/actors/ovl_En_Muto/z_en_muto.h index e05e29492..6ac984c8d 100644 --- a/src/overlays/actors/ovl_En_Muto/z_en_muto.h +++ b/src/overlays/actors/ovl_En_Muto/z_en_muto.h @@ -30,6 +30,4 @@ typedef struct EnMuto { /* 0x294 */ ColliderCylinder collider; } EnMuto; // size = 0x2E0 -extern const ActorInit En_Muto_InitVars; - #endif // Z_EN_MUTO_H diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index 9e27fe605..3d653a644 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -5,6 +5,7 @@ */ #include "z_en_nb.h" +#include "objects/object_nb/object_nb.h" #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20) @@ -15,11 +16,101 @@ void EnNb_Destroy(Actor* thisx, PlayState* play); void EnNb_Update(Actor* thisx, PlayState* play); void EnNb_Draw(Actor* thisx, PlayState* play); -void func_80BC0D84(EnNb* this, PlayState* play); +void EnNb_FollowSchedule(EnNb* this, PlayState* play); void func_80BC0EAC(EnNb* this, PlayState* play); -#if 0 -const ActorInit En_Nb_InitVars = { +void func_80BC08E0(EnNb* this, PlayState* play); +void func_80BC0978(EnNb* this, PlayState* play); + +s32 func_80BC00AC(Actor* thisx, PlayState* play); +s32 func_80BC01DC(Actor* thisx, PlayState* play); + +#define EN_NB_FLAG_NONE (0) +#define EN_NB_FLAG_1 (1 << 0) +#define EN_NB_FLAG_2 (1 << 1) +#define EN_NB_FLAG_4 (1 << 2) +#define EN_NB_FLAG_8 (1 << 3) +#define EN_NB_FLAG_10 (1 << 4) +#define EN_NB_FLAG_20 (1 << 5) +#define EN_NB_FLAG_40 (1 << 6) +#define EN_NB_FLAG_80 (1 << 7) +#define EN_NB_FLAG_100 (1 << 8) +#define EN_NB_FLAG_200 (1 << 9) +#define EN_NB_FLAG_400 (1 << 10) + +typedef enum EnNbScheduleResult { + /* 0 */ EN_NB_SCH_NONE, + /* 1 */ EN_NB_SCH_1, + /* 2 */ EN_NB_SCH_2, + /* 3 */ EN_NB_SCH_3, + /* 4 */ EN_NB_SCH_4, +} EnNbScheduleResult; + +static u8 sScheduleScript[] = { + /* 0x00 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(3, 0x21 - 0x04), + /* 0x04 */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_YADOYA, 0x12 - 0x08), + /* 0x08 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(6, 0, 18, 0, 0x0F - 0x0E), + /* 0x0E */ SCHEDULE_CMD_RET_NONE(), + /* 0x0F */ SCHEDULE_CMD_RET_VAL_L(EN_NB_SCH_3), + /* 0x12 */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_OMOYA, 0x20 - 0x16), + /* 0x16 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(18, 0, 6, 0, 0x1D - 0x1C), + /* 0x1C */ SCHEDULE_CMD_RET_NONE(), + /* 0x1D */ SCHEDULE_CMD_RET_VAL_L(EN_NB_SCH_4), + /* 0x20 */ SCHEDULE_CMD_RET_NONE(), + /* 0x21 */ SCHEDULE_CMD_CHECK_NOT_IN_SCENE_S(SCENE_YADOYA, 0x72 - 0x25), + /* 0x25 */ SCHEDULE_CMD_CHECK_NOT_IN_DAY_S(1, 0x47 - 0x29), + /* 0x29 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(8, 0, 12, 0, 0x44 - 0x2F), + /* 0x2F */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(12, 0, 12, 15, 0x41 - 0x35), + /* 0x35 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(12, 15, 18, 0, 0x3E - 0x3B), + /* 0x3B */ SCHEDULE_CMD_RET_VAL_L(EN_NB_SCH_3), + /* 0x3E */ SCHEDULE_CMD_RET_VAL_L(EN_NB_SCH_1), + /* 0x41 */ SCHEDULE_CMD_RET_VAL_L(EN_NB_SCH_2), + /* 0x44 */ SCHEDULE_CMD_RET_VAL_L(EN_NB_SCH_1), + /* 0x47 */ SCHEDULE_CMD_CHECK_FLAG_S(0x32, 0x20, 0x57 - 0x4B), + /* 0x4B */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(8, 0, 18, 0, 0x54 - 0x51), + /* 0x51 */ SCHEDULE_CMD_RET_VAL_L(EN_NB_SCH_3), + /* 0x54 */ SCHEDULE_CMD_RET_VAL_L(EN_NB_SCH_1), + /* 0x57 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(8, 0, 12, 0, 0x70 - 0x5D), + /* 0x5D */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(12, 0, 12, 15, 0x6E - 0x63), + /* 0x63 */ SCHEDULE_CMD_CHECK_TIME_RANGE_S(12, 15, 18, 0, 0x6C - 0x69), + /* 0x69 */ SCHEDULE_CMD_RET_VAL_L(EN_NB_SCH_3), + /* 0x6C */ SCHEDULE_CMD_RET_VAL_S(EN_NB_SCH_1), + /* 0x6E */ SCHEDULE_CMD_RET_VAL_S(EN_NB_SCH_2), + /* 0x70 */ SCHEDULE_CMD_RET_VAL_S(EN_NB_SCH_1), + /* 0x72 */ SCHEDULE_CMD_RET_NONE(), +}; + +u8 D_80BC1464[] = { + 0x1B, 0x04, 0x08, 0x00, 0x6A, 0x0A, 0x00, 0x10, 0x00, 0x08, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x0E, + 0x29, 0x12, 0x2D, 0x00, 0x0E, 0x0C, 0x10, 0x0E, 0x29, 0x01, 0x2D, 0x00, 0x0E, 0x0C, 0x10, 0x0E, 0x29, 0x02, 0x0C, + 0x0F, 0x29, 0x03, 0x0C, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x22, 0x31, 0x2D, 0x00, 0x0E, 0x12, 0x10, 0x30, 0x1C, + 0x04, 0x04, 0x0E, 0x29, 0x04, 0x0C, 0x20, 0x00, 0x03, 0x00, 0x04, 0x15, 0x09, 0x00, 0xC4, 0x09, 0x00, 0x00, 0x0F, + 0x29, 0x05, 0x0C, 0x15, 0x09, 0x00, 0xB9, 0x30, 0x1D, 0x04, 0x04, 0x0E, 0x29, 0x0B, 0x0C, 0x20, 0x00, 0x03, 0x00, + 0x04, 0x15, 0x09, 0x00, 0xA8, 0x09, 0x00, 0x00, 0x0F, 0x29, 0x0C, 0x0C, 0x15, 0x09, 0x00, 0x9D, 0x20, 0x00, 0x03, + 0x00, 0x17, 0x1B, 0x04, 0x04, 0x00, 0x09, 0x0E, 0x29, 0x11, 0x2D, 0x00, 0x0E, 0x0C, 0x16, 0x10, 0x0E, 0x29, 0x0A, + 0x2D, 0x00, 0x0E, 0x0C, 0x16, 0x10, 0x1B, 0x04, 0x04, 0x00, 0x3B, 0x0E, 0x29, 0x0D, 0x0C, 0x05, 0x00, 0x00, 0x00, + 0x0A, 0x00, 0x00, 0x0E, 0x29, 0x10, 0x2D, 0x00, 0x0E, 0x0C, 0x12, 0x16, 0x10, 0x0E, 0x29, 0x0E, 0x00, 0x32, 0x04, + 0x00, 0x59, 0x0C, 0x0F, 0x29, 0x0F, 0x0C, 0x12, 0x06, 0x00, 0x0C, 0x00, 0x00, 0x13, 0x00, 0x0C, 0x2F, 0x00, 0x00, + 0x2E, 0x2D, 0x00, 0x2A, 0x2D, 0x00, 0x0E, 0x11, 0x32, 0x04, 0x0C, 0x16, 0x10, 0x0E, 0x29, 0x06, 0x0C, 0x05, 0x00, + 0x0A, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x29, 0x07, 0x2D, 0x00, 0x0E, 0x0C, 0x12, 0x16, 0x10, 0x0E, 0x29, 0x08, 0x00, + 0x32, 0x02, 0x00, 0x1E, 0x0C, 0x0F, 0x29, 0x09, 0x0C, 0x12, 0x06, 0x00, 0x0C, 0x00, 0x00, 0x13, 0x00, 0x0C, 0x2F, + 0x00, 0x00, 0x2E, 0x2D, 0x00, 0x29, 0x2D, 0x00, 0x0E, 0x11, 0x32, 0x02, 0x0C, 0x16, 0x10, 0x2D, 0x00, 0x0E, 0x0C, + 0x12, 0x16, 0x10, 0x00, 0x00, 0x00, +}; + +u8 D_80BC1574[] = { + 0x09, 0x00, 0x00, 0x0E, 0x28, 0xC7, 0x0C, 0x09, 0x00, 0x00, 0x17, 0x0E, 0x28, 0xC8, 0x0C, 0x09, 0x00, + 0x00, 0x18, 0x0E, 0x28, 0xC9, 0x0C, 0x09, 0x00, 0x00, 0x17, 0x0E, 0x28, 0xCA, 0x0C, 0x09, 0x00, 0x00, + 0x18, 0x0E, 0x28, 0xCB, 0x0C, 0x09, 0x00, 0x00, 0x17, 0x0E, 0x28, 0xCC, 0x0C, 0x09, 0x00, 0x00, 0x18, + 0x0E, 0x28, 0xCD, 0x0C, 0x09, 0x00, 0x00, 0x17, 0x0E, 0x28, 0xCE, 0x0C, 0x09, 0x00, 0x00, 0x18, 0x0E, + 0x28, 0xCF, 0x2D, 0x00, 0x01, 0x2D, 0x00, 0x0E, 0x0C, 0x09, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, +}; + +u8 D_80BC15C8[] = { + 0x0E, 0x23, 0x62, 0x2D, 0x00, 0x0E, 0x0C, 0x10, +}; + +ActorInit En_Nb_InitVars = { ACTOR_EN_NB, ACTORCAT_NPC, FLAGS, @@ -31,81 +122,676 @@ const ActorInit En_Nb_InitVars = { (ActorFunc)EnNb_Draw, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80BC15F0 = { - { COLTYPE_HIT1, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, }, +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_HIT1, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 10, 68, 0, { 0, 0, 0 } }, }; -// sColChkInfoInit -static CollisionCheckInfoInit2 D_80BC161C = { 0, 0, 0, 0, MASS_IMMOVABLE }; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -#endif +static AnimationInfoS sAnimationInfo[] = { + { &gNbIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // EN_NB_ANIM_0 + { &gNbIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // EN_NB_ANIM_1 + { &gNbTalkAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // EN_NB_ANIM_TALK_ONCE + { &gNbTalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // EN_NB_ANIM_TALK_LOOP + { &gNbAngryAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // EN_NB_ANIM_ANGRY + { &gNbRelievedAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -4 }, // EN_NB_ANIM_RELIEVED +}; -extern ColliderCylinderInit D_80BC15F0; -extern CollisionCheckInfoInit2 D_80BC161C; +Actor* EnNb_FindActor(EnNb* this, PlayState* play, u8 actorCategory, s16 actorId) { + Actor* thisx; + Actor* actor = NULL; -extern UNK_TYPE D_06008C40; + while (true) { + actor = SubS_FindActor(play, actor, actorCategory, actorId); + if (actor == NULL) { + break; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BBFDB0.s") + thisx = &this->actor; + if ((actor != thisx) && (actor->update != NULL)) { + break; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BBFE60.s") + if (actor->next == NULL) { + actor = NULL; + break; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BBFE8C.s") + actor = actor->next; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BBFF24.s") + return actor; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BBFF90.s") +void EnNb_UpdateSkelAnime(EnNb* this) { + this->skelAnime.playSpeed = this->animPlaySpeed; + SkelAnime_Update(&this->skelAnime); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BBFFD4.s") +s32 EnNb_ChangeAnim(EnNb* this, EnNbAnimation animIndex) { + s32 shouldChange = false; + s32 didAnimationChange = false; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC0050.s") + if ((animIndex == EN_NB_ANIM_0) || (animIndex == EN_NB_ANIM_1)) { + if ((this->animIndex != EN_NB_ANIM_0) && (this->animIndex != EN_NB_ANIM_1)) { + shouldChange = true; + } + } else if (animIndex != this->animIndex) { + shouldChange = true; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC00AC.s") + if (shouldChange) { + this->animIndex = animIndex; + didAnimationChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); + this->animPlaySpeed = this->skelAnime.playSpeed; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC01DC.s") + return didAnimationChange; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC045C.s") +void func_80BBFF24(EnNb* this, PlayState* play) { + f32 yDiff; + s32 pad; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC04FC.s") + Collider_UpdateCylinder(&this->actor, &this->collider); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC05A8.s") + yDiff = this->actor.focus.pos.y - this->actor.world.pos.y; + this->collider.dim.height = yDiff; + CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC06C4.s") +Actor* func_80BBFF90(EnNb* this, PlayState* play) { + Actor* actor; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC0800.s") + if (this->scheduleResult == EN_NB_SCH_2) { + actor = EnNb_FindActor(this, play, ACTORCAT_NPC, ACTOR_EN_AN); + } else { + actor = &GET_PLAYER(play)->actor; + } + return actor; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC08E0.s") +s32 func_80BBFFD4(EnNb* this, s16 index) { + s32 ret = false; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC0978.s") + if (ActorCutscene_GetCurrentIndex() == 0x7C) { + ActorCutscene_Stop(0x7C); + ActorCutscene_SetIntentToPlay(index); + } else if (ActorCutscene_GetCanPlayNext(index)) { + ActorCutscene_StartAndSetUnkLinkFields(index, &this->actor); + ret = true; + } else { + ActorCutscene_SetIntentToPlay(index); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC0A18.s") + return ret; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC0B98.s") +s16 func_80BC0050(EnNb* this, s32 arg1) { + s16 cutscene = this->actor.cutscene; + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC0C0C.s") + for (i = 0; i < arg1; i++) { + cutscene = ActorCutscene_GetAdditionalCutscene(cutscene); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC0C80.s") + return cutscene; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC0D08.s") +typedef enum EnNbBehaviour { + /* 0 */ ENNB_BEHAVIOUR_0, + /* 1 */ ENNB_BEHAVIOUR_1, + /* 2 */ ENNB_BEHAVIOUR_2, + /* 3 */ ENNB_BEHAVIOUR_3, + /* 4 */ ENNB_BEHAVIOUR_4, + /* 5 */ ENNB_BEHAVIOUR_5, + /* 6 */ ENNB_BEHAVIOUR_6, + /* 7 */ ENNB_BEHAVIOUR_7, + /* 8 */ ENNB_BEHAVIOUR_8, + /* 9 */ ENNB_BEHAVIOUR_9 +} EnNbBehaviour; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC0D1C.s") +s32 func_80BC00AC(Actor* thisx, PlayState* play) { + EnNb* this = THIS; + s16 cutscene = func_80BC0050(this, 0); + s32 ret = false; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC0D84.s") + switch (this->behaviour) { + case ENNB_BEHAVIOUR_0: + if (!func_80BBFFD4(this, cutscene)) { + break; + } + // fallthrough + case ENNB_BEHAVIOUR_2: + case ENNB_BEHAVIOUR_4: + case ENNB_BEHAVIOUR_6: + case ENNB_BEHAVIOUR_8: + Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(cutscene)), &this->actor); + this->behaviour++; + ret = true; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC0EAC.s") + case ENNB_BEHAVIOUR_1: + case ENNB_BEHAVIOUR_3: + case ENNB_BEHAVIOUR_5: + case ENNB_BEHAVIOUR_7: + if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) { + Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(cutscene)), + this->actor.child); + } + this->behaviour++; + ret = true; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/EnNb_Init.s") + case ENNB_BEHAVIOUR_9: + ActorCutscene_Stop(cutscene); + this->behaviour++; + ret = true; + break; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/EnNb_Destroy.s") + return ret; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/EnNb_Update.s") +s32 func_80BC01DC(Actor* thisx, PlayState* play) { + EnNb* this = THIS; + s32 pad; + s32 ret = false; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC1174.s") + switch (this->behaviour) { + case ENNB_BEHAVIOUR_0: + if (Player_GetMask(play) == PLAYER_MASK_ALL_NIGHT) { + this->behaviour = ENNB_BEHAVIOUR_1; + } else { + this->behaviour = ENNB_BEHAVIOUR_5; + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC11B4.s") + case ENNB_BEHAVIOUR_1: + // Setup a black fill-screen, although initialize to 0 alpha + Play_FillScreen(&play->state, true, 0, 0, 0, 0); + this->storyTimer = 40; + this->behaviour = (u16)(this->behaviour + 1); + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/func_80BC1278.s") + case ENNB_BEHAVIOUR_2: + // Slowly increase alpha to fill the screen with a black rectangle + R_PLAY_FILL_SCREEN_ALPHA = (s16)(s32)(255.0f - (((f32)ABS_ALT(20 - this->storyTimer) / 20.0f) * 255.0f)); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nb/EnNb_Draw.s") + if (this->storyTimer == 20) { + if (gSaveContext.eventInf[4] & 4) { + // play->interfaceCtx.storyType = STORY_TYPE_MASK_FESTIVAL; + play->interfaceCtx.storyType = 0; + } else { + // play->interfaceCtx.storyType = STORY_TYPE_GIANTS_LEAVING; + play->interfaceCtx.storyType = 1; + } + // play->interfaceCtx.storyState = STORY_STATE_FADE_IN; + play->interfaceCtx.storyState = 6; + R_STORY_FILL_SCREEN_ALPHA = 255; + } + + if (DECR(this->storyTimer) == 0) { + this->behaviour++; + } + break; + + case ENNB_BEHAVIOUR_3: + // play->interfaceCtx.storyState = STORY_STATE_SETUP_IDLE; + play->interfaceCtx.storyState = 4; + this->behaviour++; + ret = true; + break; + + case ENNB_BEHAVIOUR_4: + // play->interfaceCtx.storyState = STORY_STATE_FADE_OUT; + play->interfaceCtx.storyState = 5; + this->behaviour++; + // fallthrough + case ENNB_BEHAVIOUR_5: + if (!(gSaveContext.eventInf[4] & 4)) { + gSaveContext.save.time = CLOCK_TIME(8, 0); + Sram_IncrementDay(); + } else { + func_800FE658(120.0f); + } + + this->behaviour++; + play->nextEntrance = ENTRANCE(STOCK_POT_INN, 2); + gSaveContext.nextCutsceneIndex = 0; + play->transitionTrigger = TRANS_TRIGGER_START; + play->transitionType = TRANS_TYPE_02; + gSaveContext.nextTransitionType = TRANS_TYPE_06; + gSaveContext.eventInf[4] |= 8; + break; + } + + return ret; +} + +u8* func_80BC045C(EnNb* this, PlayState* play) { + if (gSaveContext.eventInf[4] & 8) { + this->msgEventCallback = func_80BC01DC; + return D_80BC1464; + } else if (this->scheduleResult == EN_NB_SCH_2) { + this->msgEventCallback = func_80BC00AC; + return D_80BC1574; + } else if (Player_GetMask(play) == PLAYER_MASK_KAFEIS_MASK) { + return D_80BC15C8; + } else { + this->msgEventCallback = func_80BC01DC; + return D_80BC1464; + } +} + +s32 func_80BC04FC(EnNb* this, PlayState* play) { + s32 ret = false; + + if (this->stateFlags & (EN_NB_FLAG_1 | EN_NB_FLAG_2 | EN_NB_FLAG_4)) { + if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { + this->stateFlags |= EN_NB_FLAG_20; + SubS_UpdateFlags(&this->stateFlags, EN_NB_FLAG_NONE, EN_NB_FLAG_1 | EN_NB_FLAG_2 | EN_NB_FLAG_4); + this->behaviour = ENNB_BEHAVIOUR_0; + this->msgEventCallback = NULL; + this->actor.child = this->unk_1E8; + this->msgEventScript = func_80BC045C(this, play); + this->stateFlags |= EN_NB_FLAG_20; + this->actionFunc = func_80BC0EAC; + ret = true; + } + } + return ret; +} + +void func_80BC05A8(EnNb* this, PlayState* play) { + Player* player = GET_PLAYER(play); + TextState talkState = Message_GetState(&play->msgCtx); + u16 textId = play->msgCtx.currentTextId; + + if ((&this->actor == player->targetActor) && ((textId < 0xFF) || (textId > 0x200)) && (talkState == TEXT_STATE_3) && + (this->prevTalkState == TEXT_STATE_3)) { + if ((play->state.frames % 3) == 0) { + if (this->unk_26C == 120.0f) { + this->unk_26C = 0.0f; + } else { + this->unk_26C = 120.0f; + } + } + } else { + this->unk_26C = 0.0f; + } + + Math_SmoothStepToF(&this->unk_270, this->unk_26C, 0.8f, 40.0f, 10.0f); + Matrix_Translate(this->unk_270, 0.0f, 0.0f, MTXMODE_APPLY); + this->prevTalkState = talkState; +} + +void func_80BC06C4(EnNb* this) { + s32 pad; + Vec3f sp40; + Vec3f sp34; + Player* player; + + Math_Vec3f_Copy(&sp40, &this->unk_1E8->world.pos); + Math_Vec3f_Copy(&sp34, &this->actor.world.pos); + Math_ApproachS(&this->headRotY, Math_Vec3f_Yaw(&sp34, &sp40) - this->actor.shape.rot.y, 4, 0x2AA8); + + this->headRotY = CLAMP(this->headRotY, -0x1FFE, 0x1FFE); + + Math_Vec3f_Copy(&sp34, &this->actor.focus.pos); + + if (this->unk_1E8->id == ACTOR_PLAYER) { + player = (Player*)this->unk_1E8; + + sp40.y = player->bodyPartsPos[7].y + 3.0f; + } else { + Math_Vec3f_Copy(&sp40, &this->unk_1E8->focus.pos); + } + + Math_ApproachS(&this->headRotZ, Math_Vec3f_Pitch(&sp34, &sp40), 4, 0x2AA8); + + this->headRotZ = CLAMP(this->headRotZ, -0x1554, 0x1554); +} + +void func_80BC0800(EnNb* this) { + if (this->stateFlags & EN_NB_FLAG_20) { + if ((this->unk_1E8 != NULL) && (this->unk_1E8->update != NULL)) { + if (DECR(this->unk_282) == 0) { + func_80BC06C4(this); + this->stateFlags &= ~EN_NB_FLAG_400; + this->stateFlags |= EN_NB_FLAG_100; + return; + } + } + } + + if (this->stateFlags & EN_NB_FLAG_100) { + this->stateFlags &= ~EN_NB_FLAG_100; + this->headRotZ = 0; + this->headRotY = 0; + this->unk_282 = 20; + } else if (DECR(this->unk_282) == 0) { + this->stateFlags |= EN_NB_FLAG_400; + } +} + +// Related to both stories? +void func_80BC08E0(EnNb* this, PlayState* play) { + if (this->unk_284 == 0) { + EnNb_ChangeAnim(this, EN_NB_ANIM_TALK_ONCE); + this->stateFlags |= EN_NB_FLAG_400; + this->unk_284++; + } else if ((this->unk_284 == 1) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { + EnNb_ChangeAnim(this, EN_NB_ANIM_1); + this->stateFlags &= ~EN_NB_FLAG_400; + this->unk_284++; + } +} + +void func_80BC0978(EnNb* this, PlayState* play) { + if (this->unk_284 == 0) { + EnNb_ChangeAnim(this, EN_NB_ANIM_RELIEVED); + this->stateFlags &= ~EN_NB_FLAG_20; + this->stateFlags |= EN_NB_FLAG_400; + this->unk_284++; + } else if ((this->unk_284 == 1) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { + EnNb_ChangeAnim(this, EN_NB_ANIM_TALK_LOOP); + this->stateFlags &= ~EN_NB_FLAG_400; + this->unk_284++; + } +} + +s32 func_80BC0A18(EnNb* this, PlayState* play) { + Player* player = GET_PLAYER(play); + u16 currentTextId = play->msgCtx.currentTextId; + + if (player->stateFlags1 & PLAYER_STATE1_40) { + this->stateFlags |= EN_NB_FLAG_80; + + if (this->textId != currentTextId) { + switch (currentTextId) { + case 0x28CF: + this->stateFlags |= EN_NB_FLAG_20; + EnNb_ChangeAnim(this, EN_NB_ANIM_TALK_LOOP); + break; + + case 0x2904: // "You want to hear the carnival of time story? ..." + case 0x290B: // "You want to hear the four giants story? ..." + this->unk_18C = func_80BC08E0; + this->unk_284 = 0; + break; + + case 0x28CD: + this->unk_18C = func_80BC0978; + this->unk_284 = 0; + break; + + case 0x28CB: // "I told you I already ate!" + EnNb_ChangeAnim(this, EN_NB_ANIM_ANGRY); + break; + + case 0x28C7: + case 0x2901: + case 0x2902: + case 0x2906: + case 0x290D: + case 0x2912: + EnNb_ChangeAnim(this, EN_NB_ANIM_TALK_LOOP); + break; + } + } + + this->textId = currentTextId; + } else if (this->stateFlags & EN_NB_FLAG_80) { + this->unk_18C = NULL; + this->textId = 0; + this->stateFlags &= ~EN_NB_FLAG_80; + EnNb_ChangeAnim(this, EN_NB_ANIM_1); + } + + if (this->unk_18C != NULL) { + this->unk_18C(this, play); + } + + return 0; +} + +s32 func_80BC0B98(EnNb* this, PlayState* play, ScheduleOutput* scheduleOutput) { + s32 success = false; + + if (EnNb_FindActor(this, play, ACTORCAT_NPC, ACTOR_EN_AN) != NULL) { + SubS_UpdateFlags(&this->stateFlags, EN_NB_FLAG_1 | EN_NB_FLAG_2, EN_NB_FLAG_1 | EN_NB_FLAG_2 | EN_NB_FLAG_4); + this->stateFlags |= EN_NB_FLAG_20; + EnNb_ChangeAnim(this, EN_NB_ANIM_0); + success = true; + } + + return success; +} + +s32 func_80BC0C0C(EnNb* this, PlayState* play, ScheduleOutput* scheduleOutput) { + if (!(gSaveContext.eventInf[4] & 8)) { + SubS_UpdateFlags(&this->stateFlags, EN_NB_FLAG_1 | EN_NB_FLAG_2, EN_NB_FLAG_1 | EN_NB_FLAG_2 | EN_NB_FLAG_4); + } else { + SubS_UpdateFlags(&this->stateFlags, EN_NB_FLAG_4, EN_NB_FLAG_1 | EN_NB_FLAG_2 | EN_NB_FLAG_4); + } + EnNb_ChangeAnim(this, EN_NB_ANIM_0); + + return true; +} + +s32 EnNb_ProcessScheduleOutput(EnNb* this, PlayState* play, ScheduleOutput* scheduleOutput) { + s32 success; + + this->actor.flags |= ACTOR_FLAG_1; + this->actor.targetMode = 0; + this->stateFlags = EN_NB_FLAG_NONE; + this->unk_274 = 40.0f; + + switch (scheduleOutput->result) { + default: + success = false; + break; + + case EN_NB_SCH_1: + case EN_NB_SCH_3: + case EN_NB_SCH_4: + success = func_80BC0C0C(this, play, scheduleOutput); + break; + + case EN_NB_SCH_2: + success = func_80BC0B98(this, play, scheduleOutput); + break; + } + return success; +} + +s32 func_80BC0D08(EnNb* this, PlayState* play) { + return 0; +} + +void EnNb_HandleSchedule(EnNb* this, PlayState* play) { + if ((this->scheduleResult == EN_NB_SCH_1) || (this->scheduleResult == EN_NB_SCH_2) || + (this->scheduleResult == EN_NB_SCH_3) || (this->scheduleResult == EN_NB_SCH_4)) { + func_80BC0D08(this, play); + } + + Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 3, 0x2AA8); +} + +void EnNb_FollowSchedule(EnNb* this, PlayState* play) { + ScheduleOutput scheduleOutput; + + this->timePathTimeSpeed = REG(15) + ((void)0, gSaveContext.save.daySpeed); + + if (gSaveContext.eventInf[4] & 8) { + scheduleOutput.result = EN_NB_SCH_1; + EnNb_ProcessScheduleOutput(this, play, &scheduleOutput); + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; + this->actor.flags |= ACTOR_FLAG_1; + } else if (!Schedule_RunScript(play, sScheduleScript, &scheduleOutput) || + ((this->scheduleResult != scheduleOutput.result) && + !EnNb_ProcessScheduleOutput(this, play, &scheduleOutput))) { + this->actor.shape.shadowDraw = NULL; + this->actor.flags &= ~ACTOR_FLAG_1; + scheduleOutput.result = EN_NB_SCH_NONE; + } else { + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; + this->actor.flags |= ACTOR_FLAG_1; + } + + this->scheduleResult = scheduleOutput.result; + this->unk_1E8 = func_80BBFF90(this, play); + EnNb_HandleSchedule(this, play); +} + +void func_80BC0EAC(EnNb* this, PlayState* play) { + if (func_8010BF58(&this->actor, play, this->msgEventScript, this->msgEventCallback, &this->msgEventArg4)) { + if (gSaveContext.eventInf[4] & 8) { + gSaveContext.eventInf[4] &= (u8)~4; + gSaveContext.eventInf[4] &= (u8)~8; + } + + SubS_UpdateFlags(&this->stateFlags, EN_NB_FLAG_1 | EN_NB_FLAG_2, EN_NB_FLAG_1 | EN_NB_FLAG_2 | EN_NB_FLAG_4); + if (this->scheduleResult != EN_NB_SCH_2) { + this->stateFlags &= ~EN_NB_FLAG_20; + } + + this->actor.child = NULL; + this->stateFlags |= EN_NB_FLAG_400; + this->unk_282 = 20; + this->msgEventArg4 = 0; + this->actionFunc = EnNb_FollowSchedule; + } +} + +void EnNb_Init(Actor* thisx, PlayState* play) { + EnNb* this = THIS; + + ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); + SkelAnime_InitFlex(play, &this->skelAnime, &gNbSkel, NULL, this->jointTable, this->morphTable, NB_LIMB_MAX); + + this->animIndex = EN_NB_ANIM_INVALID; + EnNb_ChangeAnim(this, EN_NB_ANIM_0); + + Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); + Actor_SetScale(&this->actor, 0.01f); + this->stateFlags = EN_NB_FLAG_NONE; + + if (gSaveContext.eventInf[4] & 8) { + SubS_UpdateFlags(&this->stateFlags, EN_NB_FLAG_4, EN_NB_FLAG_1 | EN_NB_FLAG_2 | EN_NB_FLAG_4); + } else { + gSaveContext.eventInf[4] &= (u8)~4; + gSaveContext.eventInf[4] &= (u8)~8; + } + + this->actionFunc = EnNb_FollowSchedule; + this->actionFunc(this, play); +} + +void EnNb_Destroy(Actor* thisx, PlayState* play) { + EnNb* this = THIS; + + Collider_DestroyCylinder(play, &this->collider); + play->interfaceCtx.storyState = 3; +} + +void EnNb_Update(Actor* thisx, PlayState* play) { + EnNb* this = THIS; + + func_80BC04FC(this, play); + this->actionFunc(this, play); + func_80BC0A18(this, play); + + if (this->scheduleResult != EN_NB_SCH_NONE) { + EnNb_UpdateSkelAnime(this); + func_80BC0800(this); + if (Actor_IsFacingPlayer(&this->actor, 0x38E0)) { + func_8013C964(&this->actor, play, this->unk_274, 30.0f, ITEM_OCARINA, + this->stateFlags & (EN_NB_FLAG_1 | EN_NB_FLAG_2 | EN_NB_FLAG_4)); + } + func_80BBFF24(this, play); + } +} + +s32 EnNb_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + EnNb* this = THIS; + + if (limbIndex == NB_LIMB_HEAD) { + func_80BC05A8(this, play); + } + + return false; +} + +void EnNb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + EnNb* this = THIS; + Vec3f focusTarget; + + if ((ActorCutscene_GetCurrentIndex() == -1) && (limbIndex == NB_LIMB_HEAD)) { + Matrix_MultVec3f(&gZeroVec3f, &focusTarget); + Math_ApproachF(&thisx->focus.pos.x, focusTarget.x, 0.6f, 10000.0f); + Math_ApproachF(&thisx->focus.pos.y, focusTarget.y, 0.6f, 10000.0f); + Math_ApproachF(&thisx->focus.pos.z, focusTarget.z, 0.6f, 10000.0f); + Math_Vec3s_Copy(&thisx->focus.rot, &thisx->world.rot); + } +} + +void EnNb_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) { + EnNb* this = THIS; + s32 stepRot; + s32 overrideRot; + + if (!(this->stateFlags & EN_NB_FLAG_400)) { + overrideRot = false; + if (this->stateFlags & EN_NB_FLAG_100) { + overrideRot = true; + stepRot = true; + } else { + stepRot = true; + } + } else { + overrideRot = false; + stepRot = false; + } + + if (limbIndex == NB_LIMB_HEAD) { + SubS_UpdateLimb(this->headRotZ + 0x4000, this->headRotY + this->actor.shape.rot.y + 0x4000, + &this->headComputedPos, &this->headComputedRot, stepRot, overrideRot); + Matrix_Pop(); + Matrix_Translate(this->headComputedPos.x, this->headComputedPos.y, this->headComputedPos.z, MTXMODE_NEW); + Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); + Matrix_RotateYS(this->headComputedRot.y, MTXMODE_APPLY); + Matrix_RotateXS(this->headComputedRot.x, MTXMODE_APPLY); + Matrix_RotateZS(this->headComputedRot.z, MTXMODE_APPLY); + Matrix_Push(); + } +} + +void EnNb_Draw(Actor* thisx, PlayState* play) { + EnNb* this = THIS; + + if (this->scheduleResult != EN_NB_SCH_NONE) { + func_8012C5B0(play->state.gfxCtx); + SkelAnime_DrawTransformFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, + this->skelAnime.dListCount, EnNb_OverrideLimbDraw, EnNb_PostLimbDraw, + EnNb_TransformLimbDraw, &this->actor); + } +} diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.h b/src/overlays/actors/ovl_En_Nb/z_en_nb.h index b094456d9..f11464c79 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.h +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.h @@ -2,18 +2,57 @@ #define Z_EN_NB_H #include "global.h" +#include "objects/object_nb/object_nb.h" struct EnNb; typedef void (*EnNbActionFunc)(struct EnNb*, PlayState*); +typedef s32 (*EnNbUnkFunc)(Actor*, PlayState*); +typedef void (*EnNbUnkFunc2)(struct EnNb*, PlayState*); + +typedef enum EnNbAnimation { + /* -1 */ EN_NB_ANIM_INVALID = -1, + /* 0 */ EN_NB_ANIM_0, + /* 1 */ EN_NB_ANIM_1, + /* 2 */ EN_NB_ANIM_TALK_ONCE, + /* 3 */ EN_NB_ANIM_TALK_LOOP, + /* 4 */ EN_NB_ANIM_ANGRY, + /* 5 */ EN_NB_ANIM_RELIEVED, +} EnNbAnimation; typedef struct EnNb { /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x44]; + /* 0x144 */ SkelAnime skelAnime; /* 0x188 */ EnNbActionFunc actionFunc; - /* 0x18C */ char unk_18C[0x110]; + /* 0x18C */ EnNbUnkFunc2 unk_18C; + /* 0x190 */ ColliderCylinder collider; + /* 0x1DC */ u8 scheduleResult; + /* 0x1E0 */ u8* msgEventScript; + /* 0x1E4 */ s32 msgEventArg4; + /* 0x1E8 */ Actor* unk_1E8; + /* 0x1EC */ UNK_TYPE1 unk_1EC[4]; + /* 0x1F0 */ Vec3f headComputedPos; + /* 0x1FC */ Vec3s headComputedRot; + /* 0x202 */ Vec3s jointTable[NB_LIMB_MAX]; + /* 0x232 */ Vec3s morphTable[NB_LIMB_MAX]; + /* 0x262 */ u16 stateFlags; + /* 0x264 */ u16 textId; + /* 0x268 */ f32 animPlaySpeed; + /* 0x26C */ f32 unk_26C; // Related to unk_270 + /* 0x270 */ f32 unk_270; // headDisplacement? controls how much the upper part of the head moves when she talks + /* 0x274 */ f32 unk_274; + /* 0x278 */ UNK_TYPE1 unk_278[4]; + /* 0x27C */ s16 headRotZ; // Slightly rotates head when talking + /* 0x27E */ s16 headRotY; + /* 0x280 */ s16 timePathTimeSpeed; + /* 0x282 */ s16 unk_282; // timer? + /* 0x284 */ s16 unk_284; // storyState? + /* 0x286 */ s16 storyTimer; + /* 0x288 */ s16 behaviour; + /* 0x28C */ EnNbUnkFunc msgEventCallback; + /* 0x290 */ EnNbAnimation animIndex; + /* 0x294 */ UNK_TYPE1 unk_294[4]; + /* 0x294 */ TextState prevTalkState; } EnNb; // size = 0x29C -extern const ActorInit En_Nb_InitVars; - #endif // Z_EN_NB_H diff --git a/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c b/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c index bf91c7516..86099a214 100644 --- a/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c +++ b/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c @@ -36,7 +36,7 @@ void EnNeoReeba_SetupDeathEffects(EnNeoReeba* this); void EnNeoReeba_PlayDeathEffects(EnNeoReeba* this, PlayState* play); void EnNeoReeba_SpawnIce(EnNeoReeba* this, PlayState* play); -const ActorInit En_Neo_Reeba_InitVars = { +ActorInit En_Neo_Reeba_InitVars = { ACTOR_EN_NEO_REEBA, ACTORCAT_ENEMY, FLAGS, @@ -466,7 +466,7 @@ void EnNeoReeba_PlayDeathEffects(EnNeoReeba* this, PlayState* play) { if (this->actor.scale.x < 0.01f) { func_800B3030(play, &this->actor.world.pos, &sDeadDbAccel, &sDeadDbVel, 120, 0, 0); Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x60); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { if (this->actionTimer <= 10) { diff --git a/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.h b/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.h index a739d96db..2cd24c88e 100644 --- a/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.h +++ b/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.h @@ -31,6 +31,4 @@ typedef struct EnNeoReeba { /* 0x310 */ u8 drawEffectType; } EnNeoReeba; // size = 0x314 -extern const ActorInit En_Neo_Reeba_InitVars; - #endif // Z_EN_NEO_REEBA_H diff --git a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c index 11872a0a1..abaf6c3e0 100644 --- a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c +++ b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c @@ -18,7 +18,7 @@ void EnNimotsu_Draw(Actor* thisx, PlayState* play); void EnNimotsu_UpdateCollision(EnNimotsu* this, PlayState* play); -const ActorInit En_Nimotsu_InitVars = { +ActorInit En_Nimotsu_InitVars = { ACTOR_EN_NIMOTSU, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.h b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.h index e839c9393..88e4a1f42 100644 --- a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.h +++ b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.h @@ -13,6 +13,4 @@ typedef struct EnNimotsu { /* 0x1DA */ s16 timer; } EnNimotsu; // size = 0x1DC -extern const ActorInit En_Nimotsu_InitVars; - #endif // Z_EN_NIMOTSU_H diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 112871c90..1c9212a63 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -48,7 +48,7 @@ enum EnNiwState { /* 8 */ NIW_STATE_HOPPING, }; -const ActorInit En_Niw_InitVars = { +ActorInit En_Niw_InitVars = { ACTOR_EN_NIW, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c b/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c index 5597bf9f6..0187e1c88 100644 --- a/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c +++ b/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c @@ -21,7 +21,7 @@ void EnNnh_WaitForDialogue(EnNnh* this, PlayState* play); void EnNnh_SetupDialogue(EnNnh* this); void EnNnh_Dialogue(EnNnh* this, PlayState* play); -const ActorInit En_Nnh_InitVars = { +ActorInit En_Nnh_InitVars = { ACTOR_EN_NNH, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_En_Nnh/z_en_nnh.h b/src/overlays/actors/ovl_En_Nnh/z_en_nnh.h index 344ccb345..bcbf9caeb 100644 --- a/src/overlays/actors/ovl_En_Nnh/z_en_nnh.h +++ b/src/overlays/actors/ovl_En_Nnh/z_en_nnh.h @@ -13,6 +13,4 @@ typedef struct EnNnh { /* 0x190 */ EnNnhActionFunc actionFunc; } EnNnh; // size = 0x194 -extern const ActorInit En_Nnh_InitVars; - #endif // Z_EN_NNH_H diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index c93e531be..d1d57e741 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -19,7 +19,7 @@ void EnNutsball_Draw(Actor* thisx, PlayState* play); void EnNutsball_InitColliderParams(EnNutsball* this); -const ActorInit En_Nutsball_InitVars = { +ActorInit En_Nutsball_InitVars = { ACTOR_EN_NUTSBALL, ACTORCAT_PROP, FLAGS, @@ -97,7 +97,8 @@ void EnNutsball_Update(Actor* thisx, PlayState* play2) { s32 bgId; CollisionPoly* poly; - if (!(player->stateFlags1 & 0x300000C0)) { + if (!(player->stateFlags1 & + (PLAYER_STATE1_40 | PLAYER_STATE1_80 | PLAYER_STATE1_10000000 | PLAYER_STATE1_20000000))) { this->timer--; if (this->timer < 0) { this->actor.velocity.y += this->actor.gravity; @@ -125,11 +126,11 @@ void EnNutsball_Update(Actor* thisx, PlayState* play2) { } else { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { if (this->timer == -300) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h index a8ae31da2..04e807727 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h @@ -12,6 +12,4 @@ typedef struct EnNutsball { /* 0x148 */ ColliderCylinder collider; } EnNutsball; // size = 0x194 -extern const ActorInit En_Nutsball_InitVars; - #endif // Z_EN_NUTSBALL_H diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c index 3f66f7f70..5fcd69fc8 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c @@ -41,7 +41,7 @@ enum EnNiwState { /* 4 */ NWC_STATE_RUNNING, // running from the player after failed breman march }; -const ActorInit En_Nwc_InitVars = { +ActorInit En_Nwc_InitVars = { ACTOR_EN_NWC, ACTORCAT_PROP, FLAGS, @@ -64,7 +64,7 @@ void EnNwc_Init(Actor* thisx, PlayState* play) { niwObjectIndex = Object_GetIndex(&play->objectCtx, OBJECT_NIW); if (niwObjectIndex < 0) { // niw object does not exist, we need it for tranformation, despawn - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -72,7 +72,7 @@ void EnNwc_Init(Actor* thisx, PlayState* play) { // if breman mask was already used, replace with adult EnNiw Actor_Spawn(&play->actorCtx, play, ACTOR_EN_NIW, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.world.rot.y, 0, NIW_TYPE_REGULAR); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -147,7 +147,7 @@ s32 EnNwc_PlayerReleasedBremanMarch(EnNwc* this, PlayState* play) { return false; } - if (player->stateFlags3 & 0x20000000) { // breman mask march + if (player->stateFlags3 & PLAYER_STATE3_20000000) { return false; } @@ -165,8 +165,7 @@ s32 EnNwc_IsFound(EnNwc* this, PlayState* play) { return false; } - if (player->stateFlags3 & 0x20000000 && // breman mask march - this->actor.xzDistToPlayer < 100.0f) { + if ((player->stateFlags3 & PLAYER_STATE3_20000000) && this->actor.xzDistToPlayer < 100.0f) { return true; } diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h index 8d2d34c6a..51c017dff 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h @@ -35,6 +35,4 @@ typedef struct EnNwc { /* 0x264 */ EnNwcActionFunc actionFunc; } EnNwc; // size = 0x268 -extern const ActorInit En_Nwc_InitVars; - #endif // Z_EN_NWC_H diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c index ae3b3f04c..df778f1a7 100644 --- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c +++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c @@ -19,7 +19,7 @@ void func_8096B104(EnOkarinaEffect* this, PlayState* play); void func_8096B174(EnOkarinaEffect* this, PlayState* play); void func_8096B1FC(EnOkarinaEffect* this, PlayState* play); -const ActorInit En_Okarina_Effect_InitVars = { +ActorInit En_Okarina_Effect_InitVars = { ACTOR_EN_OKARINA_EFFECT, ACTORCAT_ITEMACTION, FLAGS, @@ -42,7 +42,7 @@ void EnOkarinaEffect_Init(Actor* thisx, PlayState* play) { EnOkarinaEffect* this = THIS; if (play->envCtx.unk_F2[1]) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } EnOkarinaEffect_SetupAction(this, func_8096B104); } @@ -58,7 +58,7 @@ void func_8096B104(EnOkarinaEffect* this, PlayState* play) { void func_8096B174(EnOkarinaEffect* this, PlayState* play) { DECR(this->unk144); - if ((play->pauseCtx.state == 0) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) && + if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->msgCtx.msgLength == 0) && !FrameAdvance_IsEnabled(&play->state) && (this->unk144 == 0)) { EnOkarinaEffect_SetupAction(this, func_8096B1FC); } @@ -73,7 +73,7 @@ void func_8096B1FC(EnOkarinaEffect* this, PlayState* play) { } } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.h b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.h index 67fa74b2c..b633ab390 100644 --- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.h +++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.h @@ -14,6 +14,4 @@ typedef struct EnOkarinaEffect { /* 0x148 */ EnOkarinaEffectActionFunc actionFunc; } EnOkarinaEffect; // size = 0x14C -extern const ActorInit En_Okarina_Effect_InitVars; - #endif // Z_EN_OKARINA_EFFECT_H diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index 40cb4ba24..d4d3db017 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -17,7 +17,7 @@ void EnOkarinaTag_Update(Actor* thisx, PlayState* play); void func_8093E518(EnOkarinaTag* this, PlayState* play); void func_8093E68C(EnOkarinaTag* this, PlayState* play); -const ActorInit En_Okarina_Tag_InitVars = { +ActorInit En_Okarina_Tag_InitVars = { ACTOR_EN_OKARINA_TAG, ACTORCAT_SWITCH, FLAGS, diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h index 8dd51805c..0dd15c1c9 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h @@ -22,6 +22,4 @@ typedef struct EnOkarinaTag { /* 0x158 */ f32 unk158; } EnOkarinaTag; // size = 0x15C -extern const ActorInit En_Okarina_Tag_InitVars; - #endif // Z_EN_OKARINA_TAG_H diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 938696e88..8241c7e5c 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -28,7 +28,7 @@ void func_8086F57C(EnOkuta* this, PlayState* play); void func_8086F694(EnOkuta* this, PlayState* play); #if 0 -const ActorInit En_Okuta_InitVars = { +ActorInit En_Okuta_InitVars = { ACTOR_EN_OKUTA, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h index c23a4db36..93a68ae38 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h @@ -14,6 +14,4 @@ typedef struct EnOkuta { /* 0x18C */ char unk_18C[0x1A8]; } EnOkuta; // size = 0x334 -extern const ActorInit En_Okuta_InitVars; - #endif // Z_EN_OKUTA_H diff --git a/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.c b/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.c index 59b3140bc..df18de3e7 100644 --- a/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.c +++ b/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.c @@ -16,7 +16,7 @@ void EnOnpuman_Update(Actor* thisx, PlayState* play); void func_80B121D8(EnOnpuman* this, PlayState* play); -const ActorInit En_Onpuman_InitVars = { +ActorInit En_Onpuman_InitVars = { ACTOR_EN_ONPUMAN, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.h b/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.h index 88cd1e4df..581ea35dd 100644 --- a/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.h +++ b/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.h @@ -16,6 +16,4 @@ typedef struct EnOnpuman { /* 0x2A8 */ EnOnpumanActionFunc actionFunc; } EnOnpuman; // size = 0x2AC -extern const ActorInit En_Onpuman_InitVars; - #endif // Z_EN_ONPUMAN_H diff --git a/src/overlays/actors/ovl_En_Osk/z_en_osk.c b/src/overlays/actors/ovl_En_Osk/z_en_osk.c index 0180a2e67..ac3c5ef6b 100644 --- a/src/overlays/actors/ovl_En_Osk/z_en_osk.c +++ b/src/overlays/actors/ovl_En_Osk/z_en_osk.c @@ -22,7 +22,7 @@ void func_80BF61EC(EnOsk* this, PlayState* play); void func_80BF656C(EnOsk* this, PlayState* play); void func_80BF6A20(EnOsk* this, PlayState* play); -const ActorInit En_Osk_InitVars = { +ActorInit En_Osk_InitVars = { ACTOR_EN_OSK, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Osk/z_en_osk.h b/src/overlays/actors/ovl_En_Osk/z_en_osk.h index d8a4be4ce..0358911d3 100644 --- a/src/overlays/actors/ovl_En_Osk/z_en_osk.h +++ b/src/overlays/actors/ovl_En_Osk/z_en_osk.h @@ -24,6 +24,4 @@ typedef struct EnOsk { /* 0x260 */ EnOskActionFunc actionFunc; } EnOsk; // size = 0x264 -extern const ActorInit En_Osk_InitVars; - #endif // Z_EN_OSK_H diff --git a/src/overlays/actors/ovl_En_Osn/z_en_osn.c b/src/overlays/actors/ovl_En_Osn/z_en_osn.c index 1f9cb3da8..a61c0dc22 100644 --- a/src/overlays/actors/ovl_En_Osn/z_en_osn.c +++ b/src/overlays/actors/ovl_En_Osn/z_en_osn.c @@ -16,7 +16,69 @@ void EnOsn_Destroy(Actor* thisx, PlayState* play); void EnOsn_Update(Actor* thisx, PlayState* play); void EnOsn_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Osn_InitVars = { +void EnOsn_Idle(EnOsn* this, PlayState* play); +void EnOsn_StartCutscene(EnOsn* this, PlayState* play); +void EnOsn_HandleCsAction(EnOsn* this, PlayState* play); +void EnOsn_Talk(EnOsn* this, PlayState* play); + +#define OSN_STATE_SPECIAL_CONVERSTATION (1 << 0) +#define OSN_STATE_MET_HUMAN (1 << 1) +#define OSN_STATE_MET_DEKU (1 << 2) +#define OSN_STATE_MET_GORON (1 << 3) +#define OSN_STATE_MET_ZORA (1 << 4) +#define OSN_STATE_END_CONVERSATION (1 << 5) + +#define OSN_MASK_TEXT_GREAT_FAIRY (1 << 0) +#define OSN_MASK_TEXT_GIBDO (1 << 1) +#define OSN_MASK_TEXT_TRUTH (1 << 2) +#define OSN_MASK_TEXT_GIANT (1 << 3) +#define OSN_MASK_TEXT_KAFEIS (1 << 4) +#define OSN_MASK_TEXT_DON_GERO (1 << 5) +#define OSN_MASK_TEXT_BLAST (1 << 6) +#define OSN_MASK_TEXT_COUPLE (1 << 7) +#define OSN_MASK_TEXT_SCENTS (1 << 8) +#define OSN_MASK_TEXT_KAMARO (1 << 9) +#define OSN_MASK_TEXT_STONE (1 << 10) +#define OSN_MASK_TEXT_POSTMAN (1 << 11) +#define OSN_MASK_TEXT_BUNNY (1 << 12) +#define OSN_MASK_TEXT_CAPTAIN (1 << 13) +#define OSN_MASK_TEXT_BREMEN (1 << 14) +#define OSN_MASK_TEXT_CIRCUS_LEADER (1 << 15) +#define OSN_MASK_TEXT_KEATON (1 << 16) +#define OSN_MASK_TEXT_GARO (1 << 17) +#define OSN_MASK_TEXT_ALL_NIGHT (1 << 18) +#define OSN_MASK_TEXT_ROMANI (1 << 19) + +typedef enum { + /* 0 */ OSN_ANIM_IDLE, + /* 1 */ OSN_ANIM_ARMS_OUT, + /* 2 */ OSN_ANIM_BOWING, + /* 3 */ OSN_ANIM_REMINISCE, + /* 4 */ OSN_ANIM_HANDS_CLASPED, + /* 5 */ OSN_ANIM_BELIEVE, + /* 6 */ OSN_ANIM_THINK, + /* 7 */ OSN_ANIM_SHAKE_HEAD, + /* 8 */ OSN_ANIM_ORGAN_TALK, + /* 9 */ OSN_ANIM_ORGAN_PLAY, + /* 10 */ OSN_ANIM_SHAKE, + /* 11 */ OSN_ANIM_CHOKE, + /* 12 */ OSN_ANIM_DESPAIR, + /* 13 */ OSN_ANIM_FAST_BOWS, + /* 14 */ OSN_ANIM_HAND_OUT, + /* 15 */ OSN_ANIM_LYING_DOWN_FACE_UP, + /* 16 */ OSN_ANIM_LYING_DOWN_FACE_DOWN, + /* 17 */ OSN_ANIM_MASK_LOOK_AT, + /* 18 */ OSN_ANIM_TURN_AROUND_START, + /* 19 */ OSN_ANIM_TURN_AROUND_LOOP, + /* 20 */ OSN_ANIM_WALK_AWAY, + /* 21 */ OSN_ANIM_MASK_LOOK_FROM_START, + /* 22 */ OSN_ANIM_MASK_LOOK_FROM_LOOP, + /* 23 */ OSN_ANIM_HAND_OUT_2, // Exact same as OSN_ANIM_HAND_OUT + /* 24 */ OSN_ANIM_WALK_AWAY_END, // Only the last frame of OSN_ANIM_WALK_AWAY + /* 25 */ OSN_ANIM_MAX +} OsnAnimation; + +ActorInit En_Osn_InitVars = { ACTOR_EN_OSN, ACTORCAT_NPC, FLAGS, @@ -29,31 +91,31 @@ const ActorInit En_Osn_InitVars = { }; static AnimationInfo sAnimationInfo[] = { - { &object_osn_Anim_0201BC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_002F74, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_0037C4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_004320, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_004C8C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_0094E4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_009BB8, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_00AC60, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_001614, 1.0f, 1.0f, 39.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_001034, 1.0f, 1.0f, 70.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_00AE9C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_003A1C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_0055F8, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_007220, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_00A444, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_0000C4, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, - { &object_osn_Anim_0000C4, 0.0f, 1.0f, 1.0f, ANIMMODE_ONCE, 0.0f }, - { &object_osn_Anim_006D48, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_001D6C, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, - { &object_osn_Anim_002634, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_008D80, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, - { &object_osn_Anim_005D78, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, - { &object_osn_Anim_006564, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_00A444, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, - { &object_osn_Anim_008D80, 0.0f, 77.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, + { &gHappyMaskSalesmanIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanArmsOutAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanBowingAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanReminisceAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanHandsClaspedAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanBelieveAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanThinkAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanShakeHeadAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanOrganTalkAnim, 1.0f, 1.0f, 39.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanOrganPlayAnim, 1.0f, 1.0f, 70.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanShakeAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanChokeAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanDespairAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanFastBowsAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanHandOutAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanLyingDownAnim, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, + { &gHappyMaskSalesmanLyingDownAnim, 0.0f, 1.0f, 1.0f, ANIMMODE_ONCE, 0.0f }, + { &gHappyMaskSalesmanMaskLookAtAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanTurnAroundStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, + { &gHappyMaskSalesmanTurnAroundLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanWalkAwayAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, + { &gHappyMaskSalesmanMaskLookFromStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, + { &gHappyMaskSalesmanMaskLookFromLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanHandOutAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f }, + { &gHappyMaskSalesmanWalkAwayAnim, 0.0f, 77.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, }; static ColliderCylinderInit sCylinderInit = { @@ -117,12 +179,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_U8(targetMode, 0, ICHAIN_STOP), }; -void func_80AD1634(EnOsn*, PlayState*); -void func_80AD16A8(EnOsn*, PlayState*); -void func_80AD14C8(EnOsn*, PlayState*); -void func_80AD19A0(EnOsn* this, PlayState* play); - -void func_80AD0830(EnOsn* this, PlayState* play) { +void EnOsn_UpdateCollider(EnOsn* this, PlayState* play) { this->collider.dim.pos.x = this->actor.world.pos.x; this->collider.dim.pos.y = this->actor.world.pos.y; this->collider.dim.pos.z = this->actor.world.pos.z; @@ -130,225 +187,265 @@ void func_80AD0830(EnOsn* this, PlayState* play) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } -s32 func_80AD08B0(PlayState* play) { +s32 EnOsn_GetMaskText(PlayState* play) { switch (Player_GetMask(play)) { case PLAYER_MASK_GREAT_FAIRY: return 0x1FD6; + case PLAYER_MASK_GIBDO: return 0x1FD8; + case PLAYER_MASK_TRUTH: return 0x1FDA; + case PLAYER_MASK_GIANT: return 0x1FDC; + case PLAYER_MASK_KAFEIS_MASK: return 0x1FDE; + case PLAYER_MASK_DON_GERO: return 0x1FE0; + case PLAYER_MASK_BLAST: return 0x1FE2; + case PLAYER_MASK_COUPLE: return 0x1FE4; + case PLAYER_MASK_SCENTS: return 0x1FE6; + case PLAYER_MASK_KAMARO: return 0x1FE8; + case PLAYER_MASK_STONE: return 0x1FEA; + case PLAYER_MASK_POSTMAN: return 0x1FEC; + case PLAYER_MASK_BUNNY: return 0x1FEE; + case PLAYER_MASK_CAPTAIN: return 0x1FF0; + case PLAYER_MASK_BREMEN: return 0x1FF2; + case PLAYER_MASK_CIRCUS_LEADER: return 0x1FF4; + case PLAYER_MASK_KEATON: return 0x1FF6; + case PLAYER_MASK_GARO: return 0x1FF8; + case PLAYER_MASK_ALL_NIGHT: return 0x1FFA; + case PLAYER_MASK_ROMANI: return 0x1FFC; + default: return 0; } } -void func_80AD0998(EnOsn* this) { +void EnOsn_TurnAround(EnOsn* this) { s16 curFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_1EC].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - if (this->unk_1EC == 0x12 && curFrame == lastFrame) { - this->unk_1EC = 0x13; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0x13); + if ((this->animIndex == OSN_ANIM_TURN_AROUND_START) && (curFrame == lastFrame)) { + this->animIndex = OSN_ANIM_TURN_AROUND_LOOP; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, OSN_ANIM_TURN_AROUND_LOOP); } } -void func_80AD0A24(EnOsn* this) { +void EnOsn_LookFromMask(EnOsn* this) { s16 curFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_1EC].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); - if (this->unk_1EC == 0x15 && curFrame == lastFrame) { - this->unk_1EC = 0x16; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0x16); + if ((this->animIndex == OSN_ANIM_MASK_LOOK_FROM_START) && (curFrame == lastFrame)) { + this->animIndex = OSN_ANIM_MASK_LOOK_FROM_LOOP; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, OSN_ANIM_MASK_LOOK_FROM_LOOP); } } -void func_80AD0AB0(EnOsn* this) { +void EnOsn_FadeOut(EnOsn* this) { s16 curFrame = this->skelAnime.curFrame; - s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->unk_1EC].animation); + s16 lastFrame = Animation_GetLastFrame(sAnimationInfo[this->animIndex].animation); if (curFrame == lastFrame) { - this->unk_1FA -= 8; - if (this->unk_1FA < 8) { - this->unk_1FA = 0; - Actor_MarkForDeath(&this->actor); + this->alpha -= 8; + if (this->alpha < 8) { + this->alpha = 0; + Actor_Kill(&this->actor); } } } -s32 func_80AD0B38(EnOsn* this, PlayState* play) { +s32 EnOsn_GetInitialMaskText(EnOsn* this, PlayState* play) { switch (Player_GetMask(play)) { case PLAYER_MASK_GREAT_FAIRY: - if (!(this->unk_1F6 & 1)) { - this->unk_1F6 |= 1; + if (!(this->maskTextFlags & OSN_MASK_TEXT_GREAT_FAIRY)) { + this->maskTextFlags |= OSN_MASK_TEXT_GREAT_FAIRY; return 0x1FD1; } break; + case PLAYER_MASK_GIBDO: - if (!(this->unk_1F6 & 2)) { - this->unk_1F6 |= 2; + if (!(this->maskTextFlags & OSN_MASK_TEXT_GIBDO)) { + this->maskTextFlags |= OSN_MASK_TEXT_GIBDO; return 0x1FD1; } break; + case PLAYER_MASK_TRUTH: - if (!(this->unk_1F6 & 4)) { - this->unk_1F6 |= 4; + if (!(this->maskTextFlags & OSN_MASK_TEXT_TRUTH)) { + this->maskTextFlags |= OSN_MASK_TEXT_TRUTH; return 0x1FD1; } break; + case PLAYER_MASK_GIANT: - if (!(this->unk_1F6 & 8)) { - this->unk_1F6 |= 8; + if (!(this->maskTextFlags & OSN_MASK_TEXT_GIANT)) { + this->maskTextFlags |= OSN_MASK_TEXT_GIANT; return 0x1FD1; } break; + case PLAYER_MASK_KAFEIS_MASK: - if (!(this->unk_1F6 & 0x10)) { - this->unk_1F6 |= 0x10; + if (!(this->maskTextFlags & OSN_MASK_TEXT_KAFEIS)) { + this->maskTextFlags |= OSN_MASK_TEXT_KAFEIS; return 0x1FD1; } break; + case PLAYER_MASK_DON_GERO: - if (!(this->unk_1F6 & 0x20)) { - this->unk_1F6 |= 0x20; + if (!(this->maskTextFlags & OSN_MASK_TEXT_DON_GERO)) { + this->maskTextFlags |= OSN_MASK_TEXT_DON_GERO; return 0x1FD1; } break; + case PLAYER_MASK_BLAST: - if (!(this->unk_1F6 & 0x40)) { - this->unk_1F6 |= 0x40; + if (!(this->maskTextFlags & OSN_MASK_TEXT_BLAST)) { + this->maskTextFlags |= OSN_MASK_TEXT_BLAST; return 0x1FD1; } break; + case PLAYER_MASK_COUPLE: - if (!(this->unk_1F6 & 0x80)) { - this->unk_1F6 |= 0x80; + if (!(this->maskTextFlags & OSN_MASK_TEXT_COUPLE)) { + this->maskTextFlags |= OSN_MASK_TEXT_COUPLE; return 0x1FD1; } break; + case PLAYER_MASK_SCENTS: - if (!(this->unk_1F6 & 0x100)) { - this->unk_1F6 |= 0x100; + if (!(this->maskTextFlags & OSN_MASK_TEXT_SCENTS)) { + this->maskTextFlags |= OSN_MASK_TEXT_SCENTS; return 0x1FD1; } break; + case PLAYER_MASK_KAMARO: - if (!(this->unk_1F6 & 0x200)) { - this->unk_1F6 |= 0x200; + if (!(this->maskTextFlags & OSN_MASK_TEXT_KAMARO)) { + this->maskTextFlags |= OSN_MASK_TEXT_KAMARO; return 0x1FD1; } break; + case PLAYER_MASK_STONE: - if (!(this->unk_1F6 & 0x400)) { - this->unk_1F6 |= 0x400; + if (!(this->maskTextFlags & OSN_MASK_TEXT_STONE)) { + this->maskTextFlags |= OSN_MASK_TEXT_STONE; return 0x1FD1; } break; + case PLAYER_MASK_POSTMAN: - if (!(this->unk_1F6 & 0x800)) { - this->unk_1F6 |= 0x800; + if (!(this->maskTextFlags & OSN_MASK_TEXT_POSTMAN)) { + this->maskTextFlags |= OSN_MASK_TEXT_POSTMAN; return 0x1FD2; } break; + case PLAYER_MASK_BUNNY: - if (!(this->unk_1F6 & 0x1000)) { - this->unk_1F6 |= 0x1000; + if (!(this->maskTextFlags & OSN_MASK_TEXT_BUNNY)) { + this->maskTextFlags |= OSN_MASK_TEXT_BUNNY; return 0x1FD2; } break; + case PLAYER_MASK_CAPTAIN: - if (!(this->unk_1F6 & 0x2000)) { - this->unk_1F6 |= 0x2000; + if (!(this->maskTextFlags & OSN_MASK_TEXT_CAPTAIN)) { + this->maskTextFlags |= OSN_MASK_TEXT_CAPTAIN; return 0x1FD1; } break; + case PLAYER_MASK_BREMEN: - if (!(this->unk_1F6 & 0x4000)) { - this->unk_1F6 |= 0x4000; + if (!(this->maskTextFlags & OSN_MASK_TEXT_BREMEN)) { + this->maskTextFlags |= OSN_MASK_TEXT_BREMEN; return 0x1FD1; } break; + case PLAYER_MASK_CIRCUS_LEADER: - if (!(this->unk_1F6 & 0x8000)) { - this->unk_1F6 |= 0x8000; + if (!(this->maskTextFlags & OSN_MASK_TEXT_CIRCUS_LEADER)) { + this->maskTextFlags |= OSN_MASK_TEXT_CIRCUS_LEADER; return 0x1FD1; } break; + case PLAYER_MASK_KEATON: - if (!(this->unk_1F6 & 0x10000)) { - this->unk_1F6 |= 0x10000; + if (!(this->maskTextFlags & OSN_MASK_TEXT_KEATON)) { + this->maskTextFlags |= OSN_MASK_TEXT_KEATON; return 0x1FD1; } break; + case PLAYER_MASK_GARO: - if (!(this->unk_1F6 & 0x20000)) { - this->unk_1F6 |= 0x20000; + if (!(this->maskTextFlags & OSN_MASK_TEXT_GARO)) { + this->maskTextFlags |= OSN_MASK_TEXT_GARO; return 0x1FD1; } break; + case PLAYER_MASK_ALL_NIGHT: - if (!(this->unk_1F6 & 0x40000)) { - this->unk_1F6 |= 0x40000; + if (!(this->maskTextFlags & OSN_MASK_TEXT_ALL_NIGHT)) { + this->maskTextFlags |= OSN_MASK_TEXT_ALL_NIGHT; return 0x1FD1; } break; + case PLAYER_MASK_ROMANI: - if (!(this->unk_1F6 & 0x80000)) { - this->unk_1F6 |= 0x80000; + if (!(this->maskTextFlags & OSN_MASK_TEXT_ROMANI)) { + this->maskTextFlags |= OSN_MASK_TEXT_ROMANI; return 0x1FD1; } break; + default: break; } - this->unk_1EA |= 0x20; - if (gSaveContext.save.day == 3 && gSaveContext.save.time >= CLOCK_TIME(5, 0) && - gSaveContext.save.time < CLOCK_TIME(6, 0)) { + this->stateFlags |= OSN_STATE_END_CONVERSATION; + if ((gSaveContext.save.day == 3) && (gSaveContext.save.time >= CLOCK_TIME(5, 0)) && + (gSaveContext.save.time < CLOCK_TIME(6, 0))) { return 0x2006; } return 0x1FCD; } -s32 func_80AD0E10(EnOsn* this, PlayState* play) { +s32 EnOsn_GetInitialText(EnOsn* this, PlayState* play) { Player* player = GET_PLAYER(play); if ((gSaveContext.save.inventory.items[SLOT_OCARINA] != ITEM_NONE) && CHECK_QUEST_ITEM(QUEST_SONG_HEALING)) { - if (this->unk_1EA & 1) { - this->unk_1EA |= 0x20; + if (this->stateFlags & OSN_STATE_SPECIAL_CONVERSTATION) { + this->stateFlags |= OSN_STATE_END_CONVERSATION; if ((gSaveContext.save.inventory.items[SLOT_OCARINA] != ITEM_NONE) && (INV_CONTENT(ITEM_MASK_DEKU) == ITEM_MASK_DEKU)) { if ((gSaveContext.save.day == 3) && (gSaveContext.save.time >= CLOCK_TIME(5, 0)) && @@ -361,28 +458,28 @@ s32 func_80AD0E10(EnOsn* this, PlayState* play) { } if (player->transformation == PLAYER_FORM_DEKU) { - if (this->unk_1EA & 4) { - this->unk_1EA |= 0x20; + if (this->stateFlags & OSN_STATE_MET_DEKU) { + this->stateFlags |= OSN_STATE_END_CONVERSATION; if ((gSaveContext.save.day == 3) && (gSaveContext.save.time >= CLOCK_TIME(5, 0)) && (gSaveContext.save.time < CLOCK_TIME(6, 0))) { return 0x2006; } return 0x1FCD; } - this->unk_1EA |= 4; + this->stateFlags |= OSN_STATE_MET_DEKU; return 0x1FC8; } if (player->transformation == PLAYER_FORM_GORON) { - if (this->unk_1EA & 8) { - this->unk_1EA |= 0x20; + if (this->stateFlags & OSN_STATE_MET_GORON) { + this->stateFlags |= OSN_STATE_END_CONVERSATION; if ((gSaveContext.save.day == 3) && (gSaveContext.save.time >= CLOCK_TIME(5, 0)) && (gSaveContext.save.time < CLOCK_TIME(6, 0))) { return 0x2006; } return 0x1FCD; } - this->unk_1EA |= 8; + this->stateFlags |= OSN_STATE_MET_GORON; if (gSaveContext.save.weekEventReg[76] & 0x20) { return 0x1FC8; } @@ -392,15 +489,15 @@ s32 func_80AD0E10(EnOsn* this, PlayState* play) { } if (player->transformation == PLAYER_FORM_ZORA) { - if (this->unk_1EA & 0x10) { - this->unk_1EA |= 0x20; + if (this->stateFlags & OSN_STATE_MET_ZORA) { + this->stateFlags |= OSN_STATE_END_CONVERSATION; if ((gSaveContext.save.day == 3) && (gSaveContext.save.time >= CLOCK_TIME(5, 0)) && (gSaveContext.save.time < CLOCK_TIME(6, 0))) { return 0x2006; } return 0x1FCD; } - this->unk_1EA |= 0x10; + this->stateFlags |= OSN_STATE_MET_ZORA; if (gSaveContext.save.weekEventReg[76] & 0x40) { return 0x1FC8; } @@ -409,22 +506,22 @@ s32 func_80AD0E10(EnOsn* this, PlayState* play) { } if (Player_GetMask(play) == PLAYER_MASK_NONE) { - if (this->unk_1EA & 2) { - this->unk_1EA |= 0x20; + if (this->stateFlags & OSN_STATE_MET_HUMAN) { + this->stateFlags |= OSN_STATE_END_CONVERSATION; if ((gSaveContext.save.day == 3) && (gSaveContext.save.time >= CLOCK_TIME(5, 0)) && (gSaveContext.save.time < CLOCK_TIME(6, 0))) { return 0x2006; } return 0x1FCD; } - this->unk_1EA |= 2; + this->stateFlags |= OSN_STATE_MET_HUMAN; return 0x1FC8; } - return func_80AD0B38(this, play); + return EnOsn_GetInitialMaskText(this, play); } - this->unk_1EA |= 0x20; + this->stateFlags |= OSN_STATE_END_CONVERSATION; if ((gSaveContext.save.day == 3) && (gSaveContext.save.time >= CLOCK_TIME(5, 0)) && (gSaveContext.save.time < CLOCK_TIME(6, 0))) { return 0x2004; @@ -433,123 +530,123 @@ s32 func_80AD0E10(EnOsn* this, PlayState* play) { return 0x1FAE; } -void func_80AD10FC(EnOsn* this, PlayState* play) { - switch (this->unk_1F4) { +void EnOsn_HandleConversation(EnOsn* this, PlayState* play) { + switch (this->textId) { case 0x1FC8: - this->unk_1F4 = 0x1FC9; + this->textId = 0x1FC9; break; case 0x1FC9: - this->unk_1F4 = 0x1FCA; + this->textId = 0x1FCA; break; case 0x1FCA: - if ((gSaveContext.save.day == 3 && gSaveContext.save.time >= CLOCK_TIME(5, 0)) && - gSaveContext.save.time < CLOCK_TIME(6, 0)) { - this->unk_1F4 = 0x2007; + if ((gSaveContext.save.day == 3) && (gSaveContext.save.time >= CLOCK_TIME(5, 0)) && + (gSaveContext.save.time < CLOCK_TIME(6, 0))) { + this->textId = 0x2007; } else { - this->unk_1F4 = 0x1FCB; + this->textId = 0x1FCB; } break; case 0x1FCB: case 0x2007: - this->unk_1F4 = 0x1FCC; - this->unk_1EA |= 0x20; + this->textId = 0x1FCC; + this->stateFlags |= OSN_STATE_END_CONVERSATION; break; case 0x1FCE: case 0x1FD0: - this->unk_1F4 = 0x1FCF; + this->textId = 0x1FCF; break; case 0x1FCF: - this->unk_1F4 = 0x1FCA; + this->textId = 0x1FCA; break; case 0x1FD1: case 0x1FD2: - this->unk_1F4 = func_80AD08B0(play); + this->textId = EnOsn_GetMaskText(play); break; case 0x1FD6: - this->unk_1F4 = 0x1FD7; + this->textId = 0x1FD7; break; case 0x1FD8: - this->unk_1F4 = 0x1FD9; + this->textId = 0x1FD9; break; case 0x1FDA: - this->unk_1F4 = 0x1FDB; + this->textId = 0x1FDB; break; case 0x1FDC: - this->unk_1F4 = 0x1FDD; + this->textId = 0x1FDD; break; case 0x1FDE: - this->unk_1F4 = 0x1FDF; + this->textId = 0x1FDF; break; case 0x1FE0: - this->unk_1F4 = 0x1FE1; + this->textId = 0x1FE1; break; case 0x1FE2: - this->unk_1F4 = 0x1FE3; + this->textId = 0x1FE3; break; case 0x1FE4: - this->unk_1F4 = 0x1FE5; + this->textId = 0x1FE5; break; case 0x1FE6: - this->unk_1F4 = 0x1FE7; + this->textId = 0x1FE7; break; case 0x1FE8: - this->unk_1F4 = 0x1FE9; + this->textId = 0x1FE9; break; case 0x1FEA: - this->unk_1F4 = 0x1FEB; + this->textId = 0x1FEB; break; case 0x1FEC: - this->unk_1F4 = 0x1FED; + this->textId = 0x1FED; break; case 0x1FEE: - this->unk_1F4 = 0x1FEF; + this->textId = 0x1FEF; break; case 0x1FF0: - this->unk_1F4 = 0x1FF1; + this->textId = 0x1FF1; break; case 0x1FF2: - this->unk_1F4 = 0x1FF3; + this->textId = 0x1FF3; break; case 0x1FF4: - this->unk_1F4 = 0x1FF5; + this->textId = 0x1FF5; break; case 0x1FF6: - this->unk_1F4 = 0x1FF7; + this->textId = 0x1FF7; break; case 0x1FF8: - this->unk_1F4 = 0x1FF9; + this->textId = 0x1FF9; break; case 0x1FFA: - this->unk_1F4 = 0x1FFB; + this->textId = 0x1FFB; break; case 0x1FFC: - this->unk_1F4 = 0x1FFD; + this->textId = 0x1FFD; break; case 0x1FD7: @@ -563,7 +660,7 @@ void func_80AD10FC(EnOsn* this, PlayState* play) { case 0x1FF7: case 0x1FF9: case 0x1FFB: - this->unk_1F4 = 0x1FD3; + this->textId = 0x1FD3; break; case 0x1FD9: @@ -574,24 +671,24 @@ void func_80AD10FC(EnOsn* this, PlayState* play) { case 0x1FEF: case 0x1FF5: case 0x1FFD: - this->unk_1F4 = 0x1FD4; + this->textId = 0x1FD4; break; case 0x1FE5: - this->unk_1F4 = 0x1FFE; + this->textId = 0x1FFE; break; case 0x1FD3: case 0x1FD4: case 0x1FFE: - this->unk_1F4 = 0x1FD5; - this->unk_1EA |= 0x20; + this->textId = 0x1FD5; + this->stateFlags |= OSN_STATE_END_CONVERSATION; } - Message_StartTextbox(play, this->unk_1F4, &this->actor); + Message_StartTextbox(play, this->textId, &this->actor); } -void func_80AD1398(EnOsn* this) { +void EnOsn_InitCutscene(EnOsn* this) { this->cutscene = this->actor.cutscene; if ((gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) || (INV_CONTENT(ITEM_MASK_DEKU) == ITEM_MASK_DEKU)) { @@ -604,147 +701,170 @@ void func_80AD1398(EnOsn* this) { } } -void func_80AD144C(EnOsn* this, PlayState* play) { - u32 sp1C = Flags_GetSwitch(play, 0); +void EnOsn_ChooseAction(EnOsn* this, PlayState* play) { + u32 isFlagSet = Flags_GetSwitch(play, 0); + this->cutscene = this->actor.cutscene; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); - if (sp1C == 0) { - this->actionFunc = func_80AD16A8; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, OSN_ANIM_IDLE); + if (!isFlagSet) { + this->actionFunc = EnOsn_HandleCsAction; } else { - this->actionFunc = func_80AD14C8; + this->actionFunc = EnOsn_Idle; } } -void func_80AD14C8(EnOsn* this, PlayState* play) { - s16 temp_v1 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; +void EnOsn_Idle(EnOsn* this, PlayState* play) { + s16 yaw = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; - if (gSaveContext.save.inventory.items[SLOT_OCARINA] != ITEM_NONE && !CHECK_QUEST_ITEM(QUEST_SONG_HEALING)) { + if ((gSaveContext.save.inventory.items[SLOT_OCARINA] != ITEM_NONE) && !CHECK_QUEST_ITEM(QUEST_SONG_HEALING)) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - this->actionFunc = func_80AD1634; - } else if ((((this->actor.xzDistToPlayer < 100.0f) || this->actor.isTargeted) && (temp_v1 < 0x4000)) && - (temp_v1 > -0x4000)) { + this->actionFunc = EnOsn_StartCutscene; + } else if (((this->actor.xzDistToPlayer < 100.0f) || this->actor.isTargeted) && (yaw < 0x4000) && + (yaw > -0x4000)) { func_800B863C(&this->actor, play); this->actor.textId = 0xFFFF; } - } else { - if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - this->unk_1F4 = func_80AD0E10(this, play); - Message_StartTextbox(play, this->unk_1F4, &this->actor); - this->actionFunc = func_80AD19A0; - } else if ((((this->actor.xzDistToPlayer < 100.0f) || this->actor.isTargeted) && (temp_v1 < 0x4000)) && - (temp_v1 > -0x4000)) { - func_800B863C(&this->actor, play); - } + } else if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { + this->textId = EnOsn_GetInitialText(this, play); + Message_StartTextbox(play, this->textId, &this->actor); + this->actionFunc = EnOsn_Talk; + } else if (((this->actor.xzDistToPlayer < 100.0f) || this->actor.isTargeted) && (yaw < 0x4000) && (yaw > -0x4000)) { + func_800B863C(&this->actor, play); } } -void func_80AD1634(EnOsn* this, PlayState* play) { +void EnOsn_StartCutscene(EnOsn* this, PlayState* play) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_Start(this->cutscene, &this->actor); - this->actionFunc = func_80AD16A8; - return; + this->actionFunc = EnOsn_HandleCsAction; + } else { + if (ActorCutscene_GetCurrentIndex() == 0x7C) { + ActorCutscene_Stop(0x7C); + } + ActorCutscene_SetIntentToPlay(this->cutscene); } - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - } - ActorCutscene_SetIntentToPlay(this->cutscene); } -void func_80AD16A8(EnOsn* this, PlayState* play) { +void EnOsn_HandleCsAction(EnOsn* this, PlayState* play) { u8 pad; s32 actionIndex; if (Cutscene_CheckActorAction(play, 130)) { actionIndex = Cutscene_GetActorActionIndex(play, 130); - this->unk_1F0 = 0; - if (this->unk_1ED != play->csCtx.actorActions[actionIndex]->action) { - this->unk_1ED = play->csCtx.actorActions[actionIndex]->action; + this->shouldRotateHead = false; + if (this->csAction != play->csCtx.actorActions[actionIndex]->action) { + this->csAction = play->csCtx.actorActions[actionIndex]->action; switch (play->csCtx.actorActions[actionIndex]->action) { case 1: - this->unk_1EC = 2; + this->animIndex = OSN_ANIM_BOWING; break; + case 2: - this->unk_1EC = 1; + this->animIndex = OSN_ANIM_ARMS_OUT; break; + case 3: - this->unk_1EC = 7; + this->animIndex = OSN_ANIM_SHAKE_HEAD; break; + case 4: - this->unk_1EC = 3; + this->animIndex = OSN_ANIM_REMINISCE; break; + case 5: - this->unk_1EC = 6; + this->animIndex = OSN_ANIM_THINK; break; + case 6: - this->unk_1EC = 5; + this->animIndex = OSN_ANIM_BELIEVE; break; + case 7: - this->unk_1EC = 4; + this->animIndex = OSN_ANIM_HANDS_CLASPED; break; + case 8: - this->unk_1EC = 0; + this->animIndex = OSN_ANIM_IDLE; break; + case 10: - this->unk_1EC = 8; + this->animIndex = OSN_ANIM_ORGAN_TALK; break; + case 11: - this->unk_1EC = 9; + this->animIndex = OSN_ANIM_ORGAN_PLAY; break; + case 13: - this->unk_1EC = 0xA; + this->animIndex = OSN_ANIM_SHAKE; break; + case 15: - this->unk_1EC = 0xB; + this->animIndex = OSN_ANIM_CHOKE; break; + case 16: - this->unk_1EC = 0xC; + this->animIndex = OSN_ANIM_DESPAIR; break; + case 17: - this->unk_1EC = 0xD; + this->animIndex = OSN_ANIM_FAST_BOWS; break; + case 18: - this->unk_1EC = 0xE; + this->animIndex = OSN_ANIM_HAND_OUT; break; + case 19: - this->unk_1EC = 0x11; + this->animIndex = OSN_ANIM_MASK_LOOK_AT; break; + case 20: - this->unk_1EC = 0x12; + this->animIndex = OSN_ANIM_TURN_AROUND_START; break; + case 21: - this->unk_1EC = 0x14; + this->animIndex = OSN_ANIM_WALK_AWAY; break; + case 22: - this->unk_1EC = 0x15; + this->animIndex = OSN_ANIM_MASK_LOOK_FROM_START; break; + case 23: - this->unk_1EC = 0x17; + this->animIndex = OSN_ANIM_HAND_OUT_2; break; + case 24: - this->unk_1EC = 0x18; + this->animIndex = OSN_ANIM_WALK_AWAY_END; break; + default: - this->unk_1EC = 0; + this->animIndex = OSN_ANIM_IDLE; break; } - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_1EC); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } - if ((this->unk_1EC == 5) && (play->sceneId == SCENE_SPOT00) && (gSaveContext.sceneLayer == 0xB) && - (play->csCtx.frames == 400)) { + if ((this->animIndex == OSN_ANIM_BELIEVE) && (play->sceneId == SCENE_SPOT00) && + (gSaveContext.sceneLayer == 0xB) && (play->csCtx.frames == 400)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_OMVO00); } - if (this->unk_1EC == 0x12) { - func_80AD0998(this); + + if (this->animIndex == OSN_ANIM_TURN_AROUND_START) { + EnOsn_TurnAround(this); } - if (this->unk_1EC == 0x15) { - func_80AD0A24(this); + + if (this->animIndex == OSN_ANIM_MASK_LOOK_FROM_START) { + EnOsn_LookFromMask(this); } - if (this->unk_1EC == 0x18) { - func_80AD0AB0(this); + + if (this->animIndex == OSN_ANIM_WALK_AWAY_END) { + EnOsn_FadeOut(this); } - if ((this->unk_1EC == 0x14) && + + if ((this->animIndex == OSN_ANIM_WALK_AWAY) && (((Animation_OnFrame(&this->skelAnime, 17.0f))) || (Animation_OnFrame(&this->skelAnime, 27.0f)) || (Animation_OnFrame(&this->skelAnime, 37.0f)) || (Animation_OnFrame(&this->skelAnime, 47.0f)) || (Animation_OnFrame(&this->skelAnime, 57.0f)) || (Animation_OnFrame(&this->skelAnime, 67.0f)))) { @@ -752,28 +872,28 @@ void func_80AD16A8(EnOsn* this, PlayState* play) { } Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); } else { - this->unk_1F0 = 1; - this->unk_1ED = 0x63; - func_80AD144C(this, play); + this->shouldRotateHead = true; + this->csAction = 0x63; + EnOsn_ChooseAction(this, play); } } -void func_80AD19A0(EnOsn* this, PlayState* play) { +void EnOsn_Talk(EnOsn* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); if (((talkState == TEXT_STATE_DONE) || (talkState == TEXT_STATE_5)) && Message_ShouldAdvance(play)) { - if (this->unk_1EA & 0x20) { - this->unk_1EA &= ~0x20; + if (this->stateFlags & OSN_STATE_END_CONVERSATION) { + this->stateFlags &= ~OSN_STATE_END_CONVERSATION; play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; - this->actionFunc = func_80AD14C8; + this->actionFunc = EnOsn_Idle; } else { - func_80AD10FC(this, play); + EnOsn_HandleConversation(this, play); } } } -void EnOsn_Idle(EnOsn* this, PlayState* play) { +void EnOsn_DoNothing(EnOsn* this, PlayState* play) { } void EnOsn_Init(Actor* thisx, PlayState* play) { @@ -782,55 +902,55 @@ void EnOsn_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &object_osn_Skel_0202F0, &object_osn_Anim_0201BC, NULL, NULL, 0); + SkelAnime_InitFlex(play, &this->skelAnime, &gHappyMaskSalesmanSkel, &gHappyMaskSalesmanIdleAnim, NULL, NULL, 0); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); - this->unk_1FA = 255; - switch (ENOSN_GET_3(&this->actor)) { - case 0: + this->alpha = 255; + + switch (ENOSN_GET_TYPE(&this->actor)) { + case OSN_TYPE_CHOOSE: if (((gSaveContext.save.entrance == ENTRANCE(CLOCK_TOWER_INTERIOR, 2)) || (gSaveContext.save.entrance == ENTRANCE(CLOCK_TOWER_INTERIOR, 3))) || (gSaveContext.save.entrance == ENTRANCE(CLOCK_TOWER_INTERIOR, 6))) { - this->unk_1EA |= 1; + this->stateFlags |= OSN_STATE_SPECIAL_CONVERSTATION; } - this->unk_1F0 = 1; + this->shouldRotateHead = true; if (play->sceneId == SCENE_INSIDETOWER) { if ((gSaveContext.save.entrance == ENTRANCE(CLOCK_TOWER_INTERIOR, 2)) || (gSaveContext.save.entrance == ENTRANCE(CLOCK_TOWER_INTERIOR, 6))) { - this->actionFunc = func_80AD16A8; - return; + this->actionFunc = EnOsn_HandleCsAction; + } else if (gSaveContext.save.entrance == ENTRANCE(CLOCK_TOWER_INTERIOR, 3)) { + EnOsn_InitCutscene(this); + this->actionFunc = EnOsn_StartCutscene; + } else { + EnOsn_ChooseAction(this, play); } - if (gSaveContext.save.entrance == ENTRANCE(CLOCK_TOWER_INTERIOR, 3)) { - func_80AD1398(this); - this->actionFunc = func_80AD1634; - return; - } - func_80AD144C(this, play); - return; + } else { + EnOsn_ChooseAction(this, play); } - func_80AD144C(this, play); break; - case 1: - this->unk_1EC = 0xF; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_1EC); - this->actionFunc = EnOsn_Idle; + case OSN_TYPE_LIE_FACE_DOWN: + this->animIndex = OSN_ANIM_LYING_DOWN_FACE_UP; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); + this->actionFunc = EnOsn_DoNothing; break; - case 2: - this->unk_1EC = 0x10; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->unk_1EC); - this->actionFunc = EnOsn_Idle; + case OSN_TYPE_LIE_FACE_UP: + this->animIndex = OSN_ANIM_LYING_DOWN_FACE_DOWN; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); + this->actionFunc = EnOsn_DoNothing; break; - case 3: + case OSN_TYPE_CUTSCENE: this->actor.flags &= ~ACTOR_FLAG_1; - this->actionFunc = func_80AD16A8; + this->actionFunc = EnOsn_HandleCsAction; break; default: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); + break; } } @@ -844,33 +964,35 @@ void EnOsn_Destroy(Actor* thisx, PlayState* play) { void EnOsn_Update(Actor* thisx, PlayState* play) { s32 pad; EnOsn* this = THIS; - u32 sp34; + u32 isFlagSet = Flags_GetSwitch(play, 0); - sp34 = Flags_GetSwitch(play, 0); this->actionFunc(this, play); Actor_MoveWithGravity(&this->actor); SkelAnime_Update(&this->skelAnime); - if (!ENOSN_GET_3(&this->actor)) { - if (sp34 != 0) { + + if (ENOSN_GET_TYPE(&this->actor) == OSN_TYPE_CHOOSE) { + if (isFlagSet) { this->actor.flags |= ACTOR_FLAG_1; - func_80AD0830(this, play); + EnOsn_UpdateCollider(this, play); this->actor.draw = EnOsn_Draw; } else { this->actor.draw = NULL; this->actor.flags &= ~ACTOR_FLAG_1; } } - Actor_TrackPlayer(play, &this->actor, &this->unk_1D8, &this->unk_1DE, this->actor.focus.pos); + + Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); } s32 EnOsn_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx, Gfx** gfx) { EnOsn* this = (EnOsn*)thisx; - if (this->unk_1F0 && limbIndex == 11) { - Matrix_RotateXS(this->unk_1D8.y, MTXMODE_APPLY); + if (this->shouldRotateHead && (limbIndex == HAPPY_MASK_SALESMAN_LIMB_HEAD)) { + Matrix_RotateXS(this->headRot.y, MTXMODE_APPLY); } - if ((this->unk_1EC == 9 || this->unk_1EC == 8) && limbIndex == 10) { + if (((this->animIndex == OSN_ANIM_ORGAN_PLAY) || (this->animIndex == OSN_ANIM_ORGAN_TALK)) && + (limbIndex == HAPPY_MASK_SALESMAN_LIMB_BACKPACK)) { *dList = NULL; } return false; @@ -878,48 +1000,51 @@ s32 EnOsn_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p void EnOsn_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) { EnOsn* this = (EnOsn*)thisx; - Vec3f sp30 = { 0.0f, 0.0f, 0.0f }; - Vec3s sp28 = { 0x9920, -0x384, -0x320 }; + Vec3f headOffset = { 0.0f, 0.0f, 0.0f }; + Vec3s leftHandRot = { 0x9920, -0x384, -0x320 }; - if (limbIndex == 11) { - Matrix_MultVec3f(&sp30, &thisx->focus.pos); + if (limbIndex == HAPPY_MASK_SALESMAN_LIMB_HEAD) { + Matrix_MultVec3f(&headOffset, &this->actor.focus.pos); } - if (((this->unk_1EC == 17) || (this->unk_1EC == 21) || (this->unk_1EC == 22)) && (limbIndex == 6)) { + if (((this->animIndex == OSN_ANIM_MASK_LOOK_AT) || (this->animIndex == OSN_ANIM_MASK_LOOK_FROM_START) || + (this->animIndex == OSN_ANIM_MASK_LOOK_FROM_LOOP)) && + (limbIndex == HAPPY_MASK_SALESMAN_LIMB_LEFT_HAND)) { Matrix_Push(); Matrix_Translate(-400.0f, 1100.0f, -200.0f, MTXMODE_APPLY); - Matrix_RotateXS(sp28.x, MTXMODE_APPLY); - Matrix_RotateYS(sp28.y, MTXMODE_APPLY); - Matrix_RotateZS(sp28.z, MTXMODE_APPLY); + Matrix_RotateXS(leftHandRot.x, MTXMODE_APPLY); + Matrix_RotateYS(leftHandRot.y, MTXMODE_APPLY); + Matrix_RotateZS(leftHandRot.z, MTXMODE_APPLY); gSPMatrix((*gfx)++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList((*gfx)++, &object_osn_DL_0192A0); + gSPDisplayList((*gfx)++, &gHappyMaskSalesmanMajorasMaskDL); Matrix_Pop(); } } void EnOsn_Draw(Actor* thisx, PlayState* play) { - static TexturePtr D_80AD2588 = object_osn_Tex_0166F8; - static TexturePtr D_80AD258C = object_osn_Tex_016EF8; - static TexturePtr D_80AD2590 = object_osn_Tex_0176F8; - static TexturePtr D_80AD2594 = object_osn_Tex_017EF8; - static TexturePtr D_80AD2598 = object_osn_Tex_0182F8; + static TexturePtr sEyeClosedHappyTex = gHappyMaskSalesmanEyeClosedHappyTex; + static TexturePtr sEyeOpenTex = gHappyMaskSalesmanEyeOpenTex; + static TexturePtr sEyeClosedAngryTex = gHappyMaskSalesmanEyeClosedAngryTex; + static TexturePtr sSmileTex = gHappyMaskSalesmanSmileTex; + static TexturePtr sFrownTex = gHappyMaskSalesmanFrownTex; s32 pad; EnOsn* this = THIS; OPEN_DISPS(play->state.gfxCtx); - if (this->unk_1FA == 0xFF) { + if (this->alpha == 255) { func_8012C28C(play->state.gfxCtx); - if ((this->unk_1EC == 0xB) || (this->unk_1EC == 0xC) || (this->unk_1EC == 0x17) || - (play->msgCtx.currentTextId == 0x1FCA)) { - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80AD258C)); - gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80AD2594)); - } else if ((this->unk_1EC == 7) || (this->unk_1EC == 3) || (this->unk_1EC == 0xD)) { - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80AD2590)); - gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80AD2598)); + if ((this->animIndex == OSN_ANIM_CHOKE) || (this->animIndex == OSN_ANIM_DESPAIR) || + (this->animIndex == OSN_ANIM_HAND_OUT_2) || (play->msgCtx.currentTextId == 0x1FCA)) { + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeOpenTex)); + gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(sSmileTex)); + } else if ((this->animIndex == OSN_ANIM_SHAKE_HEAD) || (this->animIndex == OSN_ANIM_REMINISCE) || + (this->animIndex == OSN_ANIM_FAST_BOWS)) { + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeClosedAngryTex)); + gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(sFrownTex)); } else { - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80AD2588)); - gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80AD2594)); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeClosedHappyTex)); + gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(sSmileTex)); } gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 255); Scene_SetRenderModeXlu(play, 0, 1); @@ -928,9 +1053,9 @@ void EnOsn_Draw(Actor* thisx, PlayState* play) { EnOsn_OverrideLimbDraw, EnOsn_PostLimbDraw, &this->actor, POLY_OPA_DISP); } else { func_8012C2DC(play->state.gfxCtx); - gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80AD2588)); - gSPSegment(POLY_XLU_DISP++, 0x09, Lib_SegmentedToVirtual(D_80AD2594)); - gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, this->unk_1FA); + gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeClosedHappyTex)); + gSPSegment(POLY_XLU_DISP++, 0x09, Lib_SegmentedToVirtual(sSmileTex)); + gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, this->alpha); Scene_SetRenderModeXlu(play, 1, 2); POLY_XLU_DISP = SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, diff --git a/src/overlays/actors/ovl_En_Osn/z_en_osn.h b/src/overlays/actors/ovl_En_Osn/z_en_osn.h index fdc8ed2c7..638f31e4e 100644 --- a/src/overlays/actors/ovl_En_Osn/z_en_osn.h +++ b/src/overlays/actors/ovl_En_Osn/z_en_osn.h @@ -7,27 +7,32 @@ struct EnOsn; typedef void (*EnOsnActionFunc)(struct EnOsn*, PlayState*); +#define ENOSN_GET_TYPE(this) ((thisx)->params & 3) + +typedef enum { + /* 0 */ OSN_TYPE_CHOOSE, // Will choose between Idle and Cutscene + /* 1 */ OSN_TYPE_LIE_FACE_DOWN, + /* 2 */ OSN_TYPE_LIE_FACE_UP, + /* 3 */ OSN_TYPE_CUTSCENE +} OsnType; + typedef struct EnOsn { /* 0x000 */ Actor actor; /* 0x144 */ ColliderCylinder collider; /* 0x190 */ SkelAnime skelAnime; /* 0x1D4 */ EnOsnActionFunc actionFunc; - /* 0x1D8 */ Vec3s unk_1D8; - /* 0x1DE */ Vec3s unk_1DE; + /* 0x1D8 */ Vec3s headRot; + /* 0x1DE */ Vec3s torsoRot; /* 0x1E4 */ UNK_TYPE1 unk_1E4[0x6]; - /* 0x1EA */ u16 unk_1EA; - /* 0x1EC */ u8 unk_1EC; - /* 0x1ED */ u8 unk_1ED; + /* 0x1EA */ u16 stateFlags; + /* 0x1EC */ u8 animIndex; + /* 0x1ED */ u8 csAction; /* 0x1EE */ s16 cutscene; - /* 0x1F0 */ u8 unk_1F0; + /* 0x1F0 */ u8 shouldRotateHead; /* 0x1F1 */ UNK_TYPE1 unk_1F1[0x3]; - /* 0x1F4 */ u16 unk_1F4; - /* 0x1F6 */ s32 unk_1F6; - /* 0x1FA */ u8 unk_1FA; + /* 0x1F4 */ u16 textId; + /* 0x1F6 */ s32 maskTextFlags; + /* 0x1FA */ u8 alpha; } EnOsn; // size = 0x1FB -extern const ActorInit En_Osn_InitVars; - -#define ENOSN_GET_3(this) ((thisx)->params & 3) - #endif // Z_EN_OSN_H 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 618a30986..a17113ff8 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -92,7 +92,7 @@ typedef enum { /* 12 */ ANI_ANIM_MAX } AniAnimation; -const ActorInit En_Ossan_InitVars = { +ActorInit En_Ossan_InitVars = { ACTOR_EN_OSSAN, ACTORCAT_NPC, FLAGS, @@ -212,19 +212,19 @@ void EnOssan_CheckValidSpawn(EnOssan* this) { case 2: if (gSaveContext.save.time <= CLOCK_TIME(21, 30) && gSaveContext.save.time > CLOCK_TIME(6, 00)) { if (this->actor.params != ENOSSAN_CURIOSITY_SHOP_MAN) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (this->actor.params == ENOSSAN_CURIOSITY_SHOP_MAN) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; case 3: if (this->actor.params == ENOSSAN_CURIOSITY_SHOP_MAN) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (!(gSaveContext.save.time <= CLOCK_TIME(22, 00) && gSaveContext.save.time >= CLOCK_TIME(6, 00))) { if (this->actor.params != ENOSSAN_CURIOSITY_SHOP_MAN) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } break; @@ -266,14 +266,14 @@ void EnOssan_Init(Actor* thisx, PlayState* play) { s16 id; //! @bug Condition is impossible, params cannot be both greater then 1 AND less then 0. - if (this->actor.params > ENOSSAN_PART_TIME_WORKER && this->actor.params < ENOSSAN_CURIOSITY_SHOP_MAN) { - Actor_MarkForDeath(&this->actor); + if ((this->actor.params > ENOSSAN_PART_TIME_WORKER) && (this->actor.params < ENOSSAN_CURIOSITY_SHOP_MAN)) { + Actor_Kill(&this->actor); return; } id = sObjectIds[this->actor.params]; this->objIndex = Object_GetIndex(&play->objectCtx, id); if (this->objIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } EnOssan_CheckValidSpawn(this); @@ -306,7 +306,7 @@ void EnOssan_EndInteraction(PlayState* play, EnOssan* this) { this->drawCursor = 0; this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; play->interfaceCtx.unk_222 = 0; play->interfaceCtx.unk_224 = 0; if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_PLAYING) { @@ -366,7 +366,7 @@ void EnOssan_Idle(EnOssan* this, PlayState* play) { SubS_FillLimbRotTables(play, this->limbRotTableY, this->limbRotTableZ, ARRAY_COUNT(this->limbRotTableY)); if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; EnOssan_SetupAction(this, EnOssan_BeginInteraction); if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCurrentIndex() == 0x7C) { @@ -984,7 +984,7 @@ void EnOssan_SetupBuyItemWithFanfare(PlayState* play, EnOssan* this) { Actor_PickUp(&this->actor, play, this->items[this->cursorIndex]->getItemId, 300.0f, 300.0f); play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; Interface_SetHudVisibility(HUD_VISIBILITY_ALL); this->drawCursor = 0; EnOssan_SetupAction(this, EnOssan_BuyItemWithFanfare); @@ -1129,7 +1129,7 @@ void EnOssan_ContinueShopping(EnOssan* this, PlayState* play) { case 0: func_8019F208(); player->actor.shape.rot.y = BINANG_ROT180(player->actor.shape.rot.y); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; Message_StartTextbox(play, this->textId, &this->actor); EnOssan_SetupStartShopping(play, this, true); func_800B85E0(&this->actor, play, 100.0f, PLAYER_AP_MINUS1); @@ -1147,7 +1147,7 @@ void EnOssan_ContinueShopping(EnOssan* this, PlayState* play) { item = this->items[this->cursorIndex]; item->restockFunc(play, item); player->actor.shape.rot.y = BINANG_ROT180(player->actor.shape.rot.y); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; Message_StartTextbox(play, this->textId, &this->actor); EnOssan_SetupStartShopping(play, this, true); func_800B85E0(&this->actor, play, 100.0f, PLAYER_AP_MINUS1); @@ -1160,7 +1160,7 @@ void EnOssan_ItemPurchased(EnOssan* this, PlayState* play) { if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; EnOssan_SetupAction(this, EnOssan_ContinueShopping); this->cutsceneState = ENOSSAN_CUTSCENESTATE_PLAYING; } else { diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h index 20d669ea4..a4787cc14 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h @@ -72,6 +72,4 @@ typedef enum { /* 1 */ ENOSSAN_PART_TIME_WORKER } EnOssanWorker; -extern const ActorInit En_Ossan_InitVars; - #endif // Z_EN_OSSAN_H 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 bf93b729f..487960916 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -63,7 +63,7 @@ static EnOt* D_80B5E880; static EnOt* D_80B5E884; static EnOt* D_80B5E888; -const ActorInit En_Ot_InitVars = { +ActorInit En_Ot_InitVars = { ACTOR_EN_OT, ACTORCAT_NPC, FLAGS, @@ -201,7 +201,7 @@ void EnOt_Init(Actor* thisx, PlayState* play) { func_80B5C684(this, play); } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if ((D_80B5E888 != NULL) && (D_80B5E888->unk_32C & 1)) { this->unk_360 = D_80B5E888; @@ -219,7 +219,7 @@ void EnOt_Init(Actor* thisx, PlayState* play) { break; case 1: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; } break; @@ -274,7 +274,7 @@ void EnOt_Init(Actor* thisx, PlayState* play) { this->actor.update = func_80B5DAEC; func_80B5C634(this, play); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; } @@ -483,7 +483,7 @@ void func_80B5C634(EnOt* this, PlayState* play) { void func_80B5C64C(EnOt* this, PlayState* play) { if (gSaveContext.save.weekEventReg[26] & 8) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -629,7 +629,7 @@ void func_80B5CCA0(EnOt* this, PlayState* play) { if (SubS_StartActorCutscene(&this->actor, this->cutscenes[0], 0x7C, SUBS_CUTSCENE_NORMAL)) { Player* player = GET_PLAYER(play); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; func_80B5CCF4(this, play); } } @@ -666,7 +666,7 @@ void func_80B5CD40(EnOt* this, PlayState* play) { if (Message_ShouldAdvance(play) && (play->msgCtx.currentTextId == 0x1069)) { this->unk_32C |= 4; ActorCutscene_Stop(this->cutscenes[0]); - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; func_80B5CE6C(this, play); } break; diff --git a/src/overlays/actors/ovl_En_Ot/z_en_ot.h b/src/overlays/actors/ovl_En_Ot/z_en_ot.h index 5399e2278..7e8d7f651 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.h +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.h @@ -64,6 +64,4 @@ typedef struct EnOt { /* 0x74C */ Vec3f unk_74C; } EnOt; // size = 0x758 -extern const ActorInit En_Ot_InitVars; - #endif // Z_EN_OT_H 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 8b636787d..ab083aff1 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -48,7 +48,7 @@ typedef enum { /* 0x01 */ OWL_OK } EnOwlMessageChoice; -const ActorInit En_Owl_InitVars = { +ActorInit En_Owl_InitVars = { ACTOR_EN_OWL, ACTORCAT_NPC, FLAGS, @@ -151,21 +151,21 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { switch (owlType) { case ENOWL_GET_TYPE_1: if ((switchFlag < 0x7F) && Flags_GetSwitch(play, switchFlag)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; case ENOWL_GET_TYPE_2: if (gSaveContext.save.inventory.items[ITEM_LENS] == ITEM_LENS) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; case ENOWL_GET_TYPE_3: if (CHECK_QUEST_ITEM(QUEST_SONG_SOARING)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; @@ -429,7 +429,7 @@ void func_8095B1E4(EnOwl* this, PlayState* play) { } if (this->actor.xzDistToPlayer > 6000.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -478,7 +478,7 @@ void func_8095B3DC(EnOwl* this, PlayState* play) { void func_8095B480(EnOwl* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (player->stateFlags3 & 0x10000000) { + if (player->stateFlags3 & PLAYER_STATE3_10000000) { this->actor.textId = 0xBF1; EnOwl_ChangeMode(this, func_8095BF58, func_8095C484, &this->skelAnime2, &object_owl_Anim_00CDB0, 0.0f); this->eyeTexIndex = 0; @@ -740,7 +740,7 @@ void func_8095BF58(EnOwl* this, PlayState* play) { void func_8095BF78(EnOwl* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_20; if (this->actor.xzDistToPlayer > 6000.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_3EC, 2, 0x80, 0x40); @@ -1066,13 +1066,13 @@ void func_8095CCF4(Actor* thisx, PlayState* play) { EnOwl* this = THIS; Player* player = GET_PLAYER(play); - if (player->stateFlags3 & 0x10000000) { - Actor_MarkForDeath(&this->actor); + if (player->stateFlags3 & PLAYER_STATE3_10000000) { + Actor_Kill(&this->actor); return; } if (this->actor.world.pos.y < (this->unk_3F0 - 1000.0f)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -1083,7 +1083,7 @@ void func_8095CCF4(Actor* thisx, PlayState* play) { if (this->unk_3DC > 0) { this->unk_3DC--; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.h b/src/overlays/actors/ovl_En_Owl/z_en_owl.h index 781fd308c..033857886 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.h +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.h @@ -56,6 +56,4 @@ typedef struct EnOwl { /* 0x414 */ EnOwlFunc unk_414; } EnOwl; // size = 0x418 -extern const ActorInit En_Owl_InitVars; - #endif // Z_EN_OWL_H diff --git a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c index 075ced540..8c8a6eb57 100644 --- a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c +++ b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c @@ -69,7 +69,7 @@ void func_80BDA288(EnPamera* this); void func_80BDA2E0(EnPamera* this, PlayState* play); void func_80BDA344(Actor* thisx, PlayState* play); -const ActorInit En_Pamera_InitVars = { +ActorInit En_Pamera_InitVars = { ACTOR_EN_PAMERA, ACTORCAT_NPC, FLAGS, @@ -156,7 +156,7 @@ void EnPamera_Init(Actor* thisx, PlayState* play) { if (1) {} if (!(gSaveContext.save.weekEventReg[14] & 4) || (gSaveContext.save.weekEventReg[52] & 0x20) || (gSaveContext.save.weekEventReg[75] & 0x20) || (gSaveContext.save.entrance == ENTRANCE(IKANA_CANYON, 9))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (gSaveContext.save.weekEventReg[61] & 4) { if (!(gSaveContext.save.weekEventReg[59] & 1) || @@ -199,7 +199,7 @@ void func_80BD8588(EnPamera* this, PlayState* play) { Vec3f sp28; if (path == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (gSaveContext.save.weekEventReg[61] & 4) { path = &play->setupPathList[path->unk1]; diff --git a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.h b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.h index cf5611c4e..34f18e815 100644 --- a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.h +++ b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.h @@ -37,6 +37,4 @@ typedef struct EnPamera { /* 0x326 */ u16 unk_326; } EnPamera; // size = 0x328 -extern const ActorInit En_Pamera_InitVars; - #endif // Z_EN_PAMERA_H diff --git a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c index 0582b7ca8..b4670662c 100644 --- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c +++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c @@ -67,7 +67,7 @@ void EnPametfrog_SnapperSpawn(EnPametfrog* this, PlayState* play); void EnPametfrog_SetupTransitionGekkoSnapper(EnPametfrog* this, PlayState* play); void EnPametfrog_TransitionGekkoSnapper(EnPametfrog* this, PlayState* play); -const ActorInit En_Pametfrog_InitVars = { +ActorInit En_Pametfrog_InitVars = { ACTOR_EN_PAMETFROG, ACTORCAT_BOSS, FLAGS, @@ -192,7 +192,7 @@ void EnPametfrog_Init(Actor* thisx, PlayState* play) { Collider_InitAndSetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colElement); this->params = CLAMP(this->actor.params, 1, 4); if (Flags_GetClear(play, play->roomCtx.curRoom.num)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if (!(gSaveContext.save.weekEventReg[isFrogReturnedFlags[this->actor.params - 1] >> 8] & (u8)isFrogReturnedFlags[this->actor.params - 1])) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_MINIFROG, this->actor.world.pos.x, this->actor.world.pos.y, @@ -205,11 +205,12 @@ void EnPametfrog_Init(Actor* thisx, PlayState* play) { if (Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_BIGPAMET, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0) == NULL) { - Actor_MarkForDeath(&this->actor); - } else { - this->actor.params = GEKKO_PRE_SNAPPER; - EnPametfrog_SetupLookAround(this); + Actor_Kill(&this->actor); + return; } + + this->actor.params = GEKKO_PRE_SNAPPER; + EnPametfrog_SetupLookAround(this); } } @@ -986,7 +987,7 @@ void EnPametfrog_SpawnFrog(EnPametfrog* this, PlayState* play) { EnPametfrog_ShakeCamera(this, play, 75.0f * magShake, 10.0f * magShake); if (this->timer == 0) { EnPametfrog_StopCutscene(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h index 81af17129..9ae2f76df 100644 --- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h +++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h @@ -49,6 +49,4 @@ typedef struct EnPametfrog { /* 0x3A4 */ ColliderJntSphElement colElement[2]; } EnPametfrog; // size = 0x424 -extern const ActorInit En_Pametfrog_InitVars; - #endif // Z_EN_PAMETFROG_H diff --git a/src/overlays/actors/ovl_En_Paper/z_en_paper.c b/src/overlays/actors/ovl_En_Paper/z_en_paper.c index fd6ac6778..47d97e1c2 100644 --- a/src/overlays/actors/ovl_En_Paper/z_en_paper.c +++ b/src/overlays/actors/ovl_En_Paper/z_en_paper.c @@ -23,7 +23,7 @@ void func_80C1F4E8(EnPaper* this); void func_80C1F55C(EnPaper* this, EnPaperStruct* arg1); void func_80C1F6E0(EnPaper* this, EnPaperStruct* arg1); -const ActorInit En_Paper_InitVars = { +ActorInit En_Paper_InitVars = { ACTOR_EN_PAPER, ACTORCAT_ITEMACTION, FLAGS, @@ -154,10 +154,11 @@ void EnPaper_Update(Actor* thisx, PlayState* play) { func_80C1F87C(this); if (this->timer == 0) { - Actor_MarkForDeath(&this->actor); - } else { - this->timer--; + Actor_Kill(&this->actor); + return; } + + this->timer--; } void EnPaper_Draw(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Paper/z_en_paper.h b/src/overlays/actors/ovl_En_Paper/z_en_paper.h index 457229c3d..5e8450722 100644 --- a/src/overlays/actors/ovl_En_Paper/z_en_paper.h +++ b/src/overlays/actors/ovl_En_Paper/z_en_paper.h @@ -24,6 +24,4 @@ typedef struct EnPaper { /* 0xD84 */ s16 timer; } EnPaper; // size = 0xD88 -extern const ActorInit En_Paper_InitVars; - #endif // Z_EN_PAPER_H diff --git a/src/overlays/actors/ovl_En_Part/z_en_part.c b/src/overlays/actors/ovl_En_Part/z_en_part.c index ef348f4cc..527a91b3d 100644 --- a/src/overlays/actors/ovl_En_Part/z_en_part.c +++ b/src/overlays/actors/ovl_En_Part/z_en_part.c @@ -19,7 +19,7 @@ void EnPart_Draw(Actor* thisx, PlayState* play); void func_80865390(EnPart* this, PlayState* play); void func_808654C4(EnPart* this, PlayState* play); -const ActorInit En_Part_InitVars = { +ActorInit En_Part_InitVars = { ACTOR_EN_PART, ACTORCAT_ITEMACTION, FLAGS, @@ -79,7 +79,7 @@ void func_808654C4(EnPart* this, PlayState* play) { pos.y = this->actor.floorHeight; func_800B3030(play, &pos, &gZeroVec3f, &gZeroVec3f, this->actor.scale.y * 1400.0f, 7, 0); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 10, NA_SE_EN_EXTINCT); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (this->unk146 <= 0) { switch (this->actor.params) { @@ -101,7 +101,7 @@ void func_808654C4(EnPart* this, PlayState* play) { } break; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk146--; this->zRot += this->unk14C; diff --git a/src/overlays/actors/ovl_En_Part/z_en_part.h b/src/overlays/actors/ovl_En_Part/z_en_part.h index 53a03f281..662e8574e 100644 --- a/src/overlays/actors/ovl_En_Part/z_en_part.h +++ b/src/overlays/actors/ovl_En_Part/z_en_part.h @@ -23,6 +23,4 @@ typedef struct EnPart { /* 0x150 */ Gfx* dList; } EnPart; // size = 0x154 -extern const ActorInit En_Part_InitVars; - #endif // Z_EN_PART_H diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index cf3cd935f..3e2fdcfac 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -38,7 +38,7 @@ void func_80898594(EnPeehat* this, PlayState* play); void func_80898654(EnPeehat* this); void func_808986A4(EnPeehat* this, PlayState* play); -const ActorInit En_Peehat_InitVars = { +ActorInit En_Peehat_InitVars = { ACTOR_EN_PEEHAT, ACTORCAT_ENEMY, FLAGS, @@ -438,7 +438,7 @@ void func_80897A94(EnPeehat* this, PlayState* play) { if (!(this->actor.bgCheckFlags & 1)) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_PIHAT_SM_DEAD); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if (this->colliderTris.base.atFlags & AT_HIT) { this->colliderTris.base.atFlags &= ~AT_HIT; if (BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.world.rot.y) > 0) { @@ -588,7 +588,7 @@ void func_80898338(EnPeehat* this, PlayState* play) { func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, 40, 7, 0); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 30, NA_SE_EN_EXTINCT); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_PIHAT_SM_DEAD); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { func_80897864(this); } @@ -672,7 +672,7 @@ void func_808986A4(EnPeehat* this, PlayState* play) { if (this->unk_2B0 == 0) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xE0); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h index 182dd9175..248599c63 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h @@ -35,6 +35,4 @@ typedef struct EnPeehat { /* 0x488 */ ColliderTrisElement colliderTriElements[2]; } EnPeehat; // size = 0x540 -extern const ActorInit En_Peehat_InitVars; - #endif // Z_EN_PEEHAT_H 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 1f5aebe64..317a5eee4 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c @@ -472,7 +472,7 @@ static UNK_TYPE D_80AFB764[] = { 0x52801210, }; -const ActorInit En_Pm_InitVars = { +ActorInit En_Pm_InitVars = { ACTOR_EN_PM, ACTORCAT_NPC, FLAGS, @@ -1170,7 +1170,7 @@ s32 func_80AF8DD4(EnPm* this, PlayState* play) { u16 textId = play->msgCtx.currentTextId; s32 pad; - if (player->stateFlags1 & (0x400 | 0x40)) { + if (player->stateFlags1 & (PLAYER_STATE1_40 | PLAYER_STATE1_400)) { this->unk_356 |= 0x400; if (this->unk_358 != textId) { if ((this->unk_384 == 0) || (this->unk_384 == 1)) { @@ -1481,7 +1481,7 @@ s32 func_80AF98A0(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) { if (Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_MM3, 116.0f, 26.0f, -219.0f, 0, -0x3F46, 0, 0) != NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); ret = true; } return ret; diff --git a/src/overlays/actors/ovl_En_Pm/z_en_pm.h b/src/overlays/actors/ovl_En_Pm/z_en_pm.h index de7359d93..c7bf76e37 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.h +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.h @@ -58,6 +58,4 @@ typedef struct EnPm { /* 0x39C */ UNK_TYPE1 unk_39C[0x4]; } EnPm; // size = 0x3A0 -extern const ActorInit En_Pm_InitVars; - #endif // Z_EN_PM_H diff --git a/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.c b/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.c index e18897cf2..6d14ca25a 100644 --- a/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.c +++ b/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.c @@ -28,7 +28,7 @@ void func_80BC5830(EnPoComposer* this, PlayState* play); void func_80BC58E0(EnPoComposer* this, PlayState* play); #if 0 -const ActorInit En_Po_Composer_InitVars = { +ActorInit En_Po_Composer_InitVars = { ACTOR_EN_PO_COMPOSER, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.h b/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.h index 3d70aa8a4..a42b5048f 100644 --- a/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.h +++ b/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.h @@ -14,6 +14,4 @@ typedef struct EnPoComposer { /* 0x238 */ char unk_238[0x108]; } EnPoComposer; // size = 0x340 -extern const ActorInit En_Po_Composer_InitVars; - #endif // Z_EN_PO_COMPOSER_H diff --git a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c index a2c537606..a9fcf95e3 100644 --- a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c +++ b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c @@ -25,7 +25,7 @@ void EnPoFusen_Idle(EnPoFusen* this, PlayState* play); void EnPoFusen_IdleFuse(EnPoFusen* this, PlayState* play); s32 EnPoFusen_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); -const ActorInit En_Po_Fusen_InitVars = { +ActorInit En_Po_Fusen_InitVars = { ACTOR_EN_PO_FUSEN, ACTORCAT_PROP, FLAGS, @@ -111,7 +111,7 @@ void EnPoFusen_Init(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 0x4); if (!EnPoFusen_CheckParent(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } heightTemp = this->actor.floorHeight + 90.0f; @@ -238,7 +238,7 @@ void EnPoFusen_Pop(EnPoFusen* this, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y + 20.0f, this->actor.world.pos.z, 255, 255, 200, CLEAR_TAG_POP); Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void EnPoFusen_InitFuse(EnPoFusen* this) { diff --git a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.h b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.h index 991b0cf9e..740d65968 100644 --- a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.h +++ b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.h @@ -30,6 +30,4 @@ typedef struct EnPoFusen { /* 0x270 */ s16 fuse; } EnPoFusen; // size = 0x274 -extern const ActorInit En_Po_Fusen_InitVars; - #endif // Z_EN_PO_FUSEN_H diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 57e32a554..a89a55d9e 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -61,7 +61,7 @@ static Color_RGBA8 sPoSisterEnvColors[] = { { 0, 150, 0, 255 }, // Amy }; -const ActorInit En_Po_Sisters_InitVars = { +ActorInit En_Po_Sisters_InitVars = { ACTOR_EN_PO_SISTERS, ACTORCAT_ENEMY, FLAGS, @@ -714,10 +714,11 @@ void EnPoSisters_DeathStage2(EnPoSisters* this, PlayState* play) { this->deathTimer++; if (this->deathTimer == 32) { - Actor_MarkForDeath(&this->actor); - } else { - EnPoSisters_UpdateDeathFlameSwirl(this, this->deathTimer, &this->actor.world.pos); + Actor_Kill(&this->actor); + return; } + + EnPoSisters_UpdateDeathFlameSwirl(this, this->deathTimer, &this->actor.world.pos); } void EnPoSisters_SpawnMegClones(EnPoSisters* this, PlayState* play) { @@ -734,15 +735,15 @@ void EnPoSisters_SpawnMegClones(EnPoSisters* this, PlayState* play) { // if we cannot spawn all clones: abort if ((clone1 == NULL) || (clone2 == NULL) || (clone3 == NULL)) { if (clone1 != NULL) { - Actor_MarkForDeath(clone1); + Actor_Kill(clone1); } if (clone2 != NULL) { - Actor_MarkForDeath(clone2); + Actor_Kill(clone2); } if (clone3 != NULL) { - Actor_MarkForDeath(clone3); + Actor_Kill(clone3); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -793,7 +794,7 @@ void EnPoSisters_MegCloneWaitForSpinBack(EnPoSisters* this, PlayState* play) { EnPoSisters_SetupSpinBackToVisible(this, play); } else if (parent->actionFunc == EnPoSisters_DeathStage1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h index 368ad9da1..5e549c4d7 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h @@ -68,6 +68,4 @@ typedef struct EnPoSisters { /* 0x358 */ MtxF mtxf; } EnPoSisters; // size = 0x398 -extern const ActorInit En_Po_Sisters_InitVars; - #endif // Z_EN_PO_SISTERS_H diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index a3718497c..f1b0f74d4 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -46,7 +46,7 @@ void func_80B2E3F8(EnPoh* this, PlayState* play); void func_80B2F328(Actor* thisx, PlayState* play); void func_80B2F37C(Actor* thisx, PlayState* play); -const ActorInit En_Poh_InitVars = { +ActorInit En_Poh_InitVars = { ACTOR_EN_POH, ACTORCAT_ENEMY, FLAGS, @@ -653,7 +653,7 @@ void func_80B2E1D8(EnPoh* this) { void func_80B2E230(EnPoh* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -687,7 +687,7 @@ void func_80B2E3B0(EnPoh* this) { void func_80B2E3F8(EnPoh* this, PlayState* play) { func_80B2DDF8(this, -13); if (this->unk_197 == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.h b/src/overlays/actors/ovl_En_Poh/z_en_poh.h index 083b44f3f..b07be6195 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.h +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.h @@ -37,6 +37,4 @@ typedef struct EnPoh { /* 0x3D8 */ MtxF unk_3D8; } EnPoh; // size = 0x418 -extern const ActorInit En_Poh_InitVars; - #endif // Z_EN_POH_H diff --git a/src/overlays/actors/ovl_En_Pp/z_en_pp.c b/src/overlays/actors/ovl_En_Pp/z_en_pp.c index 5d04b7567..fad487e62 100644 --- a/src/overlays/actors/ovl_En_Pp/z_en_pp.c +++ b/src/overlays/actors/ovl_En_Pp/z_en_pp.c @@ -115,7 +115,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, EN_PP_DMGEFF_KNOCK_OFF_MASK), }; -const ActorInit En_Pp_InitVars = { +ActorInit En_Pp_InitVars = { ACTOR_EN_PP, ACTORCAT_ENEMY, FLAGS, @@ -1072,7 +1072,7 @@ void EnPp_Dead(EnPp* this, PlayState* play) { Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0xE0); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -1150,7 +1150,7 @@ void EnPp_Mask_Detach(EnPp* this, PlayState* play) { &sMaskFireVelocityAndAccel[i], 70, 0, 2); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } break; @@ -1225,7 +1225,7 @@ void EnPp_BodyPart_Move(EnPp* this, PlayState* play) { } if ((this->timer == 0) || (this->actor.bgCheckFlags & 1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Pp/z_en_pp.h b/src/overlays/actors/ovl_En_Pp/z_en_pp.h index d181c08de..aabbd9e2e 100644 --- a/src/overlays/actors/ovl_En_Pp/z_en_pp.h +++ b/src/overlays/actors/ovl_En_Pp/z_en_pp.h @@ -80,6 +80,4 @@ typedef struct EnPp { /* 0x5DC */ Vec3f damagedVelocity; } EnPp; // size = 0x5EC -extern const ActorInit En_Pp_InitVars; - #endif // Z_EN_PP_H diff --git a/src/overlays/actors/ovl_En_Pr/z_en_pr.c b/src/overlays/actors/ovl_En_Pr/z_en_pr.c index ec8ab91de..97fd2c7f5 100644 --- a/src/overlays/actors/ovl_En_Pr/z_en_pr.c +++ b/src/overlays/actors/ovl_En_Pr/z_en_pr.c @@ -68,7 +68,7 @@ static DamageTable sDamageTable = { f32 D_80A338C0[PLAYER_FORM_MAX] = { 30.0f, 30.0f, 30.0f, 15.0f, 15.0f }; -const ActorInit En_Pr_InitVars = { +ActorInit En_Pr_InitVars = { ACTOR_EN_PR, ACTORCAT_ENEMY, FLAGS, @@ -262,7 +262,7 @@ void func_80A32740(EnPr* this, PlayState* play) { if (this->unk_2C8 < sqrtf(SQ(this->actor.world.pos.x - this->actor.home.pos.x) + SQ(this->actor.world.pos.z - this->actor.home.pos.z))) { func_80A32854(this); - } else if ((this->unk_20E == 0) && (player->stateFlags1 & 0x8000000)) { + } else if ((this->unk_20E == 0) && (player->stateFlags1 & PLAYER_STATE1_8000000)) { if (sqrtf(SQ(player->actor.world.pos.x - this->actor.home.pos.x) + SQ(player->actor.world.pos.z - this->actor.home.pos.z)) < this->unk_2C8) { func_80A32AF8(this); @@ -298,7 +298,7 @@ void func_80A3295C(EnPr* this) { void func_80A32984(EnPr* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((player->stateFlags1 & 0x8000000) && (this->unk_20E == 0)) { + if ((player->stateFlags1 & PLAYER_STATE1_8000000) && (this->unk_20E == 0)) { this->unk_22C = this->actor.world.rot.y; func_80A32AF8(this); } else if (!func_80A325E4(this)) { @@ -348,7 +348,7 @@ void func_80A32B20(EnPr* this, PlayState* play) { this->unk_2B8 = D_80A338C0[(void)0, gSaveContext.save.playerForm] + player->actor.world.pos.y; func_80A324E0(this, play); - if (!(player->stateFlags1 & 0x8000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_8000000)) { this->skelAnime.playSpeed = 1.0f; this->actor.speedXZ = 1.0f; func_80A32854(this); @@ -375,7 +375,7 @@ void func_80A32CDC(EnPr* this) { void func_80A32D28(EnPr* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & 0x8000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_8000000)) { this->skelAnime.playSpeed = 1.0f; this->actor.speedXZ = 1.0f; func_80A32854(this); @@ -445,7 +445,7 @@ void func_80A32F48(EnPr* this, PlayState* play) { if (this->unk_2D2 != 0) { Math_SmoothStepToS(&this->unk_2D0, 0, 1, 15, 50); if (this->unk_2D0 < 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -463,7 +463,7 @@ void func_80A33098(EnPr* this, PlayState* play) { this->actor.focus.pos.z, 0, 0, 0, CLEAR_TAG_LARGE_LIGHT_RAYS); } - if ((player->stateFlags1 & 0x8000000) && (this->actor.colChkInfo.damageEffect == 5)) { + if ((player->stateFlags1 & PLAYER_STATE1_8000000) && (this->actor.colChkInfo.damageEffect == 5)) { this->drawDmgEffAlpha = 40; this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_MEDIUM; } diff --git a/src/overlays/actors/ovl_En_Pr/z_en_pr.h b/src/overlays/actors/ovl_En_Pr/z_en_pr.h index 6a5fe8b5a..dfa3081ca 100644 --- a/src/overlays/actors/ovl_En_Pr/z_en_pr.h +++ b/src/overlays/actors/ovl_En_Pr/z_en_pr.h @@ -54,6 +54,4 @@ typedef struct EnPr { /* 0x2FC */ ColliderCylinder collider; } EnPr; // size = 0x348 -extern const ActorInit En_Pr_InitVars; - #endif // Z_EN_PR_H diff --git a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c index 4564c679f..0cc6dc134 100644 --- a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c +++ b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c @@ -81,7 +81,7 @@ static ColliderCylinderInit sCylinderInit = { { 17, 32, -10, { 0, 0, 0 } }, }; -const ActorInit En_Pr2_InitVars = { +ActorInit En_Pr2_InitVars = { ACTOR_EN_PR2, ACTORCAT_ENEMY, FLAGS, @@ -160,7 +160,7 @@ void EnPr2_Init(Actor* thisx, PlayState* play) { } func_80A745C4(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else { @@ -174,7 +174,7 @@ void EnPr2_Init(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 20.0f, 20.0f, 0x1D); if (!(this->actor.bgCheckFlags & 0x60)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -206,7 +206,7 @@ s32 func_80A7429C(EnPr2* this, PlayState* play) { return false; } - if (!(player->stateFlags1 & 0x8000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_8000000)) { return false; } else { return true; @@ -277,7 +277,7 @@ void func_80A745FC(EnPr2* this, PlayState* play) { } if ((this->path != NULL) && !SubS_CopyPointFromPath(this->path, this->unk_1D0, &this->unk_21C)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Math_ApproachF(&this->actor.world.pos.y, this->unk_21C.y, 0.3f, 5.0f); @@ -337,7 +337,7 @@ void func_80A748E8(EnPr2* this, PlayState* play) { this->actor.speedXZ = 0.0f; Math_SmoothStepToS(&this->unk_1F4, 0, 1, 30, 100); if (this->unk_1F4 < 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { switch (this->unk_1E0) { @@ -356,7 +356,7 @@ void func_80A748E8(EnPr2* this, PlayState* play) { temp_f12 = player->actor.world.pos.z - this->unk_228.z; sqrtXZ = sqrtf(SQ(temp_f2) + SQ(temp_f12)); - if (sp48 && (player->stateFlags1 & 0x8000000) && (sqrtXZ < this->unk_208)) { + if (sp48 && (player->stateFlags1 & PLAYER_STATE1_8000000) && (sqrtXZ < this->unk_208)) { sp4C = true; func_80A74DEC(this, play); } @@ -446,7 +446,7 @@ void func_80A74E90(EnPr2* this, PlayState* play) { WaterBox* sp40; Math_ApproachF(&this->unk_204, 0.02f, 0.1f, 0.005f); - if ((this->unk_1D8 == 0) || !(player->stateFlags1 & 0x8000000) || (this->unk_1E0 == 0)) { + if ((this->unk_1D8 == 0) || !(player->stateFlags1 & PLAYER_STATE1_8000000) || (this->unk_1E0 == 0)) { func_80A74888(this); return; } @@ -455,7 +455,7 @@ void func_80A74E90(EnPr2* this, PlayState* play) { this->actor.speedXZ = 0.0f; Math_SmoothStepToS(&this->unk_1F4, 0, 1, 30, 100); if (this->unk_1F4 < 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { SkelAnime_Update(&this->skelAnime); @@ -558,7 +558,7 @@ void func_80A75310(EnPr2* this, PlayState* play) { this->actor.world.rot.z, i + 10); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else { @@ -601,7 +601,7 @@ void func_80A75310(EnPr2* this, PlayState* play) { EffectSsBubble_Spawn(play, &sp64, 0.0f, 5.0f, 5.0f, frame); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } diff --git a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.h b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.h index df5afef4e..617a5cc73 100644 --- a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.h +++ b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.h @@ -51,6 +51,4 @@ typedef struct EnPr2 { /* 0x27C */ ColliderCylinder collider; } EnPr2; // size = 0x2C8 -extern const ActorInit En_Pr2_InitVars; - #endif // Z_EN_PR2_H diff --git a/src/overlays/actors/ovl_En_Prz/z_en_prz.c b/src/overlays/actors/ovl_En_Prz/z_en_prz.c index e5c611578..23b7d7fd4 100644 --- a/src/overlays/actors/ovl_En_Prz/z_en_prz.c +++ b/src/overlays/actors/ovl_En_Prz/z_en_prz.c @@ -82,7 +82,7 @@ static ColliderCylinderInit sCylinderInit = { { 10, 10, 0, { 0, 0, 0 } }, }; -const ActorInit En_Prz_InitVars = { +ActorInit En_Prz_InitVars = { ACTOR_EN_PRZ, ACTORCAT_ENEMY, FLAGS, @@ -234,7 +234,7 @@ void func_80A763E8(EnPrz* this, PlayState* play) { return; } - if ((player->stateFlags1 & 0x8000000) && (this->unk_1F2 == 0)) { + if ((player->stateFlags1 & PLAYER_STATE1_8000000) && (this->unk_1F2 == 0)) { func_80A76748(this); return; } @@ -291,7 +291,7 @@ void func_80A76634(EnPrz* this, PlayState* play) { if (func_80A762C0(this, play) != 0) { this->unk_1E4 += 0x1500; this->unk_1E4 += (s16)Rand_ZeroFloat(5000.0f); - } else if ((player->stateFlags1 & 0x8000000) && (player->actor.floorHeight < 30.0f)) { + } else if ((player->stateFlags1 & PLAYER_STATE1_8000000) && (player->actor.floorHeight < 30.0f)) { this->actionFunc = func_80A763E8; } else { this->unk_1EE = 10; @@ -325,7 +325,7 @@ void func_80A767A8(EnPrz* this, PlayState* play) { distXZ = sqrtf(SQ(player->actor.world.pos.x - this->actor.parent->home.pos.x) + SQ(player->actor.world.pos.z - this->actor.parent->home.pos.z)); - if (!(player->stateFlags1 & 0x8000000) || (pr->unk_2C8 < distXZ)) { + if (!(player->stateFlags1 & PLAYER_STATE1_8000000) || (pr->unk_2C8 < distXZ)) { this->unk_1F2 = 100; this->skelAnime.playSpeed = 1.0f; func_80A76388(this); @@ -415,7 +415,7 @@ void func_80A76B14(EnPrz* this, PlayState* play) { EffectSsBubble_Spawn(play, &sp6C, 0.0f, 5.0f, 5.0f, Rand_ZeroFloat(0.03f) + 0.07f); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } diff --git a/src/overlays/actors/ovl_En_Prz/z_en_prz.h b/src/overlays/actors/ovl_En_Prz/z_en_prz.h index 75087c9bc..db91c7c03 100644 --- a/src/overlays/actors/ovl_En_Prz/z_en_prz.h +++ b/src/overlays/actors/ovl_En_Prz/z_en_prz.h @@ -42,6 +42,4 @@ typedef struct EnPrz { /* 0x224 */ ColliderCylinder collider; } EnPrz; // size = 0x270 -extern const ActorInit En_Prz_InitVars; - #endif // Z_EN_PRZ_H 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 78458e062..bae89c5c7 100644 --- a/src/overlays/actors/ovl_En_Pst/z_en_pst.c +++ b/src/overlays/actors/ovl_En_Pst/z_en_pst.c @@ -118,7 +118,7 @@ s32 D_80B2C488[] = { 0x2C27A40C, 0x10000000 }; s32 D_80B2C490[] = { 0x2C27850C, 0x10000000 }; -const ActorInit En_Pst_InitVars = { +ActorInit En_Pst_InitVars = { ACTOR_EN_PST, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_En_Pst/z_en_pst.h b/src/overlays/actors/ovl_En_Pst/z_en_pst.h index 1f85a1dec..6051924da 100644 --- a/src/overlays/actors/ovl_En_Pst/z_en_pst.h +++ b/src/overlays/actors/ovl_En_Pst/z_en_pst.h @@ -36,6 +36,4 @@ typedef struct EnPst { /* 0x21C */ s32 isLetterToKafeiDeposited; } EnPst; // size = 0x220 -extern const ActorInit En_Pst_InitVars; - #endif // Z_EN_PST_H diff --git a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c index 3190e3e36..261c94adc 100644 --- a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c +++ b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c @@ -69,7 +69,7 @@ typedef struct { s16 textId; // Used to determine the dog's condition } RaceDogInfo; -const ActorInit En_Racedog_InitVars = { +ActorInit En_Racedog_InitVars = { ACTOR_EN_RACEDOG, ACTORCAT_NPC, FLAGS, @@ -318,7 +318,7 @@ void EnRacedog_Init(Actor* thisx, PlayState* play) { if (ENRACEDOG_GET_INDEX(&this->actor) < 14) { this->index = ENRACEDOG_GET_INDEX(&this->actor); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->selectionArrowGreenPrimColor = 255; diff --git a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.h b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.h index b0b40be64..9d49ea4c2 100644 --- a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.h +++ b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.h @@ -51,6 +51,4 @@ typedef struct EnRacedog { /* 0x2C4 */ f32 selectionArrowScale; } EnRacedog; // size = 0x2C8 -extern const ActorInit En_Racedog_InitVars; - #endif // Z_EN_RACEDOG_H diff --git a/src/overlays/actors/ovl_En_Raf/z_en_raf.c b/src/overlays/actors/ovl_En_Raf/z_en_raf.c index a3d91bba9..c44268509 100644 --- a/src/overlays/actors/ovl_En_Raf/z_en_raf.c +++ b/src/overlays/actors/ovl_En_Raf/z_en_raf.c @@ -67,7 +67,7 @@ typedef enum { /* 3 */ EN_RAF_PETAL_SCALE_TYPE_IDLE_OR_THROW } EnRafPetalScaleType; -const ActorInit En_Raf_InitVars = { +ActorInit En_Raf_InitVars = { ACTOR_EN_RAF, ACTORCAT_PROP, FLAGS, @@ -310,7 +310,7 @@ void EnRaf_Idle(EnRaf* this, PlayState* play) { if (this->timer == 0) { if ((player->transformation != PLAYER_FORM_DEKU) && (this->dyna.actor.xzDistToPlayer < (BREG(48) + 80.0f) && (player->invincibilityTimer == 0) && - DynaPolyActor_IsInRidingMovingState(&this->dyna) && !(player->stateFlags1 & 0x8000000) && + DynaPolyActor_IsInRidingMovingState(&this->dyna) && !(player->stateFlags1 & PLAYER_STATE1_8000000) && play->grabPlayer(play, player))) { player->actor.parent = &this->dyna.actor; this->grabTarget = EN_RAF_GRAB_TARGET_PLAYER; @@ -343,7 +343,7 @@ void EnRaf_Idle(EnRaf* this, PlayState* play) { zDiff = explosive->world.pos.z - this->dyna.actor.world.pos.z; if ((fabsf(xDiff) < 80.0f) && (fabsf(yDiff) < 30.0f) && (fabsf(zDiff) < 80.0f) && (explosive->update != NULL) && (explosive->velocity.y != 0.0f)) { - Actor_MarkForDeath(explosive); + Actor_Kill(explosive); this->grabTarget = EN_RAF_GRAB_TARGET_EXPLOSIVE; this->collider.dim.radius = 30; this->collider.dim.height = 90; @@ -372,7 +372,7 @@ void EnRaf_Grab(EnRaf* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 curFrame = this->skelAnime.curFrame; - if ((this->grabTarget != EN_RAF_GRAB_TARGET_EXPLOSIVE) && (player->stateFlags2 & 0x80) && + if ((this->grabTarget != EN_RAF_GRAB_TARGET_EXPLOSIVE) && (player->stateFlags2 & PLAYER_STATE2_80) && (&this->dyna.actor == player->actor.parent)) { Math_ApproachF(&player->actor.world.pos.x, this->dyna.actor.world.pos.x, 0.3f, 10.0f); Math_ApproachF(&player->actor.world.pos.y, this->dyna.actor.world.pos.y, 0.3f, 10.0f); @@ -414,7 +414,7 @@ void EnRaf_Chew(EnRaf* this, PlayState* play) { targetChewScale = (BREG(51) / 100.0f) + 0.2f; Math_ApproachF(&this->chewScale, targetChewScale, 0.2f, 0.03f); - if ((player->stateFlags2 & 0x80) && (this->grabTarget != EN_RAF_GRAB_TARGET_EXPLOSIVE) && + if ((player->stateFlags2 & PLAYER_STATE2_80) && (this->grabTarget != EN_RAF_GRAB_TARGET_EXPLOSIVE) && (&this->dyna.actor == player->actor.parent)) { Math_ApproachF(&player->actor.world.pos.x, this->dyna.actor.world.pos.x, 0.3f, 10.0f); Math_ApproachF(&player->actor.world.pos.y, this->dyna.actor.world.pos.y, 0.3f, 10.0f); @@ -432,7 +432,7 @@ void EnRaf_Chew(EnRaf* this, PlayState* play) { play->damagePlayer(play, -2); func_800B8E58((Player*)this, player->ageProperties->unk_92 + NA_SE_VO_LI_DAMAGE_S); CollisionCheck_GreenBlood(play, NULL, &player->actor.world.pos); - if ((this->chewCount > (BREG(53) + 5)) || !(player->stateFlags2 & 0x80)) { + if ((this->chewCount > (BREG(53) + 5)) || !(player->stateFlags2 & PLAYER_STATE2_80)) { player->actor.freezeTimer = 10; EnRaf_SetupThrow(this, play); return; diff --git a/src/overlays/actors/ovl_En_Raf/z_en_raf.h b/src/overlays/actors/ovl_En_Raf/z_en_raf.h index 831346d38..f4659f48b 100644 --- a/src/overlays/actors/ovl_En_Raf/z_en_raf.h +++ b/src/overlays/actors/ovl_En_Raf/z_en_raf.h @@ -64,6 +64,4 @@ typedef struct EnRaf { /* 0x41C */ EnRafEffect effects[EN_RAF_EFFECT_COUNT]; } EnRaf; // size = 0xAE4 -extern const ActorInit En_Raf_InitVars; - #endif // Z_EN_RAF_H diff --git a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c index bfb701484..073f2045a 100644 --- a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c +++ b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c @@ -50,7 +50,7 @@ void func_80B726B4(EnRailSkb* this, PlayState* play); void func_80B72830(EnRailSkb* this, s16 arg1); s32 func_80B7285C(EnRailSkb* this); -const ActorInit En_Rail_Skb_InitVars = { +ActorInit En_Rail_Skb_InitVars = { ACTOR_EN_RAIL_SKB, ACTORCAT_ENEMY, FLAGS, @@ -248,7 +248,7 @@ void func_80B70D24(EnRailSkb* this, PlayState* play) { while (actor != NULL) { if ((actor->id == ACTOR_OBJ_HAKAISI) && func_80B70B04(this, actor->world.pos)) { if (Flags_GetSwitch(play, (actor->params & 0xFF00) >> 8)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->unk_22C = (ObjHakaisi*)actor; @@ -256,7 +256,7 @@ void func_80B70D24(EnRailSkb* this, PlayState* play) { } actor = actor->next; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } static InitChainEntry sInitChain[] = { @@ -277,7 +277,7 @@ void EnRailSkb_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); if (Flags_GetSwitch(play, ENRAILSKB_GET_FF(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Actor_ProcessInitChain(&this->actor, sInitChain); @@ -635,7 +635,7 @@ void func_80B71BB8(EnRailSkb* this, PlayState* play) { } if (this->actor.bgCheckFlags & 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.h b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.h index 09d3b4c4c..10c2653c4 100644 --- a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.h +++ b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.h @@ -43,6 +43,4 @@ typedef struct EnRailSkb { /* 0x403 */ u8 drawDmgEffType; } EnRailSkb; // size = 0x404 -extern const ActorInit En_Rail_Skb_InitVars; - #endif // Z_EN_RAIL_SKB_H diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c index 50df4d01c..7772127a0 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c @@ -84,7 +84,7 @@ typedef enum { /* 2 */ EN_RAILGIBUD_GRAB_RELEASE, } EnRailgibudGrabState; -const ActorInit En_Railgibud_InitVars = { +ActorInit En_Railgibud_InitVars = { ACTOR_EN_RAILGIBUD, ACTORCAT_ENEMY, FLAGS, @@ -273,7 +273,7 @@ void EnRailgibud_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); if (gSaveContext.save.weekEventReg[14] & 4) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } EnRailgibud_SetupWalkInCircles(this); @@ -438,7 +438,7 @@ void EnRailgibud_Grab(EnRailgibud* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (inPositionToAttack == true)) { this->grabState = EN_RAILGIBUD_GRAB_ATTACK; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_GRAB_ATTACK); - } else if (!(player->stateFlags2 & 0x80)) { + } else if (!(player->stateFlags2 & PLAYER_STATE2_80)) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_GRAB_END); this->actor.flags |= ACTOR_FLAG_1; this->grabState = EN_RAILGIBUD_GRAB_RELEASE; @@ -463,9 +463,9 @@ void EnRailgibud_Grab(EnRailgibud* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_ATTACK); } - if (!(player->stateFlags2 & 0x80) || (player->unk_B62 != 0)) { - if ((player->unk_B62 != 0) && (player->stateFlags2 & 0x80)) { - player->stateFlags2 &= ~0x80; + if (!(player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B62 != 0)) { + if ((player->unk_B62 != 0) && (player->stateFlags2 & PLAYER_STATE2_80)) { + player->stateFlags2 &= ~PLAYER_STATE2_80; player->unk_AE8 = 100; } @@ -630,7 +630,7 @@ void EnRailgibud_Dead(EnRailgibud* this, PlayState* play) { if (this->deathTimer > 300) { if (this->actor.shape.shadowAlpha == 0) { if (this->actor.parent != NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { // Don't delete the "main" Gibdo, since that will break the surviving // Gibdos' ability to start and stop walking forward. Instead, just @@ -750,9 +750,10 @@ s32 EnRailgibud_PlayerInRangeWithCorrectState(EnRailgibud* this, PlayState* play return false; } - if ((Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 100.0f) && - !(player->stateFlags1 & (0x200000 | 0x80000 | 0x40000 | 0x4000 | 0x2000 | 0x80)) && - !(player->stateFlags2 & (0x4000 | 0x80))) { + if (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 100.0f && + !(player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 | + PLAYER_STATE1_80000 | PLAYER_STATE1_200000)) && + !(player->stateFlags2 & (PLAYER_STATE2_80 | PLAYER_STATE2_4000))) { return true; } @@ -1115,7 +1116,7 @@ void EnRailgibud_InitCutsceneGibdo(EnRailgibud* this, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); if (gSaveContext.save.entrance != ENTRANCE(IKANA_CANYON, 9)) { // NOT Cutscene: Music Box House Opens - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } EnRailgibud_SetupDoNothing(this); @@ -1166,7 +1167,7 @@ void EnRailgibud_SinkIntoGround(EnRailgibud* this, PlayState* play) { if (this->sinkTimer != 0) { this->sinkTimer--; } else if (Math_SmoothStepToF(&this->actor.shape.yOffset, -9500.0f, 0.5f, 200.0f, 10.0f) < 10.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { EnRailgibud_SpawnEffectsForSinkingIntoTheGround(this, play, 0); } diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h index 78655f870..cf06d1996 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h @@ -55,6 +55,4 @@ typedef struct EnRailgibud { /* 0x405 */ s8 unk_405; // related to player->unk_ADD } EnRailgibud; // size = 0x408 -extern const ActorInit En_Railgibud_InitVars; - #endif // Z_EN_RAILGIBUD_H diff --git a/src/overlays/actors/ovl_En_Rat/z_en_rat.c b/src/overlays/actors/ovl_En_Rat/z_en_rat.c index 9057fdb4c..da0b27e6d 100644 --- a/src/overlays/actors/ovl_En_Rat/z_en_rat.c +++ b/src/overlays/actors/ovl_En_Rat/z_en_rat.c @@ -35,7 +35,7 @@ typedef enum { /* -1 */ EN_RAT_HOOKED, } EnRatHookedState; -const ActorInit En_Rat_InitVars = { +ActorInit En_Rat_InitVars = { ACTOR_EN_RAT, ACTORCAT_ENEMY, FLAGS, @@ -762,7 +762,7 @@ void EnRat_PostDetonation(EnRat* this, PlayState* play) { if (EN_RAT_GET_TYPE(&this->actor) == EN_RAT_TYPE_OVERWORLD) { EnRat_SetupRevive(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Rat/z_en_rat.h b/src/overlays/actors/ovl_En_Rat/z_en_rat.h index 6dd51d10a..9472e8c31 100644 --- a/src/overlays/actors/ovl_En_Rat/z_en_rat.h +++ b/src/overlays/actors/ovl_En_Rat/z_en_rat.h @@ -55,6 +55,4 @@ typedef struct EnRat { /* 0x268 */ ColliderSphere collider; } EnRat; // size = 0x2C0 -extern const ActorInit En_Rat_InitVars; - #endif // Z_EN_RAT_H diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 0092189c5..a086375e7 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -97,7 +97,7 @@ typedef enum { /* 4 */ EN_RD_GRAB_END, } EnRdGrabState; -const ActorInit En_Rd_InitVars = { +ActorInit En_Rd_InitVars = { ACTOR_EN_RD, ACTORCAT_ENEMY, FLAGS, @@ -654,8 +654,9 @@ void EnRd_WalkToPlayer(EnRd* this, PlayState* play) { } if ((ABS_ALT(yaw) < 0x1554) && (Actor_DistanceBetweenActors(&this->actor, &player->actor) <= 150.0f)) { - if (!(player->stateFlags1 & (0x200000 | 0x80000 | 0x40000 | 0x4000 | 0x2000 | 0x80)) && - !(player->stateFlags2 & (0x4000 | 0x80))) { + if (!(player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 | + PLAYER_STATE1_80000 | PLAYER_STATE1_200000)) && + !(player->stateFlags2 & (PLAYER_STATE2_80 | PLAYER_STATE2_4000))) { if (this->playerStunWaitTimer == 0) { if (!(this->flags & EN_RD_FLAG_CANNOT_FREEZE_PLAYER)) { player->actor.freezeTimer = 40; @@ -838,9 +839,9 @@ void EnRd_Grab(EnRd* this, PlayState* play) { Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 1500, 0); case EN_RD_GRAB_ATTACK: - if (!(player->stateFlags2 & 0x80) || (player->unk_B62 != 0)) { - if ((player->unk_B62 != 0) && (player->stateFlags2 & 0x80)) { - player->stateFlags2 &= ~0x80; + if (!(player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B62 != 0)) { + if ((player->unk_B62 != 0) && (player->stateFlags2 & PLAYER_STATE2_80)) { + player->stateFlags2 &= ~PLAYER_STATE2_80; player->unk_AE8 = 100; } Animation_Change(&this->skelAnime, &gGibdoRedeadGrabEndAnim, 0.5f, 0.0f, @@ -1068,7 +1069,7 @@ void EnRd_Dead(EnRd* this, PlayState* play) { this->actor.scale.y -= (75.0f / 1000000.0f); this->alpha -= 5; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { this->deathTimer--; diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.h b/src/overlays/actors/ovl_En_Rd/z_en_rd.h index 0affac4f1..f5fbf82cb 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.h +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.h @@ -72,6 +72,4 @@ typedef struct EnRd { /* 0x3F1 */ s8 unk_3F1; // related to player->unk_ADD } EnRd; // size = 0x3F4 -extern const ActorInit En_Rd_InitVars; - #endif // Z_EN_RD_H diff --git a/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c b/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c index d817d1df4..692bdeef2 100644 --- a/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c +++ b/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c @@ -21,7 +21,7 @@ void EnRecepgirl_Wait(EnRecepgirl* this, PlayState* play); void EnRecepgirl_SetupTalk(EnRecepgirl* this); void EnRecepgirl_Talk(EnRecepgirl* this, PlayState* play); -const ActorInit En_Recepgirl_InitVars = { +ActorInit En_Recepgirl_InitVars = { ACTOR_EN_RECEPGIRL, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.h b/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.h index b6684fc9e..a0fba9fdc 100644 --- a/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.h +++ b/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.h @@ -17,6 +17,4 @@ typedef struct EnRecepgirl { /* 0x2AE */ Vec3s headRot; } EnRecepgirl; // size = 0x2B4 -extern const ActorInit En_Recepgirl_InitVars; - #endif // Z_EN_RECEPGIRL_H diff --git a/src/overlays/actors/ovl_En_Rg/z_en_rg.c b/src/overlays/actors/ovl_En_Rg/z_en_rg.c index 2d976bdd5..2a357739a 100644 --- a/src/overlays/actors/ovl_En_Rg/z_en_rg.c +++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.c @@ -22,7 +22,7 @@ void func_80BF4FC4(EnRg* this, PlayState* play); s32 D_80BF5C10; -const ActorInit En_Rg_InitVars = { +ActorInit En_Rg_InitVars = { ACTOR_EN_RG, ACTORCAT_NPC, FLAGS, @@ -564,8 +564,9 @@ void func_80BF4AB8(EnRg* this, PlayState* play) { } while (phi_s0 != NULL); } - if ((phi_s0 == NULL) && (D_80BF5C10 == 0) && (this->unk_326 == 0) && (player->stateFlags3 & 0x80000) && - (player->invincibilityTimer == 0) && func_80BF4220(this, play, &player->actor)) { + if ((phi_s0 == NULL) && (D_80BF5C10 == 0) && (this->unk_326 == 0) && + (player->stateFlags3 & PLAYER_STATE3_80000) && (player->invincibilityTimer == 0) && + func_80BF4220(this, play, &player->actor)) { this->unk_18C = &player->actor; this->unk_310 |= 0x800; D_80BF5C10 = 1; @@ -586,7 +587,7 @@ void func_80BF4AB8(EnRg* this, PlayState* play) { this->unk_320 = CLAMP_MAX(this->unk_320, 0x190); } else if (this->collider2.base.at->id == ACTOR_PLAYER) { this->unk_326 = 0x28; - if (player->stateFlags3 & 0x1000) { + if (player->stateFlags3 & PLAYER_STATE3_1000) { player->linearVelocity *= 0.5f; player->unk_B08[0] = player->linearVelocity; player->unk_B08[1] += player->linearVelocity * 0.05f; @@ -758,7 +759,7 @@ void EnRg_Init(Actor* thisx, PlayState* play) { this->unk_31E = 0; this->actionFunc = func_80BF4EBC; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Rg/z_en_rg.h b/src/overlays/actors/ovl_En_Rg/z_en_rg.h index fe0a000b6..4db0b58e0 100644 --- a/src/overlays/actors/ovl_En_Rg/z_en_rg.h +++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.h @@ -52,6 +52,4 @@ typedef struct EnRg { /* 0x34C */ EnRgStruct unk_34C[32]; } EnRg; // size = 0xACC -extern const ActorInit En_Rg_InitVars; - #endif // Z_EN_RG_H diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c index b164e6aab..0fd1007d0 100644 --- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c +++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c @@ -14,7 +14,7 @@ void EnRiverSound_Init(Actor* thisx, PlayState* play); void EnRiverSound_Update(Actor* thisx, PlayState* play); void EnRiverSound_Draw(Actor* thisx, PlayState* play); -const ActorInit En_River_Sound_InitVars = { +ActorInit En_River_Sound_InitVars = { ACTOR_EN_RIVER_SOUND, ACTORCAT_ITEMACTION, FLAGS, @@ -36,7 +36,7 @@ void EnRiverSound_Init(Actor* thisx, PlayState* play) { pathIndex = RS_GET_PATH_INDEX(&this->actor); this->actor.params = RS_GET_TYPE(&this->actor); if (pathIndex == 0xFF) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h index b8dbcc513..eff4fbb47 100644 --- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h +++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h @@ -45,6 +45,4 @@ typedef struct EnRiverSound { /* 0x148 */ Vec3s* pathPoints; } EnRiverSound; // size = 0x14C -extern const ActorInit En_River_Sound_InitVars; - #endif // Z_EN_RIVER_SOUND_H diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index daf11baa6..15dd1d1c4 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -28,7 +28,7 @@ void func_808FB710(EnRr* this, PlayState* play); void func_808FAD1C(EnRr* this, PlayState* play); void func_808FB398(EnRr* this, PlayState* play); -const ActorInit En_Rr_InitVars = { +ActorInit En_Rr_InitVars = { ACTOR_EN_RR, ACTORCAT_ENEMY, FLAGS, @@ -296,7 +296,7 @@ void func_808FA4F4(EnRr* this, PlayState* play) { f32 sp30; f32 sp2C; - if (player->stateFlags2 & 0x80) { + if (player->stateFlags2 & PLAYER_STATE2_80) { player->actor.parent = NULL; player->unk_AE8 = 100; this->actor.flags |= ACTOR_FLAG_1; @@ -571,7 +571,8 @@ void func_808FAF94(EnRr* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 10, 500, 0); this->actor.world.rot.y = this->actor.shape.rot.y; - if ((this->unk_1E6 == 0) && !(player->stateFlags2 & 0x80) && (Player_GetMask(play) != PLAYER_MASK_STONE) && + if ((this->unk_1E6 == 0) && !(player->stateFlags2 & PLAYER_STATE2_80) && + (Player_GetMask(play) != PLAYER_MASK_STONE) && (this->actor.xzDistToPlayer < (8421.053f * this->actor.scale.x))) { func_808FA260(this); } else if ((this->actor.xzDistToPlayer < 400.0f) && (this->actor.speedXZ == 0.0f)) { @@ -714,8 +715,11 @@ void func_808FB42C(EnRr* this, PlayState* play) { Item_DropCollectible(play, &this->actor.world.pos, ITEM00_SHIELD_HERO); } Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x90); - Actor_MarkForDeath(&this->actor); - } else if (this->unk_1E4 == 88) { + Actor_Kill(&this->actor); + return; + } + + if (this->unk_1E4 == 88) { Vec3f sp74; sp74.x = this->actor.world.pos.x; @@ -809,7 +813,7 @@ void EnRr_Update(Actor* thisx, PlayState* play) { if (this->unk_1FC > 0) { Player* player = GET_PLAYER(play); - if (!(player->stateFlags2 & 0x80)) { + if (!(player->stateFlags2 & PLAYER_STATE2_80)) { this->unk_1FC--; if (this->unk_1FC == 0) { this->collider1.base.ocFlags1 |= OC1_TYPE_PLAYER; diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.h b/src/overlays/actors/ovl_En_Rr/z_en_rr.h index 072e78105..e996cfb12 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.h +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.h @@ -62,6 +62,4 @@ typedef struct EnRr { /* 0x324 */ EnRrStruct unk_324[5]; } EnRr; // size = 0x3C4 -extern const ActorInit En_Rr_InitVars; - #endif // Z_EN_RR_H diff --git a/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c b/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c index d7a4f9170..4f6dd1dc1 100644 --- a/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c +++ b/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c @@ -18,7 +18,7 @@ void EnRsn_Draw(Actor* thisx, PlayState* play); void func_80C25D84(EnRsn* this, PlayState* play); -const ActorInit En_Rsn_InitVars = { +ActorInit En_Rsn_InitVars = { ACTOR_EN_RSN, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Rsn/z_en_rsn.h b/src/overlays/actors/ovl_En_Rsn/z_en_rsn.h index b54014438..438a49b1e 100644 --- a/src/overlays/actors/ovl_En_Rsn/z_en_rsn.h +++ b/src/overlays/actors/ovl_En_Rsn/z_en_rsn.h @@ -16,6 +16,4 @@ typedef struct EnRsn { /* 0x1DE */ Vec3s unk1DE; } EnRsn; // size = 0x1E4 -extern const ActorInit En_Rsn_InitVars; - #endif // Z_EN_RSN_H diff --git a/src/overlays/actors/ovl_En_Ru/z_en_ru.c b/src/overlays/actors/ovl_En_Ru/z_en_ru.c index 1a57cba7b..042f2e46f 100644 --- a/src/overlays/actors/ovl_En_Ru/z_en_ru.c +++ b/src/overlays/actors/ovl_En_Ru/z_en_ru.c @@ -17,7 +17,7 @@ void EnRu_Draw(Actor* thisx, PlayState* play); void EnRu_DoNothing(EnRu* this, PlayState* play); -const ActorInit En_Ru_InitVars = { +ActorInit En_Ru_InitVars = { ACTOR_EN_RU, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Ru/z_en_ru.h b/src/overlays/actors/ovl_En_Ru/z_en_ru.h index b1144f88d..081f3bbd8 100644 --- a/src/overlays/actors/ovl_En_Ru/z_en_ru.h +++ b/src/overlays/actors/ovl_En_Ru/z_en_ru.h @@ -38,6 +38,4 @@ typedef struct EnRu { /* 0x450 */ s16 blinkTimer; } EnRu; // size = 0x454 -extern const ActorInit En_Ru_InitVars; - #endif // Z_EN_RU_H diff --git a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c index 98f7b0a11..f77993e5d 100644 --- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c +++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c @@ -40,7 +40,7 @@ void EnRuppecrow_FlyWhileDroppingRupees(EnRuppecrow*, PlayState*); void EnRuppecrow_UpdateSpeed(EnRuppecrow*, PlayState*); void EnRuppecrow_FlyToDespawn(EnRuppecrow*, PlayState*); -const ActorInit En_Ruppecrow_InitVars = { +ActorInit En_Ruppecrow_InitVars = { ACTOR_EN_RUPPECROW, ACTORCAT_ENEMY, FLAGS, @@ -240,7 +240,7 @@ s32 EnRuppecrow_CanSpawnBlueRupees(PlayState* play) { case PLAYER_FORM_ZORA: return false; case PLAYER_FORM_HUMAN: - if (player->stateFlags1 & 0x800000) { + if (player->stateFlags1 & PLAYER_STATE1_800000) { return true; } else { return false; @@ -257,7 +257,7 @@ void EnRuppecrow_UpdateRupees(EnRuppecrow* this) { for (rupeeIndex = 0; rupeeIndex < ENRUPPECROW_RUPEE_COUNT; rupeeIndex++) { rupee = this->rupees[rupeeIndex]; if (rupee != NULL && rupee->unk152 == 0) { - Actor_MarkForDeath(&rupee->actor); + Actor_Kill(&rupee->actor); } } } @@ -268,7 +268,7 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, PlayState* play) { EnItem00* rupee; s16 rupeeIndex = this->rupeeIndex; - if (!(player->stateFlags3 & 0x1000)) { + if (!(player->stateFlags3 & PLAYER_STATE3_1000)) { xOffset = (this->rupeeIndex & 1) ? 10.0f : -10.0f; } else { xOffset = 0.0f; @@ -407,7 +407,7 @@ void EnRuppecrow_UpdateSpeed(EnRuppecrow* this, PlayState* play) { this->speedModifier = 7.0f; break; case PLAYER_FORM_GORON: - if (player->stateFlags3 & 0x1000) { // Goron Link is curled + if (player->stateFlags3 & PLAYER_STATE3_1000) { // Goron Link is curled this->speedModifier = 19.0f; } else { this->speedModifier = 7.0f; @@ -417,7 +417,7 @@ void EnRuppecrow_UpdateSpeed(EnRuppecrow* this, PlayState* play) { this->speedModifier = 7.0f; break; case PLAYER_FORM_HUMAN: - if (player->stateFlags1 & 0x800000) { + if (player->stateFlags1 & PLAYER_STATE1_800000) { this->speedModifier = 16.0f; } else { this->speedModifier = 7.0f; @@ -507,7 +507,7 @@ void EnRuppecrow_HandleSong(EnRuppecrow* this, PlayState* play) { this->actionFunc = EnRuppecrow_HandleSongCutscene; } - if (player->stateFlags2 & 0x8000000) { + if (player->stateFlags2 & PLAYER_STATE2_8000000) { Math_ApproachF(&this->actor.speedXZ, 0.0f, 0.1f, 1.0f); } else { Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.1f, 0.1f); @@ -577,7 +577,7 @@ void EnRuppecrow_FlyToDespawn(EnRuppecrow* this, PlayState* play) { Math_ApproachF(&this->actor.velocity.y, 3.0f, 0.2f, 0.5f); if (this->actor.world.pos.y > 1000.0f || this->actor.xzDistToPlayer > 2000.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->yOffset += 0x800; this->actor.shape.yOffset = Math_SinS(this->yOffset) * 500.0f; @@ -614,7 +614,7 @@ void EnRuppecrow_FallToDespawn(EnRuppecrow* this, PlayState* play) { 0x0); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 0xB, NA_SE_EN_EXTINCT); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -643,7 +643,7 @@ void EnRuppecrow_Init(Actor* thisx, PlayState* play2) { if (this->path != NULL) { this->actionFunc = EnRuppecrow_HandleSong; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.h b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.h index 620e4b9ac..887cd8c6b 100644 --- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.h +++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.h @@ -37,6 +37,4 @@ typedef struct EnRuppecrow { /* 0x2D4 */ Vec3f limbPos[ENRUPPECROW_LIMB_POS_COUNT]; } EnRuppecrow; // size = 0x304 -extern const ActorInit En_Ruppecrow_InitVars; - #endif // Z_EN_RUPPECROW_H 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 902e60419..a53ad3bda 100644 --- a/src/overlays/actors/ovl_En_Rz/z_en_rz.c +++ b/src/overlays/actors/ovl_En_Rz/z_en_rz.c @@ -5,6 +5,7 @@ */ #include "z_en_rz.h" +#include "assets/objects/gameplay_keep/gameplay_keep.h" #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8) @@ -15,22 +16,40 @@ void EnRz_Destroy(Actor* thisx, PlayState* play); void EnRz_Update(Actor* thisx, PlayState* play); void EnRz_Draw(Actor* thisx, PlayState* play); +void EnRz_ActorShadowFunc(Actor* thisx, Lights* mapper, PlayState* play); +void EnRz_ChangeAnim(PlayState*, EnRz*, s16 animIndex, u8 animMode, f32 morphFrames); +s32 EnRz_SetupPath(EnRz* this, PlayState* play); +EnRz* EnRz_FindSister(EnRz* this, PlayState*); void func_80BFC058(EnRz* this, PlayState* play); void func_80BFC078(EnRz* this, PlayState* play); -void func_80BFC19C(EnRz* this, PlayState* play); -void func_80BFC214(EnRz* this, PlayState* play); -void func_80BFC270(EnRz* this, PlayState* play); -void func_80BFC2F4(EnRz* this, PlayState* play); -void func_80BFC36C(EnRz* this, PlayState* play); void func_80BFC3F8(EnRz* this, PlayState* play); -void func_80BFC608(EnRz* this, PlayState* play); void func_80BFC674(EnRz* this, PlayState* play); -void func_80BFC728(EnRz* this, PlayState* play); void func_80BFC7E0(EnRz* this, PlayState* play); -void func_80BFC8F8(EnRz* this, PlayState* play); +void EnRz_Walk(EnRz* this, PlayState* play); -#if 0 -const ActorInit En_Rz_InitVars = { +#define EN_RZ_STATE_1 (1 << 0) +#define EN_RZ_STATE_2 (1 << 1) + +typedef enum { + /* 0 */ EN_RZ_ANIM_THINKING, + /* 1 */ EN_RZ_ANIM_STANDING, + /* 2 */ EN_RZ_ANIM_WALKING, + /* 3 */ EN_RZ_ANIM_SITTING, + /* 4 */ EN_RZ_ANIM_APPLAUDING, + /* 5 */ EN_RZ_ANIM_ON_KNEES, + /* 6 */ EN_RZ_ANIM_DANCE, + /* 7 */ EN_RZ_ANIM_LINK_NORMAL_WAIT_FREE, + /* 8 */ EN_RZ_ANIM_LINK_DANCE, + /* 9 */ EN_RZ_ANIM_MAX +} EnRzAnimation; + +typedef enum { + /* 0 */ EN_RZ_PATHSTATUS_NORMAL, //!< not near waypoint + /* 1 */ EN_RZ_PATHSTATUS_AT_POINT, //!< no path or new waypoint + /* 2 */ EN_RZ_PATHSTATUS_END //!< reached end of path +} EnRzPathStatus; + +ActorInit En_Rz_InitVars = { ACTOR_EN_RZ, ACTORCAT_NPC, FLAGS, @@ -42,80 +61,647 @@ const ActorInit En_Rz_InitVars = { (ActorFunc)EnRz_Draw, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80BFCCF4 = { - { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, +static TexturePtr sEyeTextures[] = { + object_rz_Tex_00BC50, object_rz_Tex_00C190, object_rz_Tex_00C590, object_rz_Tex_00C990, object_rz_Tex_00CD90, +}; + +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 20, 40, 0, { 0, 0, 0 } }, }; -#endif +void EnRz_Init(Actor* thisx, PlayState* play) { + EnRz* this = THIS; + s16 tempCutscene = this->actor.cutscene; + s32 i; -extern ColliderCylinderInit D_80BFCCF4; + for (i = 0; i < ARRAY_COUNT(this->cutscenes); i++) { + this->cutscenes[i] = tempCutscene; + if (tempCutscene != -1) { + this->actor.cutscene = tempCutscene; + tempCutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + } + } -extern UNK_TYPE D_06003A20; -extern UNK_TYPE D_0600D768; + Actor_SetScale(&this->actor, 0.01f); + ActorShape_Init(&this->actor.shape, 0.0f, EnRz_ActorShadowFunc, 20.0f); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/EnRz_Init.s") + // @bug this alignment is because of player animations, but should be using ALIGN16 + SkelAnime_InitFlex(play, &this->skelAnime, &object_rz_Skel_00D8D8, &gRosaSistersStandingAnim, + (uintptr_t)this->jointTable & ~0xF, (uintptr_t)this->morphTable & ~0xF, OBJECT_RZ_LIMB_MAX); + Animation_PlayLoop(&this->skelAnime, &gRosaSistersStandingAnim); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFB780.s") + Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); + this->actor.colChkInfo.mass = MASS_IMMOVABLE; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFB864.s") + this->actionFunc = func_80BFC058; + EnRz_SetupPath(this, play); + this->animIndex = EN_RZ_ANIM_MAX; + this->actor.targetMode = 0; + this->actor.terminalVelocity = -9.0f; + this->actor.gravity = -1.0f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFB9E4.s") + switch (EN_RZ_GET_TYPE(thisx)) { + case EN_RZ_TYPE_1: + if (!(gSaveContext.save.weekEventReg[77] & 4)) { + Actor_Kill(&this->actor); + return; + } + EnRz_ChangeAnim(play, this, EN_RZ_ANIM_SITTING, ANIMMODE_LOOP, 0.0f); + this->actionFunc = func_80BFC674; + this->actor.shape.yOffset = -1500.0f; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFBA1C.s") + case EN_RZ_TYPE_2: + this->actor.flags |= ACTOR_FLAG_10; + if (gSaveContext.save.weekEventReg[77] & 4) { + EnRz_ChangeAnim(play, this, EN_RZ_ANIM_LINK_DANCE, ANIMMODE_LOOP, 0.0f); + } else { + EnRz_ChangeAnim(play, this, EN_RZ_ANIM_DANCE, ANIMMODE_LOOP, 0.0f); + } + this->actionFunc = func_80BFC3F8; + this->sister = EnRz_FindSister(this, play); + this->actor.uncullZoneForward = 300.0f; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFBA50.s") + default: // EN_RZ_TYPE_0 + this->stateFlags |= EN_RZ_STATE_2; + if (gSaveContext.save.weekEventReg[77] & 4) { + Actor_Kill(&this->actor); + return; + } + EnRz_ChangeAnim(play, this, EN_RZ_ANIM_WALKING, ANIMMODE_LOOP, 0.0f); + this->actionFunc = EnRz_Walk; + if (EN_RZ_GET_SISTER(&this->actor) == EN_RZ_JUDO) { + this->actor.textId = 0x291C; + } else { // EN_RZ_MARILLA + this->actor.textId = 0x2920; + } + break; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFBB44.s") + if (EN_RZ_GET_SISTER(&this->actor) == EN_RZ_JUDO) { + this->csAction = 0x226; + } else { // EN_RZ_MARILLA + this->csAction = 0x227; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFBC78.s") + this->actionIndex = 0; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFBCEC.s") +/** + * Custom shadow draw function of type ActorShadowFunc. + */ +void EnRz_ActorShadowFunc(Actor* thisx, Lights* mapper, PlayState* play) { + Vec3f oldPos; + EnRz* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFBD54.s") + if (this->animIndex == EN_RZ_ANIM_LINK_DANCE) { + f32 tempScale = (((27.0f - this->shadowPos.y) + this->actor.world.pos.y) * ((1 / 2.25f) * 0.001f)) + 0.01f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFBDA0.s") + this->actor.scale.x = tempScale; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFBDFC.s") + Math_Vec3f_Copy(&oldPos, &this->actor.world.pos); + Math_Vec3f_Copy(&this->actor.world.pos, &this->shadowPos); + func_800B4AEC(play, &this->actor, 50.0f); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/EnRz_Destroy.s") + if (oldPos.y < this->actor.floorHeight) { + this->actor.world.pos.y = this->actor.floorHeight; + } else { + this->actor.world.pos.y = oldPos.y; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFBE70.s") + ActorShadow_DrawCircle(&this->actor, mapper, play); + Math_Vec3f_Copy(&this->actor.world.pos, &oldPos); + this->actor.scale.x = 0.01f; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFBFAC.s") +void EnRz_ChangeAnim(PlayState* play, EnRz* this, s16 animIndex, u8 animMode, f32 morphFrames) { + // N.B. both of these arrays must be the same length due to how the animations are chosen + static AnimationHeader* sJudoAnimations[] = { + &gRosaSistersThinkingAnim, &gRosaSistersStandingAnim, &gRosaSistersWalkingWhileThinkingAnim, + &gRosaSistersSittingAnim, &gRosaSistersApplaudingAnim, &gRosaSistersOnKneesAnim, + &gRosaSistersDancingAnim, + }; + static AnimationHeader* sMarillaAnimations[] = { + &gRosaSistersStandingAnim, &gRosaSistersStandingAnim, &gRosaSistersWalkingAnim, &gRosaSistersSittingAnim, + &gRosaSistersApplaudingAnim, &gRosaSistersOnKneesAnim, &gRosaSistersDancingAnim, + }; + static LinkAnimationHeader* sLinkAnimations[] = { + &gPlayerAnim_link_normal_wait_free, + &gPlayerAnim_alink_dance_loop, + }; + f32 endFrame; + AnimationHeader** animationPtr; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFC058.s") + if (EN_RZ_GET_SISTER(&this->actor) == EN_RZ_JUDO) { + animationPtr = sJudoAnimations; + } else { // EN_RZ_MARILLA + animationPtr = sMarillaAnimations; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFC078.s") + if ((animIndex >= EN_RZ_ANIM_THINKING) && (animIndex < EN_RZ_ANIM_MAX) && + ((animIndex != this->animIndex) || (animMode != ANIMMODE_LOOP))) { + if (animIndex >= ARRAY_COUNT(sJudoAnimations)) { + endFrame = Animation_GetLastFrame(sLinkAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)]); + if (animMode == ANIMMODE_LOOP) { + LinkAnimation_Change(play, &this->skelAnime, sLinkAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)], + 2.0f / 3.0f, 0.0f, endFrame, ANIMMODE_LOOP, morphFrames); + } else { + LinkAnimation_Change(play, &this->skelAnime, sLinkAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)], + 2.0f / 3.0f, 0.0f, endFrame, ANIMMODE_LOOP, morphFrames); + } + } else { + Animation_Change(&this->skelAnime, animationPtr[animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(animationPtr[animIndex]), animMode, morphFrames); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFC19C.s") + this->animIndex = animIndex; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFC214.s") +void func_80BFB9E4(PlayState* play, EnRz* this, s16 animIndex) { + EnRz_ChangeAnim(play, this, animIndex, ANIMMODE_LOOP, -5.0f); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFC270.s") +void func_80BFBA1C(PlayState* play, EnRz* this, s16 animIndex) { + EnRz_ChangeAnim(play, this, animIndex, ANIMMODE_LOOP, 0.0f); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFC2F4.s") +s32 EnRz_SetupPath(EnRz* this, PlayState* play) { + if (EN_RZ_GET_PATH(&this->actor) != 0x3F) { + this->path = &play->setupPathList[EN_RZ_GET_PATH(&this->actor)]; + if (this->path != NULL) { + Path* path = this->path; + Vec3s* points = (Vec3s*)Lib_SegmentedToVirtual(path->points); + f32 diffX = points->x - this->actor.world.pos.x; + f32 diffY = points->z - this->actor.world.pos.z; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFC36C.s") + if ((SQ(diffX) + SQ(diffY)) < SQ(10.0f)) { + this->curPointIndex = 0; + this->stateFlags &= ~EN_RZ_STATE_1; + } else { + this->curPointIndex = path->count - 1; + this->stateFlags |= EN_RZ_STATE_1; + return true; + } + } + } else { + this->path = NULL; + this->curPointIndex = 0; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFC3F8.s") +EnRzPathStatus EnRz_GetPathStatus(EnRz* this) { + Path* path = this->path; + Vec3s* curPoint; + f32 diffX; + f32 diffZ; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFC608.s") + if (path == NULL) { + return EN_RZ_PATHSTATUS_AT_POINT; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFC674.s") + curPoint = &((Vec3s*)Lib_SegmentedToVirtual(path->points))[this->curPointIndex]; + diffX = curPoint->x - this->actor.world.pos.x; + diffZ = curPoint->z - this->actor.world.pos.z; + this->actor.world.rot.y = Math_Atan2S(diffX, diffZ); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, 0x07D0, 0xC8); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFC728.s") + if ((SQ(diffX) + SQ(diffZ)) < SQ(10.0f)) { + if (this->stateFlags & EN_RZ_STATE_1) { + this->curPointIndex--; + if (this->curPointIndex < 0) { + return EN_RZ_PATHSTATUS_END; + } + } else { + this->curPointIndex++; + if (this->curPointIndex >= path->count) { + return EN_RZ_PATHSTATUS_END; + } + } + return EN_RZ_PATHSTATUS_AT_POINT; + } + return EN_RZ_PATHSTATUS_NORMAL; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFC7E0.s") +s32 EnRz_CanTalk(EnRz* this, PlayState* play) { + if ((this->actor.xzDistToPlayer < 80.0f) && (fabsf(this->actor.playerHeightRel) < 20.0f) && + Player_IsFacingActor(&this->actor, 0x3000, play)) { + return true; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFC8AC.s") +s32 func_80BFBCEC(EnRz* this, PlayState* play) { + s32 pad; + Player* player = GET_PLAYER(play); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFC8F8.s") + if ((this->actor.xzDistToPlayer < 100.0f) && Actor_IsFacingPlayer(&this->actor, 0x3000) && + (player->stateFlags2 & PLAYER_STATE2_2000000)) { + return true; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/EnRz_Update.s") +s32 EnRz_UpdateSkelAnime(EnRz* this, PlayState* play) { + if (this->animIndex < EN_RZ_ANIM_LINK_NORMAL_WAIT_FREE) { + return SkelAnime_Update(&this->skelAnime); + } else { + return LinkAnimation_Update(play, &this->skelAnime); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/func_80BFCAD0.s") +EnRz* EnRz_FindSister(EnRz* this, PlayState* play) { + Actor* npc = play->actorCtx.actorLists[ACTORCAT_NPC].first; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rz/EnRz_Draw.s") + while (npc != NULL) { + if ((npc->id == ACTOR_EN_RZ) && (EN_RZ_GET_TYPE(&this->actor) == EN_RZ_GET_TYPE(npc))) { + if (&this->actor != npc) { + return (EnRz*)npc; + } + } + npc = npc->next; + } + return NULL; +} + +void func_80BFBDFC(PlayState* play) { + if (gSaveContext.save.weekEventReg[75] & 0x80) { + func_80151BB4(play, 0x27); + } + func_80151BB4(play, 0xC); +} + +void EnRz_Destroy(Actor* thisx, PlayState* play) { + EnRz* this = THIS; + + Collider_DestroyCylinder(play, &this->collider); +} + +s32 func_80BFBE70(EnRz* this, PlayState* play) { + u16 action; + + if ((EN_RZ_GET_SISTER(&this->actor) == EN_RZ_JUDO) && (this->animIndex == EN_RZ_ANIM_APPLAUDING)) { + func_800B9010(&this->actor, NA_SE_EV_CLAPPING_2P - SFX_FLAG); + } + + if (Cutscene_CheckActorAction(play, this->csAction)) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->csAction)); + action = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csAction)]->action; + if (this->actionIndex != action) { + this->actionIndex = action; + switch (this->actionIndex) { + case 1: + func_80BFBA1C(play, this, EN_RZ_ANIM_STANDING); + break; + + case 2: + func_80BFBA1C(play, this, EN_RZ_ANIM_ON_KNEES); + break; + + case 3: + func_80BFBA1C(play, this, EN_RZ_ANIM_APPLAUDING); + break; + + case 4: + func_80BFBA1C(play, this, EN_RZ_ANIM_LINK_DANCE); + break; + } + } + return true; + } + + return false; +} + +s32 func_80BFBFAC(EnRz* this, PlayState* play) { + if (this->actor.cutscene == -1) { + Message_StartTextbox(play, 0x2925, &this->actor); + this->actionFunc = func_80BFC078; + } else if (ActorCutscene_GetCurrentIndex() == 0x7C) { + ActorCutscene_Stop(0x7C); + ActorCutscene_SetIntentToPlay(this->actor.cutscene); + return false; + } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { + ActorCutscene_Start(this->actor.cutscene, &this->actor); + return true; + } else { + ActorCutscene_SetIntentToPlay(this->actor.cutscene); + } + return false; +} + +void func_80BFC058(EnRz* this, PlayState* play) { + EnRz_UpdateSkelAnime(this, play); +} + +void func_80BFC078(EnRz* this, PlayState* play) { + s32 pad; + Vec3f sp28; + + EnRz_UpdateSkelAnime(this, play); + + if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { + switch (play->msgCtx.currentTextId) { + case 0x2927: + case 0x2928: + func_80151938(play, play->msgCtx.currentTextId + 1); + gSaveContext.save.weekEventReg[77] |= 4; + break; + + default: + func_801477B4(play); + this->actionFunc = func_80BFC3F8; + if (this->animIndex != EN_RZ_ANIM_LINK_DANCE) { + func_80BFB9E4(play, this, EN_RZ_ANIM_DANCE); + if (this->sister != NULL) { + func_80BFB9E4(play, this->sister, EN_RZ_ANIM_DANCE); + } + } + break; + } + } + + if (EN_RZ_GET_SISTER(&this->actor) == EN_RZ_JUDO) { + sp28.x = this->actor.projectedPos.x; + sp28.y = this->actor.projectedPos.y; + sp28.z = this->actor.projectedPos.z; + func_801A1FB4(3, &sp28, NA_BGM_ROSA_SISTERS, 900.0f); + } +} + +void func_80BFC19C(EnRz* this, PlayState* play) { + EnRz_UpdateSkelAnime(this, play); + if (!func_80BFBE70(this, play)) { + this->actionFunc = func_80BFC3F8; + func_80BFBA1C(play, this, EN_RZ_ANIM_LINK_DANCE); + if (this->sister != NULL) { + func_80BFBA1C(play, this->sister, EN_RZ_ANIM_LINK_DANCE); + } + } +} + +void func_80BFC214(EnRz* this, PlayState* play) { + EnRz_UpdateSkelAnime(this, play); + if (!func_80BFBE70(this, play) && func_80BFBFAC(this, play)) { + this->actionFunc = func_80BFC19C; + } +} + +void func_80BFC270(EnRz* this, PlayState* play) { + EnRz_UpdateSkelAnime(this, play); + if (Actor_HasParent(&this->actor, play)) { + this->actor.parent = NULL; + this->actionFunc = func_80BFC214; + func_80BFBDFC(play); + } else { + Actor_PickUp(&this->actor, play, GI_HEART_PIECE, 2000.0f, 1000.0f); + } +} + +void func_80BFC2F4(EnRz* this, PlayState* play) { + EnRz_UpdateSkelAnime(this, play); + if (!func_80BFBE70(this, play)) { + func_801477B4(play); + Actor_PickUp(&this->actor, play, GI_HEART_PIECE, 2000.0f, 1000.0f); + this->actionFunc = func_80BFC270; + } +} + +void func_80BFC36C(EnRz* this, PlayState* play) { + EnRz_UpdateSkelAnime(this, play); + if (func_80BFBFAC(this, play)) { + gSaveContext.save.weekEventReg[77] |= 4; + if (gSaveContext.save.weekEventReg[75] & 0x80) { + this->actionFunc = func_80BFC214; + } else { + this->actionFunc = func_80BFC2F4; + gSaveContext.save.weekEventReg[75] |= 0x80; + } + this->actor.cutscene = this->cutscenes[1]; + } +} + +void func_80BFC3F8(EnRz* this, PlayState* play) { + s32 pad; + Vec3f bgmPos; + + EnRz_UpdateSkelAnime(this, play); + + if (this->sister == NULL) { + this->sister = EnRz_FindSister(this, play); + } + + if (!func_80BFBE70(this, play)) { + if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { + this->actionFunc = func_80BFC078; + + if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_10000)) { + this->actionFunc = func_80BFC36C; + this->actor.cutscene = this->cutscenes[0]; + this->actor.flags &= ~ACTOR_FLAG_10000; + } else if (Player_GetMask(play) == PLAYER_MASK_KAMARO) { + if (gSaveContext.save.weekEventReg[77] & 4) { + Message_StartTextbox(play, 0x2925, &this->actor); + func_80BFBDFC(play); + } else { + Message_StartTextbox(play, 0x2926, &this->actor); + func_80BFBDFC(play); + } + } else { + Message_StartTextbox(play, 0x2926, &this->actor); + func_80BFBDFC(play); + } + + } else if (EnRz_CanTalk(this, play)) { + if (func_80BFBCEC(this, play) && !(gSaveContext.save.weekEventReg[77] & 4) && this->sister != NULL) { + this->actor.flags |= ACTOR_FLAG_10000; + func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_AP_MINUS1); + } else { + this->actor.flags &= ~ACTOR_FLAG_10000; + func_800B8614(&this->actor, play, 120.0f); + } + } + + if (EN_RZ_GET_SISTER(&this->actor) == EN_RZ_JUDO) { + bgmPos.x = this->actor.projectedPos.x; + bgmPos.y = this->actor.projectedPos.y; + bgmPos.z = this->actor.projectedPos.z; + func_801A1FB4(3, &bgmPos, NA_BGM_ROSA_SISTERS, 900.0f); + } + } +} + +void func_80BFC608(EnRz* this, PlayState* play) { + EnRz_UpdateSkelAnime(this, play); + + if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { + func_801477B4(play); + this->actionFunc = func_80BFC674; + } +} + +void func_80BFC674(EnRz* this, PlayState* play) { + EnRz_UpdateSkelAnime(this, play); + + if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { + this->actionFunc = func_80BFC608; + if (Player_GetMask(play) == PLAYER_MASK_KAMARO) { + Message_StartTextbox(play, 0x2925, &this->actor); + } else { + Message_StartTextbox(play, 0x2924, &this->actor); + } + } else if (EnRz_CanTalk(this, play)) { + func_800B8614(&this->actor, play, 120.0f); + } +} + +void func_80BFC728(EnRz* this, PlayState* play) { + EnRz_UpdateSkelAnime(this, play); + + if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { + func_801477B4(play); + this->actionFunc = func_80BFC7E0; + this->actor.textId++; + if (EN_RZ_GET_SISTER(&this->actor) == EN_RZ_JUDO) { + if (this->actor.textId >= 0x2920) { + this->actor.textId = 0x291C; + } + } else if (this->actor.textId >= 0x2924) { + this->actor.textId = 0x2920; + } + } +} + +void func_80BFC7E0(EnRz* this, PlayState* play) { + EnRz_UpdateSkelAnime(this, play); + + if (this->timer > 0) { + this->timer--; + } else { + this->actionFunc = EnRz_Walk; + func_80BFB9E4(play, this, EN_RZ_ANIM_WALKING); + } + + if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { + this->actionFunc = func_80BFC728; + func_80BFB9E4(play, this, EN_RZ_ANIM_THINKING); + this->actor.speedXZ = 0.0f; + func_80BFBDFC(play); + } else if (EnRz_CanTalk(this, play)) { + func_800B8614(&this->actor, play, 120.0f); + } +} + +void EnRz_StopToThink(EnRz* this, PlayState* play) { + this->timer = 100; + this->actionFunc = func_80BFC7E0; + this->actor.speedXZ = 0.0f; + func_80BFB9E4(play, this, EN_RZ_ANIM_THINKING); +} + +void EnRz_Walk(EnRz* this, PlayState* play) { + EnRz_UpdateSkelAnime(this, play); + this->actor.speedXZ = 1.5f; + + switch (EnRz_GetPathStatus(this)) { + case EN_RZ_PATHSTATUS_END: + EnRz_SetupPath(this, play); + EnRz_StopToThink(this, play); + break; + + case EN_RZ_PATHSTATUS_AT_POINT: + EnRz_StopToThink(this, play); + break; + + default: + break; + } + + if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { + this->actionFunc = func_80BFC728; + func_80BFB9E4(play, this, EN_RZ_ANIM_THINKING); + this->actor.speedXZ = 0.0f; + func_80BFBDFC(play); + } else if (EnRz_CanTalk(this, play)) { + func_800B8614(&this->actor, play, 120.0f); + } +} + +void EnRz_Update(Actor* thisx, PlayState* play) { + s32 pad; + EnRz* this = THIS; + + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); + Actor_MoveWithGravity(&this->actor); + Actor_UpdateBgCheckInfo(play, &this->actor, 40.0f, 25.0f, 40.0f, 5); + + this->actionFunc(this, play); + + if (DECR(this->blinkTimer) == 0) { + this->blinkTimer = Rand_S16Offset(60, 60); + } + + this->eyeIndex = this->blinkTimer; + if (this->eyeIndex > 2) { + this->eyeIndex = 0; + } +} + +void EnRz_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + static Vec3f sFocusOffsetPos = { 500.0f, -500.0f, 0.0f }; + EnRz* this = THIS; + + if (limbIndex == OBJECT_RZ_LIMB_0B) { + Matrix_MultVec3f(&sFocusOffsetPos, &thisx->focus.pos); + } + if (limbIndex == OBJECT_RZ_LIMB_03) { + Matrix_MultVec3f(&gZeroVec3f, &this->shadowPos); + } +} + +void EnRz_Draw(Actor* thisx, PlayState* play) { + EnRz* this = THIS; + + OPEN_DISPS(play->state.gfxCtx); + + func_8012C28C(play->state.gfxCtx); + + if (EN_RZ_GET_SISTER(&this->actor) == EN_RZ_JUDO) { + AnimatedMat_DrawStepOpa(play, Lib_SegmentedToVirtual(&object_rz_Matanimheader_00D768), 0); + } else { // EN_RZ_MARILLA + AnimatedMat_DrawStepOpa(play, Lib_SegmentedToVirtual(&object_rz_Matanimheader_00D768), 1); + } + + if (this->animIndex == EN_RZ_ANIM_APPLAUDING) { + gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(sEyeTextures[4])); + } else if (this->stateFlags & EN_RZ_STATE_2) { + gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(sEyeTextures[3])); + } else { + gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(sEyeTextures[this->eyeIndex])); + } + + SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL, + EnRz_PostLimbDraw, &this->actor); + + CLOSE_DISPS(play->state.gfxCtx); +} diff --git a/src/overlays/actors/ovl_En_Rz/z_en_rz.h b/src/overlays/actors/ovl_En_Rz/z_en_rz.h index 5106d1413..38a7088e8 100644 --- a/src/overlays/actors/ovl_En_Rz/z_en_rz.h +++ b/src/overlays/actors/ovl_En_Rz/z_en_rz.h @@ -2,6 +2,22 @@ #define Z_EN_RZ_H #include "global.h" +#include "assets/objects/object_rz/object_rz.h" + +#define EN_RZ_GET_SISTER(thisx) ((thisx)->params & 0x8000) +#define EN_RZ_GET_TYPE(thisx) ((thisx)->params & 0xF) +#define EN_RZ_GET_PATH(thisx) (((thisx)->params & 0x7E00) >> 9) + +typedef enum { + /* 0 */ EN_RZ_JUDO, // in red + /* 1 */ EN_RZ_MARILLA // in blue +} EnRzSister; + +typedef enum { + /* 0 */ EN_RZ_TYPE_0, + /* 1 */ EN_RZ_TYPE_1, + /* 2 */ EN_RZ_TYPE_2 +} EnRzType; struct EnRz; @@ -9,10 +25,25 @@ typedef void (*EnRzActionFunc)(struct EnRz*, PlayState*); typedef struct EnRz { /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x2EC]; + /* 0x144 */ SkelAnime skelAnime; + /* 0x188 */ Vec3s jointTable[OBJECT_RZ_LIMB_MAX]; + /* 0x20C */ UNK_TYPE1 pad20C[0x94]; + /* 0x2A0 */ Vec3s morphTable[OBJECT_RZ_LIMB_MAX]; + /* 0x324 */ UNK_TYPE1 pad324[0x94]; + /* 0x3B8 */ Path* path; + /* 0x3BC */ s32 curPointIndex; + /* 0x3C0 */ ColliderCylinder collider; + /* 0x40C */ struct EnRz* sister; + /* 0x410 */ s16 eyeIndex; + /* 0x412 */ s16 blinkTimer; + /* 0x414 */ Vec3f shadowPos; + /* 0x420 */ u16 stateFlags; + /* 0x422 */ s16 animIndex; + /* 0x424 */ s16 timer; + /* 0x426 */ u16 csAction; + /* 0x428 */ u16 actionIndex; + /* 0x42A */ s16 cutscenes[2]; /* 0x430 */ EnRzActionFunc actionFunc; } EnRz; // size = 0x434 -extern const ActorInit En_Rz_InitVars; - #endif // Z_EN_RZ_H diff --git a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c index fbfe32252..e78f1970f 100644 --- a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c +++ b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c @@ -94,7 +94,7 @@ typedef enum EnSGoroAnimation { /* 0xF */ EN_S_GORO_ANIM_IDLE_STAND } EnSGoroAnimation; -const ActorInit En_S_Goro_InitVars = { +ActorInit En_S_Goro_InitVars = { ACTOR_EN_S_GORO, ACTORCAT_NPC, FLAGS, @@ -1096,7 +1096,7 @@ void EnSGoro_SetupAction(EnSGoro* this, PlayState* play) { this->actor.shape.yOffset = EN_S_GORO_ROLLEDUP_YOFFSET; break; default: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; } } @@ -1311,7 +1311,7 @@ void EnSGoro_Init(Actor* thisx, PlayState* play) { this->loadedObjIndex = objIndex; if (objIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } this->actor.draw = EnSGoro_Draw; diff --git a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.h b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.h index 0d7ac9edb..5777af17b 100644 --- a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.h +++ b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.h @@ -11,8 +11,6 @@ struct EnSGoro; typedef void (*EnSGoroActionFunc)(struct EnSGoro*, PlayState*); -extern const ActorInit En_S_Goro_InitVars; - typedef struct EnSGoro { /* 0x000 */ Actor actor; /* 0x144 */ Actor* otherGoron; diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index adcb78115..868b48923 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -25,7 +25,7 @@ void EnSb_Lunge(EnSb* this, PlayState* play); void EnSb_Bounce(EnSb* this, PlayState* play); void EnSb_ReturnToIdle(EnSb* this, PlayState* play); -const ActorInit En_Sb_InitVars = { +ActorInit En_Sb_InitVars = { ACTOR_EN_SB, ACTORCAT_ENEMY, FLAGS, @@ -368,22 +368,23 @@ void EnSb_Update(Actor* thisx, PlayState* play) { this->actor.params = 1; } Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x80); - Actor_MarkForDeath(&this->actor); - } else { - Actor_SetFocus(&this->actor, 20.0f); - Actor_MoveWithGravity(&this->actor); - this->actionFunc(this, play); - Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 25.0f, 20.0f, 5); - EnSb_UpdateDamage(this, play); - if (player->stateFlags1 & 0x8000000) { - Collider_UpdateCylinder(&this->actor, &this->collider); - if (this->vulnerableTimer == 0) { - CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); - } - CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); - } - SkelAnime_Update(&this->skelAnime); + Actor_Kill(&this->actor); + return; } + + Actor_SetFocus(&this->actor, 20.0f); + Actor_MoveWithGravity(&this->actor); + this->actionFunc(this, play); + Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 25.0f, 20.0f, 5); + EnSb_UpdateDamage(this, play); + if (player->stateFlags1 & PLAYER_STATE1_8000000) { + Collider_UpdateCylinder(&this->actor, &this->collider); + if (this->vulnerableTimer == 0) { + CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); + } + CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); + } + SkelAnime_Update(&this->skelAnime); } void EnSb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.h b/src/overlays/actors/ovl_En_Sb/z_en_sb.h index f2b3e68e8..b27322226 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.h +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.h @@ -33,6 +33,4 @@ typedef struct EnSb { /* 0x253 */ u8 isDrawn; } EnSb; // size = 0x254 -extern const ActorInit En_Sb_InitVars; - #endif // Z_EN_SB_H diff --git a/src/overlays/actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.c b/src/overlays/actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.c index 3eb978314..15e808971 100644 --- a/src/overlays/actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.c +++ b/src/overlays/actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.c @@ -23,7 +23,7 @@ typedef struct { /* 0x4 */ s16 amount; } RuppeInfo; -const ActorInit En_Sc_Ruppe_InitVars = { +ActorInit En_Sc_Ruppe_InitVars = { ACTOR_EN_SC_RUPPE, ACTORCAT_NPC, FLAGS, @@ -129,7 +129,7 @@ void func_80BD6B18(EnScRuppe* this, PlayState* play) { if (this->ruppeDisplayTime > 30) { if (func_80BD697C(this->ruppeIndex)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { f32 scale; diff --git a/src/overlays/actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.h b/src/overlays/actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.h index 80d7ed20e..8ef0f4c56 100644 --- a/src/overlays/actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.h +++ b/src/overlays/actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.h @@ -26,6 +26,4 @@ typedef enum { /* 5 */ RUPEE_UNUSED, } RupeeType; -extern const ActorInit En_Sc_Ruppe_InitVars; - #endif // Z_EN_SC_RUPPE_H diff --git a/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c b/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c index 4bccdb846..d2a9d525e 100644 --- a/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c +++ b/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c @@ -16,7 +16,7 @@ void EnScopecoin_Destroy(Actor* thisx, PlayState* play); void EnScopecoin_Update(Actor* thisx, PlayState* play); void EnScopecoin_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Scopecoin_InitVars = { +ActorInit En_Scopecoin_InitVars = { ACTOR_EN_SCOPECOIN, ACTORCAT_NPC, FLAGS, @@ -35,7 +35,7 @@ void EnScopecoin_Spin(EnScopecoin* this, PlayState* play) { void EnScopecoin_CheckCollectible(EnScopecoin* this, PlayState* play) { if (Flags_GetCollectible(play, OBJMUPICT_GET_RUPEE_FLAG(&this->actor))) { Item_DropCollectible(play, &this->actor.world.pos, ITEM00_RUPEE_RED); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -53,7 +53,7 @@ void EnScopecoin_Init(Actor* thisx, PlayState* play) { if (play->actorCtx.flags & ACTORCTX_FLAG_1) { if ((this->rupeeIndex == 2) || (this->rupeeIndex == 6)) { if (Flags_GetCollectible(play, OBJMUPICT_GET_RUPEE_FLAG(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -62,13 +62,13 @@ void EnScopecoin_Init(Actor* thisx, PlayState* play) { } else { if ((this->rupeeIndex == 2) || (this->rupeeIndex == 6)) { if (Flags_GetCollectible(play, OBJMUPICT_GET_RUPEE_FLAG(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actor.draw = NULL; this->actionFunc = EnScopecoin_CheckCollectible; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } diff --git a/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.h b/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.h index 8fd9b142c..4dda736f8 100644 --- a/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.h +++ b/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.h @@ -16,6 +16,4 @@ typedef struct EnScopecoin { /* 0x148 */ s16 rupeeIndex; } EnScopecoin; // size = 0x14C -extern const ActorInit En_Scopecoin_InitVars; - #endif // Z_EN_SCOPECOIN_H diff --git a/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c b/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c index a4fcb6cb3..bcf7be085 100644 --- a/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c +++ b/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c @@ -18,7 +18,7 @@ void EnScopecrow_Draw(Actor* thisx, PlayState* play); void func_80BCD590(EnScopecrow* this, PlayState* play); void func_80BCD640(EnScopecrow* this, PlayState* play); -const ActorInit En_Scopecrow_InitVars = { +ActorInit En_Scopecrow_InitVars = { ACTOR_EN_SCOPECROW, ACTORCAT_NPC, FLAGS, @@ -244,7 +244,7 @@ void func_80BCD640(EnScopecrow* this, PlayState* play) { } if (this->unk_1FC >= (this->path->count - 1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->unk_1FC++; } @@ -288,15 +288,15 @@ void EnScopecrow_Init(Actor* thisx, PlayState* play) { this->actor.world.pos = sp3C; this->actor.world.pos.y = BgCheck_EntityRaycastFloor1(&play->colCtx, &sp4C, &sp3C); if (this->actor.world.pos.y == BGCHECK_Y_MIN) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } func_80BCD2BC(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -323,11 +323,11 @@ void EnScopecrow_Init(Actor* thisx, PlayState* play) { return; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void EnScopecrow_Destroy(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.h b/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.h index 60775383e..30f002fb5 100644 --- a/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.h +++ b/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.h @@ -27,6 +27,4 @@ typedef struct EnScopecrow { /* 0x264 */ s16 unk_264; } EnScopecrow; // size = 0x268 -extern const ActorInit En_Scopecrow_InitVars; - #endif // Z_EN_SCOPECROW_H diff --git a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c index fd0ced593..a4a344ce7 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c @@ -33,7 +33,7 @@ void func_80BCC288(EnScopenuts* this, PlayState* play); s32 func_80BCC2AC(EnScopenuts* this, Path* path, s32 arg2_); f32 func_80BCC448(Path* path, s32 arg1, Vec3f* arg2, Vec3s* arg3); -const ActorInit En_Scopenuts_InitVars = { +ActorInit En_Scopenuts_InitVars = { ACTOR_EN_SCOPENUTS, ACTORCAT_NPC, FLAGS, @@ -240,7 +240,7 @@ void func_80BCB1C8(EnScopenuts* this, PlayState* play) { Actor_SetScale(&this->actor, this->unk_350); if (this->actor.bgCheckFlags & 1) { gSaveContext.save.weekEventReg[52] |= 0x40; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -626,7 +626,7 @@ void func_80BCBFFC(EnScopenuts* this, PlayState* play) { } void func_80BCC288(EnScopenuts* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } s32 func_80BCC2AC(EnScopenuts* this, Path* path, s32 arg2_) { @@ -686,7 +686,7 @@ void EnScopenuts_Init(Actor* thisx, PlayState* play) { if (!(gSaveContext.save.weekEventReg[74] & 0x40) && (gSaveContext.save.inventory.items[ITEM_OCARINA] == ITEM_NONE)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -706,20 +706,20 @@ void EnScopenuts_Init(Actor* thisx, PlayState* play) { if (ENSCOPENUTS_GET_3E0(&this->actor) == ENSCOPENUTS_3E0_0) { if (gSaveContext.save.weekEventReg[52] & 0x40) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if (play->actorCtx.flags & ACTORCTX_FLAG_1) { this->path = SubS_GetPathByIndex(play, ENSCOPENUTS_GET_FC00(&this->actor), 0x3F); this->actor.draw = NULL; this->actionFunc = func_80BCAFA8; this->actor.gravity = 0.0f; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (ENSCOPENUTS_GET_3E0(&this->actor) == ENSCOPENUTS_3E0_1) { if (gSaveContext.save.weekEventReg[52] & 0x40) { this->path = SubS_GetPathByIndex(play, ENSCOPENUTS_GET_FC00(&this->actor), 0x3F); if (this->path == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->actor.gravity = -1.0f; this->actor.draw = EnScopenuts_Draw; @@ -732,10 +732,10 @@ void EnScopenuts_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80BCB230; } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h index 3f6f43544..5ea0d15eb 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h @@ -47,6 +47,4 @@ typedef struct EnScopenuts { /* 0x372 */ s16 unk_372; } EnScopenuts; // size = 0x374 -extern const ActorInit En_Scopenuts_InitVars; - #endif // Z_EN_SCOPENUTS_H diff --git a/src/overlays/actors/ovl_En_Sda/z_en_sda.c b/src/overlays/actors/ovl_En_Sda/z_en_sda.c index 19fac24a8..bd453c84c 100644 --- a/src/overlays/actors/ovl_En_Sda/z_en_sda.c +++ b/src/overlays/actors/ovl_En_Sda/z_en_sda.c @@ -20,7 +20,7 @@ void func_80947668(u8* shadowTexture, Player* player, PlayState* play); Vec3f D_80947EA0[16]; -const ActorInit En_Sda_InitVars = { +ActorInit En_Sda_InitVars = { ACTOR_EN_SDA, ACTORCAT_BOSS, FLAGS, diff --git a/src/overlays/actors/ovl_En_Sda/z_en_sda.h b/src/overlays/actors/ovl_En_Sda/z_en_sda.h index ff17a2538..fd11ad5bc 100644 --- a/src/overlays/actors/ovl_En_Sda/z_en_sda.h +++ b/src/overlays/actors/ovl_En_Sda/z_en_sda.h @@ -11,6 +11,4 @@ typedef struct EnSda { /* 0x000 */ Actor actor; } EnSda; // size = 0x144 -extern const ActorInit En_Sda_InitVars; - #endif // Z_EN_SDA_H diff --git a/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c b/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c index 8e0ad276c..5ad105a76 100644 --- a/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c +++ b/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c @@ -24,7 +24,7 @@ void func_80A44DE8(EnSekihi* this, PlayState* play); void func_80A450B0(EnSekihi* this, PlayState* play); void EnSekihi_DoNothing(EnSekihi* this, PlayState* play); -const ActorInit En_Sekihi_InitVars = { +ActorInit En_Sekihi_InitVars = { ACTOR_EN_SEKIHI, ACTORCAT_PROP, FLAGS, @@ -54,23 +54,24 @@ void EnSekihi_Init(Actor* thisx, PlayState* play) { s32 objectIndex; s32 pad; - if ((params < SEKIHI_TYPE_0 || params >= SEKIHI_TYPE_MAX) || sOpaDLists[params] == NULL) { - Actor_MarkForDeath(&this->dyna.actor); - } else { - if ((params == SEKIHI_TYPE_4) && (((gSaveContext.save.skullTokenCount & 0xFFFF)) >= 30)) { - gSaveContext.save.weekEventReg[13] |= 0x20; - } - objectIndex = Object_GetIndex(&play->objectCtx, sObjectIds[params]); - if (objectIndex >= 0) { - this->objectIndex = objectIndex; - } - this->actionFunc = func_80A44DE8; - this->opaDList = sOpaDLists[params]; - this->xluDList = sXluDLists[params]; - this->dyna.actor.textId = sTextIds[params]; - this->dyna.actor.focus.pos.y = this->dyna.actor.world.pos.y + 60.0f; - Actor_SetScale(&this->dyna.actor, 0.1f); + if (((params < SEKIHI_TYPE_0) || (params >= SEKIHI_TYPE_MAX)) || sOpaDLists[params] == NULL) { + Actor_Kill(&this->dyna.actor); + return; } + + if ((params == SEKIHI_TYPE_4) && ((gSaveContext.save.skullTokenCount & 0xFFFF) >= 30)) { + gSaveContext.save.weekEventReg[13] |= 0x20; + } + objectIndex = Object_GetIndex(&play->objectCtx, sObjectIds[params]); + if (objectIndex >= 0) { + this->objectIndex = objectIndex; + } + this->actionFunc = func_80A44DE8; + this->opaDList = sOpaDLists[params]; + this->xluDList = sXluDLists[params]; + this->dyna.actor.textId = sTextIds[params]; + this->dyna.actor.focus.pos.y = this->dyna.actor.world.pos.y + 60.0f; + Actor_SetScale(&this->dyna.actor, 0.1f); } void EnSekihi_Destroy(Actor* thisx, PlayState* play) { @@ -104,7 +105,7 @@ void func_80A44DE8(EnSekihi* this, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); if ((params == SEKIHI_TYPE_4) && (INV_CONTENT(ITEM_MASK_ZORA) != ITEM_MASK_ZORA)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } } diff --git a/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.h b/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.h index e626b616d..fb4ad7e60 100644 --- a/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.h +++ b/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.h @@ -26,6 +26,4 @@ typedef enum SekihiType { /* 0x5 */ SEKIHI_TYPE_MAX } SekihiType; -extern const ActorInit En_Sekihi_InitVars; - #endif // Z_EN_SEKIHI_H 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 d4a726887..de8036ef8 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c @@ -49,7 +49,7 @@ static u16 D_80ADD938[] = { 0x0615, 0x060F, 0x060F }; static u8 D_80ADD940 = 0; -const ActorInit En_Sellnuts_InitVars = { +ActorInit En_Sellnuts_InitVars = { ACTOR_EN_SELLNUTS, ACTORCAT_NPC, FLAGS, @@ -690,7 +690,7 @@ void func_80ADC37C(EnSellnuts* this, PlayState* play) { } void func_80ADC580(EnSellnuts* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_80ADC5A4(EnSellnuts* this, PlayState* play) { @@ -704,10 +704,10 @@ void func_80ADC5A4(EnSellnuts* this, PlayState* play) { this->unk_338 |= 1; this->actor.draw = EnSellnuts_Draw; D_80ADD940 = 0; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->actionFunc = func_80ADC7B4; } else { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->actionFunc = func_80ADC6D0; } } else if (func_80ADB08C(play) < 80.0f) { @@ -836,7 +836,7 @@ void func_80ADCA64(EnSellnuts* this, PlayState* play) { } else if (this->unk_34C == 17) { ActorCutscene_Stop(this->cutscene); gSaveContext.save.weekEventReg[73] |= 4; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -948,7 +948,7 @@ void EnSellnuts_Init(Actor* thisx, PlayState* play) { s32 pad2; if ((gSaveContext.save.weekEventReg[17] & 0x80) || (gSaveContext.save.weekEventReg[61] & 0x10)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Actor_ProcessInitChain(&this->actor, sInitChain); @@ -971,7 +971,7 @@ void EnSellnuts_Init(Actor* thisx, PlayState* play) { this->actor.velocity.y = 0.0f; if (gSaveContext.save.weekEventReg[73] & 4) { if (ENSELLNUTS_GET_1(&this->actor)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->unk_338 |= 2; diff --git a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.h b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.h index 49023ce7f..b9793a6d3 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.h +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.h @@ -46,6 +46,4 @@ typedef struct EnSellnuts { /* 0x374 */ f32 unk_374; } EnSellnuts; // size = 0x378 -extern const ActorInit En_Sellnuts_InitVars; - #endif // Z_EN_SELLNUTS_H diff --git a/src/overlays/actors/ovl_En_Shn/z_en_shn.c b/src/overlays/actors/ovl_En_Shn/z_en_shn.c index 93b75e96b..9c1af02bf 100644 --- a/src/overlays/actors/ovl_En_Shn/z_en_shn.c +++ b/src/overlays/actors/ovl_En_Shn/z_en_shn.c @@ -51,7 +51,7 @@ static UNK_TYPE D_80AE70B8[] = { static UNK_TYPE D_80AE71C4[] = { 0x00374000, 0x1C2C09DB, 0x0C2F0000, 0x0C0F09DC, 0x0C0F09DD, 0x0C0F09DE, 0x0C0F09DF, 0x0C113740, 0x102C09E0, 0x0C2F0000, 0x0C0F09E1, 0x0C0F09E2, 0x0C100000 }; -const ActorInit En_Shn_InitVars = { +ActorInit En_Shn_InitVars = { ACTOR_EN_SHN, ACTORCAT_NPC, FLAGS, @@ -201,7 +201,7 @@ s32 func_80AE65F4(EnShn* this, PlayState* play) { Player* player = GET_PLAYER(play); u16 temp = play->msgCtx.currentTextId; - if (player->stateFlags1 & 0x40) { + if (player->stateFlags1 & PLAYER_STATE1_40) { if (this->unk_1DA != temp) { if ((this->unk_1D8 & 0x80) || (this->unk_1D8 & 0x100)) { this->unk_1D8 |= 8; diff --git a/src/overlays/actors/ovl_En_Shn/z_en_shn.h b/src/overlays/actors/ovl_En_Shn/z_en_shn.h index e373abde2..bb4740142 100644 --- a/src/overlays/actors/ovl_En_Shn/z_en_shn.h +++ b/src/overlays/actors/ovl_En_Shn/z_en_shn.h @@ -43,6 +43,4 @@ typedef struct EnShn { /* 0x2EC */ s32 unk_2EC; } EnShn; // size = 0x2F0 -extern const ActorInit En_Shn_InitVars; - #endif // Z_EN_SHN_H diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.c b/src/overlays/actors/ovl_En_Si/z_en_si.c index eccfc5f1e..5f7e111a4 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -19,7 +19,7 @@ void func_8098CB70(EnSi* this, PlayState* play); void func_8098CBDC(EnSi* this, PlayState* play); #if 0 -const ActorInit En_Si_InitVars = { +ActorInit En_Si_InitVars = { ACTOR_EN_SI, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.h b/src/overlays/actors/ovl_En_Si/z_en_si.h index 032e1f116..b401e5e6a 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.h +++ b/src/overlays/actors/ovl_En_Si/z_en_si.h @@ -13,6 +13,4 @@ typedef struct EnSi { /* 0x148 */ char unk_148[0x58]; } EnSi; // size = 0x1A0 -extern const ActorInit En_Si_InitVars; - #endif // Z_EN_SI_H diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index d0c02e4fa..4fd9f5f14 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -145,7 +145,7 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0xF), }; -const ActorInit En_Skb_InitVars = { +ActorInit En_Skb_InitVars = { ACTOR_EN_SKB, ACTORCAT_ENEMY, FLAGS, @@ -555,7 +555,7 @@ void func_8099599C(EnSkb* this, PlayState* play) { Math_ApproachF(&this->actor.shape.shadowScale, 0.0f, 1.0f, 2.5f); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -800,7 +800,7 @@ void func_80996474(EnSkb* this) { void func_809964A0(EnSkb* this, PlayState* play) { if (this->unk_3D0++ >= 19) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.h b/src/overlays/actors/ovl_En_Skb/z_en_skb.h index 002604838..1fbf441ea 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.h +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.h @@ -9,6 +9,10 @@ typedef void (*EnSkbActionFunc)(struct EnSkb*, PlayState*); #define ENSKB_GET_F0(thisx) (((thisx)->params >> 4) & 0xF) +typedef enum { + /* 0 */ ENSKB_PARAMS_0, +} EnSkbParams; + typedef struct EnSkb { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; @@ -36,6 +40,4 @@ typedef struct EnSkb { /* 0x3E6 */ u8 drawDmgEffType; } EnSkb; // size = 0x3E8 -extern const ActorInit En_Skb_InitVars; - #endif // Z_EN_SKB_H diff --git a/src/overlays/actors/ovl_En_Slime/z_en_slime.c b/src/overlays/actors/ovl_En_Slime/z_en_slime.c index b9660682f..2b8e5f4c6 100644 --- a/src/overlays/actors/ovl_En_Slime/z_en_slime.c +++ b/src/overlays/actors/ovl_En_Slime/z_en_slime.c @@ -33,7 +33,7 @@ void func_80A30C2C(EnSlime* this, PlayState* play); void func_80A30CEC(EnSlime* this, PlayState* play); #if 0 -const ActorInit En_Slime_InitVars = { +ActorInit En_Slime_InitVars = { ACTOR_EN_SLIME, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Slime/z_en_slime.h b/src/overlays/actors/ovl_En_Slime/z_en_slime.h index dacbd824c..0381a592a 100644 --- a/src/overlays/actors/ovl_En_Slime/z_en_slime.h +++ b/src/overlays/actors/ovl_En_Slime/z_en_slime.h @@ -13,6 +13,4 @@ typedef struct EnSlime { /* 0x148 */ char unk_148[0xC0]; } EnSlime; // size = 0x208 -extern const ActorInit En_Slime_InitVars; - #endif // Z_EN_SLIME_H diff --git a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c index e2dd8b54b..8bd665bc0 100644 --- a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c +++ b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c @@ -34,8 +34,8 @@ void EnSnowman_SetupDead(EnSnowman* this); void EnSnowman_Dead(EnSnowman* this, PlayState* play); void EnSnowman_SetupSplitDoNothing(EnSnowman* this); void EnSnowman_SplitDoNothing(EnSnowman* this, PlayState* play); -void EnSnowman_SetupMarkForDeath(EnSnowman* this); -void EnSnowman_MarkForDeath(EnSnowman* this, PlayState* play); +void EnSnowman_SetupKill(EnSnowman* this); +void EnSnowman_Kill(EnSnowman* this, PlayState* play); void EnSnowman_CreateSplitEeno(EnSnowman* this, Vec3f* basePos, s32 yRot); void EnSnowman_SetupCombine(EnSnowman* this, PlayState* play, Vec3f* combinePos); void EnSnowman_Combine(EnSnowman* this, PlayState* play); @@ -61,7 +61,7 @@ typedef enum { /* 3 */ EN_SNOWMAN_COMBINE_STATE_BEING_ABSORBED_OR_DONE, } EnSnowmanCombineState; -const ActorInit En_Snowman_InitVars = { +ActorInit En_Snowman_InitVars = { ACTOR_EN_SNOWMAN, ACTORCAT_ENEMY, FLAGS, @@ -211,14 +211,14 @@ void EnSnowman_Init(Actor* thisx, PlayState* play) { EN_SNOWMAN_TYPE_SPLIT, -1, thisx->unk20, NULL); if ((thisx->child == NULL) || (thisx->parent == NULL)) { if (thisx->child != NULL) { - Actor_MarkForDeath(thisx->child); + Actor_Kill(thisx->child); } if (thisx->parent != NULL) { - Actor_MarkForDeath(thisx->parent); + Actor_Kill(thisx->parent); } - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } @@ -395,7 +395,7 @@ void EnSnowman_MoveSnowPile(EnSnowman* this, PlayState* play) { EnSnowman_SetupCombine(this, play, &combinePos); } else if ((this->work.timer == 0) && (fabsf(this->actor.playerHeightRel) < 60.0f) && (this->actor.xzDistToPlayer < this->attackRange) && (Player_GetMask(play) != PLAYER_MASK_STONE) && - !(player->stateFlags1 & 0x800000)) { + !(player->stateFlags1 & PLAYER_STATE1_800000)) { EnSnowman_SetupEmerge(this, play); } else if (this->snowPileTargetRotY != this->actor.shape.rot.y) { if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->snowPileTargetRotY, 0x100)) { @@ -439,7 +439,7 @@ void EnSnowman_Emerge(EnSnowman* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { if (this->combineState == EN_SNOWMAN_COMBINE_STATE_ACTIVE) { EnSnowman_SetupSubmerge(this, play); - } else if (!(player->stateFlags1 & 0x800000) && (Player_GetMask(play) != PLAYER_MASK_STONE)) { + } else if (!(player->stateFlags1 & PLAYER_STATE1_800000) && (Player_GetMask(play) != PLAYER_MASK_STONE)) { this->collider.base.acFlags |= AC_ON; this->work.snowballsToThrowBeforeIdling = 3; EnSnowman_SetupReadySnowball(this); @@ -529,7 +529,7 @@ void EnSnowman_ThrowSnowball(EnSnowman* this, PlayState* play) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); if (SkelAnime_Update(&this->skelAnime)) { if ((this->work.snowballsToThrowBeforeIdling != 0) && (Player_GetMask(play) != PLAYER_MASK_STONE) && - !(player->stateFlags1 & 0x800000)) { + !(player->stateFlags1 & PLAYER_STATE1_800000)) { EnSnowman_SetupReadySnowball(this); } else { this->work.snowballsToThrowBeforeIdling = 0; @@ -634,11 +634,11 @@ void EnSnowman_Melt(EnSnowman* this, PlayState* play) { if (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_SPLIT) { EnSnowman_SetupSplitDoNothing(this); } else if (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_LARGE) { - Actor_MarkForDeath(this->actor.parent); - Actor_MarkForDeath(this->actor.child); - Actor_MarkForDeath(&this->actor); + Actor_Kill(this->actor.parent); + Actor_Kill(this->actor.child); + Actor_Kill(&this->actor); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -765,7 +765,7 @@ void EnSnowman_Dead(EnSnowman* this, PlayState* play) { if (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_SPLIT) { EnSnowman_SetupSplitDoNothing(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -788,9 +788,9 @@ void EnSnowman_SetupSplitDoNothing(EnSnowman* this) { this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_10); if ((this->actor.parent != NULL) && (((EnSnowman*)this->actor.parent)->actionFunc == EnSnowman_SplitDoNothing)) { if ((this->actor.child != NULL) && (((EnSnowman*)this->actor.child)->actionFunc == EnSnowman_SplitDoNothing)) { - EnSnowman_SetupMarkForDeath((EnSnowman*)this->actor.parent); - EnSnowman_SetupMarkForDeath((EnSnowman*)this->actor.child); - Actor_MarkForDeath(&this->actor); + EnSnowman_SetupKill((EnSnowman*)this->actor.parent); + EnSnowman_SetupKill((EnSnowman*)this->actor.child); + Actor_Kill(&this->actor); } } @@ -801,19 +801,19 @@ void EnSnowman_SplitDoNothing(EnSnowman* this, PlayState* play) { } /** - * Turns off collision on the Eeno before calling Actor_MarkForDeath on it. + * Turns off collision on the Eeno before calling Actor_Kill on it. */ -void EnSnowman_SetupMarkForDeath(EnSnowman* this) { +void EnSnowman_SetupKill(EnSnowman* this) { this->collider.base.acFlags &= ~(AC_ON | AC_HIT); this->collider.base.ocFlags1 &= ~(OC1_ON | OC1_HIT); - this->actionFunc = EnSnowman_MarkForDeath; + this->actionFunc = EnSnowman_Kill; } /** - * Simply calls Actor_MarkForDeath on the Eeno. + * Simply calls Actor_Kill on the Eeno. */ -void EnSnowman_MarkForDeath(EnSnowman* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); +void EnSnowman_Kill(EnSnowman* this, PlayState* play) { + Actor_Kill(&this->actor); } /** @@ -1025,7 +1025,7 @@ void EnSnowman_Update(Actor* thisx, PlayState* play) { EnSnowman_UpdateDamage(this, play); this->actionFunc(this, play); - if (this->actionFunc != EnSnowman_MarkForDeath) { + if (this->actionFunc != EnSnowman_Kill) { Actor_MoveWithGravity(&this->actor); if ((EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_LARGE) && (this->actionFunc == EnSnowman_ReadySnowball)) { @@ -1095,25 +1095,26 @@ void EnSnowman_UpdateSnowball(Actor* thisx, PlayState* play) { 30); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_SMALL_SNOWBALL_BROKEN); } else { - // EnSnowman_SpawnBigSnowballFragmentEffects only fworks with snowballPos, so we need - // to copy the snowball actor's current position into snowballPos to make this fwork. + // EnSnowman_SpawnBigSnowballFragmentEffects only works with snowballPos, so we need + // to copy the snowball actor's current position into snowballPos to make this work. Math_Vec3f_Copy(&this->snowballPos, &this->actor.world.pos); EnSnowman_SpawnBigSnowballFragmentEffects(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_SNOWBALL_BROKEN); } SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_IT_REFLECTION_WOOD); - Actor_MarkForDeath(&this->actor); - } else { - this->actor.shape.rot.x += 0xF00; - Actor_MoveWithGravity(&this->actor); - Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, this->collider.dim.radius * 0.6f, - this->collider.dim.height - this->collider.dim.yShift, 0x1F); - Collider_UpdateCylinder(&this->actor, &this->collider); - CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); - CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); - CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); + Actor_Kill(&this->actor); + return; } + + this->actor.shape.rot.x += 0xF00; + Actor_MoveWithGravity(&this->actor); + Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, this->collider.dim.radius * 0.6f, + this->collider.dim.height - this->collider.dim.yShift, 0x1F); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } /** diff --git a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.h b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.h index 32a1ae352..da0c0a30a 100644 --- a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.h +++ b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.h @@ -54,6 +54,4 @@ typedef struct EnSnowman { /* 0x32C */ ColliderCylinder collider; } EnSnowman; // size = 0x378 -extern const ActorInit En_Snowman_InitVars; - #endif // Z_EN_SNOWMAN_H diff --git a/src/overlays/actors/ovl_En_Snowwd/z_en_snowwd.c b/src/overlays/actors/ovl_En_Snowwd/z_en_snowwd.c index 7e50201ac..48a1cfea0 100644 --- a/src/overlays/actors/ovl_En_Snowwd/z_en_snowwd.c +++ b/src/overlays/actors/ovl_En_Snowwd/z_en_snowwd.c @@ -18,7 +18,7 @@ void EnSnowwd_Draw(Actor* thisx, PlayState* play); void func_80AF76F0(EnSnowwd* this, PlayState* play); #if 0 -const ActorInit En_Snowwd_InitVars = { +ActorInit En_Snowwd_InitVars = { ACTOR_EN_SNOWWD, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_En_Snowwd/z_en_snowwd.h b/src/overlays/actors/ovl_En_Snowwd/z_en_snowwd.h index 6706de846..a83e5d05a 100644 --- a/src/overlays/actors/ovl_En_Snowwd/z_en_snowwd.h +++ b/src/overlays/actors/ovl_En_Snowwd/z_en_snowwd.h @@ -13,6 +13,4 @@ typedef struct EnSnowwd { /* 0x194 */ EnSnowwdActionFunc actionFunc; } EnSnowwd; // size = 0x198 -extern const ActorInit En_Snowwd_InitVars; - #endif // Z_EN_SNOWWD_H 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 ebbdcf542..2a3fb4e32 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -64,7 +64,7 @@ static AnimationInfoS sAnimationInfoBombShopkeeper[] = { { &gBombShopkeeperSitAtCounterLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, }; -const ActorInit En_Sob1_InitVars = { +ActorInit En_Sob1_InitVars = { ACTOR_EN_OSSAN, ACTORCAT_NPC, FLAGS, @@ -396,18 +396,18 @@ void EnSob1_Init(Actor* thisx, PlayState* play) { this->shopType = BOMB_SHOP; break; default: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } objIds = sObjectIds[this->shopType]; this->mainObjIndex = Object_GetIndex(&play->objectCtx, objIds[0]); if (this->mainObjIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (!EnSob1_GetObjIndices(this, play, objIds)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } Actor_ProcessInitChain(&this->actor, sInitChain); @@ -446,7 +446,7 @@ void EnSob1_EndInteraction(PlayState* play, EnSob1* this) { this->drawCursor = 0; this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; play->interfaceCtx.unk_222 = 0; play->interfaceCtx.unk_224 = 0; EnSob1_SetupAction(this, EnSob1_Idle); @@ -533,7 +533,7 @@ void EnSob1_Idle(EnSob1* this, PlayState* play) { ActorCutscene_SetIntentToPlay(this->cutscene); this->cutsceneState = ENSOB1_CUTSCENESTATE_WAITING; } - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; this->welcomeTextId = EnSob1_GetWelcome(this, play); Message_StartTextbox(play, this->welcomeTextId, &this->actor); if (ENSOB1_GET_SHOPTYPE(&this->actor) == BOMB_SHOP) { @@ -790,7 +790,7 @@ void EnSob1_Walking(EnSob1* this, PlayState* play) { ActorCutscene_SetIntentToPlay(this->cutscene); this->cutsceneState = ENSOB1_CUTSCENESTATE_WAITING; } - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; this->welcomeTextId = EnSob1_GetWelcome(this, play); Message_StartTextbox(play, this->welcomeTextId, &this->actor); this->wasTalkedToWhileWalking = true; @@ -810,7 +810,7 @@ void EnSob1_ItemPurchased(EnSob1* this, PlayState* play) { if (this->cutsceneState == ENSOB1_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; EnSob1_SetupAction(this, EnSob1_ContinueShopping); this->cutsceneState = ENSOB1_CUTSCENESTATE_PLAYING; } else { @@ -932,7 +932,7 @@ void EnSob1_SetupBuyItemWithFanfare(PlayState* play, EnSob1* this) { Actor_PickUp(&this->actor, play, this->items[this->cursorIndex]->getItemId, 300.0f, 300.0f); play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; Interface_SetHudVisibility(HUD_VISIBILITY_ALL); this->drawCursor = 0; EnSob1_SetupAction(this, EnSob1_BuyItemWithFanfare); @@ -1093,7 +1093,7 @@ void EnSob1_ContinueShopping(EnSob1* this, PlayState* play) { item = this->items[this->cursorIndex]; item->restockFunc(play, item); player->actor.shape.rot.y += 0x8000; - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; Message_StartTextbox(play, this->welcomeTextId, &this->actor); EnSob1_SetupStartShopping(play, this, true); func_800B85E0(&this->actor, play, 200.0f, PLAYER_AP_MINUS1); diff --git a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.h b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.h index 6cb615d6f..eee86c112 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.h +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.h @@ -88,6 +88,4 @@ typedef enum { /* 2 */ ENSOB1_CUTSCENESTATE_PLAYING } EnSob1CutsceneState; -extern const ActorInit En_Sob1_InitVars; - #endif // Z_EN_SOB1_H diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index 408ca1b2f..023c6ba5d 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -25,7 +25,7 @@ void EnSsh_Start(EnSsh* this, PlayState* play); extern AnimationHeader D_06000304; -const ActorInit En_Ssh_InitVars = { +ActorInit En_Ssh_InitVars = { ACTOR_EN_SSH, ACTORCAT_NPC, FLAGS, @@ -655,7 +655,7 @@ void EnSsh_Init(Actor* thisx, PlayState* play) { this->initialYaw = this->actor.world.rot.y; EnSsh_SetupAction(this, EnSsh_Start); if (Inventory_GetSkullTokenCount(play->sceneId) >= 30) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h index 72a82e692..094c63f7e 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h @@ -56,6 +56,4 @@ typedef struct EnSsh { /* 0x5C8 */ s16 blinkTimer; } EnSsh; // size = 0x5CC -extern const ActorInit En_Ssh_InitVars; - #endif // Z_EN_SSH_H diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index ecc2b85b2..14e0c1cb5 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -23,7 +23,7 @@ void func_808A6E24(EnSt* this, PlayState* play); void func_808A701C(EnSt* this, PlayState* play); void func_808A7478(Actor* thisx, PlayState* play); -const ActorInit En_St_InitVars = { +ActorInit En_St_InitVars = { ACTOR_EN_ST, ACTORCAT_ENEMY, FLAGS, @@ -822,7 +822,7 @@ void func_808A701C(EnSt* this, PlayState* play) { if (count == ARRAY_COUNT(this->unk_31C)) { Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (DECR(this->unk_318) == 0) { this->unk_18C |= 0x40; @@ -839,10 +839,11 @@ void EnSt_Init(Actor* thisx, PlayState* play) { this->unk_2C0 = Object_GetIndex(&play->objectCtx, GAMEPLAY_KEEP); if (((ENST_GET_3F(&this->actor) != ENST_3F_63) && Flags_GetSwitch(play, ENST_GET_3F(&this->actor))) || (this->unk_2C0 < 0)) { - Actor_MarkForDeath(&this->actor); - } else { - this->actionFunc = func_808A6A78; + Actor_Kill(&this->actor); + return; } + + this->actionFunc = func_808A6A78; } void EnSt_Destroy(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_St/z_en_st.h b/src/overlays/actors/ovl_En_St/z_en_st.h index d5ca31f2c..5c63a9664 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.h +++ b/src/overlays/actors/ovl_En_St/z_en_st.h @@ -48,6 +48,4 @@ typedef struct EnSt { /* 0x49C */ Vec3s morphTable[30]; } EnSt; // size = 0x550 -extern const ActorInit En_St_InitVars; - #endif // Z_EN_ST_H 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 1d9ddf4e9..4ca1caae4 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -27,7 +27,7 @@ void func_80B67DA0(EnSth* this, PlayState* play); void func_80B680A8(Actor* thisx, PlayState* play); void func_80B6849C(Actor* thisx, PlayState* play); -const ActorInit En_Sth_InitVars = { +ActorInit En_Sth_InitVars = { ACTOR_EN_STH, ACTORCAT_NPC, FLAGS, @@ -107,7 +107,7 @@ void EnSth_Init(Actor* thisx, PlayState* play) { this->actor.flags |= (ACTOR_FLAG_10 | ACTOR_FLAG_20); this->actionFunc = func_80B67958; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; @@ -116,7 +116,7 @@ void EnSth_Init(Actor* thisx, PlayState* play) { if (Inventory_GetSkullTokenCount(play->sceneId) >= 30) { this->actionFunc = func_80B67DA0; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actor.textId = 0; if (!(gSaveContext.save.weekEventReg[34] & 0x40) || !(gSaveContext.save.weekEventReg[34] & 8)) { @@ -126,7 +126,7 @@ void EnSth_Init(Actor* thisx, PlayState* play) { case ENSTH_F_3: if ((gSaveContext.save.skullTokenCount & 0xFFFF) >= 30) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc = func_80B678A8; @@ -137,7 +137,7 @@ void EnSth_Init(Actor* thisx, PlayState* play) { case ENSTH_F_4: if (gSaveContext.save.weekEventReg[13] & 0x20) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actor.textId = 0; @@ -149,7 +149,7 @@ void EnSth_Init(Actor* thisx, PlayState* play) { case ENSTH_F_5: if (!(gSaveContext.save.weekEventReg[13] & 0x20) || (Inventory_GetSkullTokenCount(play->sceneId) < 30)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc = func_80B67208; diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.h b/src/overlays/actors/ovl_En_Sth/z_en_sth.h index 38d5fcc7f..857b92505 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.h +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.h @@ -32,6 +32,4 @@ typedef struct EnSth { /* 0x2A0 */ EnSthActionFunc actionFunc; } EnSth; // size = 0x2A4 -extern const ActorInit En_Sth_InitVars; - #endif // Z_EN_STH_H diff --git a/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c b/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c index 1bf91af6b..ac615a8dd 100644 --- a/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c +++ b/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c @@ -18,7 +18,7 @@ void EnSth2_Draw(Actor* thisx, PlayState* play2); void EnSth2_UpdateSkelAnime(EnSth2* this, PlayState* play); void EnSth2_UpdateActionFunc(Actor* thisx, PlayState* play); -const ActorInit En_Sth2_InitVars = { +ActorInit En_Sth2_InitVars = { ACTOR_EN_STH2, ACTORCAT_NPC, FLAGS, @@ -43,7 +43,7 @@ void EnSth2_Init(Actor* thisx, PlayState* play) { if (play->actorCtx.flags & ACTORCTX_FLAG_1) { this->actor.flags |= (ACTOR_FLAG_10 | ACTOR_FLAG_20); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc = EnSth2_UpdateSkelAnime; diff --git a/src/overlays/actors/ovl_En_Sth2/z_en_sth2.h b/src/overlays/actors/ovl_En_Sth2/z_en_sth2.h index 1166c9d29..265332ffd 100644 --- a/src/overlays/actors/ovl_En_Sth2/z_en_sth2.h +++ b/src/overlays/actors/ovl_En_Sth2/z_en_sth2.h @@ -18,6 +18,4 @@ typedef struct EnSth2 { /* 0x24C */ EnSth2ActionFunc actionFunc; } EnSth2; // size = 0x250 -extern const ActorInit En_Sth2_InitVars; - #endif // Z_EN_STH2_H 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 121d73c51..9cc5b5fad 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 @@ -27,7 +27,7 @@ void EnStoneheishi_SetupCheckGivenItem(EnStoneheishi*); void EnStoneheishi_GiveItemReward(EnStoneheishi* this, PlayState* play); void EnStoneheishi_SetupDrinkBottleProcess(EnStoneheishi* this); -const ActorInit En_Stone_heishi_InitVars = { +ActorInit En_Stone_heishi_InitVars = { ACTOR_EN_STONE_HEISHI, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.h b/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.h index 7b09d32bb..715fc7139 100644 --- a/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.h +++ b/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.h @@ -28,6 +28,4 @@ typedef struct EnStoneheishi { /* 0x278 */ ColliderCylinder collider; } EnStoneheishi; // size = 0x2C4 -extern const ActorInit En_Stone_heishi_InitVars; - #endif // Z_EN_STONE_HEISHI_H diff --git a/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c b/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c index 062422026..c4d56b70a 100644 --- a/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c +++ b/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c @@ -20,7 +20,7 @@ void func_80AE7F34(EnStopheishi* this, PlayState* play); void func_80AE85C4(EnStopheishi* this, PlayState* play); #if 0 -const ActorInit En_Stop_heishi_InitVars = { +ActorInit En_Stop_heishi_InitVars = { ACTOR_EN_STOP_HEISHI, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.h b/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.h index 5c2b639ef..8e27f1c36 100644 --- a/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.h +++ b/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.h @@ -14,6 +14,4 @@ typedef struct EnStopheishi { /* 0x258 */ char unk_258[0x90]; } EnStopheishi; // size = 0x2E8 -extern const ActorInit En_Stop_heishi_InitVars; - #endif // Z_EN_STOP_HEISHI_H diff --git a/src/overlays/actors/ovl_En_Stream/z_en_stream.c b/src/overlays/actors/ovl_En_Stream/z_en_stream.c index 782f32c0d..11e5ce7d6 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.c +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.c @@ -18,7 +18,7 @@ void EnStream_Draw(Actor* thisx, PlayState* play); void EnStream_WaitForPlayer(EnStream* this, PlayState* play); -const ActorInit En_Stream_InitVars = { +ActorInit En_Stream_InitVars = { ACTOR_EN_STREAM, ACTORCAT_BG, FLAGS, @@ -104,7 +104,7 @@ void EnStream_SuckPlayer(EnStream* this, PlayState* play) { if (yDistWithOffset > 0.0f) { Math_SmoothStepToF(&player->actor.velocity.y, -3.0f, 0.7f, yDistWithOffset, 0.0f); if (posDifference.y < -70.0f) { - player->stateFlags2 |= 0x80000000; + player->stateFlags2 |= PLAYER_STATE2_80000000; } } } else { diff --git a/src/overlays/actors/ovl_En_Stream/z_en_stream.h b/src/overlays/actors/ovl_En_Stream/z_en_stream.h index c544be02f..88856c3dd 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.h +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.h @@ -32,6 +32,4 @@ typedef struct EnStream { /* 0x14C */ UNK_TYPE1 unk_14C[0x4]; } EnStream; // size = 0x150 -extern const ActorInit En_Stream_InitVars; - #endif // Z_EN_STREAM_H diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c index 4f3882aa7..e8d56b602 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -38,7 +38,7 @@ void func_80BADE14(EnSuttari* this, PlayState* play); void func_80BADE8C(EnSuttari* this, PlayState* play); void func_80BADF3C(EnSuttari* this, PlayState* play); -const ActorInit En_Suttari_InitVars = { +ActorInit En_Suttari_InitVars = { ACTOR_EN_SUTTARI, ACTORCAT_NPC, FLAGS, @@ -861,9 +861,9 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) { if (!(gSaveContext.save.weekEventReg[83] & 4) && !(this->flags1 & 0x1000)) { if (ActorCutscene_GetCanPlayNext(this->cutscenes[0])) { ActorCutscene_Start(this->cutscenes[0], &this->actor); - if (!(player->stateFlags1 & 0x10000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_10000000)) { this->flags2 |= 0x10; - player->stateFlags1 |= 0x10000000; + player->stateFlags1 |= PLAYER_STATE1_10000000; } this->flags1 |= 0x1000; this->flags2 |= 2; @@ -904,7 +904,7 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) { func_80BABFD4(this, play); break; case 1: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); break; case 2: if (!(gSaveContext.save.weekEventReg[81] & 4)) { @@ -926,9 +926,9 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) { if (this->flags2 & 2) { this->flags2 &= ~2; } - if (!(player->stateFlags1 & 0x10000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_10000000)) { this->flags2 |= 0x10; - player->stateFlags1 |= 0x10000000; + player->stateFlags1 |= PLAYER_STATE1_10000000; } this->textId = 0x2A30; Message_StartTextbox(play, this->textId, &this->actor); @@ -963,11 +963,11 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { } } else if (play->sceneId == SCENE_BACKTOWN) { if (gSaveContext.save.time >= CLOCK_TIME(0, 20) && gSaveContext.save.time < CLOCK_TIME(6, 00)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if ((gSaveContext.save.entrance == ENTRANCE(NORTH_CLOCK_TOWN, 7)) || (gSaveContext.save.weekEventReg[58] & 0x40)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->cutscenes[0] = this->actor.cutscene; this->cutscenes[1] = ActorCutscene_GetAdditionalCutscene(this->cutscenes[0]); @@ -979,7 +979,7 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { return; } else if (play->sceneId == SCENE_ICHIBA) { if (gSaveContext.save.weekEventReg[33] & 8) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->animIndex = 0; @@ -989,7 +989,7 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { return; } else if (play->sceneId == SCENE_AYASHIISHOP) { if (gSaveContext.save.weekEventReg[33] & 8) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->animIndex = 0; @@ -1005,7 +1005,7 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { this->actionFunc = func_80BACA14; return; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_80BACA14(EnSuttari* this, PlayState* play) { @@ -1201,7 +1201,7 @@ void func_80BAD380(EnSuttari* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); Player* player = GET_PLAYER(play); - if ((player->stateFlags1 & 0x40) && (play->msgCtx.currentTextId != 0x2A31)) { + if ((player->stateFlags1 & PLAYER_STATE1_40) && (play->msgCtx.currentTextId != 0x2A31)) { this->flags1 |= 0x8000; this->actor.speedXZ = 0.0f; } else { @@ -1209,7 +1209,7 @@ void func_80BAD380(EnSuttari* this, PlayState* play) { func_80BABA90(this, 1, 1); if ((this->flags1 & 0x4000) && (talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) { this->flags2 &= ~0x10; - player->stateFlags1 &= ~0x10000000; + player->stateFlags1 &= ~PLAYER_STATE1_10000000; this->flags1 &= ~0x4000; ActorCutscene_Stop(this->cutscenes[1]); play->msgCtx.msgMode = 0x43; @@ -1226,7 +1226,7 @@ void func_80BAD380(EnSuttari* this, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, CLEAR_TAG_SMALL_EXPLOSION); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 30, NA_SE_IT_BOMB_EXPLOSION); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (this->unk1F4[1] == -0x63) { @@ -1266,7 +1266,7 @@ void func_80BAD5F8(EnSuttari* this, PlayState* play) { this->unk428 = scheduleOutput.result; func_80BAC2FC(this, play); if ((this->unk430 == 1) && (this->timePath->unk1 == 0xFF)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } func_80BAB434(this); @@ -1304,7 +1304,7 @@ void func_80BAD7F8(EnSuttari* this, PlayState* play) { this->unk428 = scheduleOutput.result; func_80BAC2FC(this, play); if ((this->unk430 == 1) && (this->timePath->unk1 == 0xFF)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if ((this->flags1 & 0x20) && (scheduleOutput.result != 9)) { @@ -1434,7 +1434,7 @@ void func_80BADE8C(EnSuttari* this, PlayState* play) { void func_80BADF3C(EnSuttari* this, PlayState* play) { func_80BABB90(this, 0); if (this->unk1F4[0] == -0x63) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->unk3F2 = this->headRot.y; if (DECR(this->unk3F6) == 0) { @@ -1448,7 +1448,7 @@ void EnSuttari_Init(Actor* thisx, PlayState* play) { s32 pad; if (gSaveContext.save.weekEventReg[79] & 0x40) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } Collider_InitCylinder(play, &this->collider); @@ -1476,7 +1476,7 @@ void EnSuttari_Update(Actor* thisx, PlayState* play) { Player* player = GET_PLAYER(play); this->actionFunc(this, play); - if ((this->flags1 & 8) && (this->flags2 & 0x10) && (player->stateFlags1 & 0x10000000)) { + if ((this->flags1 & 8) && (this->flags2 & 0x10) && (player->stateFlags1 & PLAYER_STATE1_10000000)) { player->actor.freezeTimer = 3; } if (!(this->flags1 & 0x8000)) { diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.h b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.h index 427f74988..669cf549e 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.h +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.h @@ -60,6 +60,4 @@ typedef struct EnSuttari { /* 0x45A */ s16 cutsceneIdx; } EnSuttari; // size = 0x45C -extern const ActorInit En_Suttari_InitVars; - #endif // Z_EN_SUTTARI_H diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index fc3aff029..da5ba5b8d 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -28,7 +28,7 @@ void func_808DB100(EnSw* this, PlayState* play); void func_808DB25C(EnSw* this, PlayState* play); void func_808DB2E0(EnSw* this, PlayState* play); -const ActorInit En_Sw_InitVars = { +ActorInit En_Sw_InitVars = { ACTOR_EN_SW, ACTORCAT_NPC, FLAGS, @@ -738,7 +738,7 @@ s32 func_808DA08C(EnSw* this, PlayState* play) { void func_808DA350(EnSw* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((player->stateFlags1 & 0x200000) && (this->actor.xyzDistToPlayerSq < 8000.0f)) { + if ((player->stateFlags1 & PLAYER_STATE1_200000) && (this->actor.xyzDistToPlayerSq < 8000.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_LAUGH); Math_Vec3f_Copy(&this->unk_374, &player->actor.world.pos); this->unk_410 &= ~0x20; @@ -1023,7 +1023,7 @@ void func_808DAEB4(EnSw* this, PlayState* play) { } if (count == ARRAY_COUNT(this->unk_464)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { Math_ApproachF(&this->actor.scale.x, 0.0f, 0.08f, 1.0f); @@ -1038,7 +1038,7 @@ void func_808DAEB4(EnSw* this, PlayState* play) { 0, this->actor.params) != NULL) { play_sound(NA_SE_SY_KINSTA_MARK_APPEAR); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } func_808D94D0(this, play, 0, 0, 0x1554); } @@ -1210,7 +1210,7 @@ void EnSw_Init(Actor* thisx, PlayState* play) { break; } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.h b/src/overlays/actors/ovl_En_Sw/z_en_sw.h index 7bf39b6c2..4544346a0 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.h +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.h @@ -50,6 +50,4 @@ typedef struct EnSw { /* 0x4A0 */ s32 unk_4A0; } EnSw; // size = 0x4A4 -extern const ActorInit En_Sw_InitVars; - #endif // Z_EN_SW_H diff --git a/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c b/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c index 0b76c7715..1a2f8b685 100644 --- a/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c +++ b/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c @@ -25,7 +25,7 @@ void EnSyatekiCrow_Dead(EnSyatekiCrow* this, PlayState* play); static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; -const ActorInit En_Syateki_Crow_InitVars = { +ActorInit En_Syateki_Crow_InitVars = { ACTOR_EN_SYATEKI_CROW, ACTORCAT_ENEMY, FLAGS, @@ -96,7 +96,7 @@ void EnSyatekiCrow_Init(Actor* thisx, PlayState* play2) { ActorShape_Init(&this->actor.shape, 2000.0f, ActorShadow_DrawCircle, 20.0f); if ((path == NULL) || (EN_SYATEKI_CROW_GET_INDEX(&this->actor) >= 0x80)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.h b/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.h index f7a876285..f244b0b60 100644 --- a/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.h +++ b/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.h @@ -32,6 +32,4 @@ typedef struct EnSyatekiCrow { /* 0x25C */ ColliderJntSphElement colliderElements[1]; } EnSyatekiCrow; // size = 0x29C -extern const ActorInit En_Syateki_Crow_InitVars; - #endif // Z_EN_SYATEKI_CROW_H diff --git a/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c b/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c index b7e79fdfd..601095cfd 100644 --- a/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c +++ b/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c @@ -39,7 +39,7 @@ typedef enum { /* 1 */ EN_SYATEKI_DEKUNUTS_HEADDRESS_TYPE_FLIPPED_UP, } EnSyatekiDekunutsHeaddressType; -const ActorInit En_Syateki_Dekunuts_InitVars = { +ActorInit En_Syateki_Dekunuts_InitVars = { ACTOR_EN_SYATEKI_DEKUNUTS, ACTORCAT_ENEMY, FLAGS, @@ -142,7 +142,7 @@ void EnSyatekiDekunuts_Init(Actor* thisx, PlayState* play2) { DEKU_SCRUB_LIMB_MAX); if (path == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.h b/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.h index 51baf398f..2ceb0b32d 100644 --- a/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.h +++ b/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.h @@ -40,6 +40,4 @@ typedef struct EnSyatekiDekunuts { /* 0x26C */ UNK_TYPE1 unk_26C[0x4]; } EnSyatekiDekunuts; // size = 0x270 -extern const ActorInit En_Syateki_Dekunuts_InitVars; - #endif // Z_EN_SYATEKI_DEKUNUTS_H diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 838eaa2a5..c6d04def5 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 @@ -59,7 +59,7 @@ void EnSyatekiMan_Town_EndGame(EnSyatekiMan* this, PlayState* play); #define COLUMN_CENTER 1 #define COLUMN_RIGHT 2 -const ActorInit En_Syateki_Man_InitVars = { +ActorInit En_Syateki_Man_InitVars = { ACTOR_EN_SYATEKI_MAN, ACTORCAT_NPC, FLAGS, @@ -346,7 +346,7 @@ void EnSyatekiMan_Swamp_HandleChoice(EnSyatekiMan* this, PlayState* play) { play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; this->shootingGameState = SG_GAME_STATE_MOVING_PLAYER; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->actionFunc = EnSyatekiMan_Swamp_MovePlayerAndExplainRules; } } else { @@ -410,7 +410,7 @@ void EnSyatekiMan_Swamp_HandleNormalMessage(EnSyatekiMan* this, PlayState* play) case 0xA32: // You have to try harder! if (gSaveContext.save.weekEventReg[63] & 2) { func_801477B4(play); - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; gSaveContext.save.weekEventReg[63] &= (u8)~1; gSaveContext.save.weekEventReg[63] &= (u8)~2; this->actionFunc = EnSyatekiMan_Swamp_Idle; @@ -435,7 +435,7 @@ void EnSyatekiMan_Swamp_HandleNormalMessage(EnSyatekiMan* this, PlayState* play) play->msgCtx.stateTimer = 4; player->actor.freezeTimer = 0; gSaveContext.minigameState = 3; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->actionFunc = EnSyatekiMan_Swamp_SetupGiveReward; EnSyatekiMan_Swamp_SetupGiveReward(this, play); break; @@ -446,8 +446,8 @@ void EnSyatekiMan_Swamp_HandleNormalMessage(EnSyatekiMan* this, PlayState* play) void EnSyatekiMan_Swamp_Talk(EnSyatekiMan* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (player->stateFlags1 & 0x20) { - player->stateFlags1 |= 0x20; + if (player->stateFlags1 & PLAYER_STATE1_20) { + player->stateFlags1 |= PLAYER_STATE1_20; } switch (Message_GetState(&play->msgCtx)) { @@ -468,7 +468,7 @@ void EnSyatekiMan_Swamp_Talk(EnSyatekiMan* this, PlayState* play) { if (Message_ShouldAdvance(play)) { play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; gSaveContext.save.weekEventReg[63] &= (u8)~1; gSaveContext.save.weekEventReg[63] &= (u8)~2; this->actionFunc = EnSyatekiMan_Swamp_Idle; @@ -640,7 +640,7 @@ void EnSyatekiMan_Town_HandleChoice(EnSyatekiMan* this, PlayState* play) { } if (this->shootingGameState == SG_GAME_STATE_ONE_MORE_GAME) { - player->stateFlags3 &= ~0x400; + player->stateFlags3 &= ~PLAYER_STATE3_400; gSaveContext.minigameState = 3; } @@ -676,7 +676,7 @@ void EnSyatekiMan_Town_HandleChoice(EnSyatekiMan* this, PlayState* play) { } if (this->shootingGameState == SG_GAME_STATE_ONE_MORE_GAME) { - player->stateFlags3 &= ~0x400; + player->stateFlags3 &= ~PLAYER_STATE3_400; gSaveContext.minigameState = 3; } @@ -746,7 +746,7 @@ void EnSyatekiMan_Town_HandleNormalMessage(EnSyatekiMan* this, PlayState* play) play->msgCtx.stateTimer = 4; player->actor.freezeTimer = 0; this->shootingGameState = SG_GAME_STATE_MOVING_PLAYER; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; gSaveContext.save.weekEventReg[63] |= 1; gSaveContext.save.weekEventReg[63] &= (u8)~2; this->actionFunc = EnSyatekiMan_Town_MovePlayerAndSayHighScore; @@ -819,8 +819,8 @@ void EnSyatekiMan_Town_HandleNormalMessage(EnSyatekiMan* this, PlayState* play) void EnSyatekiMan_Town_Talk(EnSyatekiMan* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (player->stateFlags1 & 0x20) { - player->stateFlags1 |= 0x20; + if (player->stateFlags1 & PLAYER_STATE1_20) { + player->stateFlags1 |= PLAYER_STATE1_20; } switch (Message_GetState(&play->msgCtx)) { @@ -841,7 +841,7 @@ void EnSyatekiMan_Town_Talk(EnSyatekiMan* this, PlayState* play) { if (Message_ShouldAdvance(play)) { gSaveContext.save.weekEventReg[63] &= (u8)~1; gSaveContext.save.weekEventReg[63] &= (u8)~2; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->actionFunc = EnSyatekiMan_Town_Idle; this->shootingGameState = SG_GAME_STATE_NONE; } @@ -902,7 +902,7 @@ void EnSyatekiMan_Swamp_GiveReward(EnSyatekiMan* this, PlayState* play) { this->prevTextId = 0xA37; } - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->actor.flags &= ~ACTOR_FLAG_10000; this->score = 0; this->shootingGameState = SG_GAME_STATE_NONE; @@ -955,7 +955,7 @@ void EnSyatekiMan_Town_GiveReward(EnSyatekiMan* this, PlayState* play) { if (CURRENT_DAY != 3) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->score = 0; this->shootingGameState = SG_GAME_STATE_NONE; gSaveContext.save.weekEventReg[63] &= (u8)~1; @@ -966,7 +966,7 @@ void EnSyatekiMan_Town_GiveReward(EnSyatekiMan* this, PlayState* play) { // This may be our last day in business... Message_StartTextbox(play, 0x408, &this->actor); this->prevTextId = 0x408; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->actor.flags &= ~ACTOR_FLAG_10000; this->score = 0; this->shootingGameState = SG_GAME_STATE_NONE; @@ -980,7 +980,7 @@ void EnSyatekiMan_Swamp_MovePlayerAndExplainRules(EnSyatekiMan* this, PlayState* Player* player = GET_PLAYER(play); if (EnSyatekiMan_MovePlayerToPos(play, sSwampPlayerPos)) { - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->shootingGameState = SG_GAME_STATE_EXPLAINING_RULES; if (this->talkFlags != TALK_FLAG_SWAMP_HAS_EXPLAINED_THE_RULES) { this->talkFlags = TALK_FLAG_SWAMP_HAS_EXPLAINED_THE_RULES; @@ -1011,7 +1011,7 @@ void EnSyatekiMan_Swamp_StartGame(EnSyatekiMan* this, PlayState* play) { sGameStartTimer = 30; this->flagsIndex = 0; this->score = 0; - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_FOUND); this->dekuScrubFlags = (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) | (1 << 0); this->guayFlags = 0; @@ -1076,7 +1076,7 @@ void EnSyatekiMan_Swamp_RunGame(EnSyatekiMan* this, PlayState* play) { this->actor.draw = EnSyatekiMan_Draw; this->flagsIndex = 0; this->currentWave = 0; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; sHasSpawnedGuaysForThisWave = false; func_801A2C20(); this->actionFunc = EnSyatekiMan_Swamp_EndGame; @@ -1085,7 +1085,7 @@ void EnSyatekiMan_Swamp_RunGame(EnSyatekiMan* this, PlayState* play) { this->actor.draw = EnSyatekiMan_Draw; this->flagsIndex = 0; this->currentWave = 0; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; sHasSpawnedGuaysForThisWave = false; func_801A2C20(); this->shootingGameState = SG_GAME_STATE_GIVING_BONUS; @@ -1155,7 +1155,7 @@ void EnSyatekiMan_Swamp_AddBonusPoints(EnSyatekiMan* this, PlayState* play) { static s32 sBonusTimer = 0; Player* player = GET_PLAYER(play); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; if (play->interfaceCtx.unk_286 == 0) { if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_1] == SECONDS_TO_TIMER(0)) { gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_1] = SECONDS_TO_TIMER(0); @@ -1216,14 +1216,14 @@ void EnSyatekiMan_Town_StartGame(EnSyatekiMan* this, PlayState* play) { player->actor.shape.rot.y = -0x8000; player->actor.world.rot.y = player->actor.shape.rot.y; play->unk_18790(play, -0x8000, &this->actor); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; sGameStartTimer--; } else if (sGameStartTimer > 0) { player->actor.shape.rot.y = -0x8000; player->actor.world.rot.y = player->actor.shape.rot.y; sGameStartTimer--; } else if (sGameStartTimer == 0) { - player->stateFlags1 &= ~0x20; + player->stateFlags1 &= ~PLAYER_STATE1_20; this->score = 0; this->flagsIndex = 0; this->perGameVar1.octorokState = SG_OCTO_STATE_INITIAL; @@ -1352,7 +1352,7 @@ void EnSyatekiMan_Town_RunGame(EnSyatekiMan* this, PlayState* play) { this->perGameVar1.octorokState = SG_OCTO_STATE_HIDING; gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_1] = SECONDS_TO_TIMER(0); gSaveContext.timerStates[TIMER_ID_MINIGAME_1] = TIMER_STATE_STOP; - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; sModFromLosingTime = 0; this->actor.draw = EnSyatekiMan_Draw; func_801A2C20(); diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h index 30bc1b1ad..0b637fecf 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h @@ -70,6 +70,4 @@ typedef struct EnSyatekiMan { /* 0x284 */ s16 prevTextId; } EnSyatekiMan; // size = 0x288 -extern const ActorInit En_Syateki_Man_InitVars; - #endif // Z_EN_SYATEKI_MAN_H diff --git a/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c b/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c index d9059577c..5358d44cf 100644 --- a/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c +++ b/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c @@ -28,7 +28,7 @@ void func_80A36504(EnSyatekiOkuta* this, PlayState* play); void func_80A365EC(EnSyatekiOkuta* this, PlayState* play); void func_80A36CB0(EnSyatekiOkuta* this); -const ActorInit En_Syateki_Okuta_InitVars = { +ActorInit En_Syateki_Okuta_InitVars = { ACTOR_EN_SYATEKI_OKUTA, ACTORCAT_ENEMY, FLAGS, @@ -105,7 +105,7 @@ void EnSyatekiOkuta_Init(Actor* thisx, PlayState* play) { if (!(WaterBox_GetSurface1_2(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &ySurface, &waterbox)) || (ySurface <= this->actor.floorHeight)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { this->actor.world.pos.y = this->actor.home.pos.y = ySurface; } diff --git a/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.h b/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.h index a455765cd..0527354d0 100644 --- a/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.h +++ b/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.h @@ -24,6 +24,4 @@ typedef struct EnSyatekiOkuta { /* 0x2AA */ s16 unk_2AA; } EnSyatekiOkuta; // size = 0x2AC -extern const ActorInit En_Syateki_Okuta_InitVars; - #endif // Z_EN_SYATEKI_OKUTA_H diff --git a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c index ad9aa824f..20871efb2 100644 --- a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c +++ b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c @@ -101,7 +101,7 @@ static Vec3f D_80A20EDC = { 0.0f, 20.0f, 0.0f }; static Vec3f D_80A20EE8 = { 0.0f, 0.0f, 0.0f }; -const ActorInit En_Syateki_Wf_InitVars = { +ActorInit En_Syateki_Wf_InitVars = { ACTOR_EN_SYATEKI_WF, ACTORCAT_ENEMY, FLAGS, @@ -156,7 +156,7 @@ void EnSyatekiWf_Init(Actor* thisx, PlayState* play) { } if (path == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.h b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.h index 9e01dca3d..56770952f 100644 --- a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.h +++ b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.h @@ -35,6 +35,4 @@ typedef struct EnSyatekiWf { /* 0x3AC */ UNK_TYPE1 unk_3AC[0x20]; } EnSyatekiWf; // size = 0x3CC -extern const ActorInit En_Syateki_Wf_InitVars; - #endif // Z_EN_SYATEKI_WF_H diff --git a/src/overlays/actors/ovl_En_Tab/z_en_tab.c b/src/overlays/actors/ovl_En_Tab/z_en_tab.c index ffa557746..ad1367f06 100644 --- a/src/overlays/actors/ovl_En_Tab/z_en_tab.c +++ b/src/overlays/actors/ovl_En_Tab/z_en_tab.c @@ -66,7 +66,7 @@ s32 D_80BE1A0C[] = { 0x0C103012, 0x14FFEC06, 0x00920000, 0x1300920C, 0x10300034, 0x0100050E, 0x2B100C10, 0x0E2B110C, 0x10000000, }; -const ActorInit En_Tab_InitVars = { +ActorInit En_Tab_InitVars = { ACTOR_EN_TAB, ACTORCAT_NPC, FLAGS, @@ -428,7 +428,7 @@ s32 func_80BE10BC(EnTab* this, PlayState* play) { switch (this->unk_1D8) { case 1: - if ((player->stateFlags1 & 0x40) && !(play->msgCtx.currentTextId <= 0x2B00) && + if ((player->stateFlags1 & PLAYER_STATE1_40) && !(play->msgCtx.currentTextId <= 0x2B00) && (play->msgCtx.currentTextId < 0x2B08)) { this->actor.child = &this->unk_1E4->actor; this->unk_2FC |= 8; diff --git a/src/overlays/actors/ovl_En_Tab/z_en_tab.h b/src/overlays/actors/ovl_En_Tab/z_en_tab.h index 81ce92006..6bb0503a7 100644 --- a/src/overlays/actors/ovl_En_Tab/z_en_tab.h +++ b/src/overlays/actors/ovl_En_Tab/z_en_tab.h @@ -45,6 +45,4 @@ typedef struct EnTab { /* 0x338 */ s32 unk_338; } EnTab; // size = 0x33C -extern const ActorInit En_Tab_InitVars; - #endif // Z_EN_TAB_H diff --git a/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c b/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c index 0d39a0db2..2cc547e9a 100644 --- a/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c +++ b/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c @@ -34,7 +34,7 @@ static ColliderCylinderInit sUnusedColliderInit = { { 20, 30, 0, { 0, 0, 0 } }, }; -const ActorInit En_Tag_Obj_InitVars = { +ActorInit En_Tag_Obj_InitVars = { ACTOR_EN_TAG_OBJ, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.h b/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.h index a58b2b1d3..25e7025d8 100644 --- a/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.h +++ b/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.h @@ -11,6 +11,4 @@ typedef struct EnTagObj { /* 0x194 */ s32 hasSpawnedSeahorse; } EnTagObj; // size = 0x198 -extern const ActorInit En_Tag_Obj_InitVars; - #endif // Z_EN_TAG_OBJ_H diff --git a/src/overlays/actors/ovl_En_Takaraya/z_en_takaraya.c b/src/overlays/actors/ovl_En_Takaraya/z_en_takaraya.c index 726d97227..9bc0cd1b9 100644 --- a/src/overlays/actors/ovl_En_Takaraya/z_en_takaraya.c +++ b/src/overlays/actors/ovl_En_Takaraya/z_en_takaraya.c @@ -16,7 +16,7 @@ void EnTakaraya_Update(Actor* thisx, PlayState* play); void EnTakaraya_Draw(Actor* thisx, PlayState* play); #if 0 -const ActorInit En_Takaraya_InitVars = { +ActorInit En_Takaraya_InitVars = { ACTOR_EN_TAKARAYA, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Takaraya/z_en_takaraya.h b/src/overlays/actors/ovl_En_Takaraya/z_en_takaraya.h index cc707f027..cfa37125e 100644 --- a/src/overlays/actors/ovl_En_Takaraya/z_en_takaraya.h +++ b/src/overlays/actors/ovl_En_Takaraya/z_en_takaraya.h @@ -14,6 +14,4 @@ typedef struct EnTakaraya { /* 0x2AC */ char unk_2AC[0x10]; } EnTakaraya; // size = 0x2BC -extern const ActorInit En_Takaraya_InitVars; - #endif // Z_EN_TAKARAYA_H diff --git a/src/overlays/actors/ovl_En_Talk/z_en_talk.c b/src/overlays/actors/ovl_En_Talk/z_en_talk.c index c5b25233d..4f9b2a53d 100644 --- a/src/overlays/actors/ovl_En_Talk/z_en_talk.c +++ b/src/overlays/actors/ovl_En_Talk/z_en_talk.c @@ -16,7 +16,7 @@ void EnTalk_Update(Actor* thisx, PlayState* play); void func_80BDE058(EnTalk* this, PlayState* play); void func_80BDE090(EnTalk* this, PlayState* play); -const ActorInit En_Talk_InitVars = { +ActorInit En_Talk_InitVars = { ACTOR_EN_TALK, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_En_Talk/z_en_talk.h b/src/overlays/actors/ovl_En_Talk/z_en_talk.h index 393a457b5..ef2f67798 100644 --- a/src/overlays/actors/ovl_En_Talk/z_en_talk.h +++ b/src/overlays/actors/ovl_En_Talk/z_en_talk.h @@ -14,6 +14,4 @@ typedef struct EnTalk { /* 0x144 */ EnTalkActionFunc actionFunc; } EnTalk; // size = 0x148 -extern const ActorInit En_Talk_InitVars; - #endif // Z_EN_TALK_H 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 393caa1d9..ed17ca42c 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 @@ -102,7 +102,7 @@ typedef enum { /* 2 */ EN_TALK_GIBUD_GRAB_RELEASE, } EnTalkGibudGrabState; -const ActorInit En_Talk_Gibud_InitVars = { +ActorInit En_Talk_Gibud_InitVars = { ACTOR_EN_TALK_GIBUD, ACTORCAT_ENEMY, FLAGS, @@ -269,7 +269,7 @@ void EnTalkGibud_Init(Actor* thisx, PlayState* play) { } if (this->switchFlag != -1 && Flags_GetSwitch(play, this->switchFlag)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } EnTalkGibud_SetupIdle(this); @@ -420,9 +420,9 @@ void EnTalkGibud_Grab(EnTalkGibud* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_ATTACK); } - if (!(player->stateFlags2 & 0x80) || (player->unk_B62 != 0)) { - if ((player->unk_B62 != 0) && (player->stateFlags2 & 0x80)) { - player->stateFlags2 &= ~0x80; + if (!(player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B62 != 0)) { + if ((player->unk_B62 != 0) && (player->stateFlags2 & PLAYER_STATE2_80)) { + player->stateFlags2 &= ~PLAYER_STATE2_80; player->unk_AE8 = 100; } @@ -824,8 +824,8 @@ void EnTalkGibud_Talk(EnTalkGibud* this, PlayState* play) { } else { func_80123D50(play, player, ITEM_BOTTLE, PLAYER_AP_BOTTLE); } - player->stateFlags1 |= 0x20; - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_20; + player->stateFlags1 |= PLAYER_STATE1_20000000; this->actor.flags |= ACTOR_FLAG_100000; EnTalkGibud_SetupDisappear(this); } else { @@ -868,15 +868,15 @@ void EnTalkGibud_Disappear(EnTalkGibud* this, PlayState* play) { func_800B3030(play, &pos, &velocity, &accel, 100, 0, 1); } func_800B9010(&this->actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG); - player->stateFlags1 |= 0x20000000; + player->stateFlags1 |= PLAYER_STATE1_20000000; this->disappearanceTimer--; } else { if (this->switchFlag != -1) { Flags_SetSwitch(play, this->switchFlag); } - player->stateFlags1 &= ~0x20; - player->stateFlags1 &= ~0x20000000; - Actor_MarkForDeath(&this->actor); + player->stateFlags1 &= ~PLAYER_STATE1_20; + player->stateFlags1 &= ~PLAYER_STATE1_20000000; + Actor_Kill(&this->actor); } } @@ -895,8 +895,9 @@ s32 EnTalkGibud_PlayerInRangeWithCorrectState(EnTalkGibud* this, PlayState* play Player* player = GET_PLAYER(play); if ((Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 150.0f) && - !(player->stateFlags1 & (0x200000 | 0x80000 | 0x40000 | 0x4000 | 0x2000 | 0x80)) && - !(player->stateFlags2 & (0x4000 | 0x80))) { + !(player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 | + PLAYER_STATE1_80000 | PLAYER_STATE1_200000)) && + !(player->stateFlags2 & (PLAYER_STATE2_80 | PLAYER_STATE2_4000))) { return true; } diff --git a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h index ba55f9fc3..4d11e6c15 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 @@ -45,6 +45,4 @@ typedef struct EnTalkGibud { /* 0x3F7 */ s8 unk_3F7; // related to player->unk_ADD } EnTalkGibud; // size = 0x3F8 -extern const ActorInit En_Talk_Gibud_InitVars; - #endif // Z_EN_TALK_GIBUD_H 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 fbc74cb10..d6089e5b5 100644 --- a/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.c +++ b/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.c @@ -18,7 +18,7 @@ void EnTanron1_Draw(Actor* thisx, PlayState* play); void func_80BB5318(EnTanron1* this, PlayState* play); void func_80BB5AAC(EnTanron1* this, PlayState* play); -const ActorInit En_Tanron1_InitVars = { +ActorInit En_Tanron1_InitVars = { ACTOR_EN_TANRON1, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.h b/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.h index d8e96537f..bff1b46bf 100644 --- a/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.h +++ b/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.h @@ -39,6 +39,4 @@ typedef struct EnTanron1 { /* 0x3360 */ Vec3f unk_3360; } EnTanron1; // size = 0x336C -extern const ActorInit En_Tanron1_InitVars; - #endif // Z_EN_TANRON1_H diff --git a/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c b/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c index 9737c9f81..1c46247ba 100644 --- a/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c +++ b/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c @@ -30,7 +30,7 @@ Boss04* D_80BB8450; f32 D_80BB8454; EnTanron2* D_80BB8458[82]; -const ActorInit En_Tanron2_InitVars = { +ActorInit En_Tanron2_InitVars = { ACTOR_EN_TANRON2, ACTORCAT_BOSS, FLAGS, @@ -394,7 +394,7 @@ void func_80BB7408(EnTanron2* this, PlayState* play) { if (this->actor.world.pos.y <= this->actor.floorHeight) { this->actor.world.pos.y = this->actor.floorHeight; if ((s8)this->actor.colChkInfo.health <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); func_80BB71C8(this, play); D_80BB8450->unk_6F6--; D_80BB8450->unk_2E2 += 4; @@ -470,7 +470,7 @@ void func_80BB7578(EnTanron2* this, PlayState* play) { Matrix_MultVecZ(10.0f, &this->actor.velocity); this->unk_152 = Rand_ZeroFloat(100.0f) + 200.0f; } else if (D_80BB8450->unk_1F6 == 10) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); func_80BB71C8(this, play); } } @@ -579,7 +579,7 @@ void func_80BB7B90(Actor* thisx, PlayState* play) { D_80BB8454 = (Math_SinS(play->gameplayFrames * 0x3000) * 0.1f) + 1.0f; if (D_80BB8450->unk_1F6 == 11) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.h b/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.h index efbcc3108..3ae619a2d 100644 --- a/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.h +++ b/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.h @@ -28,6 +28,4 @@ typedef struct EnTanron2 { /* 0x1B0 */ ColliderCylinder collider2; } EnTanron2; // size = 0x1FC -extern const ActorInit En_Tanron2_InitVars; - #endif // Z_EN_TANRON2_H diff --git a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c index d683cde8c..3d831913e 100644 --- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c +++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c @@ -31,7 +31,7 @@ static Vec3f sZeroVec[] = { 0.0f, 0.0f, 0.0f }; static Boss03* sGyorg = NULL; -const ActorInit En_Tanron3_InitVars = { +ActorInit En_Tanron3_InitVars = { ACTOR_EN_TANRON3, ACTORCAT_BOSS, FLAGS, @@ -211,7 +211,7 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) { // If the player gets eaten by Gyorg, or if the attack timer ran out, // stop chasing the player for a little bit. - if (this->workTimer[WORK_TIMER_ATTACK] == 0 || (player->stateFlags2 & 0x80)) { + if (this->workTimer[WORK_TIMER_ATTACK] == 0 || (player->stateFlags2 & PLAYER_STATE2_80)) { this->workTimer[WORK_TIMER_WAIT] = 150; this->isNonHostile = true; } @@ -354,7 +354,7 @@ void EnTanron3_Die(EnTanron3* this, PlayState* play) { Actor_MoveWithoutGravityReverse(&this->actor); if (this->workTimer[WORK_TIMER_DIE] == 0) { EnTanron3_SpawnBubbles(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if (Rand_ZeroOne() < 0.3f) { Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0x60); } diff --git a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h index 14971d6e8..8859de6a4 100644 --- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h +++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h @@ -41,6 +41,4 @@ typedef struct EnTanron3 { /* 0x2F8 */ EnTanron3ActionFunc actionFunc; } EnTanron3; // size = 0x2FC -extern const ActorInit En_Tanron3_InitVars; - #endif // Z_EN_TANRON3_H diff --git a/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.c b/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.c index c67b36940..b53343931 100644 --- a/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.c +++ b/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.c @@ -31,7 +31,7 @@ typedef enum { /* 1 */ SEAGULL_TIMER_CHOOSE_TARGET, } SeagullTimers; -const ActorInit En_Tanron4_InitVars = { +ActorInit En_Tanron4_InitVars = { ACTOR_EN_TANRON4, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.h b/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.h index de4874cfc..36a48c91a 100644 --- a/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.h +++ b/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.h @@ -28,6 +28,4 @@ typedef struct EnTanron4 { #define SEAGULL_CLONE -1 #define SEAGULL_FOLLOW_ACTOR 100 -extern const ActorInit En_Tanron4_InitVars; - #endif // Z_EN_TANRON4_H diff --git a/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c b/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c index f45afbb01..c052c3309 100644 --- a/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c +++ b/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c @@ -23,7 +23,7 @@ void func_80BE5C10(Actor* thisx, PlayState* play); s32 D_80BE5D80 = 0; -const ActorInit En_Tanron5_InitVars = { +ActorInit En_Tanron5_InitVars = { ACTOR_EN_TANRON5, ACTORCAT_BOSS, FLAGS, @@ -150,7 +150,7 @@ void EnTanron5_Init(Actor* thisx, PlayState* play) { if (ENTANRON5_GET(&this->actor) >= ENTANRON5_100) { D_80BE5D80++; if (D_80BE5D80 > 60) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -201,7 +201,7 @@ void EnTanron5_Init(Actor* thisx, PlayState* play) { Collider_InitAndSetCylinder(play, &child->collider, &child->actor, &sCylinderInit); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 150.0f, 100.0f, 4); this->actor.world.pos.y = this->actor.floorHeight + -20.0f; @@ -230,7 +230,7 @@ void EnTanron5_Update(Actor* thisx, PlayState* play2) { this->unk_1A0++; Actor_SetScale(&this->actor, 0.0f); if (this->unk_1A0 >= 40) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } return; } else { @@ -406,13 +406,13 @@ void func_80BE5818(Actor* thisx, PlayState* play2) { this->unk_1A0++; this->actor.world.pos.y -= 2.0f * D_80BE5DD0; if (this->unk_1A0 == 40) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } return; } if (DECR(this->unk_144) == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (this->actor.speedXZ > 0.02f) { @@ -435,7 +435,7 @@ void func_80BE5818(Actor* thisx, PlayState* play2) { } this->unk_1A0++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } else { @@ -464,7 +464,7 @@ void func_80BE5818(Actor* thisx, PlayState* play2) { } else { Item_Give(play, ITEM_MAGIC_LARGE); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); play_sound(NA_SE_SY_GET_ITEM); } else { this->unk_1A1 = 20; diff --git a/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.h b/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.h index 9f9e47021..d40938bf8 100644 --- a/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.h +++ b/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.h @@ -25,6 +25,4 @@ typedef struct EnTanron5 { /* 0x1A1 */ u8 unk_1A1; } EnTanron5; // size = 0x1A4 -extern const ActorInit En_Tanron5_InitVars; - #endif // Z_EN_TANRON5_H diff --git a/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c b/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c index ceac1e116..4faa072f9 100644 --- a/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c +++ b/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c @@ -18,7 +18,7 @@ void EnTanron6_Draw(Actor* thisx, PlayState* play); void EnTanron6_DoNothing(EnTanron6* this); void func_80BE60D0(EnTanron6* this, PlayState* play); -const ActorInit En_Tanron6_InitVars = { +ActorInit En_Tanron6_InitVars = { ACTOR_EN_TANRON6, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.h b/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.h index fb565a5c8..89d9a4aae 100644 --- a/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.h +++ b/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.h @@ -13,6 +13,4 @@ typedef struct EnTanron6 { /* 0x200 */ EnTanron6ActionFunc actionFunc; } EnTanron6; // size = 0x204 -extern const ActorInit En_Tanron6_InitVars; - #endif // Z_EN_TANRON6_H diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index 348290ccf..95fdce4e1 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -16,7 +16,7 @@ void EnTest_Destroy(Actor* thisx, PlayState* play); void EnTest_Update(Actor* thisx, PlayState* play); void EnTest_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Test_InitVars = { +ActorInit En_Test_InitVars = { ACTOR_EN_TEST, ACTORCAT_ITEMACTION, FLAGS, @@ -175,7 +175,7 @@ void EnTest_Init(Actor* thisx, PlayState* play2) { thisx->floorHeight = BgCheck_EntityRaycastFloor3(&play->colCtx, &thisx->floorPoly, &sp34, &thisx->world.pos); if ((thisx->floorPoly == NULL) || (thisx->floorHeight == BGCHECK_Y_MIN)) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } @@ -208,7 +208,7 @@ void EnTest_Update(Actor* thisx, PlayState* play) { if (func_80183DE0(&this->skeletonInfo) && (this->actor.parent == NULL) && (this->actor.params != -1)) { this->unk_209++; if (this->unk_209 > 20) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.h b/src/overlays/actors/ovl_En_Test/z_en_test.h index e01c44c6a..2b8d62993 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.h +++ b/src/overlays/actors/ovl_En_Test/z_en_test.h @@ -28,6 +28,4 @@ typedef struct EnTest { /* 0x20C */ EnTestStruct unk_20C[20]; } EnTest; // size = 0x6BC -extern const ActorInit En_Test_InitVars; - #endif // Z_EN_TEST_H diff --git a/src/overlays/actors/ovl_En_Test2/z_en_test2.c b/src/overlays/actors/ovl_En_Test2/z_en_test2.c index c9151d621..257aea283 100644 --- a/src/overlays/actors/ovl_En_Test2/z_en_test2.c +++ b/src/overlays/actors/ovl_En_Test2/z_en_test2.c @@ -27,7 +27,7 @@ typedef struct EnTest2ModelInfo { /* 0x8 */ AnimatedMaterial* animMat; } EnTest2ModelInfo; // size = 0xC -const ActorInit En_Test2_InitVars = { +ActorInit En_Test2_InitVars = { ACTOR_EN_TEST2, ACTORCAT_BG, FLAGS, @@ -85,7 +85,7 @@ void EnTest2_Update(Actor* thisx, PlayState* play) { objectIndex = Object_GetIndex(&play->objectCtx, sObjectIds[this->actor.params]); if (objectIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (Object_IsLoaded(&play->objectCtx, objectIndex)) { diff --git a/src/overlays/actors/ovl_En_Test2/z_en_test2.h b/src/overlays/actors/ovl_En_Test2/z_en_test2.h index ccbba11e7..3b03e0cc1 100644 --- a/src/overlays/actors/ovl_En_Test2/z_en_test2.h +++ b/src/overlays/actors/ovl_En_Test2/z_en_test2.h @@ -15,6 +15,4 @@ typedef enum { /* 0xC */ EN_TEST2_PARAMS_C } EnTest2_Params; -extern const ActorInit En_Test2_InitVars; - #endif // Z_EN_TEST2_H 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 f50fca2e7..a5777e9d4 100644 --- a/src/overlays/actors/ovl_En_Test3/z_en_test3.c +++ b/src/overlays/actors/ovl_En_Test3/z_en_test3.c @@ -15,7 +15,7 @@ void EnTest3_Destroy(Actor* thisx, PlayState* play); void EnTest3_Update(Actor* thisx, PlayState* play); #if 0 -const ActorInit En_Test3_InitVars = { +ActorInit En_Test3_InitVars = { ACTOR_EN_TEST3, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Test3/z_en_test3.h b/src/overlays/actors/ovl_En_Test3/z_en_test3.h index 9d902bad1..fbddc77f1 100644 --- a/src/overlays/actors/ovl_En_Test3/z_en_test3.h +++ b/src/overlays/actors/ovl_En_Test3/z_en_test3.h @@ -14,6 +14,4 @@ typedef struct EnTest3 { /* 0x770 */ char unk_770[0x648]; } EnTest3; // size = 0xDB8 -extern const ActorInit En_Test3_InitVars; - #endif // Z_EN_TEST3_H diff --git a/src/overlays/actors/ovl_En_Test4/z_en_test4.c b/src/overlays/actors/ovl_En_Test4/z_en_test4.c index 805a6f8bf..439f3837f 100644 --- a/src/overlays/actors/ovl_En_Test4/z_en_test4.c +++ b/src/overlays/actors/ovl_En_Test4/z_en_test4.c @@ -4,6 +4,7 @@ * Description: Three-Day Timer */ +#include "prevent_bss_reordering.h" #include "z_en_test4.h" #include "overlays/gamestates/ovl_daytelop/z_daytelop.h" #include "overlays/actors/ovl_En_Horse/z_en_horse.h" @@ -19,7 +20,7 @@ void EnTest4_Update(Actor* thisx, PlayState* play); void func_80A42AB8(EnTest4* this, PlayState* play); void func_80A42F20(EnTest4* this, PlayState* play); -const ActorInit En_Test4_InitVars = { +ActorInit En_Test4_InitVars = { ACTOR_EN_TEST4, ACTORCAT_SWITCH, FLAGS, @@ -305,7 +306,7 @@ void EnTest4_Init(Actor* thisx, PlayState* play) { } if (sIsLoaded || (gSaveContext.eventInf[2] & 0x80)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { sIsLoaded = true; this->actor.room = -1; @@ -319,7 +320,7 @@ void EnTest4_Init(Actor* thisx, PlayState* play) { SET_NEXT_GAMESTATE(&play->state, DayTelop_Init, sizeof(DayTelopState)); this->unk_144 = 1; gSaveContext.save.time = CLOCK_TIME(6, 0); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { gSaveContext.save.day = 1; dayTemp = gSaveContext.save.day; @@ -333,7 +334,7 @@ void EnTest4_Init(Actor* thisx, PlayState* play) { func_80A41D70(this, play); if ((gSaveContext.cutsceneTrigger == 0) && (sCutscenes[this->unk_144] >= 0) && !(play->actorCtx.flags & ACTORCTX_FLAG_1)) { - player->stateFlags1 |= 0x200; + player->stateFlags1 |= PLAYER_STATE1_200; } } else { if ((gSaveContext.save.time > CLOCK_TIME(18, 0)) || (gSaveContext.save.time < CLOCK_TIME(6, 0))) { @@ -389,7 +390,7 @@ void func_80A42AB8(EnTest4* this, PlayState* play) { } else if (temp_a0 == CLOCK_TIME(6, 0)) { if (CURRENT_DAY == 3) { Interface_StartMoonCrash(play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); gSaveContext.eventInf[1] |= 0x80; } else if (((sCutscenes[this->unk_144] < 0) || (play->actorCtx.flags & ACTORCTX_FLAG_1)) && (CURRENT_DAY != 3)) { @@ -399,7 +400,7 @@ void func_80A42AB8(EnTest4* this, PlayState* play) { Play_SetRespawnData(&play->state, RESPAWN_MODE_DOWN, Entrance_CreateFromSpawn(0), player->unk_3CE, 0xBFF, &player->unk_3C0, player->unk_3CC); func_80169EFC(&play->state); - if (player->stateFlags1 & 0x800000) { + if (player->stateFlags1 & PLAYER_STATE1_800000) { EnHorse* rideActor = (EnHorse*)player->rideActor; if ((rideActor->type == HORSE_TYPE_EPONA) || (rideActor->type == HORSE_TYPE_2)) { @@ -413,12 +414,12 @@ void func_80A42AB8(EnTest4* this, PlayState* play) { gSaveContext.respawnFlag = -4; gSaveContext.eventInf[2] |= 0x80; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } if ((sCutscenes[this->unk_144] >= 0) && !(play->actorCtx.flags & ACTORCTX_FLAG_1)) { - player->stateFlags1 |= 0x200; + player->stateFlags1 |= PLAYER_STATE1_200; this->unk_146 = gSaveContext.save.time; } else { if (this->unk_144 == 0) { @@ -456,8 +457,8 @@ void func_80A42AB8(EnTest4* this, PlayState* play) { gSaveContext.nextCutsceneIndex = 0xFFF1; play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_02; - player->stateFlags1 |= 0x200; - Actor_MarkForDeath(&this->actor); + player->stateFlags1 |= PLAYER_STATE1_200; + Actor_Kill(&this->actor); } func_80A42198(this); } else { @@ -494,7 +495,7 @@ void func_80A42F20(EnTest4* this, PlayState* play) { gSaveContext.save.time += CLOCK_TIME_MINUTE; this->unk_146 = gSaveContext.save.time; play->numSetupActors = -play->numSetupActors; - player->stateFlags1 &= ~0x200; + player->stateFlags1 &= ~PLAYER_STATE1_200; } } else { this->actionFunc = func_80A42AB8; @@ -563,7 +564,7 @@ void EnTest4_Update(Actor* thisx, PlayState* play) { EnTest4* this = THIS; Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & 2)) { + if (!(player->stateFlags1 & PLAYER_STATE1_2)) { this->actionFunc(this, play); if (func_800FE4B8(play) != 0) { diff --git a/src/overlays/actors/ovl_En_Test4/z_en_test4.h b/src/overlays/actors/ovl_En_Test4/z_en_test4.h index 5f39f9f56..0a372f245 100644 --- a/src/overlays/actors/ovl_En_Test4/z_en_test4.h +++ b/src/overlays/actors/ovl_En_Test4/z_en_test4.h @@ -23,6 +23,4 @@ typedef enum { /* 1 */ TEST4_STATE_1 } EnTest4State; -extern const ActorInit En_Test4_InitVars; - #endif // Z_EN_TEST4_H diff --git a/src/overlays/actors/ovl_En_Test5/z_en_test5.c b/src/overlays/actors/ovl_En_Test5/z_en_test5.c index 13cb04b02..83451fa02 100644 --- a/src/overlays/actors/ovl_En_Test5/z_en_test5.c +++ b/src/overlays/actors/ovl_En_Test5/z_en_test5.c @@ -16,7 +16,7 @@ void EnTest5_Update(Actor* thisx, PlayState* play2); void EnTest5_HandleBottleAction(EnTest5* this, PlayState* play); void EnTest5_SetupAction(EnTest5* this, EnTest5ActionFunc actionFunc); -const ActorInit En_Test5_InitVars = { +ActorInit En_Test5_InitVars = { ACTOR_EN_TEST5, ACTORCAT_ITEMACTION, FLAGS, @@ -41,7 +41,7 @@ void EnTest5_Init(Actor* thisx, PlayState* play2) { // If not spawned above a water source, immediately despawn if (!WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &ySurface, &water)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Test5/z_en_test5.h b/src/overlays/actors/ovl_En_Test5/z_en_test5.h index bcfcd98e3..8d0c47784 100644 --- a/src/overlays/actors/ovl_En_Test5/z_en_test5.h +++ b/src/overlays/actors/ovl_En_Test5/z_en_test5.h @@ -17,6 +17,4 @@ typedef struct EnTest5 { /* 0x158 */ EnTest5ActionFunc actionFunc; } EnTest5; // size = 0x15C -extern const ActorInit En_Test5_InitVars; - #endif // Z_EN_TEST5_H diff --git a/src/overlays/actors/ovl_En_Test6/z_en_test6.c b/src/overlays/actors/ovl_En_Test6/z_en_test6.c index ea50336d9..48f5327ad 100644 --- a/src/overlays/actors/ovl_En_Test6/z_en_test6.c +++ b/src/overlays/actors/ovl_En_Test6/z_en_test6.c @@ -42,7 +42,7 @@ void func_80A92950(EnTest6* this, PlayState* play); EnTest6Struct D_80A94910[12]; -const ActorInit En_Test6_InitVars = { +ActorInit En_Test6_InitVars = { ACTOR_EN_TEST6, ACTORCAT_ITEMACTION, FLAGS, @@ -302,7 +302,7 @@ void EnTest6_Init(Actor* thisx, PlayState* play2) { if (((ENTEST6_GET(&this->actor) == ENTEST6_24) || (ENTEST6_GET(&this->actor) == ENTEST6_25) || (ENTEST6_GET(&this->actor) == ENTEST6_26)) && (play->playerActorCsIds[8] == -1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -398,7 +398,7 @@ void func_80A916F0(EnTest6* this, PlayState* play) { func_800B7298(play, NULL, 6); func_80A90C34(); Distortion_ClearType(DISTORTION_TYPE_5); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_80A91760(EnTest6* this, PlayState* play) { @@ -619,7 +619,7 @@ void func_80A92118(EnTest6* this, PlayState* play) { func_800B7298(play, NULL, 6); func_80A90C34(); Distortion_ClearType(DISTORTION_TYPE_5); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_80A92188(EnTest6* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Test6/z_en_test6.h b/src/overlays/actors/ovl_En_Test6/z_en_test6.h index ad596960e..ec06afb91 100644 --- a/src/overlays/actors/ovl_En_Test6/z_en_test6.h +++ b/src/overlays/actors/ovl_En_Test6/z_en_test6.h @@ -49,6 +49,4 @@ typedef struct EnTest6 { /* 0x286 */ s16 unk_286; } EnTest6; // size = 0x288 -extern const ActorInit En_Test6_InitVars; - #endif // Z_EN_TEST6_H diff --git a/src/overlays/actors/ovl_En_Test7/z_en_test7.c b/src/overlays/actors/ovl_En_Test7/z_en_test7.c index 5f153e5a9..7dbbaec93 100644 --- a/src/overlays/actors/ovl_En_Test7/z_en_test7.c +++ b/src/overlays/actors/ovl_En_Test7/z_en_test7.c @@ -34,7 +34,7 @@ void func_80AF2EC8(EnTest7* this, PlayState* play); void func_80AF2F98(EnTest7* this, PlayState* play); void func_80AF30F4(EnTest7* this, PlayState* play); -const ActorInit En_Test7_InitVars = { +ActorInit En_Test7_InitVars = { ACTOR_EN_TEST7, ACTORCAT_ITEMACTION, FLAGS, @@ -413,12 +413,12 @@ void EnTest7_Init(Actor* thisx, PlayState* play2) { } if (play->playerActorCsIds[8] == -1) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } ActorCutscene_SetIntentToPlay(play->playerActorCsIds[8]); - player2->stateFlags1 |= 0x20; + player2->stateFlags1 |= PLAYER_STATE1_20; Lights_PointNoGlowSetInfo(&this->lightInfo, (Math_SinS(this->unk_1E8E) * 90.0f) + player->actor.world.pos.x, player->actor.world.pos.y + 10.0f, (Math_CosS(this->unk_1E8E) * 90.0f) + player->actor.world.pos.z, 255, 255, 255, 255); @@ -594,11 +594,11 @@ void func_80AF2030(EnTest7* this, PlayState* play) { subCam->fov = ((subCam->fov - this->subCamFov) * sp1C) + this->subCamFov; if (this->unk_1E54 >= 100) { - MREG(64) = 1; - MREG(65) = 255; - MREG(66) = 255; - MREG(67) = 255; - MREG(68) = 255; + R_PLAY_FILL_SCREEN_ON = true; + R_PLAY_FILL_SCREEN_R = 255; + R_PLAY_FILL_SCREEN_G = 255; + R_PLAY_FILL_SCREEN_B = 255; + R_PLAY_FILL_SCREEN_ALPHA = 255; play->unk_18844 = 0; this->unk_144 &= ~4; func_80AF082C(this, func_80AF21E8); @@ -612,13 +612,13 @@ void func_80AF21E8(EnTest7* this, PlayState* play) { Color_RGB8 sp24 = { 64, 0, 0 }; Color_RGB8 sp20 = { 220, 220, 255 }; - if (MREG(64) != 0) { + if (R_PLAY_FILL_SCREEN_ON) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_WARP_WING_VANISH); - MREG(64) = 0; - MREG(65) = 0; - MREG(66) = 0; - MREG(67) = 0; - MREG(68) = 0; + R_PLAY_FILL_SCREEN_ON = false; + R_PLAY_FILL_SCREEN_R = 0; + R_PLAY_FILL_SCREEN_G = 0; + R_PLAY_FILL_SCREEN_B = 0; + R_PLAY_FILL_SCREEN_ALPHA = 0; } sp1C = 1.0f - (sp2C / 10.0f); @@ -759,7 +759,7 @@ void func_80AF2938(EnTest7* this, PlayState* play) { this->unk_1E98 = player->actor.draw; player->actor.draw = NULL; - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; this->unk_144 |= 2; this->unk_148.unk_04 = 30.0f; if (play->roomCtx.curRoom.unk3 != 1) { @@ -911,7 +911,7 @@ void func_80AF2F98(EnTest7* this, PlayState* play) { this->unk_148.unk_00 = this->unk_148.unk_04; this->unk_148.unk_08 = ((this->unk_148.unk_04 * -0.29999998f) / 11.0f) + 0.7f; this->unk_148.unk_0C = ((this->unk_148.unk_04 * -0.29999998f) / 11.0f) + 0.7f; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; } } @@ -919,9 +919,9 @@ void func_80AF30F4(EnTest7* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->unk_1E54 > 90) { - player->stateFlags1 &= ~0x20; - player->stateFlags1 &= ~0x20000000; - Actor_MarkForDeath(&this->actor); + player->stateFlags1 &= ~PLAYER_STATE1_20; + player->stateFlags1 &= ~PLAYER_STATE1_20000000; + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Test7/z_en_test7.h b/src/overlays/actors/ovl_En_Test7/z_en_test7.h index da6dec94b..30bf8e73c 100644 --- a/src/overlays/actors/ovl_En_Test7/z_en_test7.h +++ b/src/overlays/actors/ovl_En_Test7/z_en_test7.h @@ -62,6 +62,4 @@ typedef struct EnTest7 { /* 0x1E98 */ EnTest7UnkDrawFunc unk_1E98; } EnTest7; // size = 0x1E9C -extern const ActorInit En_Test7_InitVars; - #endif // Z_EN_TEST7_H diff --git a/src/overlays/actors/ovl_En_Tg/z_en_tg.c b/src/overlays/actors/ovl_En_Tg/z_en_tg.c index f4c970ea8..947f97b62 100644 --- a/src/overlays/actors/ovl_En_Tg/z_en_tg.c +++ b/src/overlays/actors/ovl_En_Tg/z_en_tg.c @@ -21,7 +21,7 @@ void EnTg_UpdateHearts(PlayState* play, EnTgHeartEffect* effect, s32 numEffects) void EnTg_DrawHearts(PlayState* play, EnTgHeartEffect* effect, s32 numEffects); void EnTg_SpawnHeart(EnTg* this, EnTgHeartEffect* effect, Vec3f* heartStartPos, s32 numEffects); -const ActorInit En_Tg_InitVars = { +ActorInit En_Tg_InitVars = { ACTOR_EN_TG, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Tg/z_en_tg.h b/src/overlays/actors/ovl_En_Tg/z_en_tg.h index 3cdcb57f1..ca67624c1 100644 --- a/src/overlays/actors/ovl_En_Tg/z_en_tg.h +++ b/src/overlays/actors/ovl_En_Tg/z_en_tg.h @@ -31,6 +31,4 @@ typedef struct EnTg { /* 0x2F0 */ EnTgHeartEffect effects[10]; } EnTg; // size = 0x548 -extern const ActorInit En_Tg_InitVars; - #endif // Z_EN_TG_H diff --git a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c index fc82ed262..54a680562 100644 --- a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c +++ b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c @@ -32,7 +32,7 @@ void func_80C126D8(EnThiefbird* this, PlayState* play); void func_80C12744(EnThiefbird* this); void func_80C127F4(EnThiefbird* this, PlayState* play); -const ActorInit En_Thiefbird_InitVars = { +ActorInit En_Thiefbird_InitVars = { ACTOR_EN_THIEFBIRD, ACTORCAT_ENEMY, FLAGS, @@ -166,12 +166,16 @@ void EnThiefbird_Init(Actor* thisx, PlayState* play) { if (this->actor.params == 1) { D_80C1392C = 1; Math_Vec3f_Copy(&D_80C13920, &this->actor.world.pos); - Actor_MarkForDeath(&this->actor); - } else if (STOLEN_ITEM_1 != STOLEN_ITEM_NONE) { - Actor_MarkForDeath(&this->actor); - } else { - func_80C11538(this); + Actor_Kill(&this->actor); + return; } + + if (STOLEN_ITEM_1 != STOLEN_ITEM_NONE) { + Actor_Kill(&this->actor); + return; + } + + func_80C11538(this); } void EnThiefbird_Destroy(Actor* thisx, PlayState* play) { @@ -517,8 +521,9 @@ void func_80C11590(EnThiefbird* this, PlayState* play) { this->unk_18E--; } - if ((this->unk_18E == 0) && (this->actor.xzDistToPlayer < 300.0f) && !(player->stateFlags1 & 0x800000) && - (Player_GetMask(play) != PLAYER_MASK_STONE) && (this->actor.depthInWater < -40.0f)) { + if ((this->unk_18E == 0) && (this->actor.xzDistToPlayer < 300.0f) && + !(player->stateFlags1 & PLAYER_STATE1_800000) && (Player_GetMask(play) != PLAYER_MASK_STONE) && + (this->actor.depthInWater < -40.0f)) { func_80C118E4(this); } } @@ -561,9 +566,9 @@ void func_80C1193C(EnThiefbird* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, rot, 4, 0x1000, 0x100); } - if ((this->unk_18E == 0) || (player->stateFlags1 & 0x800000) || (Player_GetMask(play) == PLAYER_MASK_STONE) || - (this->collider.base.atFlags & AT_HIT) || (this->actor.bgCheckFlags & 1) || - (this->actor.depthInWater > -40.0f)) { + if ((this->unk_18E == 0) || (player->stateFlags1 & PLAYER_STATE1_800000) || + (Player_GetMask(play) == PLAYER_MASK_STONE) || (this->collider.base.atFlags & AT_HIT) || + (this->actor.bgCheckFlags & 1) || (this->actor.depthInWater > -40.0f)) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_THIEFBIRD_VOICE); @@ -657,7 +662,7 @@ void func_80C11DF0(EnThiefbird* this, PlayState* play) { } } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -830,7 +835,7 @@ void func_80C126D8(EnThiefbird* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Math_ApproachS(&this->actor.shape.rot.x, 0x3000, 6, 0x1000); if (this->actor.playerHeightRel > 100.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.h b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.h index 1bbee73e0..c40555299 100644 --- a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.h +++ b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.h @@ -43,6 +43,4 @@ typedef struct EnThiefbird { /* 0x3F0 */ EnThiefbirdUnkStruct unk_3F0[40]; } EnThiefbird; // size = 0x990 -extern const ActorInit En_Thiefbird_InitVars; - #endif // Z_EN_THIEFBIRD_H diff --git a/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c b/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c index a8e74ff6e..fa140ba85 100644 --- a/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c +++ b/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c @@ -30,7 +30,7 @@ void func_80ACA724(EnTimeTag* this, PlayState* play); void func_80ACA7C4(EnTimeTag* this, PlayState* play); void func_80ACA840(EnTimeTag* this, PlayState* play); -const ActorInit En_Time_Tag_InitVars = { +ActorInit En_Time_Tag_InitVars = { ACTOR_EN_TIME_TAG, ACTORCAT_ITEMACTION, FLAGS, @@ -50,7 +50,7 @@ void EnTimeTag_Init(Actor* thisx, PlayState* play) { switch (ENTIMETAG_GET_E000(&this->actor)) { case 4: if ((gSaveContext.save.weekEventReg[8] & 0x40) || (CURRENT_DAY != 3)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actor.home.rot.x = 0; diff --git a/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.h b/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.h index 6ee46c1d3..ed6b611e4 100644 --- a/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.h +++ b/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.h @@ -17,6 +17,4 @@ typedef struct EnTimeTag { /* 0x144 */ EnTimeTagActionFunc actionFunc; } EnTimeTag; // size = 0x148 -extern const ActorInit En_Time_Tag_InitVars; - #endif // Z_EN_TIME_TAG_H diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index b912f6f38..eb005b224 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -46,7 +46,7 @@ void func_80895CB0(EnTite* this); void func_80895D08(EnTite* this, PlayState* play); void func_80895E28(EnTite* this, PlayState* play); -const ActorInit En_Tite_InitVars = { +ActorInit En_Tite_InitVars = { ACTOR_EN_TITE, ACTORCAT_ENEMY, FLAGS, @@ -668,12 +668,13 @@ void func_808951B8(EnTite* this, PlayState* play) { func_800B3030(play, &this->limbPos[i], &gZeroVec3f, &gZeroVec3f, 40, 7, 1); SoundSource_PlaySfxAtFixedWorldPos(play, &this->limbPos[i], 11, NA_SE_EN_EXTINCT); } - Actor_MarkForDeath(&this->actor); - } else { - for (i = 0; i < ARRAY_COUNT(this->unk_33C); i++) { - Math_Vec3f_Sum(&this->limbPos[i], &this->unk_33C[i], &this->limbPos[i]); - this->unk_33C[i].y += this->actor.gravity; - } + Actor_Kill(&this->actor); + return; + } + + for (i = 0; i < ARRAY_COUNT(this->unk_33C); i++) { + Math_Vec3f_Sum(&this->limbPos[i], &this->unk_33C[i], &this->limbPos[i]); + this->unk_33C[i].y += this->actor.gravity; } } diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.h b/src/overlays/actors/ovl_En_Tite/z_en_tite.h index 2d3a13a37..4b87634a3 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.h +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.h @@ -37,6 +37,4 @@ typedef struct EnTite { /* 0x3AC */ ColliderSphere collider; } EnTite; // size = 0x404 -extern const ActorInit En_Tite_InitVars; - #endif // Z_EN_TITE_H 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 60c4b4dd0..5ce216aff 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -69,7 +69,7 @@ static u8 D_80AEF800[] = { /* 0xE */ SCHEDULE_CMD_RET_NONE(), }; -const ActorInit En_Tk_InitVars = { +ActorInit En_Tk_InitVars = { ACTOR_EN_TK, ACTORCAT_NPC, FLAGS, @@ -209,11 +209,11 @@ void EnTk_Init(Actor* thisx, PlayState* play) { if (Flags_GetSwitch(play, this->unk_2B1)) { if (this->unk_2B0 == 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else if (this->unk_2B0 == 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -252,7 +252,7 @@ void EnTk_Init(Actor* thisx, PlayState* play) { switch (this->unk_2B0) { case 4: if (D_80AF0050 != 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } D_80AF0050 = 1; @@ -271,7 +271,7 @@ void EnTk_Init(Actor* thisx, PlayState* play) { break; default: - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -679,7 +679,7 @@ void func_80AED940(EnTk* this, PlayState* play) { if (ENTK_GET_F(actor) == 1) { Math_Vec3f_Copy(&this->unk_2EC, &actor->world.pos); Math_Vec3s_Copy(&this->unk_2F8, &actor->world.rot); - Actor_MarkForDeath(actor); + Actor_Kill(actor); this->unk_2CA |= 0x40; break; } @@ -735,7 +735,7 @@ void func_80AEDD4C(EnTk* this, PlayState* play) { if (this->unk_2E8 <= 0) { ActorCutscene_Stop(this->cutscenes[1]); func_801477B4(play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -928,11 +928,12 @@ void func_80AEE374(EnTk* this, PlayState* play) { SubS_FindActorCustom(play, &this->actor, NULL, ACTORCAT_NPC, ACTOR_EN_TK, &sp30, func_80AEE300); if (sp30.unk_00 == 0) { - Actor_MarkForDeath(&this->actor); - } else { - this->unk_2CC = Actor_YawToPoint(&this->actor, &sp30.unk_00->world.pos); - this->actionFunc = func_80AEE414; + Actor_Kill(&this->actor); + return; } + + this->unk_2CC = Actor_YawToPoint(&this->actor, &sp30.unk_00->world.pos); + this->actionFunc = func_80AEE414; } void func_80AEE414(EnTk* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.h b/src/overlays/actors/ovl_En_Tk/z_en_tk.h index 279cd0810..42a8aa96a 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.h +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.h @@ -63,6 +63,4 @@ typedef struct EnTk { /* 0x3F0 */ s32 timePathElapsedTime; } EnTk; // size = 0x3F4 -extern const ActorInit En_Tk_InitVars; - #endif // Z_EN_TK_H diff --git a/src/overlays/actors/ovl_En_Torch/z_en_torch.c b/src/overlays/actors/ovl_En_Torch/z_en_torch.c index 9a09e27eb..00335577b 100644 --- a/src/overlays/actors/ovl_En_Torch/z_en_torch.c +++ b/src/overlays/actors/ovl_En_Torch/z_en_torch.c @@ -13,7 +13,7 @@ void EnTorch_Init(Actor* thisx, PlayState* play); -const ActorInit En_Torch_InitVars = { +ActorInit En_Torch_InitVars = { ACTOR_EN_TORCH, ACTORCAT_ITEMACTION, FLAGS, GAMEPLAY_KEEP, sizeof(EnTorch), (ActorFunc)EnTorch_Init, (ActorFunc)NULL, (ActorFunc)NULL, (ActorFunc)NULL, }; @@ -29,5 +29,5 @@ void EnTorch_Init(Actor* thisx, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOX, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, ENBOX_PARAMS(ENBOX_TYPE_SMALL, sChestContents[(returnData >> 0x5) & 0x7], returnData)); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } diff --git a/src/overlays/actors/ovl_En_Torch/z_en_torch.h b/src/overlays/actors/ovl_En_Torch/z_en_torch.h index 87e1d6782..9ebfabb64 100644 --- a/src/overlays/actors/ovl_En_Torch/z_en_torch.h +++ b/src/overlays/actors/ovl_En_Torch/z_en_torch.h @@ -9,6 +9,4 @@ typedef struct EnTorch { /* 0x000 */ Actor actor; } EnTorch; // size = 0x144 -extern const ActorInit En_Torch_InitVars; - #endif // Z_EN_TORCH_H diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 0486f7c5c..83d084951 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -19,7 +19,7 @@ void EnTorch2_Draw(Actor* thisx, PlayState* play2); void EnTorch2_UpdateIdle(Actor* thisx, PlayState* play); void EnTorch2_UpdateDeath(Actor* thisx, PlayState* play); -const ActorInit En_Torch2_InitVars = { +ActorInit En_Torch2_InitVars = { ACTOR_EN_TORCH2, ACTORCAT_ITEMACTION, FLAGS, @@ -58,11 +58,7 @@ static InitChainEntry sInitChain[] = { // Shells for each of Link's different forms // (Playing elegy as Fierce Deity puts down a human shell) static Gfx* sShellDLists[] = { - gameplay_keep_DL_01C430, // Human - gameplay_keep_DL_048DF0, // Zora - gameplay_keep_DL_089070, // Deku - gameplay_keep_DL_057B10, // Goron - gameplay_keep_DL_01C430, // Human + gElegyShellHumanDL, gElegyShellGoronDL, gElegyShellZoraDL, gElegyShellDekuDL, gElegyShellHumanDL, }; void EnTorch2_Init(Actor* thisx, PlayState* play) { @@ -153,17 +149,18 @@ void EnTorch2_UpdateDeath(Actor* thisx, PlayState* play) { // Fall down and become transparent, then delete once invisible if (Math_StepToS(&this->alpha, 0, 8)) { - Actor_MarkForDeath(&this->actor); - } else { - this->actor.gravity = -1.0f; - Actor_MoveWithGravity(&this->actor); + Actor_Kill(&this->actor); + return; } + + this->actor.gravity = -1.0f; + Actor_MoveWithGravity(&this->actor); } void EnTorch2_Draw(Actor* thisx, PlayState* play2) { PlayState* play = play2; EnTorch2* this = THIS; - Gfx* gfx = sShellDLists[thisx->params]; + Gfx* gfx = sShellDLists[this->actor.params]; OPEN_DISPS(play->state.gfxCtx); if (this->alpha == 0xFF) { diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h index 744a7975c..9033b9923 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h @@ -29,6 +29,4 @@ typedef enum { /* 4 */ TORCH2_STATE_DYING, } EnTorch2State; -extern const ActorInit En_Torch2_InitVars; - #endif // Z_EN_TORCH2_H 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 a55c899ef..75878a7b6 100644 --- a/src/overlays/actors/ovl_En_Toto/z_en_toto.c +++ b/src/overlays/actors/ovl_En_Toto/z_en_toto.c @@ -50,7 +50,7 @@ s32 func_80BA4B24(EnToto* this, PlayState* play); s32 func_80BA4C0C(EnToto* this, PlayState* play); s32 func_80BA4C44(EnToto* this, PlayState* play); -const ActorInit En_Toto_InitVars = { +ActorInit En_Toto_InitVars = { ACTOR_EN_TOTO, ACTORCAT_NPC, FLAGS, @@ -186,7 +186,7 @@ void EnToto_Init(Actor* thisx, PlayState* play) { Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); if ((play->sceneId == SCENE_MILK_BAR) && (gSaveContext.save.time >= CLOCK_TIME(6, 0)) && (gSaveContext.save.time < CLOCK_TIME(21, 30))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); @@ -333,7 +333,7 @@ void func_80BA3DBC(EnToto* this, PlayState* play) { } } else { player = GET_PLAYER(play); - if (player->stateFlags1 & 0x400 && player->unk_AE7 != 0) { + if ((player->stateFlags1 & PLAYER_STATE1_400) && player->unk_AE7 != 0) { func_80151BB4(play, 48); func_80151BB4(play, 9); func_80151BB4(play, 10); @@ -510,7 +510,7 @@ s32 func_80BA4530(EnToto* this, PlayState* play) { func_80BA3C88(this); if (player->actor.world.pos.z > -270.0f) { if (this->spotlights != NULL) { - Actor_MarkForDeath(this->spotlights); + Actor_Kill(this->spotlights); } this->unk2B6 = 1; return this->text->unk1; @@ -612,11 +612,11 @@ s32 func_80BA4A00(EnToto* this, PlayState* play) { actor = &GET_PLAYER(play)->actor; actor = actor->next; while (actor != NULL) { - Actor_MarkForDeath(actor); + Actor_Kill(actor); actor = actor->next; } if (this->spotlights != NULL) { - Actor_MarkForDeath(this->spotlights); + Actor_Kill(this->spotlights); } func_800B7298(play, NULL, 0x45); if (this->unk2B3 == 0xF) { diff --git a/src/overlays/actors/ovl_En_Toto/z_en_toto.h b/src/overlays/actors/ovl_En_Toto/z_en_toto.h index 94c80ef4a..3c95a7dbb 100644 --- a/src/overlays/actors/ovl_En_Toto/z_en_toto.h +++ b/src/overlays/actors/ovl_En_Toto/z_en_toto.h @@ -42,6 +42,4 @@ typedef struct EnToto { /* 0x2C8 */ s32 pad2C8; } EnToto; // size = 0x2CC -extern const ActorInit En_Toto_InitVars; - #endif // Z_EN_TOTO_H diff --git a/src/overlays/actors/ovl_En_Trt/z_en_trt.c b/src/overlays/actors/ovl_En_Trt/z_en_trt.c index 71abb140a..3c144bc99 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.c +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.c @@ -90,7 +90,7 @@ static AnimationInfoS sAnimationInfo[] = { { &gKotakeFlyAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, }; -const ActorInit En_Trt_InitVars = { +ActorInit En_Trt_InitVars = { ACTOR_EN_TRT, ACTORCAT_NPC, FLAGS, @@ -223,7 +223,7 @@ void EnTrt_EndInteraction(PlayState* play, EnTrt* this) { this->drawCursor = 0; this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; play->interfaceCtx.unk_222 = 0; play->interfaceCtx.unk_224 = 0; this->textId = 0x834; @@ -341,7 +341,7 @@ void EnTrt_GetMushroom(EnTrt* this, PlayState* play) { if (this->cutsceneState != ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) { EnTrt_SetupGetMushroomCutscene(this); if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) { - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; } } else if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) { switch (this->textId) { @@ -450,7 +450,7 @@ void EnTrt_GiveRedPotionForKoume(EnTrt* this, PlayState* play) { gSaveContext.save.weekEventReg[12] |= 0x10; } gSaveContext.save.weekEventReg[84] |= 0x40; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; this->actionFunc = EnTrt_GivenRedPotionForKoume; } else if (gSaveContext.save.weekEventReg[12] & 0x10) { Actor_PickUp(&this->actor, play, GI_POTION_RED, 300.0f, 300.0f); @@ -467,7 +467,7 @@ void EnTrt_GivenRedPotionForKoume(EnTrt* this, PlayState* play) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; //! @bug: EnTrt_ContinueShopping gets overwritten by EnTrt_ItemGiven this->actionFunc = EnTrt_ContinueShopping; this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING; @@ -652,7 +652,7 @@ void EnTrt_SetupBuyItemWithFanfare(PlayState* play, EnTrt* this) { Actor_PickUp(&this->actor, play, this->items[this->cursorIndex]->getItemId, 300.0f, 300.0f); play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; - player->stateFlags2 &= ~0x20000000; + player->stateFlags2 &= ~PLAYER_STATE2_20000000; Interface_SetHudVisibility(HUD_VISIBILITY_ALL); this->drawCursor = 0; this->actionFunc = EnTrt_BuyItemWithFanfare; @@ -797,7 +797,7 @@ void EnTrt_IdleSleeping(EnTrt* this, PlayState* play) { ActorCutscene_SetIntentToPlay(this->cutscene); this->cutsceneState = ENTRT_CUTSCENESTATE_WAITING; } - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; this->timer = 45; this->actionFunc = EnTrt_BeginInteraction; } else if (((player->actor.world.pos.x >= -50.0f) && (player->actor.world.pos.x <= -25.0f)) && @@ -838,7 +838,7 @@ void EnTrt_IdleAwake(EnTrt* this, PlayState* play) { ActorCutscene_SetIntentToPlay(this->cutscene); this->cutsceneState = ENTRT_CUTSCENESTATE_WAITING; } - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; if (player->transformation == PLAYER_FORM_HUMAN) { this->flags |= ENTRT_MET; } @@ -999,7 +999,7 @@ void EnTrt_ItemGiven(EnTrt* this, PlayState* play) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; this->actionFunc = EnTrt_ContinueShopping; this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING; } else { @@ -1124,7 +1124,7 @@ void EnTrt_ContinueShopping(EnTrt* this, PlayState* play) { case 0: func_8019F208(); player->actor.shape.rot.y = BINANG_ROT180(player->actor.shape.rot.y); - player->stateFlags2 |= 0x20000000; + player->stateFlags2 |= PLAYER_STATE2_20000000; Message_StartTextbox(play, this->textId, &this->actor); EnTrt_SetupStartShopping(play, this, true); func_800B85E0(&this->actor, play, 400.0f, PLAYER_AP_MINUS1); diff --git a/src/overlays/actors/ovl_En_Trt/z_en_trt.h b/src/overlays/actors/ovl_En_Trt/z_en_trt.h index 9cbf5d51c..c81032af5 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.h +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.h @@ -64,6 +64,4 @@ typedef enum { /* 3 */ ENTRT_CUTSCENESTATE_PLAYING } EnTrtCutsceneState; -extern const ActorInit En_Trt_InitVars; - #endif // Z_EN_TRT_H diff --git a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c index ac6a4f476..0dca63bd2 100644 --- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c +++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c @@ -52,7 +52,7 @@ static AnimationInfoS sAnimationInfo[] = { { &gKotakeFlyAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, }; -const ActorInit En_Trt2_InitVars = { +ActorInit En_Trt2_InitVars = { ACTOR_EN_TRT2, ACTORCAT_NPC, FLAGS, @@ -243,7 +243,7 @@ void func_80AD381C(EnTrt2* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_10; } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -251,7 +251,7 @@ void func_80AD38B8(EnTrt2* this, PlayState* play) { Vec3s sp30; if (this->unk_3D9 == 2) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (this->path != NULL) { @@ -468,7 +468,7 @@ void func_80AD4298(EnTrt2* this, PlayState* play) { if (ActorCutscene_GetCanPlayNext(this->unk_3DA)) { ActorCutscene_StartAndSetUnkLinkFields(this->unk_3DA, &this->actor); - player->stateFlags1 |= 0x20; + player->stateFlags1 |= PLAYER_STATE1_20; this->unk_3B2 = 6; } else { if (ActorCutscene_GetCurrentIndex() == 0x7C) { @@ -481,8 +481,8 @@ void func_80AD4298(EnTrt2* this, PlayState* play) { void func_80AD431C(EnTrt2* this, PlayState* play) { Player* player = GET_PLAYER(play); - player->stateFlags1 &= ~0x20; - Actor_MarkForDeath(&this->actor); + player->stateFlags1 &= ~PLAYER_STATE1_20; + Actor_Kill(&this->actor); } void func_80AD434C(EnTrt2* this, PlayState* play) { @@ -743,12 +743,12 @@ void func_80AD4DB4(EnTrt2* this, PlayState* play) { this->unk_3BC = func_80AD4608; if (gSaveContext.save.weekEventReg[12] & 8) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (gSaveContext.save.weekEventReg[84] & 0x40) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -758,18 +758,18 @@ void func_80AD4DB4(EnTrt2* this, PlayState* play) { gSaveContext.save.weekEventReg[15] |= 0x80; this->unk_3B2 = 3; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else if (gSaveContext.save.day == 2) { if (gSaveContext.save.weekEventReg[15] & 0x80) { this->unk_3B2 = 4; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } else if (gSaveContext.save.day == 3) { diff --git a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.h b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.h index da5c6fa9c..44c2565f7 100644 --- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.h +++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.h @@ -41,6 +41,4 @@ typedef struct EnTrt2 { /* 0x3DA */ s16 unk_3DA; } EnTrt2; // size = 0x3DC -extern const ActorInit En_Trt2_InitVars; - #endif // Z_EN_TRT2_H 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 c54d924df..518ca189e 100644 --- a/src/overlays/actors/ovl_En_Tru/z_en_tru.c +++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.c @@ -76,7 +76,7 @@ static UNK_TYPE D_80A889A4[] = { 0x550C1000, }; -const ActorInit En_Tru_InitVars = { +ActorInit En_Tru_InitVars = { ACTOR_EN_TRU, ACTORCAT_NPC, FLAGS, @@ -955,7 +955,7 @@ s32 func_80A87B48(Actor* thisx, PlayState* play) { sp4C.z = 40.0f; Lib_Vec3f_TranslateAndRotateY(&this->actor.world.pos, sp3E, &sp4C, &sp40); func_80A85620(this->unk_394, &sp40, 2.0f, 0.08f, 60.0f); - func_8016A268(&play->state, 1, 160, 160, 160, 0); + Play_FillScreen(&play->state, true, 160, 160, 160, 0); this->unk_370 = 20; this->unk_372 = 10; this->unk_364++; @@ -967,7 +967,7 @@ s32 func_80A87B48(Actor* thisx, PlayState* play) { case 2: if (DECR(this->unk_370) != 0) { - MREG(68) = 255.0f - ((fabsf(10.0f - this->unk_370) / 10) * 255.0f); + R_PLAY_FILL_SCREEN_ALPHA = 255.0f - ((fabsf(10.0f - this->unk_370) / 10) * 255.0f); if (this->unk_370 == 9) { this->actor.shape.shadowDraw = NULL; this->unk_34E |= (0x200 | 0x8); @@ -978,7 +978,7 @@ s32 func_80A87B48(Actor* thisx, PlayState* play) { EnTru_ChangeAnim(this, KOUME_ANIM_HOVER1); } } else { - MREG(64) = 0; + R_PLAY_FILL_SCREEN_ON = false; ret = true; } break; @@ -1128,7 +1128,7 @@ void EnTru_Init(Actor* thisx, PlayState* play) { EnTru* this = THIS; if ((gSaveContext.save.entrance != 0xC200) || (gSaveContext.save.weekEventReg[12] & 8)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Tru/z_en_tru.h b/src/overlays/actors/ovl_En_Tru/z_en_tru.h index 711d5aeb6..48964b555 100644 --- a/src/overlays/actors/ovl_En_Tru/z_en_tru.h +++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.h @@ -60,6 +60,4 @@ typedef struct EnTru { /* 0x394 */ EnTruUnkStruct unk_394[30]; } EnTru; // size = 0x934 -extern const ActorInit En_Tru_InitVars; - #endif // Z_EN_TRU_H diff --git a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c index 69725414a..dd199db69 100644 --- a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c +++ b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c @@ -40,7 +40,7 @@ typedef enum { /* 0x10 */ KOUME_MT_ANIM_MAX } KoumeMtAnimation; -const ActorInit En_Tru_Mt_InitVars = { +ActorInit En_Tru_Mt_InitVars = { ACTOR_EN_TRU_MT, ACTORCAT_NPC, FLAGS, @@ -346,7 +346,7 @@ void func_80B76980(EnTruMt* this, PlayState* play) { Message_StartTextbox(play, 0x87F, &this->actor); gSaveContext.eventInf[3] |= 0x40; gSaveContext.eventInf[4] |= 1; - player->stateFlags3 &= ~0x400; + player->stateFlags3 &= ~PLAYER_STATE3_400; this->actor.speedXZ = 0.0f; this->actionFunc = func_80B76BB8; } else if (gSaveContext.eventInf[4] & 1) { @@ -366,7 +366,7 @@ void func_80B76A64(EnTruMt* this, PlayState* play) { func_80B76924(this); func_80B76980(this, play); - player->stateFlags3 |= 0x400; + player->stateFlags3 |= PLAYER_STATE3_400; if (this->path != NULL) { func_80B76540(this->path, this->unk_36C, &this->actor.world.pos, &sp34); @@ -406,7 +406,7 @@ void func_80B76C38(EnTruMt* this, PlayState* play) { func_80B76924(this); func_80B76980(this, play); - player->stateFlags3 |= 0x400; + player->stateFlags3 |= PLAYER_STATE3_400; } void EnTruMt_Init(Actor* thisx, PlayState* play) { @@ -414,12 +414,12 @@ void EnTruMt_Init(Actor* thisx, PlayState* play) { EnTruMt* this = THIS; if (!(gSaveContext.eventInf[3] & 0x20)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (func_80B763C4(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.h b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.h index 54d58326e..b114804d7 100644 --- a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.h +++ b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.h @@ -41,6 +41,4 @@ typedef struct EnTruMt { /* 0x3A4 */ u8 unk_3A4; } EnTruMt; // size = 0x3A8 -extern const ActorInit En_Tru_Mt_InitVars; - #endif // Z_EN_TRU_MT_H 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 15d4cf3e5..31674a668 100644 --- a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c +++ b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c @@ -29,7 +29,7 @@ void func_80AE0D10(EnTsn* this, PlayState* play); void func_80AE0D78(EnTsn* this, PlayState* play); void func_80AE0F84(Actor* thisx, PlayState* play); -const ActorInit En_Tsn_InitVars = { +ActorInit En_Tsn_InitVars = { ACTOR_EN_TSN, ACTORCAT_NPC, FLAGS, @@ -88,7 +88,7 @@ void func_80ADFCEC(EnTsn* this, PlayState* play) { switch (ENTSN_GET_F(&this->actor)) { case ENTSN_F_0: if (gSaveContext.save.weekEventReg[26] & 8) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actor.textId = 0x106E; @@ -107,7 +107,7 @@ void func_80ADFCEC(EnTsn* this, PlayState* play) { if ((ENTSN_GET_F(&this->actor)) == ENTSN_F_0) { this->actionFunc = func_80AE0D78; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } return; } @@ -116,7 +116,7 @@ void func_80ADFCEC(EnTsn* this, PlayState* play) { this->unk_220 = 0; if (this->unk_1D8 == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if ((ENTSN_GET_F(&this->actor)) == ENTSN_F_1) { func_800BC154(play, &play->actorCtx, &this->actor, 6); } @@ -145,7 +145,7 @@ void EnTsn_Init(Actor* thisx, PlayState* play) { this->actor.gravity = -1.0f; if (gSaveContext.save.weekEventReg[55] & 0x80) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -291,7 +291,7 @@ void func_80AE0304(EnTsn* this, PlayState* play) { void func_80AE0418(EnTsn* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { Message_StartTextbox(play, 0x107D, NULL); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.h b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.h index 396918fdb..ff0b6bcbf 100644 --- a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.h +++ b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.h @@ -29,6 +29,4 @@ typedef struct EnTsn { /* 0x230 */ s16 unk_230; } EnTsn; // size = 0x234 -extern const ActorInit En_Tsn_InitVars; - #endif // Z_EN_TSN_H diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index bf1e44e98..4f7b8b720 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -39,7 +39,7 @@ static ColliderCylinderInit sCylinderInit = { { 11, 28, 0, { 0, 0, 0 } }, }; -const ActorInit En_Tubo_Trap_InitVars = { +ActorInit En_Tubo_Trap_InitVars = { ACTOR_EN_TUBO_TRAP, ACTORCAT_PROP, FLAGS, @@ -177,7 +177,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { EnTuboTrap_SpawnEffectsInWater(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_BOMB_DROP_WATER); EnTuboTrap_DropCollectible(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -187,7 +187,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_IT_SHIELD_REFLECT_SW); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -197,7 +197,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_EXPLOSION); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -209,7 +209,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); SoundSource_PlaySfxAtFixedWorldPos(play, &player2->actor.world.pos, 40, NA_SE_PL_BODY_HIT); EnTuboTrap_DropCollectible(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -218,7 +218,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { EnTuboTrap_SpawnEffectsOnLand(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h index db3b9cbe4..8df1aeb55 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h @@ -15,6 +15,4 @@ typedef struct EnTuboTrap { /* 0x158 */ ColliderCylinder collider; } EnTuboTrap; // size = 0x1A4 -extern const ActorInit En_Tubo_Trap_InitVars; - #endif // Z_EN_TUBO_TRAP_H diff --git a/src/overlays/actors/ovl_En_Twig/z_en_twig.c b/src/overlays/actors/ovl_En_Twig/z_en_twig.c index 1f26288c4..e0c46c7cb 100644 --- a/src/overlays/actors/ovl_En_Twig/z_en_twig.c +++ b/src/overlays/actors/ovl_En_Twig/z_en_twig.c @@ -25,7 +25,7 @@ void func_80AC0AC8(EnTwig* this, PlayState* play); void func_80AC0CC4(EnTwig* this, PlayState* play); void func_80AC0D2C(EnTwig* this, PlayState* play); -const ActorInit En_Twig_InitVars = { +ActorInit En_Twig_InitVars = { ACTOR_EN_TWIG, ACTORCAT_MISC, FLAGS, @@ -70,7 +70,7 @@ void EnTwig_Init(Actor* thisx, PlayState* play2) { this->dyna.actor.bgCheckFlags |= 0x400; switch (this->unk_160) { case 0: - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); break; case 1: if (!sRingsHaveSpawned) { @@ -82,11 +82,11 @@ void EnTwig_Init(Actor* thisx, PlayState* play2) { } if (RACERING_GET_PARAM_1F0(&this->dyna.actor) != 0) { if (!(gSaveContext.save.weekEventReg[24] & 4)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } } else if (gSaveContext.save.weekEventReg[24] & 4) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } Actor_SetScale(&this->dyna.actor, 4.2f); @@ -213,7 +213,7 @@ void func_80AC0D2C(EnTwig* this, PlayState* play) { sCurrentRing = -1; } } - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } this->unk_170 += 180.0f / 0x10000; diff --git a/src/overlays/actors/ovl_En_Twig/z_en_twig.h b/src/overlays/actors/ovl_En_Twig/z_en_twig.h index 3de7f8f4b..3bdb62209 100644 --- a/src/overlays/actors/ovl_En_Twig/z_en_twig.h +++ b/src/overlays/actors/ovl_En_Twig/z_en_twig.h @@ -25,6 +25,4 @@ typedef struct EnTwig { /* 0x180 */ Vec3f unk_180; } EnTwig; // size = 0x18C -extern const ActorInit En_Twig_InitVars; - #endif // Z_EN_TWIG_H diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c index 926f88f70..34551dac9 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -23,7 +23,7 @@ static u8 D_8089F3E0 = 0; static u8 D_8089F3E4 = 0; -const ActorInit En_Viewer_InitVars = { +ActorInit En_Viewer_InitVars = { ACTOR_EN_VIEWER, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h index c4819f788..1532e7c70 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h @@ -27,6 +27,4 @@ typedef enum { /* 0x2 */ ENVIEWER_PARAMS_2 } EnViewerParams; -extern const ActorInit En_Viewer_InitVars; - #endif // Z_EN_VIEWER_H diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index 2dedc7c2a..50109f887 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -29,7 +29,7 @@ void func_808CCB08(EnVm* this); void func_808CCB50(EnVm* this, PlayState* play); void func_808CCCF0(EnVm* this, PlayState* play); -const ActorInit En_Vm_InitVars = { +ActorInit En_Vm_InitVars = { ACTOR_EN_VM, ACTORCAT_ENEMY, FLAGS, @@ -398,7 +398,7 @@ void func_808CCCF0(EnVm* this, PlayState* play) { } } else if (this->unk_214 == 0) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.h b/src/overlays/actors/ovl_En_Vm/z_en_vm.h index dd1c36aa2..ca0678d90 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.h +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.h @@ -35,6 +35,4 @@ typedef struct EnVm { /* 0x300 */ ColliderTrisElement colliderTrisElements[1]; } EnVm; // size = 0x35C -extern const ActorInit En_Vm_InitVars; - #endif // Z_EN_VM_H diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 9dca3642f..1ddcc4add 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -43,7 +43,7 @@ void EnWallmas_WaitForProximity(EnWallmas* this, PlayState* play); void EnWallmas_WaitForSwitchFlag(EnWallmas* this, PlayState* play); void EnWallmas_Stun(EnWallmas* this, PlayState* play); -const ActorInit En_Wallmas_InitVars = { +ActorInit En_Wallmas_InitVars = { ACTOR_EN_WALLMAS, ACTORCAT_ENEMY, FLAGS, @@ -171,7 +171,7 @@ void EnWallmas_Init(Actor* thisx, PlayState* play) { if (WALLMASTER_GET_TYPE(&this->actor) == WALLMASTER_TYPE_FLAG) { if (Flags_GetSwitch(play, this->switchFlag)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -243,8 +243,9 @@ void EnWallmas_WaitToDrop(EnWallmas* this, PlayState* play) { this->timer--; } - if ((player->stateFlags1 & 0x08100000) || (player->stateFlags2 & 0x80) || (player->unk_B5E > 0) || - (player->actor.freezeTimer > 0) || !(player->actor.bgCheckFlags & 1) || + if ((player->stateFlags1 & (PLAYER_STATE1_100000 | PLAYER_STATE1_8000000)) || + (player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B5E > 0) || (player->actor.freezeTimer > 0) || + !(player->actor.bgCheckFlags & 1) || ((WALLMASTER_GET_TYPE(&this->actor) == WALLMASTER_TYPE_PROXIMITY) && (Math_Vec3f_DistXZ(&this->actor.home.pos, playerPos) > (120.f + this->detectionRadius)))) { AudioSfx_StopById(NA_SE_EN_FALL_AIM); @@ -279,9 +280,9 @@ void EnWallmas_SetupDrop(EnWallmas* this, PlayState* play) { void EnWallmas_Drop(EnWallmas* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((player->stateFlags2 & 0x80) || (player->actor.freezeTimer > 0)) { + if ((player->stateFlags2 & PLAYER_STATE2_80) || (player->actor.freezeTimer > 0)) { EnWallmas_SetupReturnToCeiling(this); - } else if (!Play_InCsMode(play) && !(player->stateFlags2 & 0x10) && (player->invincibilityTimer >= 0) && + } else if (!Play_InCsMode(play) && !(player->stateFlags2 & PLAYER_STATE2_10) && (player->invincibilityTimer >= 0) && (this->actor.xzDistToPlayer < 30.0f) && (this->actor.playerHeightRel < -5.0f) && (-(f32)(player->cylinder.dim.height + 10) < this->actor.playerHeightRel)) { EnWallmas_SetupTakePlayer(this, play); @@ -376,7 +377,7 @@ void EnWallmas_ReturnToCeiling(EnWallmas* this, PlayState* play) { if (this->actor.playerHeightRel < -900.0f) { if (WALLMASTER_GET_TYPE(&this->actor) == WALLMASTER_TYPE_FLAG) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -444,7 +445,7 @@ void EnWallmas_Die(EnWallmas* this, PlayState* play) { if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.0015f)) { Actor_SetScale(&this->actor, 0.01f); Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x90); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actor.scale.z = this->actor.scale.x; diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h index af7c6f18c..ceb1d1823 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h @@ -52,6 +52,4 @@ typedef struct EnWallmas { /* 0x358 */ ColliderCylinder collider; } EnWallmas; // size = 0x3A4 -extern const ActorInit En_Wallmas_InitVars; - #endif // Z_EN_WALLMAS_H diff --git a/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c b/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c index 34c8db4bb..32038c411 100644 --- a/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c +++ b/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c @@ -21,7 +21,7 @@ void func_80A66278(EnWarpUzu* this, PlayState* play); void func_80A66384(EnWarpUzu* this, PlayState* play); void EnWarpUzu_DoNothing(EnWarpUzu* this, PlayState* play); -const ActorInit En_Warp_Uzu_InitVars = { +ActorInit En_Warp_Uzu_InitVars = { ACTOR_EN_WARP_UZU, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.h b/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.h index a1a7766e6..6b8bfb362 100644 --- a/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.h +++ b/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.h @@ -13,6 +13,4 @@ typedef struct EnWarpUzu { /* 0x148 */ ColliderCylinder collider; } EnWarpUzu; // size = 0x194 -extern const ActorInit En_Warp_Uzu_InitVars; - #endif // Z_EN_WARP_UZU_H diff --git a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c index 1ba5e6ebc..67a1196bc 100644 --- a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c +++ b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c @@ -24,7 +24,7 @@ void EnWarpTag_Unused809C0A20(EnWarptag* this, PlayState* play); void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play); void EnWarpTag_GrottoReturn(EnWarptag* this, PlayState* play); -const ActorInit En_Warp_tag_InitVars = { +ActorInit En_Warp_tag_InitVars = { ACTOR_EN_WARP_TAG, ACTORCAT_ITEMACTION, FLAGS, @@ -59,7 +59,7 @@ void EnWarptag_Init(Actor* thisx, PlayState* play) { } else { if ((this->dangeonKeepObject = Object_GetIndex(&play->objectCtx, GAMEPLAY_DANGEON_KEEP)) < 0) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } this->actionFunc = EnWarpTag_CheckDungeonKeepObject; @@ -176,7 +176,7 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) { player->actor.world.pos.z = this->dyna.actor.world.pos.z + (diffZ * distance); if (Math_StepToS(&this->unkValue15E, 0x2710, 0xC8)) { - player->stateFlags3 |= 0x1; + player->stateFlags3 |= PLAYER_STATE3_1; player->actor.gravity = -0.5f; if (this->dyna.actor.playerHeightRel < -80.0f) { diff --git a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.h b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.h index ea7eff8ab..ac76ccb67 100644 --- a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.h +++ b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.h @@ -18,8 +18,6 @@ typedef struct EnWarptag { /* 0x160 */ EnWarptagActionFunc actionFunc; } EnWarptag; // size = 0x164 -extern const ActorInit En_Warp_tag_InitVars; - // Only two known Variants: // Goron Trial (MOON): 0x03C1 // Deku Playground: 0x83C0 diff --git a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c index aa36b6947..5f92164b3 100644 --- a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c +++ b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c @@ -30,7 +30,7 @@ void func_80A5A184(Actor* thisx, PlayState* play2); void func_80A5A534(Actor* thisx, PlayState* play); void func_80A5A6B8(Actor* thisx, PlayState* play2); -const ActorInit En_Water_Effect_InitVars = { +ActorInit En_Water_Effect_InitVars = { ACTOR_EN_WATER_EFFECT, ACTORCAT_BOSS, FLAGS, @@ -580,7 +580,7 @@ void func_80A5A534(Actor* thisx, PlayState* play) { s32 i; if (this->unk_E38 < 1.0f) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->unk_DC4++; diff --git a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h index e4fb752dc..433ebac62 100644 --- a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h +++ b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h @@ -43,6 +43,4 @@ typedef struct EnWaterEffect { /* 0xE38 */ f32 unk_E38; } EnWaterEffect; // size = 0xE3C -extern const ActorInit En_Water_Effect_InitVars; - #endif // Z_EN_WATER_EFFECT_H diff --git a/src/overlays/actors/ovl_En_Wdhand/z_en_wdhand.c b/src/overlays/actors/ovl_En_Wdhand/z_en_wdhand.c index a4cf5379a..83cf47291 100644 --- a/src/overlays/actors/ovl_En_Wdhand/z_en_wdhand.c +++ b/src/overlays/actors/ovl_En_Wdhand/z_en_wdhand.c @@ -16,7 +16,7 @@ void EnWdhand_Update(Actor* thisx, PlayState* play); void EnWdhand_Draw(Actor* thisx, PlayState* play); #if 0 -const ActorInit En_Wdhand_InitVars = { +ActorInit En_Wdhand_InitVars = { ACTOR_EN_WDHAND, ACTORCAT_ENEMY, FLAGS, diff --git a/src/overlays/actors/ovl_En_Wdhand/z_en_wdhand.h b/src/overlays/actors/ovl_En_Wdhand/z_en_wdhand.h index adf19ce8c..5eb02fa1a 100644 --- a/src/overlays/actors/ovl_En_Wdhand/z_en_wdhand.h +++ b/src/overlays/actors/ovl_En_Wdhand/z_en_wdhand.h @@ -14,6 +14,4 @@ typedef struct EnWdhand { /* 0x1EC */ char unk_1EC[0x268]; } EnWdhand; // size = 0x454 -extern const ActorInit En_Wdhand_InitVars; - #endif // Z_EN_WDHAND_H diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index ec6f12aeb..ebbc71ca3 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -35,7 +35,7 @@ void func_809672DC(EnWeatherTag* this, PlayState* play); void func_809674C8(EnWeatherTag* this, PlayState* play); void func_80967608(EnWeatherTag* this, PlayState* play); -const ActorInit En_Weather_Tag_InitVars = { +ActorInit En_Weather_Tag_InitVars = { ACTOR_EN_WEATHER_TAG, ACTORCAT_PROP, FLAGS, @@ -78,7 +78,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { break; case WEATHERTAG_TYPE_UNK1: if (gSaveContext.save.weekEventReg[52] & 0x20) { // if cleared STT - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } EnWeatherTag_SetupAction(this, func_80966B08); break; @@ -214,15 +214,15 @@ void func_80966A68(EnWeatherTag* this, PlayState* play) { } if ((s16)this->unk154 < 0) { // cast req this->unk154 = 0; - // @BUG redudant code - Actor_MarkForDeath(&this->actor); + // redundant code + Actor_Kill(&this->actor); EnWeatherTag_SetupAction(this, EnWeatherTag_Die); } func_8096689C(this, play); } void EnWeatherTag_Die(EnWeatherTag* this, PlayState* play) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } // WEATHERTAG_TYPE_UNK1 diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h index 84aa36b03..b1e7f8f86 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h @@ -19,8 +19,6 @@ typedef struct EnWeatherTag { /* 0x158 */ u16 unk158; // increment/decrement amount for 154 } EnWeatherTag; // size = 0x15C -extern const ActorInit En_Weather_Tag_InitVars; - #define WEATHER_TAG_TYPE(thisx) ((thisx)->params & 0xF) #define WEATHER_TAG_PATHID(thisx) (((thisx)->params >> 4) & 0xF) #define WEATHER_TAG_RANGE100(thisx) ((u8)(((thisx)->params >> 8) & 0xFF) * 100.0f) diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index 811f828a8..bc505ee53 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -55,7 +55,7 @@ void func_80993524(EnWf* this); void func_8099357C(EnWf* this, PlayState* play); s32 func_8099408C(PlayState* play, EnWf* this); -const ActorInit En_Wf_InitVars = { +ActorInit En_Wf_InitVars = { ACTOR_EN_WF, ACTORCAT_PROP, FLAGS, @@ -309,7 +309,7 @@ void EnWf_Init(Actor* thisx, PlayState* play) { } if (Flags_GetClear(play, this->actor.room)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -1181,7 +1181,7 @@ void func_80992E0C(EnWf* this, PlayState* play) { } else { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x60); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { s32 i; Vec3f sp60; diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.h b/src/overlays/actors/ovl_En_Wf/z_en_wf.h index 38570dd9e..c8a0c7af8 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.h +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.h @@ -37,6 +37,4 @@ typedef struct EnWf { /* 0x49C */ ColliderCylinder collider3; } EnWf; // size = 0x4E8 -extern const ActorInit En_Wf_InitVars; - #endif // Z_EN_WF_H diff --git a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c index 0abf1fe56..b8a623539 100644 --- a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c +++ b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c @@ -80,7 +80,7 @@ typedef enum { /* 5 */ EN_WIZ_ANIM_DAMAGE, } EnWizAnimation; -const ActorInit En_Wiz_InitVars = { +ActorInit En_Wiz_InitVars = { ACTOR_EN_WIZ, ACTORCAT_ENEMY, FLAGS, @@ -352,7 +352,7 @@ void EnWiz_Init(Actor* thisx, PlayState* play) { } if ((this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -1183,7 +1183,7 @@ void EnWiz_Dead(EnWiz* this, PlayState* play) { if (this->alpha < 30) { EnWiz_SelectPlatform(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EN_EXTINCT); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if (this->switchFlag >= 0) { Flags_SetSwitch(play, this->switchFlag); } diff --git a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.h b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.h index 3d18abab2..4d35a0f68 100644 --- a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.h +++ b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.h @@ -77,6 +77,4 @@ typedef struct EnWiz { /* 0x8D0 */ Vec3s ghostJointTables[10][WIZROBE_LIMB_MAX]; } EnWiz; // size = 0xD80 -extern const ActorInit En_Wiz_InitVars; - #endif // Z_EN_WIZ_H diff --git a/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.c b/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.c index ce13687a7..857bb5300 100644 --- a/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.c +++ b/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.c @@ -21,7 +21,7 @@ void EnWizBrock_UpdateStatus(EnWizBrock* this, PlayState* play); s16 sPlatformIndex = 0; -const ActorInit En_Wiz_Brock_InitVars = { +ActorInit En_Wiz_Brock_InitVars = { ACTOR_EN_WIZ_BROCK, ACTORCAT_PROP, FLAGS, @@ -80,7 +80,7 @@ void EnWizBrock_UpdateStatus(EnWizBrock* this, PlayState* play) { (BREG(56) / 1000.0f) + 0.002f); this->dyna.actor.scale.z = this->dyna.actor.scale.x; if (this->dyna.actor.scale.y < 0.001f) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } } diff --git a/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.h b/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.h index 3b23d08b0..3df0362ed 100644 --- a/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.h +++ b/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.h @@ -25,6 +25,4 @@ typedef struct EnWizBrock { /* 0x1AC */ f32 alpha; } EnWizBrock; // size = 0x1B0 -extern const ActorInit En_Wiz_Brock_InitVars; - #endif // Z_EN_WIZ_BROCK_H diff --git a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c index ca3fde745..4ed3333fd 100644 --- a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c +++ b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c @@ -37,7 +37,7 @@ typedef enum { static s32 sPoolHitByIceArrow = false; -const ActorInit En_Wiz_Fire_InitVars = { +ActorInit En_Wiz_Fire_InitVars = { ACTOR_EN_WIZ_FIRE, ACTORCAT_ENEMY, FLAGS, @@ -330,7 +330,7 @@ void EnWiz_SmallFlame(EnWizFire* this, PlayState* play) { Math_ApproachF(&this->scale, 2.0f * this->targetScale, 0.2f, 0.002f); Math_ApproachZeroF(&this->alpha, 1.0f, 35.0f); if ((this->timer == 0) && (this->alpha < 2.0f)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } return; } @@ -444,7 +444,7 @@ void EnWiz_Pool(EnWizFire* this, PlayState* play) { if ((this->poolScale < 0.001f) && (this->blendScaleFrac < 0.001f)) { sPoolHitByIceArrow = false; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } return; @@ -463,7 +463,7 @@ void EnWiz_Pool(EnWizFire* this, PlayState* play) { wiz->hasActiveProjectile = false; } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -483,7 +483,7 @@ void EnWiz_KillMagicProjectile(EnWizFire* this, PlayState* play) { } } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } @@ -636,7 +636,7 @@ void EnWizFire_Update(Actor* thisx, PlayState* play2) { } } - if ((player->stateFlags2 & 0x4000) && (player->unk_AE8 < 90)) { + if ((player->stateFlags2 & PLAYER_STATE2_4000) && (player->unk_AE8 < 90)) { player->unk_AE8 = 90; } diff --git a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.h b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.h index 180192d4c..90bf472dc 100644 --- a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.h +++ b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.h @@ -64,6 +64,4 @@ typedef struct EnWizFire { /* 0x0254 */ EnWizFireEffect effects[200]; } EnWizFire; // size = 0x2AF4 -extern const ActorInit En_Wiz_Fire_InitVars; - #endif // Z_EN_WIZ_FIRE_H diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index 08295ad1e..ba63b3021 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -38,7 +38,7 @@ typedef enum { static f32 sSpawnCos; static f32 sSpawnSin; -const ActorInit En_Wood02_InitVars = { +ActorInit En_Wood02_InitVars = { ACTOR_EN_WOOD02, ACTORCAT_PROP, FLAGS, @@ -312,7 +312,7 @@ void EnWood02_Init(Actor* thisx, PlayState* play) { if (floorY > BGCHECK_Y_MIN) { this->actor.world.pos.y = floorY; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } @@ -374,7 +374,7 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { ((EnWood02*)thisx->parent)->unk_14A[index] = phi_v0; - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } this->unk_151 = 0; @@ -449,7 +449,7 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { thisx->shape.rot.z = Math_SinS(this->unk_146 * 0xBB8) * 16384.0f; this->unk_14A[0]--; if (this->unk_14A[0] == 0) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); } } diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h index 310d1e5de..128607414 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h @@ -50,6 +50,4 @@ typedef enum { /* 0x1A */ WOOD_TREE_SPECIAL = 0x1A } WoodType; -extern const ActorInit En_Wood02_InitVars; - #endif // Z_EN_WOOD02_H 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 11474f01e..106b23926 100644 --- a/src/overlays/actors/ovl_En_Yb/z_en_yb.c +++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.c @@ -32,7 +32,7 @@ void EnYb_ActorShadowFunc(Actor* thisx, Lights* mapper, PlayState* play); void EnYb_ChangeAnim(PlayState* play, EnYb* this, s16 animIndex, u8 animMode, f32 morphFrames); s32 EnYb_CanTalk(EnYb* this, PlayState* play); -const ActorInit En_Yb_InitVars = { +ActorInit En_Yb_InitVars = { ACTOR_EN_YB, ACTORCAT_NPC, FLAGS, @@ -84,7 +84,7 @@ void EnYb_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); ActorShape_Init(&this->actor.shape, 0.0f, EnYb_ActorShadowFunc, 20.0f); - // @Bug this alignment is because of player animations, but should be using ALIGN16 + // @bug this alignment is because of player animations, but should be using ALIGN16 SkelAnime_InitFlex(play, &this->skelAnime, &gYbSkeleton, &object_yb_Anim_000200, (uintptr_t)this->jointTable & ~0xF, (uintptr_t)this->morphTable & ~0xF, YB_LIMB_MAX); @@ -122,7 +122,7 @@ void EnYb_Init(Actor* thisx, PlayState* play) { // check if already healed if (gSaveContext.save.weekEventReg[82] & 4) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -250,7 +250,7 @@ void EnYb_Disappear(EnYb* this, PlayState* play) { if (this->alpha > 10) { this->alpha -= 10; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -372,10 +372,10 @@ void EnYb_Idle(EnYb* this, PlayState* play) { } if (this->playerOcarinaOut & 1) { - if (!(player->stateFlags2 & 0x8000000)) { + if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) { this->playerOcarinaOut &= ~1; } - } else if ((player->stateFlags2 & 0x8000000) && this->actor.xzDistToPlayer < 180.0f && + } else if ((player->stateFlags2 & PLAYER_STATE2_8000000) && this->actor.xzDistToPlayer < 180.0f && fabsf(this->actor.playerHeightRel) < 50.0f) { this->playerOcarinaOut |= 1; Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c index d5e6f2e00..e77aace23 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c @@ -15,7 +15,7 @@ void EnZl1_Destroy(Actor* thisx, PlayState* play); void EnZl1_Update(Actor* thisx, PlayState* play); void EnZl1_Draw(Actor* thisx, PlayState* play); -const ActorInit En_Zl1_InitVars = { +ActorInit En_Zl1_InitVars = { ACTOR_EN_ZL1, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h index e1b118191..4138558fb 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h @@ -10,6 +10,4 @@ typedef struct EnZl1 { /* 0x144 */ char unk_144[0xC0]; } EnZl1; // size = 0x204 -extern const ActorInit En_Zl1_InitVars; - #endif // Z_EN_ZL1_H diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index 92e0b2925..3dffe0a6f 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -18,7 +18,7 @@ void EnZl4_Draw(Actor* thisx, PlayState* play); void func_809A1D0C(EnZl4* this, PlayState* play); #if 0 -const ActorInit En_Zl4_InitVars = { +ActorInit En_Zl4_InitVars = { ACTOR_EN_ZL4, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h index eeb272579..326d2545e 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h @@ -14,6 +14,4 @@ typedef struct EnZl4 { /* 0x294 */ char unk_294[0x60]; } EnZl4; // size = 0x2F4 -extern const ActorInit En_Zl4_InitVars; - #endif // Z_EN_ZL4_H diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index c4bf8f56d..74d830be1 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -19,7 +19,7 @@ void EnZo_FollowPath(EnZo* this, PlayState* play); void EnZo_TreadWater(EnZo* this, PlayState* play); void EnZo_DoNothing(EnZo* this, PlayState* play); -const ActorInit En_Zo_InitVars = { +ActorInit En_Zo_InitVars = { ACTOR_EN_ZO, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Zob/z_en_zob.c b/src/overlays/actors/ovl_En_Zob/z_en_zob.c index 1970e53df..cebdd68cf 100644 --- a/src/overlays/actors/ovl_En_Zob/z_en_zob.c +++ b/src/overlays/actors/ovl_En_Zob/z_en_zob.c @@ -37,7 +37,7 @@ void func_80BA0BB4(EnZob* this, PlayState* play); void func_80BA0C14(EnZob* this, PlayState* play); void func_80BA0CF4(EnZob* this, PlayState* play); -const ActorInit En_Zob_InitVars = { +ActorInit En_Zob_InitVars = { ACTOR_EN_ZOB, ACTORCAT_NPC, FLAGS, @@ -121,7 +121,7 @@ void EnZob_Init(Actor* thisx, PlayState* play) { } if (!(gSaveContext.save.weekEventReg[55] & 0x80)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; @@ -136,7 +136,7 @@ void EnZob_Init(Actor* thisx, PlayState* play) { default: if (gSaveContext.save.weekEventReg[55] & 0x80) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actor.flags |= ACTOR_FLAG_10; break; @@ -525,7 +525,7 @@ void func_80BA0374(EnZob* this, PlayState* play) { func_801477B4(play); this->actionFunc = func_80BA0318; player->unk_A90 = &this->actor; - player->stateFlags3 |= 0x20; + player->stateFlags3 |= PLAYER_STATE3_20; break; } } diff --git a/src/overlays/actors/ovl_En_Zob/z_en_zob.h b/src/overlays/actors/ovl_En_Zob/z_en_zob.h index cd9ccc908..25ce14fdc 100644 --- a/src/overlays/actors/ovl_En_Zob/z_en_zob.h +++ b/src/overlays/actors/ovl_En_Zob/z_en_zob.h @@ -32,6 +32,4 @@ typedef struct EnZob { /* 0x314 */ EnZobActionFunc actionFunc; } EnZob; // size = 0x318 -extern const ActorInit En_Zob_InitVars; - #endif // Z_EN_ZOB_H diff --git a/src/overlays/actors/ovl_En_Zod/z_en_zod.c b/src/overlays/actors/ovl_En_Zod/z_en_zod.c index d2645b67b..83a5dda4b 100644 --- a/src/overlays/actors/ovl_En_Zod/z_en_zod.c +++ b/src/overlays/actors/ovl_En_Zod/z_en_zod.c @@ -16,7 +16,7 @@ void EnZod_Update(Actor* thisx, PlayState* play); void EnZod_Draw(Actor* thisx, PlayState* play); #if 0 -const ActorInit En_Zod_InitVars = { +ActorInit En_Zod_InitVars = { ACTOR_EN_ZOD, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Zod/z_en_zod.h b/src/overlays/actors/ovl_En_Zod/z_en_zod.h index 2fd9b7400..08cf29f2d 100644 --- a/src/overlays/actors/ovl_En_Zod/z_en_zod.h +++ b/src/overlays/actors/ovl_En_Zod/z_en_zod.h @@ -13,6 +13,4 @@ typedef struct EnZod { /* 0x29C */ EnZodActionFunc actionFunc; } EnZod; // size = 0x2A0 -extern const ActorInit En_Zod_InitVars; - #endif // Z_EN_ZOD_H diff --git a/src/overlays/actors/ovl_En_Zog/z_en_zog.c b/src/overlays/actors/ovl_En_Zog/z_en_zog.c index 0ea1d448f..4f0a82980 100644 --- a/src/overlays/actors/ovl_En_Zog/z_en_zog.c +++ b/src/overlays/actors/ovl_En_Zog/z_en_zog.c @@ -33,7 +33,7 @@ void func_80B95240(EnZog* this, PlayState* play); static u8 D_80B95E10; -const ActorInit En_Zog_InitVars = { +ActorInit En_Zog_InitVars = { ACTOR_EN_ZOG, ACTORCAT_NPC, FLAGS, @@ -207,7 +207,7 @@ void EnZog_Init(Actor* thisx, PlayState* play) { if ((ENZOG_GET_F(&this->actor) != ENZOG_F_2) && (INV_CONTENT(ITEM_MASK_ZORA) == ITEM_MASK_ZORA) && ((play->csCtx.currentCsIndex != 2) || (gSaveContext.sceneLayer != 0) || (play->sceneId != SCENE_30GYOSON))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -601,10 +601,10 @@ void func_80B943EC(EnZog* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->unk_30A & 0x10) { - if (!(player->stateFlags2 & 0x8000000)) { + if (!(player->stateFlags2 & PLAYER_STATE2_8000000)) { this->unk_30A &= ~0x10; } - } else if ((player->stateFlags2 & 0x8000000) && (this->actor.xzDistToPlayer < 120.0f)) { + } else if ((player->stateFlags2 & PLAYER_STATE2_8000000) && (this->actor.xzDistToPlayer < 120.0f)) { this->unk_30A |= 0x10; Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); } diff --git a/src/overlays/actors/ovl_En_Zog/z_en_zog.h b/src/overlays/actors/ovl_En_Zog/z_en_zog.h index e649c52ab..9971d77fa 100644 --- a/src/overlays/actors/ovl_En_Zog/z_en_zog.h +++ b/src/overlays/actors/ovl_En_Zog/z_en_zog.h @@ -40,6 +40,4 @@ typedef struct EnZog { /* 0x328 */ EnZogActionFunc actionFunc; } EnZog; // size = 0x32C -extern const ActorInit En_Zog_InitVars; - #endif // Z_EN_ZOG_H diff --git a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c index fba4baf7a..f882c9711 100644 --- a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c +++ b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c @@ -38,7 +38,7 @@ void func_80B32BB8(EnZoraegg* this, PlayState* play); void func_80B32C34(EnZoraegg* this, PlayState* play); void func_80B32D08(EnZoraegg* this, PlayState* play); -const ActorInit En_Zoraegg_InitVars = { +ActorInit En_Zoraegg_InitVars = { ACTOR_EN_ZORAEGG, ACTORCAT_ITEMACTION, FLAGS, @@ -98,14 +98,14 @@ void EnZoraegg_Init(Actor* thisx, PlayState* play) { switch (ENZORAEGG_GET_1F(&this->actor)) { case ENZORAEGG_1F_00: if (Flags_GetSwitch(play, ENZORAEGG_GET_FE00(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; case ENZORAEGG_1F_11: if (func_80B319A8(play) >= 7) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); this->actor.home.rot.z = 1; return; } @@ -119,7 +119,7 @@ void EnZoraegg_Init(Actor* thisx, PlayState* play) { case ENZORAEGG_1F_08: case ENZORAEGG_1F_09: if (gSaveContext.save.weekEventReg[19] & 0x40) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; @@ -132,7 +132,7 @@ void EnZoraegg_Init(Actor* thisx, PlayState* play) { case ENZORAEGG_1F_0F: case ENZORAEGG_1F_10: if (!(gSaveContext.save.weekEventReg[19] & 0x40)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } break; @@ -335,7 +335,7 @@ void func_80B32094(EnZoraegg* this, PlayState* play) { void func_80B320E0(EnZoraegg* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { Flags_SetSwitch(play, ENZORAEGG_GET_FE00(&this->actor)); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actionFunc = func_80B32094; Message_StartTextbox(play, 0x24B, &this->actor); @@ -406,7 +406,7 @@ void func_80B32390(EnZoraegg* this, PlayState* play) { if (temp_v0 != NULL) { ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, temp_v0); gSaveContext.eventInf[3] |= 8; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if ((func_80B319A8(play) >= 7) && (fabsf(player->actor.world.pos.x - this->actor.world.pos.x) < (100.0f * this->actor.scale.x)) && @@ -571,7 +571,7 @@ void func_80B32B3C(EnZoraegg* this, PlayState* play) { void func_80B32B70(EnZoraegg* this, PlayState* play) { func_80B31C40(this, play); if (Cutscene_CheckActorAction(play, 0x1C9)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -584,7 +584,7 @@ void func_80B32BB8(EnZoraegg* this, PlayState* play) { } if (Cutscene_CheckActorAction(play, 0x1C9)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.h b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.h index b5b19afde..f36f77c2b 100644 --- a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.h +++ b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.h @@ -59,6 +59,4 @@ typedef struct EnZoraegg { /* 0x1F8 */ EnZoraeggActionFunc actionFunc; } EnZoraegg; // size = 0x1FC -extern const ActorInit En_Zoraegg_InitVars; - #endif // Z_EN_ZORAEGG_H 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 11fcc2595..0570d4c6d 100644 --- a/src/overlays/actors/ovl_En_Zos/z_en_zos.c +++ b/src/overlays/actors/ovl_En_Zos/z_en_zos.c @@ -50,7 +50,7 @@ typedef enum { /* 13 */ EN_ZOS_ANIM_MAX } EnZosAnimation; -const ActorInit En_Zos_InitVars = { +ActorInit En_Zos_InitVars = { ACTOR_EN_ZOS, ACTORCAT_NPC, FLAGS, @@ -101,7 +101,7 @@ void EnZos_Init(Actor* thisx, PlayState* play) { switch (ENZOS_GET_F(&this->actor)) { case ENZOS_F_1: if (!(gSaveContext.save.weekEventReg[55] & 0x80)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } if (gSaveContext.save.weekEventReg[78] & 1) { @@ -121,7 +121,7 @@ void EnZos_Init(Actor* thisx, PlayState* play) { default: if (gSaveContext.save.weekEventReg[55] & 0x80) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actor.flags |= ACTOR_FLAG_10; break; diff --git a/src/overlays/actors/ovl_En_Zos/z_en_zos.h b/src/overlays/actors/ovl_En_Zos/z_en_zos.h index bf5a9c07b..e3ede7b28 100644 --- a/src/overlays/actors/ovl_En_Zos/z_en_zos.h +++ b/src/overlays/actors/ovl_En_Zos/z_en_zos.h @@ -31,6 +31,4 @@ typedef struct EnZos { /* 0x2C0 */ EnZosActionFunc actionFunc; } EnZos; // size = 0x2C4 -extern const ActorInit En_Zos_InitVars; - #endif // Z_EN_ZOS_H 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 1519a3774..f8a9c0bd2 100644 --- a/src/overlays/actors/ovl_En_Zot/z_en_zot.c +++ b/src/overlays/actors/ovl_En_Zot/z_en_zot.c @@ -32,7 +32,7 @@ void func_80B990A4(EnZot* this, PlayState* play); void func_80B992C0(EnZot* this, PlayState* play); void func_80B99384(EnZot* this, PlayState* play); -const ActorInit En_Zot_InitVars = { +ActorInit En_Zot_InitVars = { ACTOR_EN_ZOT, ACTORCAT_NPC, FLAGS, @@ -186,14 +186,14 @@ void EnZot_Init(Actor* thisx, PlayState* play2) { this->actor.colChkInfo.cylRadius = 0; this->actor.shape.yOffset = -1400.0f; if (!(gSaveContext.save.weekEventReg[55] & 0x80)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; case 18: this->actionFunc = func_80B99384; if (!(gSaveContext.save.weekEventReg[55] & 0x80)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } break; @@ -221,7 +221,7 @@ void EnZot_Init(Actor* thisx, PlayState* play2) { } if ((ENZOT_GET_1F(thisx) >= 2) && (ENZOT_GET_1F(thisx) < 11) && (gSaveContext.save.weekEventReg[55] & 0x80)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -553,7 +553,7 @@ void func_80B97708(EnZot* this, PlayState* play) { return; } - if (!(player->stateFlags1 & 0x2000000)) { + if (!(player->stateFlags1 & PLAYER_STATE1_2000000)) { phi_v1 = func_80B96CE4(this); } else { phi_v1 = 0; diff --git a/src/overlays/actors/ovl_En_Zot/z_en_zot.h b/src/overlays/actors/ovl_En_Zot/z_en_zot.h index b72328b20..1bab43ae3 100644 --- a/src/overlays/actors/ovl_En_Zot/z_en_zot.h +++ b/src/overlays/actors/ovl_En_Zot/z_en_zot.h @@ -29,6 +29,4 @@ typedef struct EnZot { /* 0x2F8 */ EnZotActionFunc actionFunc; } EnZot; // size = 0x2FC -extern const ActorInit En_Zot_InitVars; - #endif // Z_EN_ZOT_H diff --git a/src/overlays/actors/ovl_En_Zov/z_en_zov.c b/src/overlays/actors/ovl_En_Zov/z_en_zov.c index 05726ddce..81f81b052 100644 --- a/src/overlays/actors/ovl_En_Zov/z_en_zov.c +++ b/src/overlays/actors/ovl_En_Zov/z_en_zov.c @@ -28,7 +28,7 @@ void func_80BD1DB8(EnZov* this, PlayState* play); void func_80BD1F1C(EnZov* this, PlayState* play); s32 EnZov_ValidatePictograph(PlayState* play, Actor* thisx); -const ActorInit En_Zov_InitVars = { +ActorInit En_Zov_InitVars = { ACTOR_EN_ZOV, ACTORCAT_NPC, FLAGS, @@ -108,7 +108,7 @@ void EnZov_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80BD1F1C; func_80BD1570(this, 9, ANIMMODE_LOOP); if (!(gSaveContext.save.weekEventReg[55] & 0x80)) { - Actor_MarkForDeath(&this->picto.actor); + Actor_Kill(&this->picto.actor); return; } break; @@ -121,7 +121,7 @@ void EnZov_Init(Actor* thisx, PlayState* play) { default: this->unk_320 |= 2; if ((gSaveContext.save.weekEventReg[55] & 0x80) || (gSaveContext.save.weekEventReg[53] & 0x20)) { - Actor_MarkForDeath(&this->picto.actor); + Actor_Kill(&this->picto.actor); } break; } diff --git a/src/overlays/actors/ovl_En_Zov/z_en_zov.h b/src/overlays/actors/ovl_En_Zov/z_en_zov.h index 25966f994..a5e217ca3 100644 --- a/src/overlays/actors/ovl_En_Zov/z_en_zov.h +++ b/src/overlays/actors/ovl_En_Zov/z_en_zov.h @@ -36,6 +36,4 @@ typedef struct EnZov { /* 0x330 */ EnZovActionFunc actionFunc; } EnZov; // size = 0x334 -extern const ActorInit En_Zov_InitVars; - #endif // Z_EN_ZOV_H diff --git a/src/overlays/actors/ovl_En_Zow/z_en_zow.c b/src/overlays/actors/ovl_En_Zow/z_en_zow.c index 4779fdedd..2d4bf1605 100644 --- a/src/overlays/actors/ovl_En_Zow/z_en_zow.c +++ b/src/overlays/actors/ovl_En_Zow/z_en_zow.c @@ -22,7 +22,7 @@ void func_80BDD634(EnZow* this, PlayState* play); void func_80BDD6BC(EnZow* this, PlayState* play); void func_80BDD79C(EnZow* this, PlayState* play); -const ActorInit En_Zow_InitVars = { +ActorInit En_Zow_InitVars = { ACTOR_EN_ZOW, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_En_Zow/z_en_zow.h b/src/overlays/actors/ovl_En_Zow/z_en_zow.h index 777a0aa9d..a9d915667 100644 --- a/src/overlays/actors/ovl_En_Zow/z_en_zow.h +++ b/src/overlays/actors/ovl_En_Zow/z_en_zow.h @@ -39,6 +39,4 @@ typedef struct EnZow { /* 0x618 */ EnZowActionFunc actionFunc; } EnZow; // size = 0x61C -extern const ActorInit En_Zow_InitVars; - #endif // Z_EN_ZOW_H diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c index ac8592615..c4d72a8f1 100644 --- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c +++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c @@ -18,7 +18,7 @@ void ItemBHeart_Draw(Actor* thisx, PlayState* play); void func_808BCF54(ItemBHeart* this, PlayState* play); -const ActorInit Item_B_Heart_InitVars = { +ActorInit Item_B_Heart_InitVars = { ACTOR_ITEM_B_HEART, ACTORCAT_BOSS, FLAGS, @@ -41,7 +41,7 @@ void ItemBHeart_Init(Actor* thisx, PlayState* play) { ItemBHeart* this = THIS; if (Flags_GetCollectible(play, 0x1F)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -68,10 +68,11 @@ void ItemBHeart_Update(Actor* thisx, PlayState* play) { if (!(this->unk_168 < 0.5f)) { if (Actor_HasParent(&this->actor, play)) { Flags_SetCollectible(play, 0x1F); - Actor_MarkForDeath(&this->actor); - } else { - Actor_PickUp(&this->actor, play, GI_HEART_CONTAINER, 30.0f, 80.0f); + Actor_Kill(&this->actor); + return; } + + Actor_PickUp(&this->actor, play, GI_HEART_CONTAINER, 30.0f, 80.0f); } } diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h index b89e10edd..f7ff62fa9 100644 --- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h +++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h @@ -12,6 +12,4 @@ typedef struct ItemBHeart { /* 0x168 */ f32 unk_168; } ItemBHeart; // size = 0x16C -extern const ActorInit Item_B_Heart_InitVars; - #endif // Z_ITEM_B_HEART_H diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index 0bd1fd30c..e327dc3f4 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -20,7 +20,7 @@ void func_809200F8(ItemEtcetera* this, PlayState* play); void ItemEtcetera_DrawThroughLens(Actor* thisx, PlayState* play); void ItemEtcetera_Draw(Actor* thisx, PlayState* play); -const ActorInit Item_Etcetera_InitVars = { +ActorInit Item_Etcetera_InitVars = { ACTOR_ITEM_ETCETERA, ACTORCAT_PROP, FLAGS, @@ -102,15 +102,16 @@ void ItemEtcetera_WaitForObject(ItemEtcetera* this, PlayState* play) { void func_8092009C(ItemEtcetera* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - Actor_MarkForDeath(&this->actor); - } else { - Actor_PickUp(&this->actor, play, this->getItemId, 30.0f, 50.0f); + Actor_Kill(&this->actor); + return; } + + Actor_PickUp(&this->actor, play, this->getItemId, 30.0f, 50.0f); } void func_809200F8(ItemEtcetera* this, PlayState* play) { if (Flags_GetTreasure(play, ITEMETCETERA_GET_TREASUREFLAG(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h index e33f1e1fb..4ac893ba5 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h @@ -37,6 +37,4 @@ typedef struct ItemEtcetera { /* 0x154 */ ItemEtceteraActionFunc actionFunc; } ItemEtcetera; // size = 0x158 -extern const ActorInit Item_Etcetera_InitVars; - #endif // Z_ITEM_ETCETERA_H diff --git a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c index 1f3fae3ac..0599e117d 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c @@ -17,7 +17,7 @@ void ItemInbox_Draw(Actor* thisx, PlayState* play); void ItemInbox_Idle(ItemInbox* this, PlayState* play); -const ActorInit Item_Inbox_InitVars = { +ActorInit Item_Inbox_InitVars = { ACTOR_ITEM_INBOX, ACTORCAT_NPC, FLAGS, @@ -41,7 +41,7 @@ void ItemInbox_Destroy(Actor* thisx, PlayState* play) { void ItemInbox_Idle(ItemInbox* this, PlayState* play) { if (Flags_GetTreasure(play, (this->actor.params >> 8) & 0x1F)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h index 0b3247ee7..e6b1adfd6 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h @@ -12,6 +12,4 @@ typedef struct ItemInbox { /* 0x144 */ ItemInboxActionFunc actionFunc; } ItemInbox; // size = 0x148 -extern const ActorInit Item_Inbox_InitVars; - #endif // Z_ITEM_INBOX_H diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index 5160dc074..4880a326e 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -41,7 +41,7 @@ typedef struct { /* 0x1F */ u8 params; } MirRayDataEntry; // size = 0x20 -const ActorInit Mir_Ray_InitVars = { +ActorInit Mir_Ray_InitVars = { ACTOR_MIR_RAY, ACTORCAT_ITEMACTION, FLAGS, @@ -296,7 +296,7 @@ void MirRay_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); if (MIRRAY_LOCATION(&this->actor) >= MIRRAY_MAX) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->sourcePt.x = dataEntry->sourcePoint.x; @@ -483,8 +483,6 @@ void MirRay_RemoveSimilarReflections(MirRayShieldReflection* reflection) { } // Creates the reflected beam's collider (to interact with objects) and places and orients the shield images -#ifdef NON_MATCHING -// Beginning block re-ordered void MirRay_ReflectedBeam(MirRay* this, PlayState* play, MirRayShieldReflection* reflection) { Player* player = GET_PLAYER(play); s32 i; @@ -498,8 +496,6 @@ void MirRay_ReflectedBeam(MirRay* this, PlayState* play, MirRayShieldReflection* f32 spE8[3]; f32 normalVec[3]; MtxF* shieldMtx = &player->shieldMf; - Vec3f vecA; - Vec3f vecC; spE8[0] = -(shieldMtx->xz * this->reflectRange) * this->reflectIntensity * 400.0f; spE8[1] = -(shieldMtx->yz * this->reflectRange) * this->reflectIntensity * 400.0f; @@ -513,85 +509,86 @@ void MirRay_ReflectedBeam(MirRay* this, PlayState* play, MirRayShieldReflection* vecD.y = spE8[1] + vecB.y; vecD.z = spE8[2] + vecB.z; - vecA.x = vecB.x + (shieldMtx->xx * 300.0f); - vecA.y = vecB.y + (shieldMtx->yx * 300.0f); - vecA.z = vecB.z + (shieldMtx->zx * 300.0f); + { + Vec3f vecA; + Vec3f vecC; - vecC.x = vecD.x + (shieldMtx->xx * 300.0f); - vecC.y = vecD.y + (shieldMtx->yx * 300.0f); - vecC.z = vecD.z + (shieldMtx->zx * 300.0f); + vecA.x = vecB.x + (shieldMtx->xx * 300.0f); + vecA.y = vecB.y + (shieldMtx->yx * 300.0f); + vecA.z = vecB.z + (shieldMtx->zx * 300.0f); - Collider_SetQuadVertices(&this->collider2, &vecA, &vecB, &vecC, &vecD); + vecC.x = vecD.x + (shieldMtx->xx * 300.0f); + vecC.y = vecD.y + (shieldMtx->yx * 300.0f); + vecC.z = vecD.z + (shieldMtx->zx * 300.0f); - for (i = 0; i < 6; i++) { - if (reflection[i].reflectionPoly != NULL) { - normalVec[0] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.x); - normalVec[1] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.y); - normalVec[2] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.z); + Collider_SetQuadVertices(&this->collider2, &vecA, &vecB, &vecC, &vecD); - if (Math3D_LineSegVsPlane(normalVec[0], normalVec[1], normalVec[2], reflection[i].reflectionPoly->dist, - &vecB, &vecD, &sp118, 1)) { + for (i = 0; i < 6; i++) { + if (reflection[i].reflectionPoly != NULL) { + normalVec[0] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.x); + normalVec[1] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.y); + normalVec[2] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.z); - reflection[i].pos.x = sp118.x; - reflection[i].pos.y = sp118.y; - reflection[i].pos.z = sp118.z; + if (Math3D_LineSegVsPlane(normalVec[0], normalVec[1], normalVec[2], reflection[i].reflectionPoly->dist, + &vecB, &vecD, &sp118, 1)) { - temp_f0 = sqrtf(SQ(sp118.x - vecB.x) + SQ(sp118.y - vecB.y) + SQ(sp118.z - vecB.z)); + reflection[i].pos.x = sp118.x; + reflection[i].pos.y = sp118.y; + reflection[i].pos.z = sp118.z; - if (temp_f0 < (this->reflectIntensity * 600.0f)) { - reflection[i].opacity = 200; + temp_f0 = sqrtf(SQ(sp118.x - vecB.x) + SQ(sp118.y - vecB.y) + SQ(sp118.z - vecB.z)); + + if (temp_f0 < (this->reflectIntensity * 600.0f)) { + reflection[i].opacity = 200; + } else { + reflection[i].opacity = (s32)(800.0f - temp_f0); + } + + reflection[i].opacity = (s32)(reflection[i].opacity * 1.275f); + + sp10C.x = (shieldMtx->xx * 100.0f) + vecB.x; + sp10C.y = (shieldMtx->yx * 100.0f) + vecB.y; + sp10C.z = (shieldMtx->zx * 100.0f) + vecB.z; + + sp100.x = (spE8[0] * 4.0f) + sp10C.x; + sp100.y = (spE8[1] * 4.0f) + sp10C.y; + sp100.z = (spE8[2] * 4.0f) + sp10C.z; + + reflection[i].mtx.xx = reflection[i].mtx.yy = reflection[i].mtx.zz = reflection[i].mtx.ww = 1.0f; + + reflection[i].mtx.yx = reflection[i].mtx.zx = reflection[i].mtx.wx = reflection[i].mtx.xy = + reflection[i].mtx.zy = reflection[i].mtx.wy = reflection[i].mtx.xz = reflection[i].mtx.yz = + reflection[i].mtx.wz = reflection[i].mtx.xw = reflection[i].mtx.yw = reflection[i].mtx.zw = + 0.0f; + + if (Math3D_LineSegVsPlane(normalVec[0], normalVec[1], normalVec[2], + reflection[i].reflectionPoly->dist, &sp10C, &sp100, &intersection, 1)) { + reflection[i].mtx.xx = intersection.x - sp118.x; + reflection[i].mtx.yx = intersection.y - sp118.y; + reflection[i].mtx.zx = intersection.z - sp118.z; + } + + sp10C.x = (shieldMtx->xy * 100.0f) + vecB.x; + sp10C.y = (shieldMtx->yy * 100.0f) + vecB.y; + sp10C.z = (shieldMtx->zy * 100.0f) + vecB.z; + + sp100.x = (spE8[0] * 4.0f) + sp10C.x; + sp100.y = (spE8[1] * 4.0f) + sp10C.y; + sp100.z = (spE8[2] * 4.0f) + sp10C.z; + + if (Math3D_LineSegVsPlane(normalVec[0], normalVec[1], normalVec[2], + reflection[i].reflectionPoly->dist, &sp10C, &sp100, &intersection, 1)) { + reflection[i].mtx.xy = intersection.x - sp118.x; + reflection[i].mtx.yy = intersection.y - sp118.y; + reflection[i].mtx.zy = intersection.z - sp118.z; + } } else { - reflection[i].opacity = (s32)(800.0f - temp_f0); + reflection[i].reflectionPoly = NULL; } - - reflection[i].opacity = (s32)(reflection[i].opacity * 1.275f); - - sp10C.x = (shieldMtx->xx * 100.0f) + vecB.x; - sp10C.y = (shieldMtx->yx * 100.0f) + vecB.y; - sp10C.z = (shieldMtx->zx * 100.0f) + vecB.z; - - sp100.x = (spE8[0] * 4.0f) + sp10C.x; - sp100.y = (spE8[1] * 4.0f) + sp10C.y; - sp100.z = (spE8[2] * 4.0f) + sp10C.z; - - reflection[i].mtx.xx = reflection[i].mtx.yy = reflection[i].mtx.zz = reflection[i].mtx.ww = 1.0f; - - reflection[i].mtx.yx = reflection[i].mtx.zx = reflection[i].mtx.wx = reflection[i].mtx.xy = - reflection[i].mtx.zy = reflection[i].mtx.wy = reflection[i].mtx.xz = reflection[i].mtx.yz = - reflection[i].mtx.wz = reflection[i].mtx.xw = reflection[i].mtx.yw = reflection[i].mtx.zw = - 0.0f; - - if (Math3D_LineSegVsPlane(normalVec[0], normalVec[1], normalVec[2], reflection[i].reflectionPoly->dist, - &sp10C, &sp100, &intersection, 1)) { - reflection[i].mtx.xx = intersection.x - sp118.x; - reflection[i].mtx.yx = intersection.y - sp118.y; - reflection[i].mtx.zx = intersection.z - sp118.z; - } - - sp10C.x = (shieldMtx->xy * 100.0f) + vecB.x; - sp10C.y = (shieldMtx->yy * 100.0f) + vecB.y; - sp10C.z = (shieldMtx->zy * 100.0f) + vecB.z; - - sp100.x = (spE8[0] * 4.0f) + sp10C.x; - sp100.y = (spE8[1] * 4.0f) + sp10C.y; - sp100.z = (spE8[2] * 4.0f) + sp10C.z; - - if (Math3D_LineSegVsPlane(normalVec[0], normalVec[1], normalVec[2], reflection[i].reflectionPoly->dist, - &sp10C, &sp100, &intersection, 1)) { - reflection[i].mtx.xy = intersection.x - sp118.x; - reflection[i].mtx.yy = intersection.y - sp118.y; - reflection[i].mtx.zy = intersection.z - sp118.z; - } - } else { - reflection[i].reflectionPoly = NULL; } } } } -#else -void MirRay_ReflectedBeam(MirRay* this, PlayState* play, MirRayShieldReflection* reflection); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray/MirRay_ReflectedBeam.s") -#endif void MirRay_Draw(Actor* thisx, PlayState* play) { s32 pad; diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h index 3ba21c444..cd48cfed1 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h @@ -40,6 +40,4 @@ typedef struct MirRay { /* 0x2A6 */ u8 unLit; // Conditioned on. set in Cobra? } MirRay; // size = 0x2A8 -extern const ActorInit Mir_Ray_InitVars; - #endif // Z_MIR_RAY_H diff --git a/src/overlays/actors/ovl_Mir_Ray2/z_mir_ray2.c b/src/overlays/actors/ovl_Mir_Ray2/z_mir_ray2.c index 215b63776..a552e35ab 100644 --- a/src/overlays/actors/ovl_Mir_Ray2/z_mir_ray2.c +++ b/src/overlays/actors/ovl_Mir_Ray2/z_mir_ray2.c @@ -15,7 +15,7 @@ void MirRay2_Destroy(Actor* thisx, PlayState* play); void MirRay2_Update(Actor* thisx, PlayState* play); void MirRay2_Draw(Actor* thisx, PlayState* play); -const ActorInit Mir_Ray2_InitVars = { +ActorInit Mir_Ray2_InitVars = { ACTOR_MIR_RAY2, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Mir_Ray2/z_mir_ray2.h b/src/overlays/actors/ovl_Mir_Ray2/z_mir_ray2.h index ac5202bdb..4bb40d40d 100644 --- a/src/overlays/actors/ovl_Mir_Ray2/z_mir_ray2.h +++ b/src/overlays/actors/ovl_Mir_Ray2/z_mir_ray2.h @@ -19,6 +19,4 @@ typedef struct MirRay2 { /* 0x1B0 */ LightInfo lightInfo; } MirRay2; // size = 0x1C0 -extern const ActorInit Mir_Ray2_InitVars; - #endif // Z_MIR_RAY2_H diff --git a/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c b/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c index 66a14a2a6..8f6fcbfe9 100644 --- a/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c +++ b/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c @@ -16,7 +16,7 @@ void MirRay3_Destroy(Actor* thisx, PlayState* play); void MirRay3_Update(Actor* thisx, PlayState* play); void MirRay3_Draw(Actor* thisx, PlayState* play); -const ActorInit Mir_Ray3_InitVars = { +ActorInit Mir_Ray3_InitVars = { ACTOR_MIR_RAY3, ACTORCAT_ITEMACTION, FLAGS, @@ -213,7 +213,6 @@ void func_80B9E7D0(MirRay3Struct* ptr) { } } -#ifdef NON_MATCHING void func_80B9E8D4(MirRay3* this, PlayState* play, MirRay3Struct* ptr) { Player* player = GET_PLAYER(play); s32 i; @@ -231,7 +230,6 @@ void func_80B9E8D4(MirRay3* this, PlayState* play, MirRay3Struct* ptr) { f32 temp_f2; Vec3f spD4; Vec3f spC8; - CollisionPoly* spC4; spF8[0] = -(shieldMf->mf[2][0] * this->unk_260) * this->unk_214 * 400.0f; spF8[1] = -(shieldMf->mf[2][1] * this->unk_260) * this->unk_214 * 400.0f; @@ -321,28 +319,28 @@ void func_80B9E8D4(MirRay3* this, PlayState* play, MirRay3Struct* ptr) { sp134.y = (spF8[1] * temp_f2) + sp140.y; sp134.z = (spF8[2] * temp_f2) + sp140.z; - if (!BgCheck_AnyLineTest1(&play->colCtx, &sp140, &sp134, &sp128, &spC4, 1)) { - Math_Vec3f_Copy(&sp128, &sp134); + { + CollisionPoly* spC4; + + if (!BgCheck_AnyLineTest1(&play->colCtx, &sp140, &sp134, &sp128, &spC4, 1)) { + Math_Vec3f_Copy(&sp128, &sp134); + } + + sp128.x += spF8[0] * 5.0f; + sp128.y += spF8[1] * 5.0f; + sp128.z += spF8[2] * 5.0f; + + spD4.x = (shieldMf->mf[0][0] * 300.0f) + sp140.x; + spD4.y = (shieldMf->mf[0][1] * 300.0f) + sp140.y; + spD4.z = (shieldMf->mf[0][2] * 300.0f) + sp140.z; + + spC8.x = (shieldMf->mf[0][0] * 300.0f) + sp128.x; + spC8.y = (shieldMf->mf[0][1] * 300.0f) + sp128.y; + spC8.z = (shieldMf->mf[0][2] * 300.0f) + sp128.z; + + Collider_SetQuadVertices(&this->colliderQuad, &spD4, &sp140, &spC8, &sp128); } - - sp128.x += spF8[0] * 5.0f; - sp128.y += spF8[1] * 5.0f; - sp128.z += spF8[2] * 5.0f; - - spD4.x = (shieldMf->mf[0][0] * 300.0f) + sp140.x; - spD4.y = (shieldMf->mf[0][1] * 300.0f) + sp140.y; - spD4.z = (shieldMf->mf[0][2] * 300.0f) + sp140.z; - - spC8.x = (shieldMf->mf[0][0] * 300.0f) + sp128.x; - spC8.y = (shieldMf->mf[0][1] * 300.0f) + sp128.y; - spC8.z = (shieldMf->mf[0][2] * 300.0f) + sp128.z; - - Collider_SetQuadVertices(&this->colliderQuad, &spD4, &sp140, &spC8, &sp128); } -#else -void func_80B9E8D4(MirRay3* this, PlayState* play, MirRay3Struct* ptr); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray3/func_80B9E8D4.s") -#endif void MirRay3_Draw(Actor* thisx, PlayState* play) { s32 pad[2]; diff --git a/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.h b/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.h index 7aecd111f..3e285c050 100644 --- a/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.h +++ b/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.h @@ -19,6 +19,4 @@ typedef struct MirRay3 { /* 0x260 */ f32 unk_260; } MirRay3; // size = 0x264 -extern const ActorInit Mir_Ray3_InitVars; - #endif // Z_MIR_RAY3_H diff --git a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c index f0049800d..acea3daf1 100644 --- a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c +++ b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c @@ -24,7 +24,7 @@ void func_80ACBDFC(ObjAqua* this, PlayState* play); void func_80ACBD34(ObjAqua* this); -const ActorInit Obj_Aqua_InitVars = { +ActorInit Obj_Aqua_InitVars = { ACTOR_OBJ_AQUA, ACTORCAT_ITEMACTION, FLAGS, @@ -184,10 +184,10 @@ void func_80ACBC8C(ObjAqua* this, PlayState* play) { } else { func_80ACB6A0(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 0x28, NA_SE_EV_BOMB_DROP_WATER); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (this->counter <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -207,7 +207,7 @@ void func_80ACBD48(ObjAqua* this, PlayState* play) { if (this->actor.shape.shadowAlpha > 2) { this->actor.shape.shadowAlpha -= 2; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -232,7 +232,7 @@ void func_80ACBDFC(ObjAqua* this, PlayState* play) { (Rand_ZeroOne() * 0.1f) + 0.03f); } if (this->counter <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.h b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.h index fa2b1c636..a47ea661a 100644 --- a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.h +++ b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.h @@ -19,6 +19,4 @@ typedef struct ObjAqua { /* 0x198 */ s16 unk_198; } ObjAqua; // size = 0x19C -extern const ActorInit Obj_Aqua_InitVars; - #endif // Z_OBJ_AQUA_H diff --git a/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c b/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c index b9310b27e..565c99504 100644 --- a/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c +++ b/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c @@ -23,7 +23,7 @@ void func_809A562C(ObjArmos* this, PlayState* play); void func_809A57D8(ObjArmos* this); void func_809A57F4(ObjArmos* this, PlayState* play); -const ActorInit Obj_Armos_InitVars = { +ActorInit Obj_Armos_InitVars = { ACTOR_OBJ_ARMOS, ACTORCAT_PROP, FLAGS, @@ -252,7 +252,7 @@ void func_809A54E0(ObjArmos* this, PlayState* play) { func_809A518C(this, sp20); func_809A5610(this); } else { - GET_PLAYER(play)->stateFlags2 &= ~0x10; + GET_PLAYER(play)->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } @@ -289,7 +289,7 @@ void func_809A562C(ObjArmos* this, PlayState* play) { sp20 = true; } - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; if (!sp20) { @@ -309,7 +309,7 @@ void func_809A57D8(ObjArmos* this) { void func_809A57F4(ObjArmos* this, PlayState* play) { if (fabsf(this->dyna.pushForce) > 0.1f) { - GET_PLAYER(play)->stateFlags2 &= ~0x10; + GET_PLAYER(play)->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } diff --git a/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.h b/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.h index a0c91f214..2e9453005 100644 --- a/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.h +++ b/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.h @@ -38,6 +38,4 @@ typedef struct ObjArmos { /* 0x270 */ s16 unk_270; } ObjArmos; // size = 0x274 -extern const ActorInit Obj_Armos_InitVars; - #endif // Z_OBJ_ARMOS_H 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 c13fde9b0..2a8a63fec 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -60,7 +60,7 @@ void func_80938C1C(Actor* thisx, PlayState* play); void func_80938E00(Actor* thisx, PlayState* play); void func_80938F50(Actor* thisx, PlayState* play); -const ActorInit Obj_Bean_InitVars = { +ActorInit Obj_Bean_InitVars = { ACTOR_OBJ_BEAN, ACTORCAT_BG, FLAGS, @@ -378,11 +378,12 @@ void ObjBean_Init(Actor* thisx, PlayState* play) { this->dyna.actor.flags |= ACTOR_FLAG_10; func_80937C10(this); if (!func_80936D58(this, play)) { - Actor_MarkForDeath(&this->dyna.actor); - } else { - func_800BC154(play, &play->actorCtx, &this->dyna.actor, 7); - func_80937DD8(this); + Actor_Kill(&this->dyna.actor); + return; } + + func_800BC154(play, &play->actorCtx, &this->dyna.actor, 7); + func_80937DD8(this); } else { s32 params2 = OBJBEAN_GET_3F00(&this->dyna.actor); Path* path = &play->setupPathList[params2]; @@ -509,7 +510,7 @@ void func_80937DEC(ObjBean* this, PlayState* play) { } if (this->unk_1FF && Flags_GetSwitch(play, OBJBEAN_GET_3F80(&this->dyna.actor, 1))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -714,8 +715,11 @@ void func_80938670(ObjBean* this) { void func_8093868C(ObjBean* this, PlayState* play) { if (this->unk_1B2 <= 0) { - Actor_MarkForDeath(&this->dyna.actor); - } else if (this->unk_1B2 <= 20) { + Actor_Kill(&this->dyna.actor); + return; + } + + if (this->unk_1B2 <= 20) { this->dyna.actor.scale.x *= 0.89f; this->dyna.actor.scale.y *= 0.89f; this->dyna.actor.scale.z *= 0.89f; diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h index 5af772007..7699b3427 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h @@ -59,6 +59,4 @@ typedef struct ObjBean { /* 0x200 */ u8 unk_200; } ObjBean; // size = 0x204 -extern const ActorInit Obj_Bean_InitVars; - #endif // Z_OBJ_BEAN_H diff --git a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c index d57c9937d..f8534afea 100644 --- a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c +++ b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c @@ -19,7 +19,7 @@ void ObjBell_Draw(Actor* thisx, PlayState* play); s32 func_80A356D8(ObjBell* this); s32 func_80A357A8(ObjBell* this, PlayState* play); -const ActorInit Obj_Bell_InitVars = { +ActorInit Obj_Bell_InitVars = { ACTOR_OBJ_BELL, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.h b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.h index c55381ad3..a98f29680 100644 --- a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.h +++ b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.h @@ -20,6 +20,4 @@ typedef struct ObjBell { /* 0x224 */ UNK_TYPE1 unk_224[0x04]; } ObjBell; // size = 0x228 -extern const ActorInit Obj_Bell_InitVars; - #endif // Z_OBJ_BELL_H diff --git a/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c b/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c index 7f59fe579..4b7e9f471 100644 --- a/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c +++ b/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c @@ -24,7 +24,7 @@ void func_80AE9180(ObjBigicicle* this, PlayState* play); void func_80AE9258(ObjBigicicle* this, PlayState* play); void func_80AE939C(ObjBigicicle* this, PlayState* play); -const ActorInit Obj_Bigicicle_InitVars = { +ActorInit Obj_Bigicicle_InitVars = { ACTOR_OBJ_BIGICICLE, ACTORCAT_PROP, FLAGS, @@ -126,7 +126,7 @@ void ObjBigicicle_Init(Actor* thisx, PlayState* play) { this->collider2.dim.yShift = this->collider2.dim.yShift * sp30; if (Flags_GetSwitch(play, this->actor.params)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -285,7 +285,7 @@ void func_80AE939C(ObjBigicicle* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_GLASSBROKEN_IMPACT); ActorCutscene_Stop(this->actor.cutscene); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void ObjBigicicle_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.h b/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.h index 7e28abd45..2eb5a00bd 100644 --- a/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.h +++ b/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.h @@ -19,6 +19,4 @@ typedef struct ObjBigicicle { /* 0x198 */ ColliderCylinder collider2; } ObjBigicicle; // size = 0x1E4 -extern const ActorInit Obj_Bigicicle_InitVars; - #endif // Z_OBJ_BIGICICLE_H diff --git a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c index 9c35b0298..437f0c234 100644 --- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c +++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c @@ -17,7 +17,7 @@ void ObjBlockstop_Update(Actor* thisx, PlayState* play); void ObjBlockstop_CheckForBlock(ObjBlockstop* this, PlayState* play); void ObjBlockstop_TryPlayCutscene(ObjBlockstop* this, PlayState* play); -const ActorInit Obj_Blockstop_InitVars = { +ActorInit Obj_Blockstop_InitVars = { ACTOR_OBJ_BLOCKSTOP, ACTORCAT_PROP, FLAGS, @@ -33,7 +33,7 @@ void ObjBlockstop_Init(Actor* thisx, PlayState* play) { ObjBlockstop* this = THIS; if (Flags_GetSwitch(play, this->actor.params)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } this->actionFunc = ObjBlockstop_CheckForBlock; } @@ -62,7 +62,7 @@ void ObjBlockstop_TryPlayCutscene(ObjBlockstop* this, PlayState* play) { if (ActorCutscene_GetLength(this->actor.cutscene) != -1) { ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } ActorCutscene_SetIntentToPlay(this->actor.cutscene); diff --git a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.h b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.h index 95af6757c..15d45a90b 100644 --- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.h +++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.h @@ -12,6 +12,4 @@ typedef struct ObjBlockstop { /* 0x144 */ ObjBlockstopActionFunc actionFunc; } ObjBlockstop; // size = 0x148 -extern const ActorInit Obj_Blockstop_InitVars; - #endif // Z_OBJ_BLOCKSTOP_H diff --git a/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c b/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c index 1fca2a001..6545b98e5 100644 --- a/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c +++ b/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c @@ -18,7 +18,7 @@ void ObjBoat_Draw(Actor* thisx, PlayState* play); void func_80B9B428(Actor* thisx, PlayState* play2); -const ActorInit Obj_Boat_InitVars = { +ActorInit Obj_Boat_InitVars = { ACTOR_OBJ_BOAT, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.h b/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.h index a3ed2b147..795c50689 100644 --- a/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.h +++ b/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.h @@ -20,6 +20,4 @@ typedef struct ObjBoat { /* 0x164 */ Vec3s* unk_164; } ObjBoat; // size = 0x168 -extern const ActorInit Obj_Boat_InitVars; - #endif // Z_OBJ_BOAT_H diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index 27f3e13aa..84b2abc63 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -24,7 +24,7 @@ void func_8093A1F0(ObjBombiwa* this, PlayState* play); void func_8093A418(Actor* thisx, PlayState* play); void func_8093A608(Actor* thisx, PlayState* play); -const ActorInit Obj_Bombiwa_InitVars = { +ActorInit Obj_Bombiwa_InitVars = { ACTOR_OBJ_BOMBIWA, ACTORCAT_PROP, FLAGS, @@ -183,7 +183,7 @@ void ObjBombiwa_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); if (Flags_GetSwitch(play, OBJBOMBIWA_GET_7F(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -350,7 +350,7 @@ void func_80939EF4(ObjBombiwa* this, PlayState* play) { if (params == OBJBOMBIWA_100_0) { func_80939794(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { func_80939994(play, &this->actor.world.pos); this->actor.flags |= ACTOR_FLAG_10; @@ -439,7 +439,7 @@ void func_8093A1F0(ObjBombiwa* this, PlayState* play) { this->unk_201--; if ((this->unk_200 >= 4) || (this->unk_201 <= 0)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h index 50e0bbf92..b49a89323 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h @@ -32,6 +32,4 @@ typedef struct ObjBombiwa { /* 0x204 */ ObjBombiwaActionFunc actionFunc; } ObjBombiwa; // size = 0x208 -extern const ActorInit Obj_Bombiwa_InitVars; - #endif // Z_OBJ_BOMBIWA_H diff --git a/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c b/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c index 79da4f332..387d79616 100644 --- a/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c +++ b/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c @@ -18,7 +18,7 @@ void ObjBoyo_Destroy(Actor* thisx, PlayState* play2); void ObjBoyo_Update(Actor* thisx, PlayState* play2); void ObjBoyo_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Boyo_InitVars = { +ActorInit Obj_Boyo_InitVars = { ACTOR_OBJ_BOYO, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.h b/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.h index 69e188530..dcff2a893 100644 --- a/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.h +++ b/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.h @@ -28,6 +28,4 @@ typedef struct ObjBoyo { /* 0x1AC */ s16 unk_1AC; } ObjBoyo; // size = 0x1B0 -extern const ActorInit Obj_Boyo_InitVars; - #endif // Z_OBJ_BOYO_H diff --git a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c index d387436be..e77ea9890 100644 --- a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c +++ b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c @@ -28,7 +28,7 @@ void ObjChan_Draw(Actor* thisx, PlayState* play); void ObjChan_ChandelierAction(ObjChan* this2, PlayState* play); void ObjChan_PotAction(ObjChan* this, PlayState* play); -const ActorInit Obj_Chan_InitVars = { +ActorInit Obj_Chan_InitVars = { ACTOR_OBJ_CHAN, ACTORCAT_BG, FLAGS, @@ -83,7 +83,7 @@ void ObjChan_Init(Actor* thisx, PlayState* play) { if (OBJCHAN_SUBTYPE(&this->actor) == OBJCHAN_SUBTYPE_CHANDELIER) { if (sObjChanLoaded) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actor.room = -1; @@ -169,7 +169,7 @@ void ObjChan_InitChandelier(ObjChan* this2, PlayState* play) { true, &sp90)) { this->unk1CC = this->actor.world.pos.y - this->unk1C0.y; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -184,7 +184,7 @@ void ObjChan_InitChandelier(ObjChan* this2, PlayState* play) { temp_v0->myPotIndex = i; temp_v0->actor.cutscene = this->actor.cutscene; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -317,7 +317,7 @@ void ObjChan_PotAction(ObjChan* this, PlayState* play) { this->actor.cutscene, this->actor.unk20, NULL); } } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.h b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.h index a3a4e6d93..f08f18adf 100644 --- a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.h +++ b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.h @@ -57,6 +57,4 @@ typedef struct ObjChan { /* 0x1E0 */ s16 cutscenes[2]; } ObjChan; // size = 0x1E4 -extern const ActorInit Obj_Chan_InitVars; - #endif // Z_OBJ_CHAN_H diff --git a/src/overlays/actors/ovl_Obj_Chikuwa/z_obj_chikuwa.c b/src/overlays/actors/ovl_Obj_Chikuwa/z_obj_chikuwa.c index 5fc5d6b31..0c888a4ac 100644 --- a/src/overlays/actors/ovl_Obj_Chikuwa/z_obj_chikuwa.c +++ b/src/overlays/actors/ovl_Obj_Chikuwa/z_obj_chikuwa.c @@ -17,7 +17,7 @@ void ObjChikuwa_Destroy(Actor* thisx, PlayState* play); void ObjChikuwa_Update(Actor* thisx, PlayState* play); void ObjChikuwa_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Chikuwa_InitVars = { +ActorInit Obj_Chikuwa_InitVars = { ACTOR_OBJ_CHIKUWA, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Chikuwa/z_obj_chikuwa.h b/src/overlays/actors/ovl_Obj_Chikuwa/z_obj_chikuwa.h index 7ebba3021..ee5174246 100644 --- a/src/overlays/actors/ovl_Obj_Chikuwa/z_obj_chikuwa.h +++ b/src/overlays/actors/ovl_Obj_Chikuwa/z_obj_chikuwa.h @@ -34,6 +34,4 @@ typedef struct ObjChikuwa { /* 0x9A6 */ u8 unk_9A6; } ObjChikuwa; // size = 0x9A8 -extern const ActorInit Obj_Chikuwa_InitVars; - #endif // Z_OBJ_CHIKUWA_H diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index ef1feb1a9..367bf1619 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -22,7 +22,7 @@ void func_8098DEA0(ObjComb* this, PlayState* play); void func_8098E098(ObjComb* this); void func_8098E0B8(ObjComb* this, PlayState* play); -const ActorInit Obj_Comb_InitVars = { +ActorInit Obj_Comb_InitVars = { ACTOR_OBJ_COMB, ACTORCAT_PROP, FLAGS, @@ -335,7 +335,7 @@ void ObjComb_Init(Actor* thisx, PlayState* play) { Collider_InitJntSph(play, &this->collider); if ((sp2C == 1) && OBJCOMB_GET_10(&this->actor) && (gSaveContext.save.weekEventReg[83] & 2)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -383,7 +383,7 @@ void func_8098DC60(ObjComb* this, PlayState* play) { if (this->collider.elements->info.acHitInfo->toucher.dmgFlags & 0x0182C29C) { func_8098CEAC(this, play); func_8098DA74(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { s32 dmgFlags = this->collider.elements->info.acHitInfo->toucher.dmgFlags; @@ -489,7 +489,7 @@ void func_8098E098(ObjComb* this) { void func_8098E0B8(ObjComb* this, PlayState* play) { this->unk_1B4--; if (this->unk_1B4 <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h index ed5188576..0ee61baaf 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h @@ -34,6 +34,4 @@ typedef struct ObjComb { /* 0x1B8 */ s8 unk_1B8; } ObjComb; // size = 0x1BC -extern const ActorInit Obj_Comb_InitVars; - #endif // Z_OBJ_COMB_H diff --git a/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c b/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c index be3f365e3..9daa20bad 100644 --- a/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c +++ b/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c @@ -21,7 +21,7 @@ void ObjDanpeilift_Move(ObjDanpeilift* this, PlayState* play); void ObjDanpeilift_Teleport(ObjDanpeilift* this, PlayState* play); void ObjDanpeilift_Wait(ObjDanpeilift* this, PlayState* play); -const ActorInit Obj_Danpeilift_InitVars = { +ActorInit Obj_Danpeilift_InitVars = { ACTOR_OBJ_DANPEILIFT, ACTORCAT_BG, FLAGS, @@ -57,23 +57,24 @@ void ObjDanpeilift_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 1); DynaPolyActor_LoadMesh(play, &this->dyna, &object_obj_danpeilift_Colheader_000BA0); if (this->dyna.bgId == BG_ACTOR_MAX) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); + return; + } + + this->speed = OBJDANPEILIFT_GET_SPEED(thisx); + if (this->speed < 0.0f) { + this->speed = -this->speed; + } + if (this->speed < 0.01f) { + this->actionFunc = ObjDanpeilift_DoNothing; } else { - this->speed = OBJDANPEILIFT_GET_SPEED(thisx); - if (this->speed < 0.0f) { - this->speed = -this->speed; - } - if (this->speed < 0.01f) { - this->actionFunc = ObjDanpeilift_DoNothing; - } else { - path = &play->setupPathList[OBJDANPEILIFT_GET_PATH(thisx)]; - this->curPoint = OBJDANPEILIFT_GET_STARTING_POINT(thisx); - this->endPoint = path->count - 1; - this->direction = 1; - this->points = Lib_SegmentedToVirtual(path->points); - ObjDanpeilift_UpdatePosition(this, this->curPoint); - this->actionFunc = ObjDanpeilift_Move; - } + path = &play->setupPathList[OBJDANPEILIFT_GET_PATH(thisx)]; + this->curPoint = OBJDANPEILIFT_GET_STARTING_POINT(thisx); + this->endPoint = path->count - 1; + this->direction = 1; + this->points = Lib_SegmentedToVirtual(path->points); + ObjDanpeilift_UpdatePosition(this, this->curPoint); + this->actionFunc = ObjDanpeilift_Move; } } diff --git a/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.h b/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.h index 31f6b90c4..392d5d4ca 100644 --- a/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.h +++ b/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.h @@ -32,6 +32,4 @@ typedef struct ObjDanpeilift { /* 0x188 */ s16 cutsceneTimer; } ObjDanpeilift; // size = 0x18C -extern const ActorInit Obj_Danpeilift_InitVars; - #endif // Z_OBJ_DANPEILIFT_H diff --git a/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c b/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c index 6cc8e2d04..060e793ca 100644 --- a/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c +++ b/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c @@ -17,7 +17,7 @@ void func_80983678(ObjDemo* this, PlayState* play); void func_80983704(ObjDemo* this, PlayState* play); void func_80983634(PlayState* play); -const ActorInit Obj_Demo_InitVars = { +ActorInit Obj_Demo_InitVars = { ACTOR_OBJ_DEMO, ACTORCAT_PROP, FLAGS, @@ -34,7 +34,7 @@ void ObjDemo_Init(Actor* thisx, PlayState* play) { thisx->params = OBJDEMO_GET_FF(thisx); if ((thisx->params != OBJDEMO_FF_FF) && (Flags_GetSwitch(play, thisx->params))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (thisx->shape.rot.x < 0) { @@ -96,7 +96,7 @@ void func_80983704(ObjDemo* this, PlayState* play) { if (this->actor.params != 0xFF) { Flags_SetSwitch(play, this->actor.params); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { ActorCutscene_SetIntentToPlay(this->actor.cutscene); @@ -109,7 +109,7 @@ void ObjDemo_Update(Actor* thisx, PlayState* play) { ObjDemo* this = THIS; if ((this->actor.params != 0xFF) && Flags_GetSwitch(play, this->actor.params)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc(this, play); diff --git a/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.h b/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.h index be774bf07..065a21fe9 100644 --- a/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.h +++ b/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.h @@ -17,6 +17,4 @@ typedef struct ObjDemo { /* 0x150 */ f32 yRange; } ObjDemo; // size = 0x154 -extern const ActorInit Obj_Demo_InitVars; - #endif // Z_OBJ_DEMO_H diff --git a/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.c b/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.c index fa92bd2e3..fce6d99ec 100644 --- a/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.c +++ b/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.c @@ -28,7 +28,7 @@ void func_80B139F4(ObjDhouse* this, PlayState* play); void func_80B13C08(Actor* thisx, PlayState* play); void func_80B13E40(Actor* thisx, PlayState* play); -const ActorInit Obj_Dhouse_InitVars = { +ActorInit Obj_Dhouse_InitVars = { ACTOR_OBJ_DHOUSE, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.h b/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.h index 807af52f9..c03dbed7d 100644 --- a/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.h +++ b/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.h @@ -45,6 +45,4 @@ typedef struct ObjDhouse { /* 0x1370 */ s16 unk_1370; } ObjDhouse; // size = 0x1374 -extern const ActorInit Obj_Dhouse_InitVars; - #endif // Z_OBJ_DHOUSE_H diff --git a/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c b/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c index 4c8f38350..0b6a6b988 100644 --- a/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c +++ b/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c @@ -16,7 +16,7 @@ void ObjDinner_Destroy(Actor* thisx, PlayState* play); void ObjDinner_Update(Actor* thisx, PlayState* play); void ObjDinner_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Dinner_InitVars = { +ActorInit Obj_Dinner_InitVars = { ACTOR_OBJ_DINNER, ACTORCAT_PROP, FLAGS, @@ -32,7 +32,7 @@ void ObjDinner_Init(Actor* thisx, PlayState* play) { ObjDinner* this = THIS; if (gSaveContext.save.isNight != true || (CURRENT_DAY == 3 && gSaveContext.save.weekEventReg[22] & 1)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Actor_SetScale(&this->actor, 0.1f); } diff --git a/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.h b/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.h index 8dc49ee48..a27dce28b 100644 --- a/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.h +++ b/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.h @@ -10,6 +10,4 @@ typedef struct ObjDinner { /* 0x144 */ char unk_144[0x4]; } ObjDinner; // size = 0x148 -extern const ActorInit Obj_Dinner_InitVars; - #endif // Z_OBJ_DINNER_H diff --git a/src/overlays/actors/ovl_Obj_Dora/z_obj_dora.c b/src/overlays/actors/ovl_Obj_Dora/z_obj_dora.c index c8b9926c5..9b6c81266 100644 --- a/src/overlays/actors/ovl_Obj_Dora/z_obj_dora.c +++ b/src/overlays/actors/ovl_Obj_Dora/z_obj_dora.c @@ -35,7 +35,7 @@ typedef enum { /* 0xF */ DORA_DMGEFF_LIGHT } ObjDoraDamageEffect; -const ActorInit Obj_Dora_InitVars = { +ActorInit Obj_Dora_InitVars = { ACTOR_OBJ_DORA, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Dora/z_obj_dora.h b/src/overlays/actors/ovl_Obj_Dora/z_obj_dora.h index ece93f627..3c1b17f2a 100644 --- a/src/overlays/actors/ovl_Obj_Dora/z_obj_dora.h +++ b/src/overlays/actors/ovl_Obj_Dora/z_obj_dora.h @@ -21,6 +21,4 @@ typedef struct ObjDora { /* 0x3AA */ s16 unk3AA; // Set but not used } ObjDora; // size = 0x3AC -extern const ActorInit Obj_Dora_InitVars; - #endif // Z_OBJ_DORA_H diff --git a/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c b/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c index 0c0177d2f..01675c173 100644 --- a/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c +++ b/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c @@ -17,7 +17,7 @@ void ObjDowsing_Update(Actor* thisx, PlayState* play); s32 ObjDowsing_GetFlag(ObjDowsing* this, PlayState* play); s32 ObjDowsing_CheckValidSpawn(ObjDowsing* this, PlayState* play); -const ActorInit Obj_Dowsing_InitVars = { +ActorInit Obj_Dowsing_InitVars = { ACTOR_OBJ_DOWSING, ACTORCAT_ITEMACTION, FLAGS, @@ -46,7 +46,7 @@ s32 ObjDowsing_GetFlag(ObjDowsing* this, PlayState* play) { s32 ObjDowsing_CheckValidSpawn(ObjDowsing* this, PlayState* play) { if (ObjDowsing_GetFlag(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return true; } return false; diff --git a/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.h b/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.h index 7b1125a28..879c99d80 100644 --- a/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.h +++ b/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.h @@ -18,6 +18,4 @@ typedef struct ObjDowsing { /* 0x000 */ Actor actor; } ObjDowsing; // size = 0x144 -extern const ActorInit Obj_Dowsing_InitVars; - #endif // Z_OBJ_DOWSING_H diff --git a/src/overlays/actors/ovl_Obj_Driftice/z_obj_driftice.c b/src/overlays/actors/ovl_Obj_Driftice/z_obj_driftice.c index 5db059252..f0eaaf25a 100644 --- a/src/overlays/actors/ovl_Obj_Driftice/z_obj_driftice.c +++ b/src/overlays/actors/ovl_Obj_Driftice/z_obj_driftice.c @@ -25,7 +25,7 @@ void func_80A67450(ObjDriftice* this, PlayState* play); void func_80A674A8(ObjDriftice* this); void func_80A674C4(ObjDriftice* this, PlayState* play); -const ActorInit Obj_Driftice_InitVars = { +ActorInit Obj_Driftice_InitVars = { ACTOR_OBJ_DRIFTICE, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Driftice/z_obj_driftice.h b/src/overlays/actors/ovl_Obj_Driftice/z_obj_driftice.h index e2f37350a..21e0f8f27 100644 --- a/src/overlays/actors/ovl_Obj_Driftice/z_obj_driftice.h +++ b/src/overlays/actors/ovl_Obj_Driftice/z_obj_driftice.h @@ -56,6 +56,6 @@ typedef struct ObjDriftice { /* 0x24C */ s32 unk_24C; } ObjDriftice; // size = 0x250 -extern const ActorInit Obj_Driftice_InitVars; +extern ActorInit Obj_Driftice_InitVars; #endif // Z_OBJ_DRIFTICE_H diff --git a/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c b/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c index d2da273b5..fd2bf4c02 100644 --- a/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c +++ b/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c @@ -15,7 +15,7 @@ void ObjEnding_Init(Actor* thisx, PlayState* play); void ObjEnding_Update(Actor* thisx, PlayState* play); void ObjEnding_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Ending_InitVars = { +ActorInit Obj_Ending_InitVars = { ACTOR_OBJ_ENDING, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.h b/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.h index 163134f36..dfe6a83ea 100644 --- a/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.h +++ b/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.h @@ -16,6 +16,4 @@ typedef struct ObjEnding { /* 0x148 */ AnimatedMaterial* animMat; } ObjEnding; // size = 0x14C -extern const ActorInit Obj_Ending_InitVars; - #endif // Z_OBJ_ENDING_H diff --git a/src/overlays/actors/ovl_Obj_Entotu/z_obj_entotu.c b/src/overlays/actors/ovl_Obj_Entotu/z_obj_entotu.c index cd7106240..723dfcf3e 100644 --- a/src/overlays/actors/ovl_Obj_Entotu/z_obj_entotu.c +++ b/src/overlays/actors/ovl_Obj_Entotu/z_obj_entotu.c @@ -16,7 +16,7 @@ void ObjEntotu_Destroy(Actor* thisx, PlayState* play); void ObjEntotu_Update(Actor* thisx, PlayState* play); void ObjEntotu_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Entotu_InitVars = { +ActorInit Obj_Entotu_InitVars = { ACTOR_OBJ_ENTOTU, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Entotu/z_obj_entotu.h b/src/overlays/actors/ovl_Obj_Entotu/z_obj_entotu.h index a00a7fcd4..ba667b6c7 100644 --- a/src/overlays/actors/ovl_Obj_Entotu/z_obj_entotu.h +++ b/src/overlays/actors/ovl_Obj_Entotu/z_obj_entotu.h @@ -14,6 +14,4 @@ typedef struct ObjEntotu { /* 0x1C6 */ s16 unk_1C6; } ObjEntotu; // size = 0x1C8 -extern const ActorInit Obj_Entotu_InitVars; - #endif // Z_OBJ_ENTOTU_H diff --git a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c index f8a7d38d7..ceedeb6c4 100644 --- a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c +++ b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c @@ -20,7 +20,7 @@ void ObjEtcetera_Setup(ObjEtcetera* this, PlayState* play); void ObjEtcetera_DrawIdle(Actor* thisx, PlayState* play); void ObjEtcetera_DrawAnimated(Actor* thisx, PlayState* play); -const ActorInit Obj_Etcetera_InitVars = { +ActorInit Obj_Etcetera_InitVars = { ACTOR_OBJ_ETCETERA, ACTORCAT_BG, FLAGS, @@ -135,7 +135,7 @@ void ObjEtcetera_Idle(ObjEtcetera* this, PlayState* play) { s16 minOscillationTimer; Player* player = GET_PLAYER(play); - if ((player->stateFlags3 & 0x200) && (this->dyna.actor.xzDistToPlayer < 20.0f)) { + if ((player->stateFlags3 & PLAYER_STATE3_200) && (this->dyna.actor.xzDistToPlayer < 20.0f)) { // Player is launching out of the Deku Flower Animation_Change(&this->skelAnime, &gDekuFlowerBounceAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gDekuFlowerBounceAnim), ANIMMODE_ONCE, 0.0f); @@ -146,7 +146,7 @@ void ObjEtcetera_Idle(ObjEtcetera* this, PlayState* play) { this->bounceOscillationScale = 0.003f; this->oscillationTimer = 30; this->burrowFlag &= ~1; - } else if ((player->stateFlags3 & 0x2000) && (this->dyna.actor.xzDistToPlayer < 30.0f) && + } else if ((player->stateFlags3 & PLAYER_STATE3_2000) && (this->dyna.actor.xzDistToPlayer < 30.0f) && (this->dyna.actor.playerHeightRel > 0.0f)) { // Player is hovering above the Deku Flower minOscillationTimer = 10 - (s32)(this->dyna.actor.playerHeightRel * 0.05f); @@ -159,7 +159,8 @@ void ObjEtcetera_Idle(ObjEtcetera* this, PlayState* play) { // Player is walking onto the Deku Flower, or falling on it from a height this->oscillationTimer = 10; ObjEtcetera_StartRustleAnimation(this); - } else if ((player->actor.speedXZ > 0.1f) || ((player->unk_ABC < 0.0f) && !(player->stateFlags3 & 0x100))) { + } else if ((player->actor.speedXZ > 0.1f) || + ((player->unk_ABC < 0.0f) && !(player->stateFlags3 & PLAYER_STATE3_100))) { // Player is walking on top of the Deku Flower, is at the very start of burrowing, or is at the very // start of launching this->oscillationTimer = 10; diff --git a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.h b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.h index 33810ae06..1805e151a 100644 --- a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.h +++ b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.h @@ -33,6 +33,4 @@ typedef struct ObjEtcetera { /* 0x280 */ ObjEtceteraActionFunc actionFunc; } ObjEtcetera; // size = 0x284 -extern const ActorInit Obj_Etcetera_InitVars; - #endif // Z_OBJ_ETCETERA_H diff --git a/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.c b/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.c index 54bd7966c..a4c4e21d2 100644 --- a/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.c +++ b/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.c @@ -22,7 +22,7 @@ void func_80A4CC54(ObjFireshield* this); void func_80A4CCBC(ObjFireshield* this); void func_80A4CD28(ObjFireshield* this); -const ActorInit Obj_Fireshield_InitVars = { +ActorInit Obj_Fireshield_InitVars = { ACTOR_OBJ_FIRESHIELD, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.h b/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.h index bc01ceac4..ffe1d7a35 100644 --- a/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.h +++ b/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.h @@ -28,6 +28,4 @@ typedef struct ObjFireshield { /* 0x1A8 */ s8 unk_1A8; } ObjFireshield; // size = 0x1AC -extern const ActorInit Obj_Fireshield_InitVars; - #endif // Z_OBJ_FIRESHIELD_H diff --git a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c index c4ebe8063..49e8ac934 100644 --- a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c +++ b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c @@ -31,7 +31,7 @@ s16 D_80A1DA3C; s16 D_80A1DA3E; s16 D_80A1DA40; -const ActorInit Obj_Flowerpot_InitVars = { +ActorInit Obj_Flowerpot_InitVars = { ACTOR_OBJ_FLOWERPOT, ACTORCAT_PROP, FLAGS, @@ -464,7 +464,7 @@ void func_80A1C838(ObjFlowerpot* this, PlayState* play) { } func_80A1BD80(this, play); func_80A1B994(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if ((this->collider.elements[0].info.bumperFlags & BUMP_HIT) && (this->collider.elements[0].info.acHitInfo->toucher.dmgFlags & 0x058BFFBC)) { if (!(this->unk_1EA & 2)) { @@ -475,7 +475,7 @@ void func_80A1C838(ObjFlowerpot* this, PlayState* play) { } func_80A1BA44(this, play); func_80A1B994(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { if (this->collider.elements[1].info.bumperFlags & BUMP_HIT) { if (!(this->unk_1EA & 2)) { @@ -610,7 +610,7 @@ void func_80A1CEF4(ObjFlowerpot* this2, PlayState* play) { } func_80A1BA44(this, play); func_80A1B994(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -624,7 +624,7 @@ void func_80A1CEF4(ObjFlowerpot* this2, PlayState* play) { func_80A1BD80(this, play); func_80A1B994(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.h b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.h index 3e803672c..ec1ec43bb 100644 --- a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.h +++ b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.h @@ -21,6 +21,4 @@ typedef struct ObjFlowerpot { /* 0x1EC */ s8 unk_1EC; } ObjFlowerpot; // size = 0x1F0 -extern const ActorInit Obj_Flowerpot_InitVars; - #endif // Z_OBJ_FLOWERPOT_H diff --git a/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.c b/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.c index 99a481577..c3d4d1398 100644 --- a/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.c +++ b/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.c @@ -14,7 +14,7 @@ void ObjFunen_Init(Actor* thisx, PlayState* play); void ObjFunen_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Funen_InitVars = { +ActorInit Obj_Funen_InitVars = { ACTOR_OBJ_FUNEN, ACTORCAT_PROP, FLAGS, OBJECT_FUNEN, sizeof(ObjFunen), (ActorFunc)ObjFunen_Init, (ActorFunc)Actor_Noop, (ActorFunc)Actor_Noop, (ActorFunc)ObjFunen_Draw, diff --git a/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.h b/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.h index dfafc94cf..eb7ca5e2b 100644 --- a/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.h +++ b/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.h @@ -9,6 +9,4 @@ typedef struct ObjFunen { /* 0x000 */ Actor actor; } ObjFunen; // size = 0x144 -extern const ActorInit Obj_Funen_InitVars; - #endif // Z_OBJ_FUNEN_H diff --git a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c index 343a8f61e..315c7dc0f 100644 --- a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c +++ b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c @@ -24,7 +24,7 @@ void func_80B3C39C(ObjGhaka* this, PlayState* play); void func_80B3C4E0(ObjGhaka* this, PlayState* play); void func_80B3C624(ObjGhaka* this, PlayState* play); -const ActorInit Obj_Ghaka_InitVars = { +ActorInit Obj_Ghaka_InitVars = { ACTOR_OBJ_GHAKA, ACTORCAT_PROP, FLAGS, @@ -89,7 +89,7 @@ void func_80B3C39C(ObjGhaka* this, PlayState* play) { player->transformation == PLAYER_FORM_GORON) { func_80B3C2B0(this); } else { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } @@ -136,7 +136,7 @@ void func_80B3C624(ObjGhaka* this, PlayState* play) { this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z + this->unk_168; if (stepTemp) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; func_80B3C2C4(this, play); gSaveContext.save.weekEventReg[20] |= 0x20; @@ -159,7 +159,7 @@ void ObjGhaka_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 0x4); if (this->dyna.actor.floorPoly == 0) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } if (gSaveContext.save.weekEventReg[20] & 0x20) { func_80B3C2C4(this, play); diff --git a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.h b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.h index 34c71f6b8..5eb92f1e6 100644 --- a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.h +++ b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.h @@ -14,6 +14,4 @@ typedef struct ObjGhaka { /* 0x168 */ s16 unk_168; } ObjGhaka; // size = 0x16C -extern const ActorInit Obj_Ghaka_InitVars; - #endif // Z_OBJ_GHAKA_H diff --git a/src/overlays/actors/ovl_Obj_Grass/z_obj_grass.c b/src/overlays/actors/ovl_Obj_Grass/z_obj_grass.c index df880906e..3414aaafa 100644 --- a/src/overlays/actors/ovl_Obj_Grass/z_obj_grass.c +++ b/src/overlays/actors/ovl_Obj_Grass/z_obj_grass.c @@ -26,7 +26,7 @@ f32 D_809AAE10[20]; #include "overlays/ovl_Obj_Grass/ovl_Obj_Grass.c" -const ActorInit Obj_Grass_InitVars = { +ActorInit Obj_Grass_InitVars = { ACTOR_OBJ_GRASS, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Grass/z_obj_grass.h b/src/overlays/actors/ovl_Obj_Grass/z_obj_grass.h index be73c70b5..fffcdad4e 100644 --- a/src/overlays/actors/ovl_Obj_Grass/z_obj_grass.h +++ b/src/overlays/actors/ovl_Obj_Grass/z_obj_grass.h @@ -43,6 +43,4 @@ typedef struct ObjGrass { /* 0x3298 */ struct ObjGrassCarry* unk_3298[2]; } ObjGrass; // size = 0x32A0 -extern const ActorInit Obj_Grass_InitVars; - #endif // Z_OBJ_GRASS_H diff --git a/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c b/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c index 11c8619ce..568e10141 100644 --- a/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c +++ b/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c @@ -29,7 +29,7 @@ void func_809AB6FC(ObjGrassCarry* this); void func_809AB77C(ObjGrassCarry* this, PlayState* play); void func_809ABB7C(Actor* this, PlayState* play); -const ActorInit Obj_Grass_Carry_InitVars = { +ActorInit Obj_Grass_Carry_InitVars = { ACTOR_OBJ_GRASS_CARRY, ACTORCAT_PROP, FLAGS, @@ -347,7 +347,7 @@ void ObjGrassCarry_Update(Actor* thisx, PlayState* play) { if (this->unk_190 == NULL) { if ((this->actionFunc != func_809AB610) && (this->actionFunc != func_809AB77C)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } diff --git a/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.h b/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.h index 0e59033fc..fa870305e 100644 --- a/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.h +++ b/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.h @@ -19,6 +19,4 @@ typedef struct ObjGrassCarry { /* 0x19C */ ObjGrassCarryActionFunc actionFunc; } ObjGrassCarry; // size = 0x1A0 -extern const ActorInit Obj_Grass_Carry_InitVars; - #endif // Z_OBJ_GRASS_CARRY_H diff --git a/src/overlays/actors/ovl_Obj_Grass_Unit/z_obj_grass_unit.c b/src/overlays/actors/ovl_Obj_Grass_Unit/z_obj_grass_unit.c index 125c78850..c57ed608f 100644 --- a/src/overlays/actors/ovl_Obj_Grass_Unit/z_obj_grass_unit.c +++ b/src/overlays/actors/ovl_Obj_Grass_Unit/z_obj_grass_unit.c @@ -13,7 +13,7 @@ void ObjGrassUnit_Init(Actor* thisx, PlayState* play); #if 0 -const ActorInit Obj_Grass_Unit_InitVars = { +ActorInit Obj_Grass_Unit_InitVars = { ACTOR_OBJ_GRASS_UNIT, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Grass_Unit/z_obj_grass_unit.h b/src/overlays/actors/ovl_Obj_Grass_Unit/z_obj_grass_unit.h index 113132e5e..58a8a427a 100644 --- a/src/overlays/actors/ovl_Obj_Grass_Unit/z_obj_grass_unit.h +++ b/src/overlays/actors/ovl_Obj_Grass_Unit/z_obj_grass_unit.h @@ -9,6 +9,4 @@ typedef struct ObjGrassUnit { /* 0x000 */ Actor actor; } ObjGrassUnit; // size = 0x144 -extern const ActorInit Obj_Grass_Unit_InitVars; - #endif // Z_OBJ_GRASS_UNIT_H diff --git a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c index 8e5a6d4a0..9c38849c9 100644 --- a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c +++ b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c @@ -37,7 +37,7 @@ void func_80B15330(ObjHakaisi* this, PlayState* play); void func_80B1544C(Actor* thisx, PlayState* play); void func_80B154A0(Actor* thisx, PlayState* play); -const ActorInit Obj_Hakaisi_InitVars = { +ActorInit Obj_Hakaisi_InitVars = { ACTOR_OBJ_HAKAISI, ACTORCAT_PROP, FLAGS, @@ -120,13 +120,13 @@ void ObjHakaisi_Init(Actor* thisx, PlayState* play) { } if ((this->switchFlag != -1) && Flags_GetSwitch(play, this->switchFlag)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4); if (this->dyna.actor.floorPoly == NULL) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } func_800C0094(this->dyna.actor.floorPoly, this->dyna.actor.world.pos.x, this->dyna.actor.floorHeight, @@ -406,7 +406,7 @@ void func_80B15330(ObjHakaisi* this, PlayState* play) { if (this->dyna.actor.bgCheckFlags & 2) { func_80B14B6C(this, play, this->dyna.actor.world.pos, 40); func_80B14CF8(play, this->dyna.actor.world.pos, 100, 30, 10); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } Matrix_RotateAxisS(this->unk_19C, &this->unk_184, MTXMODE_NEW); diff --git a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.h b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.h index a4e5d233c..ed5341a82 100644 --- a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.h +++ b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.h @@ -24,6 +24,4 @@ typedef struct ObjHakaisi { /* 0x19E */ u8 unk_19E; } ObjHakaisi; // size = 0x1A0 -extern const ActorInit Obj_Hakaisi_InitVars; - #endif // Z_OBJ_HAKAISI_H diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index 11baddb38..752b669cf 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -16,7 +16,7 @@ void ObjHamishi_Destroy(Actor* thisx, PlayState* play2); void ObjHamishi_Update(Actor* thisx, PlayState* play); void ObjHamishi_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Hamishi_InitVars = { +ActorInit Obj_Hamishi_InitVars = { ACTOR_OBJ_HAMISHI, ACTORCAT_PROP, FLAGS, @@ -181,7 +181,7 @@ void ObjHamishi_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 2.3f); if (Flags_GetSwitch(play, OBJHAMISHI_GET_SWITCHFLAG(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -233,7 +233,7 @@ void ObjHamishi_Update(Actor* thisx, PlayState* play) { func_809A10F4(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); Flags_SetSwitch(play, OBJHAMISHI_GET_SWITCHFLAG(&this->actor)); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } } diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h index da838d480..962a59612 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h @@ -21,6 +21,4 @@ typedef struct ObjHamishi { /* 0x1A2 */ u8 unk_1A2; } ObjHamishi; // size = 0x1A4 -extern const ActorInit Obj_Hamishi_InitVars; - #endif // Z_OBJ_HAMISHI_H diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c index 6eb0b0adc..97fbbec3d 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c @@ -16,7 +16,7 @@ void ObjHana_Destroy(Actor* thisx, PlayState* play); void ObjHana_Update(Actor* thisx, PlayState* play); void ObjHana_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Hana_InitVars = { +ActorInit Obj_Hana_InitVars = { ACTOR_OBJ_HANA, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h index f885850cd..dd8c4676c 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h @@ -9,6 +9,4 @@ typedef struct ObjHana { /* 0x000 */ Actor actor; } ObjHana; // size = 0x144 -extern const ActorInit Obj_Hana_InitVars; - #endif // Z_OBJ_HANA_H diff --git a/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.c b/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.c index 467dfa8b8..1c33af7fe 100644 --- a/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.c +++ b/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.c @@ -23,7 +23,7 @@ void ObjHariko_SetupBobHead(ObjHariko* this); void ObjHariko_BobHead(ObjHariko* this, PlayState* play); void ObjHariko_CheckForQuakes(ObjHariko* this); -const ActorInit Obj_Hariko_InitVars = { +ActorInit Obj_Hariko_InitVars = { ACTOR_OBJ_HARIKO, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.h b/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.h index 5d9a8e39b..88a51a83f 100644 --- a/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.h +++ b/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.h @@ -16,6 +16,4 @@ typedef struct ObjHariko { /* 0x154 */ s16 unk154; // Set but not used } ObjHariko; // size = 0x158 -extern const ActorInit Obj_Hariko_InitVars; - #endif // Z_OBJ_HARIKO_H diff --git a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c index ae528e3ea..5ecd2a63f 100644 --- a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c +++ b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c @@ -26,7 +26,7 @@ void ObjHgdoor_SetupStopCs(ObjHgdoor* this); void ObjHgdoor_StopCs(ObjHgdoor* this, PlayState* play); s32 ObjHgdoor_Rotate(ObjHgdoor* this, PlayState* play); -const ActorInit Obj_Hgdoor_InitVars = { +ActorInit Obj_Hgdoor_InitVars = { ACTOR_OBJ_HGDOOR, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.h b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.h index 3e0af9e8c..7172952bb 100644 --- a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.h +++ b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.h @@ -19,6 +19,4 @@ typedef struct ObjHgdoor { /* 0x166 */ u16 csAction; } ObjHgdoor; // size = 0x168 -extern const ActorInit Obj_Hgdoor_InitVars; - #endif // Z_OBJ_HGDOOR_H diff --git a/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c b/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c index 9f19241ac..ae047f029 100644 --- a/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c +++ b/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c @@ -21,7 +21,7 @@ void ObjHsStump_Idle(ObjHsStump* this, PlayState* play); void ObjHsStump_SetupAppear(ObjHsStump* this, PlayState* play); void ObjHsStump_Appear(ObjHsStump* this, PlayState* play); -const ActorInit Obj_HsStump_InitVars = { +ActorInit Obj_HsStump_InitVars = { ACTOR_OBJ_HSSTUMP, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.h b/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.h index 1f82a15b1..0f06fdfaf 100644 --- a/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.h +++ b/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.h @@ -20,6 +20,4 @@ typedef struct ObjHsStump { /* 0x168 */ f32 rotFactor; } ObjHsStump; // size = 0x16C -extern const ActorInit Obj_HsStump_InitVars; - #endif // Z_OBJ_HSSTUMP_H diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c index 3339d1440..26d89f00d 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -23,7 +23,7 @@ void func_8093E05C(ObjHsblock* this); void func_8093E0E8(ObjHsblock* this); void func_8093E10C(ObjHsblock* this, PlayState* play); -const ActorInit Obj_Hsblock_InitVars = { +ActorInit Obj_Hsblock_InitVars = { ACTOR_OBJ_HSBLOCK, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h index 0411cc9e4..f91926409 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h @@ -17,6 +17,4 @@ typedef struct ObjHsblock { /* 0x15C */ ObjHsblockActionFunc actionFunc; } ObjHsblock; // size = 0x160 -extern const ActorInit Obj_Hsblock_InitVars; - #endif // Z_OBJ_HSBLOCK_H diff --git a/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c b/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c index 3ad2cf5e8..8210f23d3 100644 --- a/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c +++ b/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c @@ -28,7 +28,7 @@ void func_80A55310(ObjHugebombiwa* this); void func_80A55564(ObjHugebombiwa* this, PlayState* play); void func_80A55B34(Actor* thisx, PlayState* play); -const ActorInit Obj_Hugebombiwa_InitVars = { +ActorInit Obj_Hugebombiwa_InitVars = { ACTOR_OBJ_HUGEBOMBIWA, ACTORCAT_PROP, FLAGS, @@ -341,7 +341,7 @@ void ObjHugebombiwa_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); if (Flags_GetSwitch(play, ENHUGEBOMBIWA_GET_7F(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -524,7 +524,7 @@ void func_80A55064(ObjHugebombiwa* this, PlayState* play) { this->unk_4B2--; if ((this->unk_4B0 >= 20) || (this->unk_4B2 <= 0)) { ActorCutscene_Stop(this->actor.cutscene); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -620,7 +620,7 @@ void func_80A55564(ObjHugebombiwa* this, PlayState* play) { this->unk_4B2--; if ((this->unk_4B0 >= 20) || (this->unk_4B2 <= 0)) { ActorCutscene_Stop(this->actor.cutscene); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.h b/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.h index 67b428182..932a61c3d 100644 --- a/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.h +++ b/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.h @@ -29,6 +29,4 @@ typedef struct ObjHugebombiwa { /* 0x4B4 */ ObjHugebombiwaActionFunc actionFunc; } ObjHugebombiwa; // size = 0x4B8 -extern const ActorInit Obj_Hugebombiwa_InitVars; - #endif // Z_OBJ_HUGEBOMBIWA_H diff --git a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c index 384d1cbad..f35d270a0 100644 --- a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c +++ b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c @@ -46,7 +46,7 @@ ObjHansuiStruct D_80B9DC70[] = { { 3, 3 }, { 3, 5 }, { 3, 1 }, { 3, 6 }, { 3, 2 }, { 3, 4 }, { 3, 0 }, }; -const ActorInit Obj_Hunsui_InitVars = { +ActorInit Obj_Hunsui_InitVars = { ACTOR_OBJ_HUNSUI, ACTORCAT_BG, FLAGS, @@ -239,7 +239,7 @@ void ObjHunsui_Init(Actor* thisx, PlayState* play) { this->dyna.actor.shape.rot.z = 0; this->dyna.actor.room = -1; } else { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } break; @@ -253,7 +253,7 @@ void ObjHunsui_Init(Actor* thisx, PlayState* play) { this->dyna.actor.shape.rot.z = 0; this->dyna.actor.room = -1; } else { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } break; @@ -269,7 +269,7 @@ void ObjHunsui_Init(Actor* thisx, PlayState* play) { this->dyna.actor.room = -1; this->actionFunc = func_80B9D714; // clang-format on } else { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } break; @@ -431,7 +431,7 @@ void func_80B9D120(ObjHunsui* this, PlayState* play) { D_80B9DED8.unk_02 = 0; break; } - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -536,7 +536,7 @@ void func_80B9D508(ObjHunsui* this, PlayState* play) { D_80B9DED8.unk_02 = 0; break; } - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -574,7 +574,7 @@ void func_80B9D714(ObjHunsui* this, PlayState* play) { if ((this->unk_16C != play->roomCtx.curRoom.num) && (this->unk_16C != play->roomCtx.prevRoom.num) && (this->unk_16D != play->roomCtx.curRoom.num) && (this->unk_16D != play->roomCtx.prevRoom.num)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } else { if (Flags_GetSwitch(play, this->unk_168)) { this->unk_172 &= ~2; diff --git a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h index 2f3d968a6..14a2eea62 100644 --- a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h +++ b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h @@ -54,6 +54,4 @@ typedef struct ObjHunsui { /* 0x1B4 */ BgDblueMovebg* unk_1B4; } ObjHunsui; // size = 0x1B8 -extern const ActorInit Obj_Hunsui_InitVars; - #endif // Z_OBJ_HUNSUI_H diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c index 2ba1e4352..cf6588c31 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c @@ -22,7 +22,7 @@ void func_80931A38(ObjIcePoly* this, PlayState* play); void func_80931E58(ObjIcePoly* this, PlayState* play); void func_80931EEC(ObjIcePoly* this, PlayState* play); -const ActorInit Obj_Ice_Poly_InitVars = { +ActorInit Obj_Ice_Poly_InitVars = { ACTOR_OBJ_ICE_POLY, ACTORCAT_ITEMACTION, FLAGS, @@ -117,7 +117,7 @@ void ObjIcePoly_Init(Actor* thisx, PlayState* play) { if (((this->unk_149 != OBJICEPOLY_FF_FF) && Flags_GetSwitch(play, this->unk_149)) || ((play->sceneId == SCENE_KAJIYA) && (gSaveContext.save.weekEventReg[33] & 0x80))) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } @@ -178,7 +178,7 @@ void func_80931A38(ObjIcePoly* this, PlayState* play) { s32 pad3; f32 sp58; - if (!(player->stateFlags2 & 0x4000) && (this->unk_14A != 0)) { + if (!(player->stateFlags2 & PLAYER_STATE2_4000) && (this->unk_14A != 0)) { this->unk_14A--; } @@ -269,12 +269,13 @@ void func_80931E58(ObjIcePoly* this, PlayState* play) { ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); if (this->unk_14A == 1) { func_80931828(this, play); - Actor_MarkForDeath(&this->actor); - } else { - this->unk_14A = 40; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_MELT); - this->actionFunc = func_80931EEC; + Actor_Kill(&this->actor); + return; } + + this->unk_14A = 40; + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_MELT); + this->actionFunc = func_80931EEC; } else { ActorCutscene_SetIntentToPlay(this->actor.cutscene); } @@ -330,7 +331,7 @@ void func_80931EEC(ObjIcePoly* this, PlayState* play) { if (this->unk_149 != OBJICEPOLY_FF_FF) { Flags_SetSwitch(play, this->unk_149); } - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h index 601c5c9e7..b081a7250 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h @@ -21,6 +21,4 @@ typedef struct ObjIcePoly { /* 0x1E4 */ ColliderCylinder colliders2[2]; } ObjIcePoly; // size = 0x27C -extern const ActorInit Obj_Ice_Poly_InitVars; - #endif // Z_OBJ_ICE_POLY_H diff --git a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c index b01f22ae6..8a039c496 100644 --- a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c +++ b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c @@ -45,7 +45,7 @@ void func_80A26B64(ObjIceblock* this, PlayState* play); void func_80A26B74(ObjIceblock* this, PlayState* play); void func_80A26BF8(ObjIceblock* this, PlayState* play); -const ActorInit Obj_Iceblock_InitVars = { +ActorInit Obj_Iceblock_InitVars = { ACTOR_OBJ_ICEBLOCK, ACTORCAT_BG, FLAGS, @@ -849,7 +849,7 @@ void func_80A25404(ObjIceblock* this) { void func_80A2541C(ObjIceblock* this, PlayState* play) { Player* player = GET_PLAYER(play); - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } @@ -1410,7 +1410,7 @@ void func_80A266E0(ObjIceblock* this, PlayState* play) { func_80A2508C(this, play); if (sp20) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.h b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.h index 46ebc0c40..466cd97b7 100644 --- a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.h +++ b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.h @@ -78,6 +78,4 @@ typedef struct ObjIceblock { /* 0x2B4 */ f32 unk_2B4; } ObjIceblock; // size = 0x2B8 -extern const ActorInit Obj_Iceblock_InitVars; - #endif // Z_OBJ_ICEBLOCK_H diff --git a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c index 57e0f4b2e..0f4f83503 100644 --- a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c +++ b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c @@ -16,7 +16,7 @@ void ObjJgGakki_Destroy(Actor* thisx, PlayState* play); void ObjJgGakki_Update(Actor* thisx, PlayState* play); void ObjJgGakki_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Jg_Gakki_InitVars = { +ActorInit Obj_Jg_Gakki_InitVars = { ACTOR_OBJ_JG_GAKKI, ACTORCAT_PROP, FLAGS, @@ -42,7 +42,7 @@ void ObjJgGakki_Init(Actor* thisx, PlayState* play2) { } else if ((play->sceneId == SCENE_17SETUGEN) || (play->sceneId == SCENE_10YUKIYAMANOMURA)) { Animation_Change(&this->skelAnime, &gGoronElderDrumTakeOutAnim, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, 0.0f); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } Actor_SetScale(&this->actor, 0.01f); } diff --git a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.h b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.h index a3e8ae8eb..0da5151a4 100644 --- a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.h +++ b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.h @@ -11,6 +11,4 @@ typedef struct ObjJgGakki { /* 0x188 */ ColliderCylinder collider; } ObjJgGakki; // size = 0x1D4 -extern const ActorInit Obj_Jg_Gakki_InitVars; - #endif // Z_OBJ_JG_GAKKI_H diff --git a/src/overlays/actors/ovl_Obj_Jgame_Light/z_obj_jgame_light.c b/src/overlays/actors/ovl_Obj_Jgame_Light/z_obj_jgame_light.c index 21b764593..af05f0ba3 100644 --- a/src/overlays/actors/ovl_Obj_Jgame_Light/z_obj_jgame_light.c +++ b/src/overlays/actors/ovl_Obj_Jgame_Light/z_obj_jgame_light.c @@ -27,7 +27,7 @@ void func_80C15474(ObjJgameLight* this, PlayState* play); void ObjJgameLight_UpdateCollision(ObjJgameLight* this, PlayState* play); void func_80C15718(ObjJgameLight* this, PlayState* play); -const ActorInit Obj_Jgame_Light_InitVars = { +ActorInit Obj_Jgame_Light_InitVars = { ACTOR_OBJ_JGAME_LIGHT, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Jgame_Light/z_obj_jgame_light.h b/src/overlays/actors/ovl_Obj_Jgame_Light/z_obj_jgame_light.h index a81bbf3cc..0be39f7a6 100644 --- a/src/overlays/actors/ovl_Obj_Jgame_Light/z_obj_jgame_light.h +++ b/src/overlays/actors/ovl_Obj_Jgame_Light/z_obj_jgame_light.h @@ -27,6 +27,4 @@ typedef struct ObjJgameLight { /* 0x1B8 */ u8 prevHealth; } ObjJgameLight; // size = 0x1BC -extern const ActorInit Obj_Jgame_Light_InitVars; - #endif // Z_OBJ_JGAME_LIGHT_H diff --git a/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.c b/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.c index cbe3cecfc..3942fff76 100644 --- a/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.c +++ b/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.c @@ -44,7 +44,7 @@ void ObjKendoKanban_Settled(ObjKendoKanban* this, PlayState* play); void ObjKendoKanban_HandlePhysics(ObjKendoKanban* this, PlayState* play); s32 ObjKendoKanban_IsPlayerOnTop(ObjKendoKanban* this, PlayState* play); -const ActorInit Obj_Kendo_Kanban_InitVars = { +ActorInit Obj_Kendo_Kanban_InitVars = { ACTOR_OBJ_KENDO_KANBAN, ACTORCAT_NPC, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.h b/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.h index 9d01b63fc..72bf6e71e 100644 --- a/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.h +++ b/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.h @@ -31,6 +31,4 @@ typedef struct ObjKendoKanban { /* 0x30C */ u8 boardFragments; } ObjKendoKanban; // size = 0x310 -extern const ActorInit Obj_Kendo_Kanban_InitVars; - #endif // Z_OBJ_KENDO_KANBAN_H diff --git a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c index 28c10781d..abd9b2577 100644 --- a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c +++ b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c @@ -16,7 +16,7 @@ void ObjKepnKoya_Destroy(Actor* thisx, PlayState* play); void ObjKepnKoya_Update(Actor* thisx, PlayState* play); void ObjKepnKoya_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Kepn_Koya_InitVars = { +ActorInit Obj_Kepn_Koya_InitVars = { ACTOR_OBJ_KEPN_KOYA, ACTORCAT_PROP, FLAGS, @@ -41,7 +41,7 @@ void ObjKepnKoya_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); DynaPolyActor_LoadMesh(play, &this->dyna, &object_kepn_koya_Colheader_00805C); if (this->dyna.bgId == BG_ACTOR_MAX) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.h b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.h index ce33c0112..58b4f69a1 100644 --- a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.h +++ b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.h @@ -10,6 +10,4 @@ typedef struct ObjKepnKoya { /* 0x15C */ UNK_TYPE1 unk15C[0x4]; } ObjKepnKoya; // size = 0x160 -extern const ActorInit Obj_Kepn_Koya_InitVars; - #endif // Z_OBJ_KEPN_KOYA_H diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index 9bd2e0442..36927b262 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -36,7 +36,7 @@ static s16 D_80927384 = 0; static s16 D_80927388 = 0; static s16 D_8092738C = 0; -const ActorInit Obj_Kibako_InitVars = { +ActorInit Obj_Kibako_InitVars = { ACTOR_OBJ_KIBAKO, ACTORCAT_PROP, FLAGS, @@ -151,7 +151,7 @@ void ObjKibako_Init(Actor* thisx, PlayState* play2) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->bankIndex = Object_GetIndex(&play->objectCtx, sObjectIdList[whichBankIndex]); if (this->bankIndex < 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->unk199 = this->actor.room; @@ -284,12 +284,12 @@ void ObjKibako_Idle(ObjKibako* this, PlayState* play) { ObjKibako_SpawnCollectible(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else if (this->collider.base.acFlags & AC_HIT) { ObjKibako_AirBreak(this, play); ObjKibako_SpawnCollectible(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { Actor_MoveWithGravity(&this->actor); func_809262BC(this); @@ -388,14 +388,14 @@ void ObjKibako_Thrown(ObjKibako* this, PlayState* play) { ObjKibako_AirBreak(this, play); ObjKibako_SpawnCollectible(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { if (this->actor.bgCheckFlags & 0x40) { ObjKibako_WaterBreak(this, play); ObjKibako_SpawnCollectible(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { if (this->actor.velocity.y < -0.05f) { this->actor.gravity = -2.3f; diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h index b3ef71cca..102dd1e1b 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h @@ -22,6 +22,4 @@ typedef struct ObjKibako { /* 0x199 */ s8 unk199; /* room? */ } ObjKibako; // size = 0x19C -extern const ActorInit Obj_Kibako_InitVars; - #endif // Z_OBJ_KIBAKO_H diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c index d32e7a2cd..06af2a8e3 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -19,7 +19,7 @@ void ObjKibako2_Draw(Actor* thisx, PlayState* play); void ObjKibako2_Idle(ObjKibako2* this, PlayState* play); void ObjKibako2_Kill(ObjKibako2* this, PlayState* play); -const ActorInit Obj_Kibako2_InitVars = { +ActorInit Obj_Kibako2_InitVars = { ACTOR_OBJ_KIBAKO2, ACTORCAT_BG, FLAGS, @@ -221,7 +221,7 @@ void ObjKibako2_Idle(ObjKibako2* this, PlayState* play) { void ObjKibako2_Kill(ObjKibako2* this, PlayState* play) { ObjKibako2_SpawnContents(this, play); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } void ObjKibako2_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h index f1816ab4d..47c8649d9 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h @@ -25,6 +25,4 @@ typedef struct ObjKibako2 { /* 0x1AD */ s8 skulltulaNoiseTimer; } ObjKibako2; // size = 0x1B0 -extern const ActorInit Obj_Kibako2_InitVars; - #endif // Z_OBJ_KIBAKO2_H diff --git a/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.c b/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.c index 24597e4aa..9c9215b24 100644 --- a/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.c +++ b/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.c @@ -16,7 +16,7 @@ void ObjKinoko_Destroy(Actor* thisx, PlayState* play); void ObjKinoko_Update(Actor* thisx, PlayState* play); void ObjKinoko_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Kinoko_InitVars = { +ActorInit Obj_Kinoko_InitVars = { ACTOR_OBJ_KINOKO, ACTORCAT_ITEMACTION, FLAGS, @@ -49,7 +49,7 @@ void ObjKinoko_Update(Actor* thisx, PlayState* play) { thisx->flags |= ACTOR_FLAG_1; if (Actor_HasParent(thisx, play)) { Flags_SetCollectible(play, OBJ_KINOKO_GET_FLAG(thisx)); - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } Actor_PickUp(thisx, play, GI_MAX, 20.0f, 10.0f); diff --git a/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.h b/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.h index 9073e3e14..335f33a02 100644 --- a/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.h +++ b/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.h @@ -9,8 +9,6 @@ typedef struct ObjKinoko { /* 0x000 */ Actor actor; } ObjKinoko; // size = 0x144 -extern const ActorInit Obj_Kinoko_InitVars; - #define OBJ_KINOKO_GET_FLAG(thisx) ((thisx)->params & 0x7F) #endif // Z_OBJ_KINOKO_H diff --git a/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.c b/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.c index 810525a58..9ceff660e 100644 --- a/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.c +++ b/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.c @@ -23,7 +23,7 @@ void ObjKzsaku_Idle(ObjKzsaku* this, PlayState* play); void ObjKzsaku_Rise(ObjKzsaku* this, PlayState* play); void func_80C08CB0(ObjKzsaku* this, PlayState* play); -const ActorInit Obj_Kzsaku_InitVars = { +ActorInit Obj_Kzsaku_InitVars = { ACTOR_OBJ_KZSAKU, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.h b/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.h index c4a9298fa..0a6f00187 100644 --- a/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.h +++ b/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.h @@ -17,6 +17,4 @@ typedef struct ObjKzsaku { /* 0x168 */ s16 timer; } ObjKzsaku; // size = 0x16C -extern const ActorInit Obj_Kzsaku_InitVars; - #endif // Z_OBJ_KZSAKU_H diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index 4668bfffd..aff88964b 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -27,7 +27,7 @@ void func_8093DB70(ObjLift* this); void func_8093DB90(ObjLift* this, PlayState* play); void func_8093DC90(Actor* thisx, PlayState* play); -const ActorInit Obj_Lift_InitVars = { +ActorInit Obj_Lift_InitVars = { ACTOR_OBJ_LIFT, ACTORCAT_BG, FLAGS, @@ -102,14 +102,15 @@ void ObjLift_Init(Actor* thisx, PlayState* play) { this->dyna.actor.home.rot.z = this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z; DynaPolyActor_Init(&this->dyna, 1); if ((this->unk_178 <= 0) && (Flags_GetSwitch(play, OBJLIFT_GET_7F(&this->dyna.actor)))) { - Actor_MarkForDeath(&this->dyna.actor); - } else { - DynaPolyActor_LoadMesh(play, &this->dyna, &gDampeGraveBrownElevatorCol); - this->unk_160 = Rand_Next() >> 0x10; - this->unk_162 = Rand_Next() >> 0x10; - this->unk_164 = Rand_Next() >> 0x10; - func_8093D760(this); + Actor_Kill(&this->dyna.actor); + return; } + + DynaPolyActor_LoadMesh(play, &this->dyna, &gDampeGraveBrownElevatorCol); + this->unk_160 = Rand_Next() >> 0x10; + this->unk_162 = Rand_Next() >> 0x10; + this->unk_164 = Rand_Next() >> 0x10; + func_8093D760(this); } void ObjLift_Destroy(Actor* thisx, PlayState* play) { @@ -196,7 +197,7 @@ void func_8093DA48(ObjLift* this, PlayState* play) { func_800C62BC(play, &play->colCtx.dyna, this->dyna.bgId); } else { Flags_SetSwitch(play, OBJLIFT_GET_7F(&this->dyna.actor)); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } } diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h index ea29a9cb9..b7f2af050 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h @@ -24,6 +24,4 @@ typedef struct ObjLift { /* 0x178 */ s16 unk_178; } ObjLift; // size = 0x17C -extern const ActorInit Obj_Lift_InitVars; - #endif // Z_OBJ_LIFT_H diff --git a/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c b/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c index 6884526ee..16a628fa2 100644 --- a/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c +++ b/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c @@ -22,7 +22,7 @@ void func_80AF3BA0(ObjLightblock* this, PlayState* play); void func_80AF3C18(ObjLightblock* this); void func_80AF3C34(ObjLightblock* this, PlayState* play); -const ActorInit Obj_Lightblock_InitVars = { +ActorInit Obj_Lightblock_InitVars = { ACTOR_OBJ_LIGHTBLOCK, ACTORCAT_BG, FLAGS, @@ -93,17 +93,18 @@ void ObjLightblock_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); Collider_InitCylinder(play, &this->collider); if (Flags_GetSwitch(play, LIGHTBLOCK_DESTROYED(&this->dyna.actor))) { - Actor_MarkForDeath(&this->dyna.actor); - } else { - DynaPolyActor_LoadMesh(play, &this->dyna, &object_lightblock_Colheader_000B80); - Collider_SetCylinder(play, &this->collider, &this->dyna.actor, &sCylinderInit); - Collider_UpdateCylinder(&this->dyna.actor, &this->collider); - this->collider.dim.radius = typeVars->radius; - this->collider.dim.height = typeVars->height; - this->collider.dim.yShift = typeVars->yShift; - this->alpha = 255; - func_80AF3AC8(this); + Actor_Kill(&this->dyna.actor); + return; } + + DynaPolyActor_LoadMesh(play, &this->dyna, &object_lightblock_Colheader_000B80); + Collider_SetCylinder(play, &this->collider, &this->dyna.actor, &sCylinderInit); + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); + this->collider.dim.radius = typeVars->radius; + this->collider.dim.height = typeVars->height; + this->collider.dim.yShift = typeVars->yShift; + this->alpha = 255; + func_80AF3AC8(this); } void ObjLightblock_Destroy(Actor* thisx, PlayState* play) { @@ -167,8 +168,11 @@ void func_80AF3C34(ObjLightblock* this, PlayState* play) { if (this->timer <= 0) { temp_a0 = this->dyna.actor.cutscene; ActorCutscene_Stop(temp_a0); - Actor_MarkForDeath(&this->dyna.actor); - } else if (this->timer <= 60) { + Actor_Kill(&this->dyna.actor); + return; + } + + if (this->timer <= 60) { if (this->alpha > 40) { this->alpha -= 40; } else { diff --git a/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.h b/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.h index eb16a7a92..63a106dac 100644 --- a/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.h +++ b/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.h @@ -19,6 +19,4 @@ typedef struct ObjLightblock { /* 0x1AE */ s8 collisionCounter; } ObjLightblock; // size = 0x1B0 -extern const ActorInit Obj_Lightblock_InitVars; - #endif // Z_OBJ_LIGHTBLOCK_H diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index dafd9bc2c..f2946d536 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -27,7 +27,7 @@ void ObjLightSwitch_SetupDisabled(ObjLightswitch* this); void ObjLightSwitch_Disabled(ObjLightswitch* this, PlayState* play); void ObjLightswitch_Idle(ObjLightswitch* this, PlayState* play); -const ActorInit Obj_Lightswitch_InitVars = { +ActorInit Obj_Lightswitch_InitVars = { ACTOR_OBJ_LIGHTSWITCH, ACTORCAT_SWITCH, FLAGS, @@ -173,7 +173,7 @@ void ObjLightswitch_Init(Actor* thisx, PlayState* play) { } if (isTriggered) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -315,10 +315,11 @@ void ObjLightSwitch_Fade(ObjLightswitch* this, PlayState* play) { this->colorAlpha -= 200; ObjLightswitch_SpawnEffects(this, play); // spawn burning fire effect if (this->colorAlpha < 0) { - Actor_MarkForDeath(&this->actor); - } else { - func_800B9010(&this->actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG); // "burn into ashes" + Actor_Kill(&this->actor); + return; } + + func_800B9010(&this->actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG); // "burn into ashes" } void ObjLightswitch_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h index a07900138..c26dab262 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h @@ -29,8 +29,6 @@ typedef struct ObjLightswitch { } ObjLightswitch; // size = 0x1C0 -extern const ActorInit Obj_Lightswitch_InitVars; - #define LIGHTSWITCH_FACE_ASLEEP 0 #define LIGHTSWITCH_FACE_WAKING 1 #define LIGHTSWITCH_FACE_FULLAWAKE 2 diff --git a/src/overlays/actors/ovl_Obj_Lupygamelift/z_obj_lupygamelift.c b/src/overlays/actors/ovl_Obj_Lupygamelift/z_obj_lupygamelift.c index 697c73f6a..6620c5116 100644 --- a/src/overlays/actors/ovl_Obj_Lupygamelift/z_obj_lupygamelift.c +++ b/src/overlays/actors/ovl_Obj_Lupygamelift/z_obj_lupygamelift.c @@ -21,7 +21,7 @@ void func_80AF04D8(ObjLupygamelift* this, PlayState* play); void func_80AF0514(ObjLupygamelift* this); void func_80AF0530(ObjLupygamelift* this, PlayState* play); -const ActorInit Obj_Lupygamelift_InitVars = { +ActorInit Obj_Lupygamelift_InitVars = { ACTOR_OBJ_LUPYGAMELIFT, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Lupygamelift/z_obj_lupygamelift.h b/src/overlays/actors/ovl_Obj_Lupygamelift/z_obj_lupygamelift.h index e2abd8be5..e25f9cd6d 100644 --- a/src/overlays/actors/ovl_Obj_Lupygamelift/z_obj_lupygamelift.h +++ b/src/overlays/actors/ovl_Obj_Lupygamelift/z_obj_lupygamelift.h @@ -21,6 +21,4 @@ typedef struct ObjLupygamelift { /* 0x170 */ s16 timer; } ObjLupygamelift; /* size = 0x174 */ -extern const ActorInit Obj_Lupygamelift_InitVars; - #endif // Z_OBJ_LUPYGAMELIFT_H diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c index 90aa5fa40..fefa5797d 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -18,7 +18,7 @@ s32 func_8099FA40(ObjMakekinsuta* this, PlayState* play); void func_8099FB64(Actor* thisx, PlayState* play); void func_8099FD7C(Actor* thisx, PlayState* play); -const ActorInit Obj_Makekinsuta_InitVars = { +ActorInit Obj_Makekinsuta_InitVars = { ACTOR_OBJ_MAKEKINSUTA, ACTORCAT_ITEMACTION, FLAGS, @@ -54,7 +54,7 @@ void ObjMakekinsuta_Init(Actor* thisx, PlayState* play) { this->unk144 = -1; } if (Flags_GetSwitch(play, OBJMAKEKINSUTA_GET_SWITCH_FLAGS(thisx))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h index d5bc998f0..17c9220e2 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h @@ -15,6 +15,4 @@ typedef struct ObjMakekinsuta { /* 0x144 */ s8 unk144; } ObjMakekinsuta; // size = 0x148 -extern const ActorInit Obj_Makekinsuta_InitVars; - #endif // Z_OBJ_MAKEKINSUTA_H diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c index b5f9d67b2..bb7d30f69 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c @@ -13,7 +13,7 @@ void ObjMakeoshihiki_Init(Actor* thisx, PlayState* play); void ObjMakeoshihiki_Update(Actor* thisx, PlayState* play); -const ActorInit Obj_Makeoshihiki_InitVars = { +ActorInit Obj_Makeoshihiki_InitVars = { ACTOR_OBJ_MAKEOSHIHIKI, ACTORCAT_PROP, FLAGS, @@ -68,7 +68,7 @@ void ObjMakeoshihiki_Init(Actor* thisx, PlayState* play) { childPoint = &this->pathPoints[childPointIndex]; if (Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_OBJ_OSHIHIKI, childPoint->x, childPoint->y, childPoint->z, 0, 0, 0, 0xFFF1) == NULL) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h index 8a419c550..47fbe831b 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h @@ -15,6 +15,4 @@ typedef struct ObjMakeoshihiki { /* 0x148 */ s32 pathCount; } ObjMakeoshihiki; // size = 0x14C -extern const ActorInit Obj_Makeoshihiki_InitVars; - #endif // Z_OBJ_MAKEOSHIHIKI_H diff --git a/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c b/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c index e1b1bc1b9..358cfde4b 100644 --- a/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c +++ b/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c @@ -16,7 +16,7 @@ void ObjMilkBin_Destroy(Actor* thisx, PlayState* play); void ObjMilkBin_Update(Actor* thisx, PlayState* play2); void ObjMilkBin_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Milk_Bin_InitVars = { +ActorInit Obj_Milk_Bin_InitVars = { ACTOR_OBJ_MILK_BIN, ACTORCAT_PROP, FLAGS, @@ -76,7 +76,7 @@ void ObjMilkBin_Update(Actor* thisx, PlayState* play2) { if (this->type == OBJ_MILK_BIN_TYPE_1) { if (gSaveContext.save.weekEventReg[22] & 1) { if (((gSaveContext.save.day == 2) && (gSaveContext.save.isNight == 1)) || (gSaveContext.save.day >= 3)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } } diff --git a/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.h b/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.h index c5f313661..9eb0d298d 100644 --- a/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.h +++ b/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.h @@ -13,8 +13,6 @@ typedef struct ObjMilkBin { /* 0x198 */ s32 type; } ObjMilkBin; // size = 0x19C -extern const ActorInit Obj_Milk_Bin_InitVars; - typedef enum { /* 0 */ OBJ_MILK_BIN_TYPE_DEFAULT, /* 1 */ OBJ_MILK_BIN_TYPE_1, // This actor will kill itself if the player has obtained the milk bottle and the current time is the night of the second day onwards. diff --git a/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.c b/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.c index 429333546..556f72b67 100644 --- a/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.c +++ b/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.c @@ -16,7 +16,7 @@ void ObjMine_Update(Actor* thisx, PlayState* play); void ObjMine_Draw(Actor* thisx, PlayState* play); #if 0 -const ActorInit Obj_Mine_InitVars = { +ActorInit Obj_Mine_InitVars = { ACTOR_OBJ_MINE, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.h b/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.h index c2ce765f9..257a6ff3a 100644 --- a/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.h +++ b/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.h @@ -14,6 +14,4 @@ typedef struct ObjMine { /* 0x01A8 */ char unk_1A8[0x120C]; } ObjMine; // size = 0x13B4 -extern const ActorInit Obj_Mine_InitVars; - #endif // Z_OBJ_MINE_H diff --git a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c index 31ba1fa63..e6f9ec496 100644 --- a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c +++ b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c @@ -25,7 +25,7 @@ void func_80C06768(ObjMoonStone* this, PlayState* play); void func_80C0685C(ObjMoonStone* this); void func_80C06870(ObjMoonStone* this, PlayState* play); -const ActorInit Obj_Moon_Stone_InitVars = { +ActorInit Obj_Moon_Stone_InitVars = { ACTOR_OBJ_MOON_STONE, ACTORCAT_PROP, FLAGS, @@ -57,7 +57,7 @@ void ObjMoonStone_Init(Actor* thisx, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_1; func_80C0673C(this); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -129,7 +129,7 @@ void func_80C0685C(ObjMoonStone* this) { void func_80C06870(ObjMoonStone* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { gSaveContext.save.weekEventReg[74] |= 0x40; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -137,7 +137,7 @@ void ObjMoonStone_Update(Actor* thisx, PlayState* play) { ObjMoonStone* this = THIS; Player* player = GET_PLAYER(play); - if (!(player->stateFlags1 & 0x10000282)) { + if (!(player->stateFlags1 & (PLAYER_STATE1_2 | PLAYER_STATE1_80 | PLAYER_STATE1_200 | PLAYER_STATE1_10000000))) { this->actionFunc(this, play); } } diff --git a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.h b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.h index 375d40fad..dfb9835a6 100644 --- a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.h +++ b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.h @@ -14,6 +14,4 @@ typedef struct ObjMoonStone { /* 0x194 */ s16 unk194; } ObjMoonStone; // size = 0x198 -extern const ActorInit Obj_Moon_Stone_InitVars; - #endif // Z_OBJ_MOON_STONE_H diff --git a/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c b/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c index 3b1b72f2f..2dca46caa 100644 --- a/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c +++ b/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c @@ -25,7 +25,7 @@ void func_80C06D90(ObjMuPict* this, PlayState* play); void func_80C06DC8(ObjMuPict* this, PlayState* play); void func_80C06E88(ObjMuPict* this, PlayState* play); -const ActorInit Obj_Mu_Pict_InitVars = { +ActorInit Obj_Mu_Pict_InitVars = { ACTOR_OBJ_MU_PICT, ACTORCAT_PROP, FLAGS, @@ -41,7 +41,7 @@ void ObjMuPict_Init(Actor* thisx, PlayState* play) { ObjMuPict* this = THIS; if (!(gSaveContext.save.weekEventReg[75] & 0x20) && !(gSaveContext.save.weekEventReg[52] & 0x20)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } func_80C06D90(this, play); diff --git a/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.h b/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.h index f5417d9db..98902bfb7 100644 --- a/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.h +++ b/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.h @@ -17,6 +17,4 @@ typedef struct ObjMuPict { /* 0x14C */ u16 textId; } ObjMuPict; // size = 0x150 -extern const ActorInit Obj_Mu_Pict_InitVars; - #endif // Z_OBJ_MU_PICT_H diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index 9a8072edd..815c15af8 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -20,7 +20,7 @@ void ObjMure_ActiveState(ObjMure* this, PlayState* play); void ObjMure_KillActors(ObjMure* this, PlayState* play); void ObjMure_CheckChildren(ObjMure* this, PlayState* play); -const ActorInit Obj_Mure_InitVars = { +ActorInit Obj_Mure_InitVars = { ACTOR_OBJ_MURE, ACTORCAT_ITEMACTION, FLAGS, @@ -96,15 +96,15 @@ void ObjMure_Init(Actor* thisx, PlayState* play) { this->svNum = OBJ_MURE_GET_SVNUM(&this->actor); this->type = OBJ_MURE_GET_TYPE(&this->actor); if (this->ptn >= 4) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (this->type >= OBJMURE_TYPE_MAX) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } if (!func_808D7928(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } this->actionFunc = ObjMure_InitialAction; @@ -207,7 +207,7 @@ void ObjMure_KillActorsImpl(ObjMure* this, PlayState* play) { break; case OBJMURE_CHILD_STATE_2: if (this->children[i] != NULL) { - Actor_MarkForDeath(this->children[i]); + Actor_Kill(this->children[i]); this->children[i] = NULL; } break; @@ -216,7 +216,7 @@ void ObjMure_KillActorsImpl(ObjMure* this, PlayState* play) { if (Actor_HasParent(this->children[i], play)) { this->children[i] = NULL; } else { - Actor_MarkForDeath(this->children[i]); + Actor_Kill(this->children[i]); this->children[i] = NULL; } } diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h index bc3669697..7bf2d40b7 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h @@ -29,8 +29,6 @@ typedef struct ObjMure { /* 0x1A0 */ s16 unk_1A0; } ObjMure; // size = 0x1A4 -extern const ActorInit Obj_Mure_InitVars; - #define OBJ_MURE_GET_CHNUM(thisx) (((thisx)->params >> 12) & 0xF) #define OBJ_MURE_GET_PTN(thisx) (((thisx)->params >> 8) & 0x7) #define OBJ_MURE_GET_SVNUM(thisx) (((thisx)->params >> 5) & 0x3) diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c index 31c5b50aa..bda4dc258 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c @@ -18,7 +18,7 @@ void func_809613FC(ObjMure2* this, PlayState* play); void func_80961490(ObjMure2* this, PlayState* play); #if 0 -const ActorInit Obj_Mure2_InitVars = { +ActorInit Obj_Mure2_InitVars = { ACTOR_OBJ_MURE2, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h index bf13c3fbc..f70d45f1e 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h @@ -13,6 +13,4 @@ typedef struct ObjMure2 { /* 0x148 */ char unk_148[0x38]; } ObjMure2; // size = 0x180 -extern const ActorInit Obj_Mure2_InitVars; - #endif // Z_OBJ_MURE2_H diff --git a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c index edefba93a..00f0cc5d7 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c @@ -21,7 +21,7 @@ void func_8098F5E4(ObjMure3* this, PlayState* play); void func_8098F66C(ObjMure3* this); void func_8098F680(ObjMure3* this, PlayState* play); -const ActorInit Obj_Mure3_InitVars = { +ActorInit Obj_Mure3_InitVars = { ACTOR_OBJ_MURE3, ACTORCAT_BG, FLAGS, @@ -118,7 +118,7 @@ void func_8098F364(ObjMure3* this, s32 play) { if (((*collectible)->unk1A4 != 0) || ((*collectible)->actor.update == NULL)) { this->unk164 |= (1 << i); } else { - Actor_MarkForDeath(&(*collectible)->actor); + Actor_Kill(&(*collectible)->actor); } } *collectible = NULL; @@ -148,7 +148,7 @@ void ObjMure3_Init(Actor* thisx, PlayState* play) { ObjMure3* this = THIS; if (Flags_GetSwitch(play, OBJMURE3_PARAMS_7F(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } Actor_ProcessInitChain(&this->actor, sInitChain); diff --git a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h index 2b6c4f891..8715e4308 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h @@ -19,6 +19,4 @@ typedef struct ObjMure3 { /* 0x164 */ u16 unk164; } ObjMure3; // size = 0x168 -extern const ActorInit Obj_Mure3_InitVars; - #endif // Z_OBJ_MURE3_H diff --git a/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c b/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c index 7cc7add22..55d148f4a 100644 --- a/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c +++ b/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c @@ -32,7 +32,7 @@ s32 D_80BA36B0; s32 D_80BA36B4; f32 D_80BA36B8; -const ActorInit Obj_Nozoki_InitVars = { +ActorInit Obj_Nozoki_InitVars = { ACTOR_OBJ_NOZOKI, ACTORCAT_ITEMACTION, FLAGS, @@ -96,7 +96,7 @@ void func_80BA2514(ObjNozoki* this, PlayState* play) { s32 sp24 = Object_GetIndex(&play->objectCtx, D_80BA34B8[this->unk_15C]); if (sp24 < 0) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -328,7 +328,7 @@ void func_80BA2C94(ObjNozoki* this, PlayState* play) { if (play->actorCtx.flags & ACTORCTX_FLAG_6) { if (sp34 <= 5.0f) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } else if (!(play->actorCtx.flags & ACTORCTX_FLAG_5) && (GET_PLAYER(play)->actor.id == ACTOR_PLAYER) && Flags_GetSwitch(play, OBJNOZOKI_GET_SWITCHFLAG2(&this->dyna.actor)) && (sp38 < 20.0f)) { @@ -347,7 +347,7 @@ void func_80BA2C94(ObjNozoki* this, PlayState* play) { sp38 = this->dyna.actor.home.pos.y - this->dyna.actor.world.pos.y; if (sp38 >= 100.0f) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } this->dyna.actor.shape.rot.x = -0x1F40 - (s16)(sp38 * 400.0f); diff --git a/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.h b/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.h index 7b4c3a5b8..4c4b74916 100644 --- a/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.h +++ b/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.h @@ -24,6 +24,4 @@ typedef struct ObjNozoki { /* 0x160 */ ObjNozokiActionFunc actionFunc; } ObjNozoki; // size = 0x164 -extern const ActorInit Obj_Nozoki_InitVars; - #endif // Z_OBJ_NOZOKI_H diff --git a/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c b/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c index b7a098b46..3a25ef402 100644 --- a/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c +++ b/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c @@ -31,7 +31,7 @@ void func_80AC9B5C(ObjOcarinalift* this, PlayState* play); void func_80AC9C20(ObjOcarinalift* this); void func_80AC9C48(ObjOcarinalift* this, PlayState* play); -const ActorInit Obj_Ocarinalift_InitVars = { +ActorInit Obj_Ocarinalift_InitVars = { ACTOR_OBJ_OCARINALIFT, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.h b/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.h index a542fb840..3789383c2 100644 --- a/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.h +++ b/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.h @@ -29,6 +29,4 @@ typedef enum ObjOcarinaliftParams { /* 0x1 */ OBJOCARINALIFT_PARAMSC_1 } ObjOcarinaliftParams; -extern const ActorInit Obj_Ocarinalift_InitVars; - #endif // Z_OBJ_OCARINALIFT_H diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index 4bfb5ba96..1d7762c44 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -25,7 +25,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, PlayState* play); void ObjOshihiki_SetupFall(ObjOshihiki* this, PlayState* play); void ObjOshihiki_Fall(ObjOshihiki* this, PlayState* play); -const ActorInit Obj_Oshihiki_InitVars = { +ActorInit Obj_Oshihiki_InitVars = { ACTOR_OBJ_OSHIHIKI, ACTORCAT_PROP, FLAGS, @@ -205,7 +205,7 @@ void ObjOshihiki_Init(Actor* thisx, PlayState* play) { case OBJOSHIHIKI_F_0: case OBJOSHIHIKI_F_1: case OBJOSHIHIKI_F_2: - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } } else { @@ -213,7 +213,7 @@ void ObjOshihiki_Init(Actor* thisx, PlayState* play) { case OBJOSHIHIKI_F_3: case OBJOSHIHIKI_F_4: case OBJOSHIHIKI_F_5: - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } } @@ -293,7 +293,7 @@ s32 ObjOshihiki_CheckFloor(ObjOshihiki* this, PlayState* play) { s32 ObjOshihiki_CheckGround(ObjOshihiki* this, PlayState* play) { if (this->dyna.actor.world.pos.y <= BGCHECK_Y_MIN + 10.0f) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return false; } @@ -406,11 +406,11 @@ void ObjOshihiki_OnScene(ObjOshihiki* this, PlayState* play) { return; } } - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } else if (fabsf(this->dyna.pushForce) > 0.001f) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } @@ -466,7 +466,7 @@ void ObjOshihiki_OnActor(ObjOshihiki* this, PlayState* play) { } if (!sp20 && (fabsf(this->dyna.pushForce) > 0.001f)) { - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } @@ -494,7 +494,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, PlayState* play) { if (!ObjOshihiki_CheckFloor(this, play)) { this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x; this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; this->pushDist = 0.0f; this->pushSpeed = 0.0f; @@ -508,7 +508,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, PlayState* play) { this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x; this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; this->pushDist = 0.0f; this->pushSpeed = 0.0f; @@ -542,7 +542,7 @@ void ObjOshihiki_Fall(ObjOshihiki* this, PlayState* play) { if (fabsf(this->dyna.pushForce) > 0.001f) { this->dyna.pushForce = 0.0f; - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; } Actor_MoveWithGravity(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h index ade27ca43..d2f61e2cf 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h @@ -60,6 +60,4 @@ typedef struct ObjOshihiki { /* 0x1C8 */ AnimatedMaterial* texture; } ObjOshihiki; // size = 0x1CC -extern const ActorInit Obj_Oshihiki_InitVars; - #endif // Z_OBJ_OSHIHIKI_H diff --git a/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c b/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c index 6255b2cbe..29ffa674e 100644 --- a/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c +++ b/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c @@ -41,7 +41,7 @@ typedef struct ObjPurifyInfo { /* 0x24 */ s32 isDekuCity; } ObjPurifyInfo; // size = 0x28 -const ActorInit Obj_Purify_InitVars = { +ActorInit Obj_Purify_InitVars = { ACTOR_OBJ_PURIFY, ACTORCAT_BG, FLAGS, @@ -135,11 +135,11 @@ void ObjPurify_Init(Actor* thisx, PlayState* play) { } this->objIndex = Object_GetIndex(&play->objectCtx, info->objectId); if (this->objIndex < 0) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } else if (sp20 == 0) { func_80A84EAC(this); } else if (ObjPurify_IsPurified(this)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } else { func_80A84EAC(this); } @@ -183,7 +183,7 @@ void func_80A84FA0(ObjPurify* this) { void func_80A84FB4(ObjPurify* this, PlayState* play) { if (ObjPurify_IsPurified(this)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.h b/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.h index 542938c80..2651bf049 100644 --- a/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.h +++ b/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.h @@ -16,8 +16,6 @@ typedef struct ObjPurify { /* 0x168 */ f32 unk168[2]; } ObjPurify; // size = 0x170 -extern const ActorInit Obj_Purify_InitVars; - #define OBJPURIFY_GET_INFO_INDEX(thisx) ((thisx)->params & 0xF) #define OBJPURIFY_GET_UNK_FLAG(thisx) (((thisx)->params >> 0xC) & 1) diff --git a/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c b/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c index 9f024b0c0..3aca23bca 100644 --- a/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c +++ b/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c @@ -25,7 +25,7 @@ void func_809A3D38(ObjPzlblock* this, PlayState* play); void func_809A3E58(Actor* thisx, PlayState* play); void func_809A3F0C(Actor* thisx, PlayState* play); -const ActorInit Obj_Pzlblock_InitVars = { +ActorInit Obj_Pzlblock_InitVars = { ACTOR_OBJ_PZLBLOCK, ACTORCAT_PROP, FLAGS, @@ -268,7 +268,7 @@ void func_809A3A74(ObjPzlblock* this, PlayState* play) { } } - GET_PLAYER(play)->stateFlags2 &= ~0x10; + GET_PLAYER(play)->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } @@ -299,7 +299,7 @@ void func_809A3BC0(ObjPzlblock* this, PlayState* play) { sp20 = 1; } - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; if (sp20 == 0) { func_809A3A48(this); @@ -318,7 +318,7 @@ void func_809A3D1C(ObjPzlblock* this) { void func_809A3D38(ObjPzlblock* this, PlayState* play) { if (fabsf(this->dyna.pushForce) > 0.1f) { - GET_PLAYER(play)->stateFlags2 &= ~0x10; + GET_PLAYER(play)->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } } diff --git a/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.h b/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.h index c40800483..27a038860 100644 --- a/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.h +++ b/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.h @@ -25,6 +25,4 @@ typedef struct ObjPzlblock { /* 0x17A */ s8 unk_17A; } ObjPzlblock; // size = 0x17C -extern const ActorInit Obj_Pzlblock_InitVars; - #endif // Z_OBJ_PZLBLOCK_H diff --git a/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c b/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c index 01cfdd832..d0a705cf2 100644 --- a/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c +++ b/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c @@ -28,7 +28,7 @@ void ObjRaillift_Teleport(ObjRaillift* this, PlayState* play); void ObjRaillift_Wait(ObjRaillift* this, PlayState* play); void ObjRaillift_Move(ObjRaillift* this, PlayState* play); -const ActorInit Obj_Raillift_InitVars = { +ActorInit Obj_Raillift_InitVars = { ACTOR_OBJ_RAILLIFT, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.h b/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.h index cd55d1fa6..41b7a821e 100644 --- a/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.h +++ b/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.h @@ -38,6 +38,4 @@ typedef struct ObjRaillift { /* 0x188 */ s16 cutsceneTimer; } ObjRaillift; // size = 0x18C -extern const ActorInit Obj_Raillift_InitVars; - #endif // Z_OBJ_RAILLIFT_H diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 0ce2f38a1..154f662f8 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -18,7 +18,7 @@ void func_80973CD8(ObjRoomtimer* this, PlayState* play); void func_80973D3C(ObjRoomtimer* this, PlayState* play); void func_80973DE0(ObjRoomtimer* this, PlayState* play); -const ActorInit Obj_Roomtimer_InitVars = { +ActorInit Obj_Roomtimer_InitVars = { ACTOR_OBJ_ROOMTIMER, ACTORCAT_ENEMY, FLAGS, @@ -69,7 +69,7 @@ void func_80973D3C(ObjRoomtimer* this, PlayState* play) { } else if ((this->actor.params != 0x1FF) && (gSaveContext.timerStates[TIMER_ID_MINIGAME_2] == TIMER_STATE_OFF)) { play_sound(NA_SE_OC_ABYSS); func_80169EFC(&play->state); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -80,10 +80,11 @@ void func_80973DE0(ObjRoomtimer* this, PlayState* play) { if (ActorCutscene_GetLength(this->actor.cutscene) != -1) { ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); } - Actor_MarkForDeath(&this->actor); - } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + Actor_Kill(&this->actor); + return; } + + ActorCutscene_SetIntentToPlay(this->actor.cutscene); } void ObjRoomtimer_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h index be15ac11a..5ce7d13d4 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h @@ -15,6 +15,4 @@ typedef struct ObjRoomtimer { /* 0x148 */ s32 switchFlag; } ObjRoomtimer; // size = 0x14C -extern const ActorInit Obj_Roomtimer_InitVars; - #endif // Z_OBJ_ROOMTIMER_H diff --git a/src/overlays/actors/ovl_Obj_Rotlift/z_obj_rotlift.c b/src/overlays/actors/ovl_Obj_Rotlift/z_obj_rotlift.c index 6a5298728..ce18a68b0 100644 --- a/src/overlays/actors/ovl_Obj_Rotlift/z_obj_rotlift.c +++ b/src/overlays/actors/ovl_Obj_Rotlift/z_obj_rotlift.c @@ -25,7 +25,7 @@ typedef struct ObjRotliftModelInfo { /* 0x8 */ CollisionHeader* colHeader; } ObjRotliftModelInfo; // size = 0xC -const ActorInit Obj_Rotlift_InitVars = { +ActorInit Obj_Rotlift_InitVars = { ACTOR_OBJ_ROTLIFT, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Rotlift/z_obj_rotlift.h b/src/overlays/actors/ovl_Obj_Rotlift/z_obj_rotlift.h index 46cbef0ee..df3fe1dee 100644 --- a/src/overlays/actors/ovl_Obj_Rotlift/z_obj_rotlift.h +++ b/src/overlays/actors/ovl_Obj_Rotlift/z_obj_rotlift.h @@ -20,6 +20,4 @@ typedef struct ObjRotlift { /* 0x15C */ ObjEtcetera* dekuFlowers[2]; } ObjRotlift; // size = 0x164 -extern const ActorInit Obj_Rotlift_InitVars; - #endif // Z_OBJ_ROTLIFT_H diff --git a/src/overlays/actors/ovl_Obj_Shutter/z_obj_shutter.c b/src/overlays/actors/ovl_Obj_Shutter/z_obj_shutter.c index 5246b20d4..6f93935b2 100644 --- a/src/overlays/actors/ovl_Obj_Shutter/z_obj_shutter.c +++ b/src/overlays/actors/ovl_Obj_Shutter/z_obj_shutter.c @@ -16,7 +16,7 @@ void ObjShutter_Destroy(Actor* thisx, PlayState* play); void ObjShutter_Update(Actor* thisx, PlayState* play2); void ObjShutter_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Shutter_InitVars = { +ActorInit Obj_Shutter_InitVars = { ACTOR_OBJ_SHUTTER, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Shutter/z_obj_shutter.h b/src/overlays/actors/ovl_Obj_Shutter/z_obj_shutter.h index b777c64b3..3f23b3dfe 100644 --- a/src/overlays/actors/ovl_Obj_Shutter/z_obj_shutter.h +++ b/src/overlays/actors/ovl_Obj_Shutter/z_obj_shutter.h @@ -11,6 +11,4 @@ typedef struct ObjShutter { /* 0x148 */ f32 verticalOffset; } ObjShutter; // size = 0x14C -extern const ActorInit Obj_Shutter_InitVars; - #endif // Z_OBJ_SHUTTER_H diff --git a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c index 3eee8491a..9265c6615 100644 --- a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c +++ b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c @@ -27,7 +27,7 @@ void func_80A2273C(ObjSkateblock* this, PlayState* play); void func_80A227A4(ObjSkateblock* this); void func_80A227C0(ObjSkateblock* this, PlayState* play); -const ActorInit Obj_Skateblock_InitVars = { +ActorInit Obj_Skateblock_InitVars = { ACTOR_OBJ_SKATEBLOCK, ACTORCAT_BG, FLAGS, @@ -369,7 +369,7 @@ void func_80A21C88(ObjSkateblock* this, s32 arg1) { void func_80A21CB4(ObjSkateblock* this, PlayState* play) { Player* player = GET_PLAYER(play); - player->stateFlags2 &= ~0x10; + player->stateFlags2 &= ~PLAYER_STATE2_10; this->dyna.pushForce = 0.0f; } diff --git a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.h b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.h index 97a2e6ede..ab4f37240 100644 --- a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.h +++ b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.h @@ -32,6 +32,4 @@ typedef struct ObjSkateblock { /* 0x1C1 */ u8 unk_1C1; } ObjSkateblock; // size = 0x1C4 -extern const ActorInit Obj_Skateblock_InitVars; - #endif // Z_OBJ_SKATEBLOCK_H diff --git a/src/overlays/actors/ovl_Obj_Smork/z_obj_smork.c b/src/overlays/actors/ovl_Obj_Smork/z_obj_smork.c index 9d3b1265d..dd02f6c1b 100644 --- a/src/overlays/actors/ovl_Obj_Smork/z_obj_smork.c +++ b/src/overlays/actors/ovl_Obj_Smork/z_obj_smork.c @@ -16,7 +16,7 @@ void ObjSmork_Destroy(Actor* thisx, PlayState* play); void ObjSmork_Update(Actor* thisx, PlayState* play); void ObjSmork_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Smork_InitVars = { +ActorInit Obj_Smork_InitVars = { ACTOR_OBJ_SMORK, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Smork/z_obj_smork.h b/src/overlays/actors/ovl_Obj_Smork/z_obj_smork.h index 5ab3e405c..a1b21d442 100644 --- a/src/overlays/actors/ovl_Obj_Smork/z_obj_smork.h +++ b/src/overlays/actors/ovl_Obj_Smork/z_obj_smork.h @@ -16,6 +16,4 @@ typedef struct ObjSmork { /* 0x1C6 */ s16 unk_1C6; } ObjSmork; // size = 0x1C8 -extern const ActorInit Obj_Smork_InitVars; - #endif // Z_OBJ_SMORK_H diff --git a/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c b/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c index 72f452682..068be3ea0 100644 --- a/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c +++ b/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c @@ -33,7 +33,7 @@ void func_80B04B48(ObjSnowball* this, PlayState* play); void func_80B04B60(ObjSnowball* this, PlayState* play); void func_80B04D34(Actor* thisx, PlayState* play); -const ActorInit Obj_Snowball_InitVars = { +ActorInit Obj_Snowball_InitVars = { ACTOR_OBJ_SNOWBALL, ACTORCAT_PROP, FLAGS, @@ -510,7 +510,7 @@ void ObjSnowball_Init(Actor* thisx, PlayState* play) { func_80B04338(this, play); if ((sp40 == 5) && Flags_GetSwitch(play, OBJSNOWBALL_GET_3F(&this->actor))) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -621,7 +621,7 @@ void func_80B04648(ObjSnowball* this, PlayState* play) { if (this->actor.home.rot.y == 1) { func_80B04B48(this, play); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else if (this->unk_208 == 0x2D) { func_80B03688(this, play); @@ -725,7 +725,7 @@ void func_80B047C0(ObjSnowball* this, PlayState* play) { if (this->actor.home.rot.y == 1) { func_80B04B48(this, play); } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } else { for (i = 0; i < ARRAY_COUNT(this->unk_1A8); i++) { diff --git a/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.h b/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.h index 0b2974d44..804c2596c 100644 --- a/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.h +++ b/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.h @@ -40,6 +40,4 @@ typedef struct ObjSnowball { /* 0x211 */ s8 unk_211; } ObjSnowball; // size = 0x214 -extern const ActorInit Obj_Snowball_InitVars; - #endif // Z_OBJ_SNOWBALL_H diff --git a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c index 74fa8fd57..d62002e73 100644 --- a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c +++ b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c @@ -26,7 +26,7 @@ void func_80B3A13C(ObjSnowball2* this, PlayState* play); void func_80B3A498(ObjSnowball2* this); void func_80B3A500(ObjSnowball2* this, PlayState* play); -const ActorInit Obj_Snowball2_InitVars = { +ActorInit Obj_Snowball2_InitVars = { ACTOR_OBJ_SNOWBALL2, ACTORCAT_PROP, FLAGS, @@ -365,7 +365,7 @@ void func_80B39C9C(ObjSnowball2* this, PlayState* play) { func_80B38E88(this, play); func_80B39108(this, play); func_80B39B5C(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } else { if (sp38 && (this->collider.elements->info.acHitInfo->toucher.dmgFlags & 2)) { @@ -464,7 +464,7 @@ void func_80B3A13C(ObjSnowball2* this, PlayState* play) { func_80B38E88(this, play); func_80B39108(this, play); func_80B39B5C(this, play); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } @@ -570,7 +570,7 @@ void func_80B3A500(ObjSnowball2* this, PlayState* play) { } if (this->unk_1AC <= 0) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.h b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.h index b6990fc1c..19bd173fb 100644 --- a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.h +++ b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.h @@ -24,6 +24,4 @@ typedef struct ObjSnowball2 { /* 0x1B0 */ UNK_TYPE1 unk1B0[4]; } ObjSnowball2; // size = 0x1B4 -extern const ActorInit Obj_Snowball2_InitVars; - #endif // Z_OBJ_SNOWBALL2_H diff --git a/src/overlays/actors/ovl_Obj_Sound/z_obj_sound.c b/src/overlays/actors/ovl_Obj_Sound/z_obj_sound.c index 221ae3acc..42c2bcc95 100644 --- a/src/overlays/actors/ovl_Obj_Sound/z_obj_sound.c +++ b/src/overlays/actors/ovl_Obj_Sound/z_obj_sound.c @@ -15,7 +15,7 @@ void ObjSound_Destroy(Actor* thisx, PlayState* play); void ObjSound_Update(Actor* thisx, PlayState* play); #if 0 -const ActorInit Obj_Sound_InitVars = { +ActorInit Obj_Sound_InitVars = { ACTOR_OBJ_SOUND, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Sound/z_obj_sound.h b/src/overlays/actors/ovl_Obj_Sound/z_obj_sound.h index 8f3c80257..a83aa840b 100644 --- a/src/overlays/actors/ovl_Obj_Sound/z_obj_sound.h +++ b/src/overlays/actors/ovl_Obj_Sound/z_obj_sound.h @@ -10,6 +10,4 @@ typedef struct ObjSound { /* 0x144 */ char unk_144[0x4]; } ObjSound; // size = 0x148 -extern const ActorInit Obj_Sound_InitVars; - #endif // Z_OBJ_SOUND_H 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 05fe851a9..214c74495 100644 --- a/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c +++ b/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c @@ -23,7 +23,7 @@ void func_80B30A4C(ObjSpidertent* this, PlayState* play); void func_80B30AD4(ObjSpidertent* this); void func_80B30AF8(ObjSpidertent* this, PlayState* play); -const ActorInit Obj_Spidertent_InitVars = { +ActorInit Obj_Spidertent_InitVars = { ACTOR_OBJ_SPIDERTENT, ACTORCAT_BG, FLAGS, @@ -565,7 +565,7 @@ void ObjSpidertent_Init(Actor* thisx, PlayState* play) { Collider_InitTris(play, &this->collider); if (Flags_GetSwitch(play, OBJSPIDERTENT_GET_7F00(&this->dyna.actor))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -792,7 +792,7 @@ void func_80B30AF8(ObjSpidertent* this, PlayState* play) { } } else if (this->unk_3C1 <= 0) { ActorCutscene_Stop(this->dyna.actor.cutscene); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.h b/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.h index 3fdb83597..881a816a7 100644 --- a/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.h +++ b/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.h @@ -27,6 +27,4 @@ typedef struct ObjSpidertent { /* 0x3C8 */ ObjSpidertentActionFunc actionFunc; } ObjSpidertent; // size = 0x3CC -extern const ActorInit Obj_Spidertent_InitVars; - #endif // Z_OBJ_SPIDERTENT_H diff --git a/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c b/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c index c57db1111..83959e168 100644 --- a/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c +++ b/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c @@ -28,7 +28,7 @@ void func_80A1EC38(ObjSpinyroll* this, PlayState* play); void func_80A1ECC0(ObjSpinyroll* this); void func_80A1ECD4(ObjSpinyroll* this, PlayState* play); -const ActorInit Obj_Spinyroll_InitVars = { +ActorInit Obj_Spinyroll_InitVars = { ACTOR_OBJ_SPINYROLL, ACTORCAT_PROP, FLAGS, @@ -500,7 +500,7 @@ void ObjSpinyroll_Init(Actor* thisx, PlayState* play) { ((sp34->x == sp30->x) && (sp34->y == sp30->y) && (sp34->z != sp30->z))) { this->unk_49C = false; } else { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } diff --git a/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.h b/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.h index 10322586a..36d8e644a 100644 --- a/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.h +++ b/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.h @@ -50,6 +50,4 @@ typedef struct ObjSpinyroll { /* 0x4E2 */ s16 unk_4E2; } ObjSpinyroll; // size = 0x4E4 -extern const ActorInit Obj_Spinyroll_InitVars; - #endif // Z_OBJ_SPINYROLL_H diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index c31168f72..7270f1a39 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -71,7 +71,7 @@ static TexturePtr sEyeSwitchTextures[][4] = { static s32 sIsSegmentTableInit = false; -const ActorInit Obj_Switch_InitVars = { +ActorInit Obj_Switch_InitVars = { ACTOR_OBJ_SWITCH, ACTORCAT_SWITCH, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h index f208a60cf..764c724a0 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h @@ -60,8 +60,6 @@ typedef struct ObjSwitch { /* 0x254 */ f32 floorSwitchDownScale; } ObjSwitch; // size = 0x258 -extern const ActorInit Obj_Switch_InitVars; - #define OBJ_SWITCH_GET_TYPE(thisx) ((thisx)->params&7) #define OBJ_SWITCH_GET_SUBTYPE(thisx) ((thisx)->params >> 4 & 7) #define OBJ_SWITCH_GET_SWITCH_FLAG(thisx) ((thisx)->params >> 8 & 0x7F) diff --git a/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.c b/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.c index 6a50a018f..5eeef1d5e 100644 --- a/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.c +++ b/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.c @@ -23,7 +23,7 @@ void func_80C25710(ObjSwprize* this); void func_80C2572C(ObjSwprize* this, PlayState* play); void ObjSwprize_SetupDoNothing(ObjSwprize* this); -const ActorInit Obj_Swprize_InitVars = { +ActorInit Obj_Swprize_InitVars = { ACTOR_OBJ_SWPRIZE, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.h b/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.h index 5b7cd2e09..efba85a87 100644 --- a/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.h +++ b/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.h @@ -16,6 +16,4 @@ typedef struct ObjSwprize { /* 0x148 */ s16 timer; } ObjSwprize; // size = 0x14C -extern const ActorInit Obj_Swprize_InitVars; - #endif // Z_OBJ_SWPRIZE_H 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 02a7d59e1..e73892e89 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -18,7 +18,7 @@ void ObjSyokudai_Destroy(Actor* thisx, PlayState* play); void ObjSyokudai_Update(Actor* thisx, PlayState* play2); void ObjSyokudai_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Syokudai_InitVars = { +ActorInit Obj_Syokudai_InitVars = { ACTOR_OBJ_SYOKUDAI, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h index d1a0be1c8..d49f38289 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h @@ -16,8 +16,6 @@ typedef struct ObjSyokudai { /* 0x1E4 */ LightInfo lightInfo; } ObjSyokudai; // size = 0x1F4 -extern const ActorInit Obj_Syokudai_InitVars; - typedef enum { /* 0 */ OBJ_SYOKUDAI_TYPE_SWITCH_CAUSES_FLAME, /* 1 */ OBJ_SYOKUDAI_TYPE_FLAME_CAUSES_SWITCH, diff --git a/src/overlays/actors/ovl_Obj_Takaraya_Wall/z_obj_takaraya_wall.c b/src/overlays/actors/ovl_Obj_Takaraya_Wall/z_obj_takaraya_wall.c index e4936f1fb..b8ab34df0 100644 --- a/src/overlays/actors/ovl_Obj_Takaraya_Wall/z_obj_takaraya_wall.c +++ b/src/overlays/actors/ovl_Obj_Takaraya_Wall/z_obj_takaraya_wall.c @@ -18,7 +18,7 @@ void ObjTakarayaWall_Draw(Actor* thisx, PlayState* play); void func_80AD9B04(ObjTakarayaWall* this, PlayState* play); #if 0 -const ActorInit Obj_Takaraya_Wall_InitVars = { +ActorInit Obj_Takaraya_Wall_InitVars = { ACTOR_OBJ_TAKARAYA_WALL, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Takaraya_Wall/z_obj_takaraya_wall.h b/src/overlays/actors/ovl_Obj_Takaraya_Wall/z_obj_takaraya_wall.h index 603041d9f..225e26512 100644 --- a/src/overlays/actors/ovl_Obj_Takaraya_Wall/z_obj_takaraya_wall.h +++ b/src/overlays/actors/ovl_Obj_Takaraya_Wall/z_obj_takaraya_wall.h @@ -13,6 +13,4 @@ typedef struct ObjTakarayaWall { /* 0x148 */ char unk_148[0x98]; } ObjTakarayaWall; // size = 0x1E0 -extern const ActorInit Obj_Takaraya_Wall_InitVars; - #endif // Z_OBJ_TAKARAYA_WALL_H diff --git a/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c b/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c index c7aa4549d..791564b57 100644 --- a/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c +++ b/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c @@ -24,7 +24,7 @@ void func_80B9C07C(ObjTaru* this, PlayState* play); void func_80B9C174(ObjTaru* this, PlayState* play); void func_80B9C1A0(ObjTaru* this, PlayState* play); -const ActorInit Obj_Taru_InitVars = { +ActorInit Obj_Taru_InitVars = { ACTOR_OBJ_TARU, ACTORCAT_BG, FLAGS, @@ -204,7 +204,7 @@ void ObjTaru_Init(Actor* thisx, PlayState* play) { if (OBJ_TARU_GET_80(thisx)) { if (Flags_GetSwitch(play, OBJ_TARU_GET_7F(thisx))) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } else { DynaPolyActor_LoadMesh(play, &this->dyna, &object_taru_Colheader_001CB0); } @@ -292,17 +292,18 @@ void func_80B9C07C(ObjTaru* this, PlayState* play) { void func_80B9C174(ObjTaru* this, PlayState* play) { func_80B9BD84(this, play); - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } void func_80B9C1A0(ObjTaru* this, PlayState* play) { if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); Flags_SetSwitch(play, OBJ_TARU_GET_7F(&this->dyna.actor)); - Actor_MarkForDeath(&this->dyna.actor); - } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + Actor_Kill(&this->dyna.actor); + return; } + + ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); } void ObjTaru_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.h b/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.h index 063e90ef4..629bc57a5 100644 --- a/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.h +++ b/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.h @@ -23,6 +23,4 @@ typedef struct ObjTaru { /* 0x1AD */ s8 unk_1AD; } ObjTaru; // size = 0x1B0 -extern const ActorInit Obj_Taru_InitVars; - #endif // Z_OBJ_TARU_H diff --git a/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c b/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c index a37f64b84..306ca7029 100644 --- a/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c +++ b/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c @@ -23,7 +23,7 @@ void func_809A481C(ObjToge* this, PlayState* play); void func_809A488C(ObjToge* this); void func_809A48AC(ObjToge* this, PlayState* play); -const ActorInit Obj_Toge_InitVars = { +ActorInit Obj_Toge_InitVars = { ACTOR_OBJ_TOGE, ACTORCAT_PROP, FLAGS, @@ -132,13 +132,13 @@ void ObjToge_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); if (OBJTOGE_GET_PATH(thisx) == 0xFF) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } path = &play->setupPathList[OBJTOGE_GET_PATH(thisx)]; if (path->count != 2) { - Actor_MarkForDeath(thisx); + Actor_Kill(thisx); return; } diff --git a/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.h b/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.h index 9a55a4219..8259e62c8 100644 --- a/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.h +++ b/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.h @@ -29,6 +29,4 @@ typedef struct ObjToge { /* 0x1CC */ f32 unk_1CC; } ObjToge; // size = 0x1D0 -extern const ActorInit Obj_Toge_InitVars; - #endif // Z_OBJ_TOGE_H diff --git a/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c b/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c index 6d4923043..694a5ac59 100644 --- a/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c +++ b/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c @@ -28,7 +28,7 @@ void ObjTokeiStep_SetupDoNothingOpen(ObjTokeiStep* this); void ObjTokeiStep_DoNothingOpen(ObjTokeiStep* this, PlayState* play); void ObjTokeiStep_DrawOpen(Actor* thisx, PlayState* play); -const ActorInit Obj_Tokei_Step_InitVars = { +ActorInit Obj_Tokei_Step_InitVars = { ACTOR_OBJ_TOKEI_STEP, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.h b/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.h index 537e7ecc7..ddb1517de 100644 --- a/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.h +++ b/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.h @@ -23,6 +23,4 @@ typedef struct ObjTokeiStep { /* 0x160 */ ObjTokeiStepPanel panels[7]; } ObjTokeiStep; // size = 0x1EC -extern const ActorInit Obj_Tokei_Step_InitVars; - #endif // Z_OBJ_TOKEI_STEP_H diff --git a/src/overlays/actors/ovl_Obj_Tokei_Tobira/z_obj_tokei_tobira.c b/src/overlays/actors/ovl_Obj_Tokei_Tobira/z_obj_tokei_tobira.c index 15e01b832..0c81ec028 100644 --- a/src/overlays/actors/ovl_Obj_Tokei_Tobira/z_obj_tokei_tobira.c +++ b/src/overlays/actors/ovl_Obj_Tokei_Tobira/z_obj_tokei_tobira.c @@ -16,7 +16,7 @@ void ObjTokeiTobira_Update(Actor* thisx, PlayState* play); void ObjTokeiTobira_Draw(Actor* thisx, PlayState* play); #if 0 -const ActorInit Obj_Tokei_Tobira_InitVars = { +ActorInit Obj_Tokei_Tobira_InitVars = { ACTOR_OBJ_TOKEI_TOBIRA, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Tokei_Tobira/z_obj_tokei_tobira.h b/src/overlays/actors/ovl_Obj_Tokei_Tobira/z_obj_tokei_tobira.h index 49e47af19..8f9983995 100644 --- a/src/overlays/actors/ovl_Obj_Tokei_Tobira/z_obj_tokei_tobira.h +++ b/src/overlays/actors/ovl_Obj_Tokei_Tobira/z_obj_tokei_tobira.h @@ -14,6 +14,4 @@ typedef struct ObjTokeiTobira { /* 0x160 */ char unk_160[0x10]; } ObjTokeiTobira; // size = 0x170 -extern const ActorInit Obj_Tokei_Tobira_InitVars; - #endif // Z_OBJ_TOKEI_TOBIRA_H diff --git a/src/overlays/actors/ovl_Obj_Tokei_Turret/z_obj_tokei_turret.c b/src/overlays/actors/ovl_Obj_Tokei_Turret/z_obj_tokei_turret.c index a0183266f..3dc8b3297 100644 --- a/src/overlays/actors/ovl_Obj_Tokei_Turret/z_obj_tokei_turret.c +++ b/src/overlays/actors/ovl_Obj_Tokei_Turret/z_obj_tokei_turret.c @@ -16,7 +16,7 @@ void ObjTokeiTurret_Destroy(Actor* thisx, PlayState* play); void ObjTokeiTurret_Update(Actor* thisx, PlayState* play); void ObjTokeiTurret_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Tokei_Turret_InitVars = { +ActorInit Obj_Tokei_Turret_InitVars = { ACTOR_OBJ_TOKEI_TURRET, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Tokei_Turret/z_obj_tokei_turret.h b/src/overlays/actors/ovl_Obj_Tokei_Turret/z_obj_tokei_turret.h index 7a2db071e..620228f53 100644 --- a/src/overlays/actors/ovl_Obj_Tokei_Turret/z_obj_tokei_turret.h +++ b/src/overlays/actors/ovl_Obj_Tokei_Turret/z_obj_tokei_turret.h @@ -16,6 +16,4 @@ typedef struct ObjTokeiTurret { /* 0x000 */ DynaPolyActor dyna; } ObjTokeiTurret; // size = 0x15C -extern const ActorInit Obj_Tokei_Turret_InitVars; - #endif // Z_OBJ_TOKEI_TURRET_H diff --git a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c index 421f5dcf0..0ee951066 100644 --- a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c +++ b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c @@ -62,7 +62,7 @@ void ObjTokeidai_Clock_Draw(Actor* thisx, PlayState* play); void ObjTokeidai_Counterweight_Draw(Actor* thisx, PlayState* play); void ObjTokeidai_ExteriorGear_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Tokeidai_InitVars = { +ActorInit Obj_Tokeidai_InitVars = { ACTOR_OBJ_TOKEIDAI, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.h b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.h index 70ef31c79..e670d19e0 100644 --- a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.h +++ b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.h @@ -62,6 +62,4 @@ typedef struct ObjTokeidai { /* 0x174 */ ObjTokeidaiActionFunc actionFunc; } ObjTokeidai; // size = 0x178 -extern const ActorInit Obj_Tokeidai_InitVars; - #endif // Z_OBJ_TOKEIDAI_H diff --git a/src/overlays/actors/ovl_Obj_Toudai/z_obj_toudai.c b/src/overlays/actors/ovl_Obj_Toudai/z_obj_toudai.c index 4a71acc95..07561b8cd 100644 --- a/src/overlays/actors/ovl_Obj_Toudai/z_obj_toudai.c +++ b/src/overlays/actors/ovl_Obj_Toudai/z_obj_toudai.c @@ -16,7 +16,7 @@ void ObjToudai_Destroy(Actor* thisx, PlayState* play); void ObjToudai_Update(Actor* thisx, PlayState* play); void ObjToudai_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Toudai_InitVars = { +ActorInit Obj_Toudai_InitVars = { ACTOR_OBJ_TOUDAI, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Toudai/z_obj_toudai.h b/src/overlays/actors/ovl_Obj_Toudai/z_obj_toudai.h index c1af4d733..60f0b9796 100644 --- a/src/overlays/actors/ovl_Obj_Toudai/z_obj_toudai.h +++ b/src/overlays/actors/ovl_Obj_Toudai/z_obj_toudai.h @@ -18,6 +18,4 @@ typedef struct ObjToudai { /* 0x23A */ UNK_TYPE1 pad23A[6]; } ObjToudai;// size = 0x240 -extern const ActorInit Obj_Toudai_InitVars; - #endif // Z_OBJ_TOUDAI_H diff --git a/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c b/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c index ef55e5ab7..4dcfd4f74 100644 --- a/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c +++ b/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c @@ -20,7 +20,7 @@ void ObjTree_DoNothing(ObjTree* this, PlayState* play); void ObjTree_SetupDoNothing(ObjTree* this); void ObjTree_Sway(ObjTree* this, PlayState* play); -const ActorInit Obj_Tree_InitVars = { +ActorInit Obj_Tree_InitVars = { ACTOR_OBJ_TREE, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.h b/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.h index 828530ab3..8d40c57f1 100644 --- a/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.h +++ b/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.h @@ -19,6 +19,4 @@ typedef struct ObjTree { /* 0x1B4 */ s16 timer; } ObjTree; // size = 0x1B8 -extern const ActorInit Obj_Tree_InitVars; - #endif // Z_OBJ_TREE_H diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index eccc9c2c3..33b493237 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -41,7 +41,7 @@ s16 D_80929504 = 0; s16 D_80929508 = 0; s16 D_8092950C = 0; -const ActorInit Obj_Tsubo_InitVars = { +ActorInit Obj_Tsubo_InitVars = { ACTOR_OBJ_TSUBO, ACTORCAT_PROP, FLAGS, @@ -190,20 +190,21 @@ void ObjTsubo_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->objBankIndex = Object_GetIndex(&play->objectCtx, sPotTypeData[type].objId); if (this->objBankIndex < 0) { - Actor_MarkForDeath(&this->actor); - } else { - this->actor.shape.shadowScale = 1.8f; - this->homeRoom = this->actor.room; - if ((type != OBJ_TSUBO_TYPE_3) && (sp2C != 2)) { - if (Item_CanDropBigFairy(play, OBJ_TSUBO_P003F(&this->actor), OBJ_TSUBO_PFE00(&this->actor))) { - this->unk_198 = true; - } - } - if ((type == OBJ_TSUBO_TYPE_3) || (sp2C != 2) || !func_809275C0(this, play)) { - this->unk_19A = -1; - } - func_80928914(this); + Actor_Kill(&this->actor); + return; } + + this->actor.shape.shadowScale = 1.8f; + this->homeRoom = this->actor.room; + if ((type != OBJ_TSUBO_TYPE_3) && (sp2C != 2)) { + if (Item_CanDropBigFairy(play, OBJ_TSUBO_P003F(&this->actor), OBJ_TSUBO_PFE00(&this->actor))) { + this->unk_198 = true; + } + } + if ((type == OBJ_TSUBO_TYPE_3) || (sp2C != 2) || !func_809275C0(this, play)) { + this->unk_19A = -1; + } + func_80928914(this); } void ObjTsubo_Destroy(Actor* thisx, PlayState* play2) { @@ -485,7 +486,7 @@ void func_809289E4(ObjTsubo* this, PlayState* play) { func_80927818(this, play, 1); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_POT_BROKEN); if (ObjTsubo_IsSceneNotGohtOrTwinmold(this, play)) { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } else { func_809291DC(this); } @@ -576,10 +577,11 @@ void func_80928F18(ObjTsubo* this, PlayState* play) { } SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_POT_BROKEN); if (ObjTsubo_IsSceneNotGohtOrTwinmold(this, play)) { - Actor_MarkForDeath(&this->actor); - } else { - func_809291DC(this); + Actor_Kill(&this->actor); + return; } + + func_809291DC(this); } else if (this->actor.bgCheckFlags & 0x40) { typeData->breakPot2(this, play); if (type == OBJ_TSUBO_TYPE_3) { @@ -590,10 +592,11 @@ void func_80928F18(ObjTsubo* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_POT_BROKEN); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); if (ObjTsubo_IsSceneNotGohtOrTwinmold(this, play)) { - Actor_MarkForDeath(&this->actor); - } else { - func_809291DC(this); + Actor_Kill(&this->actor); + return; } + + func_809291DC(this); } else { Actor_MoveWithGravity(&this->actor); Math_StepToS(&D_80929504, D_80929500, 150); diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h index 28233c911..2b3d1537f 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h @@ -31,8 +31,6 @@ typedef struct ObjTsubo { /* 0x19B */ u8 unk_19B; } ObjTsubo; // size = 0x19C -extern const ActorInit Obj_Tsubo_InitVars; - typedef enum { /* 0 */ OBJ_TSUBO_TYPE_0, /* 1 */ OBJ_TSUBO_TYPE_1, diff --git a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c index 63fe32501..687fb78ea 100644 --- a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c +++ b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c @@ -61,7 +61,7 @@ void ObjUm_DefaultAnim(ObjUm* this, PlayState* play); void ObjUm_ChangeAnim(ObjUm* this, PlayState* play, ObjUmAnimation animIndex); void ObjUm_SetupAction(ObjUm* this, ObjUmActionFunc actionFunc); -const ActorInit Obj_Um_InitVars = { +ActorInit Obj_Um_InitVars = { ACTOR_OBJ_UM, ACTORCAT_NPC, FLAGS, @@ -684,7 +684,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { // if (!AliensDefeated) if (!(gSaveContext.save.weekEventReg[22] & 1)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -705,7 +705,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { if ((gSaveContext.save.weekEventReg[34] & 0x80) || gSaveContext.save.time >= CLOCK_TIME(19, 0) || gSaveContext.save.time <= CLOCK_TIME(6, 0) || (gSaveContext.save.weekEventReg[52] & 1) || (gSaveContext.save.weekEventReg[52] & 2)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -715,7 +715,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { } } else if (this->type == OBJ_UM_TYPE_PRE_MILK_RUN) { if (!(gSaveContext.save.weekEventReg[31] & 0x80) || (gSaveContext.save.weekEventReg[52] & 1)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -729,7 +729,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { } } else if (this->type == OBJ_UM_TYPE_MILK_RUN_MINIGAME) { if (!(gSaveContext.save.weekEventReg[31] & 0x80)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -741,7 +741,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { ObjUm_RotatePlayer(this, play, 0); } else if (this->type == OBJ_UM_TYPE_POST_MILK_RUN) { if (!(gSaveContext.save.weekEventReg[52] & 1) || (gSaveContext.save.weekEventReg[59] & 2)) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -768,7 +768,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { } if (this->dyna.bgId == BGCHECK_SCENE) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -780,7 +780,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) { this->dyna.actor.shape.rot.y, 0, ENHORSE_PARAMS(ENHORSE_PARAM_DONKEY, ENHORSE_18)); if (this->donkey == NULL) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); return; } @@ -802,11 +802,11 @@ void ObjUm_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->banditsCollisions[1]); } -// ObjUm_MarkMyDonkeyAndMyselfForDeath, ObjUm_TerminateMe, ObjUmn't, ObjUm_Asinucide +// ObjUm_KillMyDonkeyAndMyself, ObjUm_TerminateMe, ObjUmn't, ObjUm_Asinucide void func_80B79524(ObjUm* this) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); if (this->donkey != NULL) { - Actor_MarkForDeath(&this->donkey->actor); + Actor_Kill(&this->donkey->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Um/z_obj_um.h b/src/overlays/actors/ovl_Obj_Um/z_obj_um.h index a6644009e..0c6a7178e 100644 --- a/src/overlays/actors/ovl_Obj_Um/z_obj_um.h +++ b/src/overlays/actors/ovl_Obj_Um/z_obj_um.h @@ -62,8 +62,6 @@ typedef struct ObjUm { /* 0x4E0 */ s32 areAllPotsBroken; // true when all of the pots have been broken } ObjUm; // size = 0x4E4 -extern const ActorInit Obj_Um_InitVars; - typedef enum { /* 0 */ OBJ_UM_TYPE_TERMINA_FIELD, /* 1 */ OBJ_UM_TYPE_RANCH, diff --git a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c index 33ebf1e50..d20f988fd 100644 --- a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c +++ b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c @@ -16,7 +16,7 @@ void ObjUsiyane_Destroy(Actor* thisx, PlayState* play); void ObjUsiyane_Update(Actor* thisx, PlayState* play); void ObjUsiyane_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Usiyane_InitVars = { +ActorInit Obj_Usiyane_InitVars = { ACTOR_OBJ_USIYANE, ACTORCAT_PROP, FLAGS, @@ -88,7 +88,7 @@ s32 func_80C07CD0(void) { void func_80C07DC4(ObjUsiyane* this, PlayState* play) { if (func_80C07CD0()) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } } @@ -166,7 +166,7 @@ void func_80C081C8(ObjUsiyane* this, PlayState* play) { } } else if (this->unk_740 >= 70) { - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); } this->unk_740++; } @@ -213,7 +213,7 @@ void ObjUsiyane_Init(Actor* thisx, PlayState* play) { break; default: - Actor_MarkForDeath(&this->dyna.actor); + Actor_Kill(&this->dyna.actor); break; } } diff --git a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.h b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.h index c38a08ed9..2abc2a38b 100644 --- a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.h +++ b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.h @@ -34,6 +34,4 @@ typedef struct ObjUsiyane { /* 0x744 */ s32 unk_744; } ObjUsiyane; // size = 0x748 -extern const ActorInit Obj_Usiyane_InitVars; - #endif // Z_OBJ_USIYANE_H diff --git a/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c b/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c index e0d07c4fb..4b0a797f6 100644 --- a/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c +++ b/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c @@ -15,7 +15,7 @@ void ObjVisiblock_Init(Actor* thisx, PlayState* play); void ObjVisiblock_Destroy(Actor* thisx, PlayState* play); void ObjVisiblock_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Visiblock_InitVars = { +ActorInit Obj_Visiblock_InitVars = { ACTOR_OBJ_VISIBLOCK, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.h b/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.h index 946685a5c..5fa08ab86 100644 --- a/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.h +++ b/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.h @@ -10,6 +10,4 @@ typedef struct ObjVisiblock { /* 0x15C */ UNK_TYPE1 unk15C[0x4]; } ObjVisiblock; // size = 0x160 -extern const ActorInit Obj_Visiblock_InitVars; - #endif // Z_OBJ_VISIBLOCK_H diff --git a/src/overlays/actors/ovl_Obj_Vspinyroll/z_obj_vspinyroll.c b/src/overlays/actors/ovl_Obj_Vspinyroll/z_obj_vspinyroll.c index be692069f..b7a1e59be 100644 --- a/src/overlays/actors/ovl_Obj_Vspinyroll/z_obj_vspinyroll.c +++ b/src/overlays/actors/ovl_Obj_Vspinyroll/z_obj_vspinyroll.c @@ -27,7 +27,7 @@ void func_80A3D0E8(ObjVspinyroll* this); void func_80A3D0FC(ObjVspinyroll* this, PlayState* play); void func_80A3D2C0(Actor* thisx, PlayState* play); -const ActorInit Obj_Vspinyroll_InitVars = { +ActorInit Obj_Vspinyroll_InitVars = { ACTOR_OBJ_VSPINYROLL, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Vspinyroll/z_obj_vspinyroll.h b/src/overlays/actors/ovl_Obj_Vspinyroll/z_obj_vspinyroll.h index 38dee86fb..09a91b437 100644 --- a/src/overlays/actors/ovl_Obj_Vspinyroll/z_obj_vspinyroll.h +++ b/src/overlays/actors/ovl_Obj_Vspinyroll/z_obj_vspinyroll.h @@ -43,6 +43,4 @@ typedef struct ObjVspinyroll { /* 0x3C8 */ s16 unk_3C8; } ObjVspinyroll; // size = 0x3CC -extern const ActorInit Obj_Vspinyroll_InitVars; - #endif // Z_OBJ_VSPINYROLL_H diff --git a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c index 4e0fb508d..7d6ade650 100644 --- a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c +++ b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c @@ -22,7 +22,7 @@ s32 ObjWarpstone_BeginOpeningCutscene(ObjWarpstone* this, PlayState* play); s32 ObjWarpstone_PlayOpeningCutscene(ObjWarpstone* this, PlayState* play); s32 ObjWarpstone_OpenedIdle(ObjWarpstone* this, PlayState* play); -const ActorInit Obj_Warpstone_InitVars = { +ActorInit Obj_Warpstone_InitVars = { ACTOR_OBJ_WARPSTONE, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.h b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.h index 8d39deef0..a2db609d6 100644 --- a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.h +++ b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.h @@ -26,8 +26,6 @@ typedef struct ObjWarpstone { /* 0x1AC */ ObjWarpstoneActionFunc actionFunc; } ObjWarpstone; // size = 0x1B0 -extern const ActorInit Obj_Warpstone_InitVars; - #define OBJ_WARPSTONE_GET_ID(thisx) ((u16)((thisx)->params & 0xF)) #define OBJ_WARPSTONE_IS_ACTIVATED(owlId) (((void)0, gSaveContext.save.playerData.owlActivationFlags) & (u16)gBitFlags[(owlId)]) diff --git a/src/overlays/actors/ovl_Obj_Wind/z_obj_wind.c b/src/overlays/actors/ovl_Obj_Wind/z_obj_wind.c index 567d9a92e..5f53030f3 100644 --- a/src/overlays/actors/ovl_Obj_Wind/z_obj_wind.c +++ b/src/overlays/actors/ovl_Obj_Wind/z_obj_wind.c @@ -16,7 +16,7 @@ void ObjWind_Update(Actor* thisx, PlayState* play); void ObjWind_Draw(Actor* thisx, PlayState* play); #if 0 -const ActorInit Obj_Wind_InitVars = { +ActorInit Obj_Wind_InitVars = { ACTOR_OBJ_WIND, ACTORCAT_ITEMACTION, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Wind/z_obj_wind.h b/src/overlays/actors/ovl_Obj_Wind/z_obj_wind.h index 23296ff09..08db8914a 100644 --- a/src/overlays/actors/ovl_Obj_Wind/z_obj_wind.h +++ b/src/overlays/actors/ovl_Obj_Wind/z_obj_wind.h @@ -10,6 +10,4 @@ typedef struct ObjWind { /* 0x144 */ char unk_144[0x4]; } ObjWind; // size = 0x148 -extern const ActorInit Obj_Wind_InitVars; - #endif // Z_OBJ_WIND_H diff --git a/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c b/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c index aea3bc7f1..cfeaabcfd 100644 --- a/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c +++ b/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c @@ -22,7 +22,7 @@ void func_808A7BA0(ObjWturn* this, PlayState* play); void func_808A7C04(ObjWturn* this, PlayState* play); void func_808A7C78(ObjWturn* this, PlayState* play); -const ActorInit Obj_Wturn_InitVars = { +ActorInit Obj_Wturn_InitVars = { ACTOR_OBJ_WTURN, ACTORCAT_ITEMACTION, FLAGS, GAMEPLAY_KEEP, sizeof(ObjWturn), (ActorFunc)ObjWturn_Init, (ActorFunc)Actor_Noop, (ActorFunc)ObjWturn_Update, (ActorFunc)NULL, @@ -41,9 +41,12 @@ void func_808A7954(ObjWturn* this) { void func_808A7968(ObjWturn* this, PlayState* play) { if (play->msgCtx.ocarinaMode >= 28 && play->msgCtx.ocarinaMode < 39) { Flags_UnsetSwitch(play, this->actor.params); - Actor_MarkForDeath(&this->actor); - } else if ((Flags_GetSwitch(play, this->actor.params) && (play->sceneId == SCENE_F40)) || - (!Flags_GetSwitch(play, this->actor.params) && (play->sceneId == SCENE_F41))) { + Actor_Kill(&this->actor); + return; + } + + if ((Flags_GetSwitch(play, this->actor.params) && (play->sceneId == SCENE_F40)) || + (!Flags_GetSwitch(play, this->actor.params) && (play->sceneId == SCENE_F41))) { func_808A7A24(this); } } diff --git a/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.h b/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.h index 9b8674f59..2e2963d0e 100644 --- a/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.h +++ b/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.h @@ -14,6 +14,4 @@ typedef struct ObjWturn { /* 0x14A */ s16 unk_14A; } ObjWturn; // size = 0x14C -extern const ActorInit Obj_Wturn_InitVars; - #endif // Z_OBJ_WTURN_H diff --git a/src/overlays/actors/ovl_Obj_Y2lift/z_obj_y2lift.c b/src/overlays/actors/ovl_Obj_Y2lift/z_obj_y2lift.c index 8870295aa..9399940d8 100644 --- a/src/overlays/actors/ovl_Obj_Y2lift/z_obj_y2lift.c +++ b/src/overlays/actors/ovl_Obj_Y2lift/z_obj_y2lift.c @@ -16,7 +16,7 @@ void ObjY2lift_Destroy(Actor* thisx, PlayState* play); void ObjY2lift_Update(Actor* thisx, PlayState* play); void ObjY2lift_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Y2lift_InitVars = { +ActorInit Obj_Y2lift_InitVars = { ACTOR_OBJ_Y2LIFT, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Y2lift/z_obj_y2lift.h b/src/overlays/actors/ovl_Obj_Y2lift/z_obj_y2lift.h index a26d305ae..cacb0fa7b 100644 --- a/src/overlays/actors/ovl_Obj_Y2lift/z_obj_y2lift.h +++ b/src/overlays/actors/ovl_Obj_Y2lift/z_obj_y2lift.h @@ -13,6 +13,4 @@ typedef struct ObjY2lift { /* 0x15F */ u8 unk15F; } ObjY2lift; // size = 0x160 -extern const ActorInit Obj_Y2lift_InitVars; - #endif // Z_OBJ_Y2LIFT_H diff --git a/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c b/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c index b8110ce6a..9d35288c5 100644 --- a/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c +++ b/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c @@ -29,7 +29,7 @@ typedef struct ShutterInfo { /* 0x1E */ u8 openTimer; } ShutterInfo; // size = 0x20 -const ActorInit Obj_Y2shutter_InitVars = { +ActorInit Obj_Y2shutter_InitVars = { ACTOR_OBJ_Y2SHUTTER, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.h b/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.h index dcc95b1b1..bccdce645 100644 --- a/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.h +++ b/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.h @@ -12,8 +12,6 @@ typedef struct ObjY2shutter { /* 0x15F */ u8 settleTimer; } ObjY2shutter; // size = 0x160 -extern const ActorInit Obj_Y2shutter_InitVars; - typedef enum { /* 0x0 */ SHUTTER_BARRED, /* 0x1 */ SHUTTER_GRATED, diff --git a/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c b/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c index 845e97da4..02107b102 100644 --- a/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c +++ b/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c @@ -16,7 +16,7 @@ void ObjYado_Destroy(Actor* thisx, PlayState* play); void ObjYado_Update(Actor* thisx, PlayState* play); void ObjYado_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Yado_InitVars = { +ActorInit Obj_Yado_InitVars = { ACTOR_OBJ_YADO, ACTORCAT_BG, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.h b/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.h index 28ffd63dc..52ef8693e 100644 --- a/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.h +++ b/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.h @@ -10,6 +10,4 @@ typedef struct ObjYado { /* 0x144 */ u8 isNight; } ObjYado; // size = 0x148 -extern const ActorInit Obj_Yado_InitVars; - #endif // Z_OBJ_YADO_H diff --git a/src/overlays/actors/ovl_Obj_Yasi/z_obj_yasi.c b/src/overlays/actors/ovl_Obj_Yasi/z_obj_yasi.c index 185638056..5af34152a 100644 --- a/src/overlays/actors/ovl_Obj_Yasi/z_obj_yasi.c +++ b/src/overlays/actors/ovl_Obj_Yasi/z_obj_yasi.c @@ -18,7 +18,7 @@ void ObjYasi_Destroy(Actor* thisx, PlayState* play); void ObjYasi_Update(Actor* thisx, PlayState* play); void ObjYasi_Draw(Actor* thisx, PlayState* play); -const ActorInit Obj_Yasi_InitVars = { +ActorInit Obj_Yasi_InitVars = { ACTOR_OBJ_YASI, ACTORCAT_PROP, FLAGS, diff --git a/src/overlays/actors/ovl_Obj_Yasi/z_obj_yasi.h b/src/overlays/actors/ovl_Obj_Yasi/z_obj_yasi.h index d1fdc6aed..fc2b777d8 100644 --- a/src/overlays/actors/ovl_Obj_Yasi/z_obj_yasi.h +++ b/src/overlays/actors/ovl_Obj_Yasi/z_obj_yasi.h @@ -9,8 +9,6 @@ typedef struct ObjYasi { /* 0x000 */ DynaPolyActor dyna; } ObjYasi; // size = 0x15C -extern const ActorInit Obj_Yasi_InitVars; - #define PALM_TREE_IS_WIDE(thisx) ((thisx)->params & 1) #endif // Z_OBJ_YASI_H diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index 264167db5..db78f579b 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -27,7 +27,7 @@ void func_808DDE9C(Actor* thisx, PlayState* play2); static f32 D_808DE5B0; -const ActorInit Object_Kankyo_InitVars = { +ActorInit Object_Kankyo_InitVars = { ACTOR_OBJECT_KANKYO, ACTORCAT_ITEMACTION, FLAGS, @@ -125,7 +125,7 @@ void ObjectKankyo_Init(Actor* thisx, PlayState* play) { void ObjectKankyo_Destroy(Actor* thisx, PlayState* play) { ObjectKankyo* this = THIS; - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void func_808DC18C(ObjectKankyo* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h index c6e374da8..8dc8d4d85 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h @@ -28,6 +28,4 @@ typedef struct ObjectKankyo { /* 0x1150 */ ObjectKankyoActionFunc actionFunc; } ObjectKankyo; // size = 0x1154 -extern const ActorInit Object_Kankyo_InitVars; - #endif // Z_OBJECT_KANKYO_H diff --git a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c index 7eaf78c20..a19cb276a 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c @@ -21,7 +21,7 @@ void OceffSpot_End(OceffSpot* this, PlayState* play); void OceffSpot_SetupAction(OceffSpot* this, OceffSpotActionFunc actionFunc); -const ActorInit Oceff_Spot_InitVars = { +ActorInit Oceff_Spot_InitVars = { ACTOR_OCEFF_SPOT, ACTORCAT_ITEMACTION, FLAGS, @@ -79,7 +79,7 @@ void OceffSpot_End(OceffSpot* this, PlayState* play) { if (this->unk16C > 0.0f) { this->unk16C -= 0.05f; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); if ((REG(15) != 0x190) && (play->msgCtx.unk12046 == 0)) { if ((play->msgCtx.ocarinaAction != 0x39) || (play->msgCtx.ocarinaMode != 0xA)) { gSaveContext.sunsSongState = SUNSSONG_START; diff --git a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h index 0a770ee9d..2e4e2a29a 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h @@ -18,6 +18,4 @@ typedef struct OceffSpot { /* 0x174 */ OceffSpotActionFunc actionFunc; } OceffSpot; // size = 0x178 -extern const ActorInit Oceff_Spot_InitVars; - #endif // Z_OCEFF_SPOT_H diff --git a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c index 3a4faceea..96d76f807 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c @@ -19,7 +19,7 @@ void OceffStorm_DefaultAction(OceffStorm* this, PlayState* play); void func_80981B48(OceffStorm* this, PlayState* play); void OceffStorm_Draw2(Actor* thisx, PlayState* play); -const ActorInit Oceff_Storm_InitVars = { +ActorInit Oceff_Storm_InitVars = { ACTOR_OCEFF_STORM, ACTORCAT_ITEMACTION, FLAGS, @@ -150,7 +150,7 @@ void OceffStorm_DefaultAction(OceffStorm* this, PlayState* play) { if (this->counter < 70) { this->counter++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h index 20dd1ffcb..87a67191c 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h @@ -17,8 +17,6 @@ typedef struct OceffStorm { /* 0x14C */ OceffStormActionFunc actionFunc; } OceffStorm; // size = 0x150 -extern const ActorInit Oceff_Storm_InitVars; - typedef enum { /* 1 */ OCEFF_STORM_ACTION_PARAM_1 = 1 } OceffStormActionParams; diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index ef1fa1035..42bf6c703 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -15,7 +15,7 @@ void OceffWipe_Destroy(Actor* thisx, PlayState* play); void OceffWipe_Update(Actor* thisx, PlayState* play); void OceffWipe_Draw(Actor* thisx, PlayState* play); -const ActorInit Oceff_Wipe_InitVars = { +ActorInit Oceff_Wipe_InitVars = { ACTOR_OCEFF_WIPE, ACTORCAT_ITEMACTION, FLAGS, @@ -51,7 +51,7 @@ void OceffWipe_Update(Actor* thisx, PlayState* play) { if (this->counter < 100) { this->counter++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h index 6828c996d..0ee4314d0 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h @@ -15,6 +15,4 @@ typedef struct OceffWipe { /* 0x144 */ s16 counter; } OceffWipe; // size = 0x148 -extern const ActorInit Oceff_Wipe_InitVars; - #endif // Z_OCEFF_WIPE_H diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c index 54672f173..3d8004c5c 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -15,7 +15,7 @@ void OceffWipe2_Destroy(Actor* thisx, PlayState* play); void OceffWipe2_Update(Actor* thisx, PlayState* play); void OceffWipe2_Draw(Actor* thisx, PlayState* play); -const ActorInit Oceff_Wipe2_InitVars = { +ActorInit Oceff_Wipe2_InitVars = { ACTOR_OCEFF_WIPE2, ACTORCAT_ITEMACTION, FLAGS, @@ -53,7 +53,7 @@ void OceffWipe2_Update(Actor* thisx, PlayState* play) { if (this->timer < 100) { this->timer++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h index c213dfe38..ee2fb2968 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h @@ -10,6 +10,4 @@ typedef struct OceffWipe2 { /* 0x144 */ s16 timer; } OceffWipe2; // size = 0x148 -extern const ActorInit Oceff_Wipe2_InitVars; - #endif // Z_OCEFF_WIPE2_H diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c index 4837f6949..52031ce00 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -16,7 +16,7 @@ void OceffWipe3_Destroy(Actor* thisx, PlayState* play); void OceffWipe3_Update(Actor* thisx, PlayState* play); void OceffWipe3_Draw(Actor* thisx, PlayState* play); -const ActorInit Oceff_Wipe3_InitVars = { +ActorInit Oceff_Wipe3_InitVars = { ACTOR_OCEFF_WIPE3, ACTORCAT_ITEMACTION, FLAGS, @@ -54,7 +54,7 @@ void OceffWipe3_Update(Actor* thisx, PlayState* play) { if (this->counter < 100) { this->counter++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h index f29ca9278..a604aae34 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h @@ -10,6 +10,4 @@ typedef struct OceffWipe3 { /* 0x144 */ s16 counter; } OceffWipe3; // size = 0x148 -extern const ActorInit Oceff_Wipe3_InitVars; - #endif // Z_OCEFF_WIPE3_H diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c index 18fecfe71..3554bc78a 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -15,7 +15,7 @@ void OceffWipe4_Destroy(Actor* thisx, PlayState* play); void OceffWipe4_Update(Actor* thisx, PlayState* play); void OceffWipe4_Draw(Actor* thisx, PlayState* play); -const ActorInit Oceff_Wipe4_InitVars = { +ActorInit Oceff_Wipe4_InitVars = { ACTOR_OCEFF_WIPE4, ACTORCAT_ITEMACTION, FLAGS, @@ -53,7 +53,7 @@ void OceffWipe4_Update(Actor* thisx, PlayState* play) { if (this->counter < 50) { this->counter++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h index 59b592318..e65bf575b 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h @@ -15,6 +15,4 @@ typedef struct OceffWipe4 { /* 0x144 */ s16 counter; } OceffWipe4; // size = 0x148 -extern const ActorInit Oceff_Wipe4_InitVars; - #endif // Z_OCEFF_WIPE4_H diff --git a/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c b/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c index 951ba1c39..0d0db6385 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c +++ b/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c @@ -15,7 +15,7 @@ void OceffWipe5_Destroy(Actor* thisx, PlayState* play); void OceffWipe5_Update(Actor* thisx, PlayState* play); void OceffWipe5_Draw(Actor* thisx, PlayState* play); -const ActorInit Oceff_Wipe5_InitVars = { +ActorInit Oceff_Wipe5_InitVars = { ACTOR_OCEFF_WIPE5, ACTORCAT_ITEMACTION, FLAGS, @@ -51,7 +51,7 @@ void OceffWipe5_Update(Actor* thisx, PlayState* play) { if (this->counter < 100) { this->counter++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.h b/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.h index 05424ea1e..21e1f2383 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.h +++ b/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.h @@ -12,6 +12,4 @@ typedef struct OceffWipe5 { /* 0x144 */ s16 counter; } OceffWipe5; // size = 0x148 -extern const ActorInit Oceff_Wipe5_InitVars; - #endif // Z_OCEFF_WIPE5_H diff --git a/src/overlays/actors/ovl_Oceff_Wipe6/z_oceff_wipe6.c b/src/overlays/actors/ovl_Oceff_Wipe6/z_oceff_wipe6.c index 97c688434..87dbe2752 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe6/z_oceff_wipe6.c +++ b/src/overlays/actors/ovl_Oceff_Wipe6/z_oceff_wipe6.c @@ -15,7 +15,7 @@ void OceffWipe6_Destroy(Actor* thisx, PlayState* play); void OceffWipe6_Update(Actor* thisx, PlayState* play); void OceffWipe6_Draw(Actor* thisx, PlayState* play); -const ActorInit Oceff_Wipe6_InitVars = { +ActorInit Oceff_Wipe6_InitVars = { ACTOR_OCEFF_WIPE6, ACTORCAT_ITEMACTION, FLAGS, @@ -49,7 +49,7 @@ void OceffWipe6_Update(Actor* thisx, PlayState* play) { if (this->counter < 100) { this->counter++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe6/z_oceff_wipe6.h b/src/overlays/actors/ovl_Oceff_Wipe6/z_oceff_wipe6.h index c37e3f9d4..2afd8f24f 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe6/z_oceff_wipe6.h +++ b/src/overlays/actors/ovl_Oceff_Wipe6/z_oceff_wipe6.h @@ -10,6 +10,4 @@ typedef struct OceffWipe6 { /* 0x144 */ s16 counter; } OceffWipe6; // size = 0x148 -extern const ActorInit Oceff_Wipe6_InitVars; - #endif // Z_OCEFF_WIPE6_H diff --git a/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c b/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c index abd01e1ff..f269a89a5 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c +++ b/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c @@ -15,7 +15,7 @@ void OceffWipe7_Destroy(Actor* thisx, PlayState* play); void OceffWipe7_Update(Actor* thisx, PlayState* play); void OceffWipe7_Draw(Actor* thisx, PlayState* play); -const ActorInit Oceff_Wipe7_InitVars = { +ActorInit Oceff_Wipe7_InitVars = { ACTOR_OCEFF_WIPE7, ACTORCAT_ITEMACTION, FLAGS, @@ -53,7 +53,7 @@ void OceffWipe7_Update(Actor* thisx, PlayState* play) { if (this->counter < 100) { this->counter++; } else { - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.h b/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.h index d5d82130c..7cb7019a7 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.h +++ b/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.h @@ -10,6 +10,4 @@ typedef struct OceffWipe7 { /* 0x144 */ s16 counter; } OceffWipe7; // size = 0x148 -extern const ActorInit Oceff_Wipe7_InitVars; - #endif // Z_OCEFF_WIPE7_H diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index 1aa2e545e..d923bdd20 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -19,7 +19,7 @@ void ShotSun_Update(Actor* thisx, PlayState* play); void ShotSun_UpdateForOcarina(ShotSun* this, PlayState* play); void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play); -const ActorInit Shot_Sun_InitVars = { +ActorInit Shot_Sun_InitVars = { ACTOR_SHOT_SUN, ACTORCAT_PROP, FLAGS, @@ -98,7 +98,7 @@ void ShotSun_SpawnFairy(ShotSun* this, PlayState* play2) { } Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, 0, 0, 0, fairyType); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } } @@ -164,8 +164,11 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play) { } } - Actor_MarkForDeath(&this->actor); - } else if (!(this->actor.xzDistToPlayer > 120.0f)) { + Actor_Kill(&this->actor); + return; + } + + if (!(this->actor.xzDistToPlayer > 120.0f)) { if ((gSaveContext.save.time >= CLOCK_TIME(6, 30)) && (gSaveContext.save.time < CLOCK_TIME(7, 30))) { cylinderPos.x = player->bodyPartsPos[7].x + (play->envCtx.unk_4 * (1.0f / 6.0f)); cylinderPos.y = (player->bodyPartsPos[7].y - 30.0f) + (play->envCtx.unk_8 * (1.0f / 6.0f)); diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h index 49fd2ffb7..3ba7f35d9 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h @@ -18,8 +18,6 @@ typedef struct ShotSun { /* 0x194 */ Vec3s hitboxPos; /* 0x19A */ s16 timer; /* 0x19C */ s8 unk_19C; // leftover from OOT secret ocarina occurrence function. -} ShotSun; // size = 0x1A0 - -extern const ActorInit Shot_Sun_InitVars; +} ShotSun; // size = 0x1A0 #endif // Z_SHOT_SUN_H diff --git a/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c b/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c index c79697e97..8c1e98bed 100644 --- a/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c +++ b/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c @@ -18,7 +18,7 @@ void TGSw_Draw(Actor* thisx, PlayState* play); void TGSw_ActionExecuteOneShot(struct TGSw* this, PlayState* play); -const ActorInit TG_Sw_InitVars = { +ActorInit TG_Sw_InitVars = { ACTOR_TG_SW, ACTORCAT_PROP, FLAGS, @@ -84,7 +84,7 @@ void TGSw_ActionExecuteOneShot(TGSw* this, PlayState* play) { actor = actor->next; } while (actor != NULL); - Actor_MarkForDeath(&this->actor); + Actor_Kill(&this->actor); } void TGSw_Init(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_TG_Sw/z_tg_sw.h b/src/overlays/actors/ovl_TG_Sw/z_tg_sw.h index 28bebb5d8..cbcb66431 100644 --- a/src/overlays/actors/ovl_TG_Sw/z_tg_sw.h +++ b/src/overlays/actors/ovl_TG_Sw/z_tg_sw.h @@ -11,6 +11,4 @@ typedef struct TGSw { /* 0x144 */ TGSwActionFunc actionFunc; } TGSw; // size = 0x148 -extern const ActorInit TG_Sw_InitVars; - #endif // Z_TG_SW_H diff --git a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c index 5d546a78f..1c6d53e7f 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c +++ b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c @@ -52,7 +52,7 @@ void EffectSsStick_Draw(PlayState* play, u32 index, EffectSs* this) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); func_8012C28C(gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->rObjBankIndex].segment); - gSPSegment(POLY_OPA_DISP++, 0x0C, D_801C0850); + gSPSegment(POLY_OPA_DISP++, 0x0C, gCullBackDList); gSPDisplayList(POLY_OPA_DISP++, gDekuStickDL); CLOSE_DISPS(gfxCtx); diff --git a/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c b/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c index 0ed80c066..a3839bc40 100644 --- a/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c +++ b/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c @@ -6,6 +6,8 @@ #include "z_fbdemo_wipe5.h" +#define THIS ((TransitionWipe5*)thisx) + void* TransitionWipe5_Init(void* thisx); void TransitionWipe5_Destroy(void* thisx); void TransitionWipe5_Update(void* thisx, s32 updateRate); @@ -16,37 +18,129 @@ void TransitionWipe5_SetColor(void* thisx, u32 color); void TransitionWipe5_SetEnvColor(void* thisx, u32 color); s32 TransitionWipe5_IsDone(void* thisx); -#if 0 TransitionInit TransitionWipe5_InitVars = { - TransitionWipe5_Init, - TransitionWipe5_Destroy, - TransitionWipe5_Update, - TransitionWipe5_Draw, - TransitionWipe5_Start, - TransitionWipe5_SetType, - TransitionWipe5_SetColor, - TransitionWipe5_SetEnvColor, - TransitionWipe5_IsDone, + TransitionWipe5_Init, TransitionWipe5_Destroy, TransitionWipe5_Update, + TransitionWipe5_Draw, TransitionWipe5_Start, TransitionWipe5_SetType, + TransitionWipe5_SetColor, TransitionWipe5_SetEnvColor, TransitionWipe5_IsDone, }; -#endif +void TransitionWipe5_Start(void* thisx) { + TransitionWipe5* this = THIS; -extern u16 D_0F000000[]; + this->isDone = false; + switch (this->unk_12) { + case 0: + this->unk_08 = 0.02f; + break; + case 1: + this->unk_08 = 0.05f; + break; + default: + this->unk_08 = 0.2f; + break; + } + switch (this->unk_11) { + case 0: + this->primColor.rgba = RGBA8(0, 0, 0, 255); + break; + case 1: + this->primColor.rgba = RGBA8(160, 160, 160, 255); + break; + default: + this->primColor.rgba = RGBA8(160, 160, 160, 255); + break; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_Start.s") +void* TransitionWipe5_Init(void* thisx) { + TransitionWipe5* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_Init.s") + bzero(this, sizeof(TransitionWipe5)); + return this; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_Destroy.s") +void TransitionWipe5_Destroy(void* thisx) { +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_Update.s") +void TransitionWipe5_Update(void* thisx, s32 updateRate) { + TransitionWipe5* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_Draw.s") + if (this->unk_10 == 0) { + this->isDone = true; + } else { + this->unk_0C += (this->unk_08 * 3.0f) / updateRate; + if (this->unk_0C >= 1.0f) { + this->unk_0C = 1.0f; + this->isDone = true; + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_IsDone.s") +void TransitionWipe5_Draw(void* thisx, Gfx** gfxP) { + Gfx* gfx = *gfxP; + s32 width = gScreenWidth; + s32 height = gScreenHeight; + s32 sp50 = D_801FBB90; + TransitionWipe5* this = THIS; + s32 alpha = (1.0f - this->unk_0C) * 255.0f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_SetType.s") + gDPPipeSync(gfx++); + gSPLoadUcodeL(gfx++, gspS2DEX2_fifo); + if (this->unk_10 == 0) { + gDPSetOtherMode(gfx++, + G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_COPY | G_PM_NPRIMITIVE, + G_AC_NONE | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2); + func_8014116C(&gfx, D_0F000000, sp50, width, height, 1); + } else { + if (alpha == 255) { + gDPSetOtherMode(gfx++, + G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_NONE | G_ZS_PRIM | G_RM_OPA_SURF | G_RM_OPA_SURF2); + } else { + gDPSetOtherMode(gfx++, + G_AD_NOISE | G_CD_NOISE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_NONE | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2); + } + gDPSetEnvColor(gfx++, 255, 255, 255, alpha); + gDPSetCombineLERP(gfx++, TEXEL0, 0, ENVIRONMENT, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, ENVIRONMENT, 0, 0, 0, 0, + ENVIRONMENT); + func_8014116C(&gfx, sp50, D_0F000000, width, height, 0); + } + gDPPipeSync(gfx++); + gSPLoadUcode(gfx++, SysUcode_GetUCode(), SysUcode_GetUCodeData()); + *gfxP = gfx; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_SetColor.s") +s32 TransitionWipe5_IsDone(void* thisx) { + TransitionWipe5* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_SetEnvColor.s") + return this->isDone; +} + +void TransitionWipe5_SetType(void* thisx, s32 type) { + TransitionWipe5* this = THIS; + + if (type & 0x80) { + this->unk_11 = 0; + this->unk_12 = type & 1; + } else if (type == 1) { + this->unk_10 = 1; + } else { + this->unk_10 = 0; + } +} + +void TransitionWipe5_SetColor(void* thisx, u32 color) { + TransitionWipe5* this = THIS; + + this->primColor.rgba = color; +} + +void TransitionWipe5_SetEnvColor(void* thisx, u32 color) { + TransitionWipe5* this = THIS; + + this->envColor.rgba = color; +} diff --git a/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.h b/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.h index d5f882dec..d5cd9137d 100644 --- a/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.h +++ b/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.h @@ -4,7 +4,14 @@ #include "global.h" typedef struct { - /* 0x0000 */ char unk_0[0x14]; + /* 0x00 */ Color_RGBA8_u32 primColor; + /* 0x04 */ Color_RGBA8_u32 envColor; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ u8 unk_10; + /* 0x11 */ u8 unk_11; + /* 0x12 */ u8 unk_12; + /* 0x13 */ u8 isDone; } TransitionWipe5; // size = 0x14 #endif diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c index 90a1a0eff..92fe82e76 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c @@ -326,7 +326,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play) { gDPSetCombineLERP(POLY_OPA_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); - if ((pauseCtx->state == 4) || (pauseCtx->state == 0x1A)) { + if ((pauseCtx->state == PAUSE_STATE_OPENING_3) || (pauseCtx->state == PAUSE_STATE_UNPAUSE_SETUP)) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sQuestHpPrimColorTargets[0][0], sQuestHpPrimColorTargets[0][1], sQuestHpPrimColorTargets[0][2], pauseCtx->alpha); } else { @@ -344,11 +344,11 @@ void KaleidoScope_DrawQuestStatus(PlayState* play) { j += 4; - if (pauseCtx->state == 6) { + if (pauseCtx->state == PAUSE_STATE_MAIN) { gDPPipeSync(POLY_OPA_DISP++); gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - if (pauseCtx->unk_200 == 2) { + if (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PLAYBACK) { // Draw ocarina buttons as they are played back pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); @@ -391,7 +391,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play) { sOcarinaButtonTextures[sQuestSongPlayedOcarinaButtons[i]], 16, 16, 0); } } - } else if (((pauseCtx->unk_200 >= 4) && (pauseCtx->unk_200 <= 6)) || (pauseCtx->unk_200 == 8)) { + } else if (IS_PAUSE_MAIN_STATE_SAVE_PROMPT || (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) { // Draw the buttons for playing a song sp1C8 = pauseCtx->ocarinaSongIndex; sp1CA = gOcarinaSongButtons[sp1C8].numButtons; @@ -407,7 +407,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play) { gDPPipeSync(POLY_OPA_DISP++); - if (pauseCtx->unk_200 == 8) { + if (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG) { // Draw ocarina buttons colored if (gOcarinaSongButtons[sp1C8].buttonIndex[k] == OCARINA_BTN_A) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 80, 150, 255, 200); @@ -425,7 +425,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play) { POLY_OPA_DISP, sOcarinaButtonTextures[gOcarinaSongButtons[sp1C8].buttonIndex[k]], 16, 16, 0); } - if (pauseCtx->unk_200 != 8) { + if (pauseCtx->mainState != PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG) { pauseCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff(); // Update ocarina song inputs @@ -475,7 +475,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play) { sOcarinaButtonTextures[sQuestSongPlayedOcarinaButtons[k]], 16, 16, 0); } - if (pauseCtx->unk_200 == 4) { + if (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT_INIT) { for (k = 0; k < 8; k++) { sQuestSongPlayedOcarinaButtons[k] = OCARINA_BTN_INVALID; sQuestSongPlayedOcarinaButtonsAlpha[k] = 0; @@ -487,7 +487,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play) { pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); pauseCtx->ocarinaStaff->pos = 0; pauseCtx->ocarinaStaff->state = 0xFE; - pauseCtx->unk_200 = 5; + pauseCtx->mainState = PAUSE_MAIN_STATE_SONG_PROMPT; } } } @@ -630,15 +630,17 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { pauseCtx->nameColorSet = PAUSE_NAME_COLOR_SET_WHITE; pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_WHITE; - // != 0 - if ((pauseCtx->state == 6) && (!pauseCtx->unk_200 || (pauseCtx->unk_200 == 5) || (pauseCtx->unk_200 == 8)) && + // != PAUSE_MAIN_STATE_IDLE + if ((pauseCtx->state == PAUSE_STATE_MAIN) && + (!pauseCtx->mainState || (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT) || + (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) && (pauseCtx->pageIndex == PAUSE_QUEST) && !pauseCtx->itemDescriptionOn) { if (pauseCtx->cursorSpecialPos == 0) { oldCursorPoint = pauseCtx->cursorPoint[PAUSE_QUEST]; if (pauseCtx->stickAdjX < -30) { // Move cursor left - if (pauseCtx->unk_200 == 5) { + if (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); } pauseCtx->unk_298 = 4.0f; @@ -646,7 +648,7 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { nextCursorPoint = sCursorPointLinks[oldCursorPoint].left; if (nextCursorPoint == CURSOR_TO_LEFT) { KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT); - pauseCtx->unk_200 = 0; + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; if (interfaceCtx->unk_212 == 6) { func_8011552C(play, 0x15); } @@ -661,7 +663,7 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { } } else if (pauseCtx->stickAdjX > 30) { // Move cursor right - if (pauseCtx->unk_200 == 5) { + if (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); } pauseCtx->unk_298 = 4.0f; @@ -669,7 +671,7 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { if (nextCursorPoint == CURSOR_TO_RIGHT) { KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT); - pauseCtx->unk_200 = 0; + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; return; } @@ -683,7 +685,7 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { if (pauseCtx->stickAdjY < -30) { // Move cursor down - if (pauseCtx->unk_200 == 5) { + if (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); } nextCursorPoint = sCursorPointLinks[oldCursorPoint].down; @@ -697,7 +699,7 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { } } else if (pauseCtx->stickAdjY > 30) { // Move cursor up - if (pauseCtx->unk_200 == 5) { + if (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); } nextCursorPoint = sCursorPointLinks[oldCursorPoint].up; @@ -712,7 +714,7 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { // if the cursor point changed if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_QUEST]) { - pauseCtx->unk_200 = 0; + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; play_sound(NA_SE_SY_CURSOR); } @@ -787,8 +789,8 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { pauseCtx->cursorItem[pauseCtx->pageIndex] = cursorItem; pauseCtx->cursorSlot[pauseCtx->pageIndex] = cursor; - if ((pauseCtx->debugEditor == DEBUG_EDITOR_NONE) && (pauseCtx->state == 6) && (pauseCtx->unk_200 == 0) && - (pauseCtx->cursorSpecialPos == 0)) { + if ((pauseCtx->debugEditor == DEBUG_EDITOR_NONE) && (pauseCtx->state == PAUSE_STATE_MAIN) && + (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) && (pauseCtx->cursorSpecialPos == 0)) { if ((cursor >= QUEST_SONG_SONATA) && (cursor <= QUEST_SONG_SUN)) { // Handle part of the ocarina songs playback if ((CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST]) || @@ -829,7 +831,7 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { pauseCtx->ocarinaButtonsY[OCARINA_BTN_C_LEFT] = -46; pauseCtx->ocarinaButtonsY[OCARINA_BTN_C_UP] = -41; - pauseCtx->unk_200 = 8; + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG; if (interfaceCtx->unk_212 != 6) { func_8011552C(play, 6); @@ -873,7 +875,7 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) && (msgCtx->msgLength == 0)) { if (pauseCtx->cursorPoint[PAUSE_QUEST] == QUEST_BOMBERS_NOTEBOOK) { play->pauseCtx.bombersNotebookOpen = true; - pauseCtx->unk_200 = 0x10; + pauseCtx->mainState = PAUSE_MAIN_STATE_BOMBERS_NOTEBOOK_OPEN; play_sound(NA_SE_SY_DECIDE); } else { pauseCtx->itemDescriptionOn = true; @@ -898,31 +900,35 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { Interface_SetHudVisibility(HUD_VISIBILITY_ALL); } } - } else if (pauseCtx->unk_200 == 5) { + } else if (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT) { // Abort reading ocarina song input if the stick is moved if ((pauseCtx->stickAdjX != 0) || (pauseCtx->stickAdjY != 0)) { - pauseCtx->unk_200 = 0; + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); } - } else if ((pauseCtx->unk_200 == 8) && CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) && - (msgCtx->msgLength == 0) && (cursor >= QUEST_SONG_SONATA) && (cursor <= QUEST_SONG_SUN)) { - pauseCtx->unk_200 = 9; + } else if ((pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG) && + CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) && (msgCtx->msgLength == 0) && + (cursor >= QUEST_SONG_SONATA) && (cursor <= QUEST_SONG_SUN)) { + pauseCtx->mainState = PAUSE_MAIN_STATE_SONG_PLAYBACK_INIT; sQuestSongPlaybackDelayTimer = 10; } if (pauseCtx->cursorSpecialPos == 0) { if ((pauseCtx->cursorSlot[PAUSE_QUEST] >= 6) && (pauseCtx->cursorSlot[PAUSE_QUEST] < 0x12) && - ((pauseCtx->unk_200 <= 2) || (pauseCtx->unk_200 == 5) || (pauseCtx->unk_200 == 8)) && + ((pauseCtx->mainState <= PAUSE_MAIN_STATE_SONG_PLAYBACK) || + (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT) || + (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) && (pauseCtx->cursorItem[pauseCtx->pageIndex] != PAUSE_ITEM_NONE)) { pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_BLUE; - if ((pauseCtx->unk_200 >= 2) && (pauseCtx->unk_200 <= 6)) { + if ((pauseCtx->mainState >= PAUSE_MAIN_STATE_SONG_PLAYBACK) && + (pauseCtx->mainState <= PAUSE_MAIN_STATE_SONG_PROMPT_DONE)) { pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_WHITE; } } } } else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { if (pauseCtx->stickAdjX > 30) { - if (pauseCtx->unk_200 == 5) { + if (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); } @@ -940,7 +946,7 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { pauseCtx->cursorSlot[pauseCtx->pageIndex] = cursor; } } else if (pauseCtx->stickAdjX < -30) { - if (pauseCtx->unk_200 == 5) { + if (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PROMPT) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); } @@ -961,7 +967,7 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { pauseCtx->cursorItem[pauseCtx->pageIndex] = cursorItem; pauseCtx->cursorSlot[pauseCtx->pageIndex] = cursor; } - } else if (pauseCtx->unk_200 == 9) { + } else if (pauseCtx->mainState == PAUSE_MAIN_STATE_SONG_PLAYBACK_INIT) { // After a short delay, start the playback of the selected song pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_BLUE; @@ -989,7 +995,7 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_DEFAULT); pauseCtx->ocarinaSongIndex = gOcarinaSongItemMap[cursor - QUEST_SONG_SONATA]; AudioOcarina_SetPlaybackSong(pauseCtx->ocarinaSongIndex + 1, 1); - pauseCtx->unk_200 = 2; + pauseCtx->mainState = PAUSE_MAIN_STATE_SONG_PLAYBACK; pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); pauseCtx->ocarinaStaff->pos = 0; } diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c index 120a07c0a..8e69188fb 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c @@ -15,7 +15,7 @@ s16 sEquipMagicArrowSlotHoldTimer = 0; // Number of frames to move icon from slot to target position when equipping. s16 sEquipAnimTimer = 10; -u8 gPlayerFormSlotRestrictions[PLAYER_FORM_MAX][24] = { +u8 gPlayerFormSlotRestrictions[PLAYER_FORM_MAX][NUM_ITEM_SLOTS] = { // Fierce Deity { false, // SLOT_OCARINA @@ -256,9 +256,9 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { // Loop over c-buttons (i) and vtx offset (j) gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); - for (i = 0, j = 24 * 4; i < 3; i++, j += 4) { + for (i = 0, j = NUM_ITEM_SLOTS * 4; i < 3; i++, j += 4) { if (GET_CUR_FORM_BTN_ITEM(i + 1) != ITEM_NONE) { - if (GET_CUR_FORM_BTN_SLOT(i + 1) < 24) { + if (GET_CUR_FORM_BTN_SLOT(i + 1) < NUM_ITEM_SLOTS) { gSPVertex(POLY_OPA_DISP++, &pauseCtx->itemVtx[j], 4, 0); POLY_OPA_DISP = func_8010DC58(POLY_OPA_DISP, gEquippedItemOutlineTex, 32, 32, 0); } @@ -270,11 +270,12 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { // Draw the item icons // Loop over slots (i) and vtx offset (j) gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - for (j = 0, i = 0; i < 24; i++, j += 4) { + for (j = 0, i = 0; i < NUM_ITEM_SLOTS; i++, j += 4) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); if (((void)0, gSaveContext.save.inventory.items[i]) != ITEM_NONE) { - if ((pauseCtx->unk_200 == 0) && (pauseCtx->pageIndex == PAUSE_ITEM) && (pauseCtx->cursorSpecialPos == 0) && + if ((pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) && (pauseCtx->pageIndex == PAUSE_ITEM) && + (pauseCtx->cursorSpecialPos == 0) && gPlayerFormSlotRestrictions[(void)0, gSaveContext.save.playerForm][i]) { if ((sEquipState == EQUIP_STATE_MAGIC_ARROW_HOVER_OVER_BOW_SLOT) && (i == SLOT_ARROW_ICE)) { // Possible bug: @@ -313,13 +314,14 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { // Draw the ammo digits if (pauseCtx->pageIndex == PAUSE_ITEM) { - if ((pauseCtx->state == 6) && ((pauseCtx->unk_200 == 0) || (pauseCtx->unk_200 == 3)) && - (pauseCtx->state != 7) && ((pauseCtx->state < 8) || (pauseCtx->state >= 0x13))) { + if ((pauseCtx->state == PAUSE_STATE_MAIN) && + ((pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) || (pauseCtx->mainState == PAUSE_MAIN_STATE_EQUIP_ITEM)) && + (pauseCtx->state != PAUSE_STATE_SAVEPROMPT) && !IS_PAUSE_STATE_GAMEOVER) { func_8012C628(play->state.gfxCtx); gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); // Loop over slots (i) and ammoIndex (j) - for (j = 0, i = 0; i < 24; i++) { + for (j = 0, i = 0; i < NUM_ITEM_SLOTS; i++) { if (gAmmoItems[i] != ITEM_NONE) { if (((void)0, gSaveContext.save.inventory.items[i]) != ITEM_NONE) { KaleidoScope_DrawAmmoCount(pauseCtx, play->state.gfxCtx, @@ -357,8 +359,8 @@ void KaleidoScope_UpdateItemCursor(PlayState* play) { pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_WHITE; pauseCtx->nameColorSet = PAUSE_NAME_COLOR_SET_WHITE; - if ((pauseCtx->state == 6) && (pauseCtx->unk_200 == 0) && (pauseCtx->pageIndex == PAUSE_ITEM) && - !pauseCtx->itemDescriptionOn) { + if ((pauseCtx->state == PAUSE_STATE_MAIN) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) && + (pauseCtx->pageIndex == PAUSE_ITEM) && !pauseCtx->itemDescriptionOn) { moveCursorResult = PAUSE_CURSOR_RESULT_NONE; oldCursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM]; @@ -394,7 +396,7 @@ void KaleidoScope_UpdateItemCursor(PlayState* play) { pauseCtx->cursorPoint[PAUSE_ITEM] = pauseCtx->cursorXIndex[PAUSE_ITEM] + (pauseCtx->cursorYIndex[PAUSE_ITEM] * 6); - if (pauseCtx->cursorPoint[PAUSE_ITEM] >= 24) { + if (pauseCtx->cursorPoint[PAUSE_ITEM] >= NUM_ITEM_SLOTS) { pauseCtx->cursorPoint[PAUSE_ITEM] = pauseCtx->cursorXIndex[PAUSE_ITEM]; } @@ -425,7 +427,7 @@ void KaleidoScope_UpdateItemCursor(PlayState* play) { pauseCtx->cursorPoint[PAUSE_ITEM] = pauseCtx->cursorXIndex[PAUSE_ITEM] + (pauseCtx->cursorYIndex[PAUSE_ITEM] * 6); - if (pauseCtx->cursorPoint[PAUSE_ITEM] >= 24) { + if (pauseCtx->cursorPoint[PAUSE_ITEM] >= NUM_ITEM_SLOTS) { pauseCtx->cursorPoint[PAUSE_ITEM] = pauseCtx->cursorXIndex[PAUSE_ITEM]; } @@ -591,7 +593,7 @@ void KaleidoScope_UpdateItemCursor(PlayState* play) { if (cursorItem != PAUSE_ITEM_NONE) { // Equip item to the C buttons if ((pauseCtx->debugEditor == DEBUG_EDITOR_NONE) && !pauseCtx->itemDescriptionOn && - (pauseCtx->state == 6) && (pauseCtx->unk_200 == 0) && + (pauseCtx->state == PAUSE_STATE_MAIN) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) && CHECK_BTN_ANY(CONTROLLER1(&play->state)->press.button, BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT)) { // Ensure that a transformation mask can not be unequipped while being used @@ -645,7 +647,7 @@ void KaleidoScope_UpdateItemCursor(PlayState* play) { // Equip item to the C buttons pauseCtx->equipTargetItem = cursorItem; pauseCtx->equipTargetSlot = cursorSlot; - pauseCtx->unk_200 = 3; + pauseCtx->mainState = PAUSE_MAIN_STATE_EQUIP_ITEM; vtxIndex = cursorSlot * 4; pauseCtx->equipAnimX = pauseCtx->itemVtx[vtxIndex].v.ob[0] * 10; pauseCtx->equipAnimY = pauseCtx->itemVtx[vtxIndex].v.ob[1] * 10; @@ -671,9 +673,9 @@ void KaleidoScope_UpdateItemCursor(PlayState* play) { } else { play_sound(NA_SE_SY_DECIDE); } - } else if ((pauseCtx->debugEditor == DEBUG_EDITOR_NONE) && (pauseCtx->state == 6) && - (pauseCtx->unk_200 == 0) && CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) && - (msgCtx->msgLength == 0)) { + } else if ((pauseCtx->debugEditor == DEBUG_EDITOR_NONE) && (pauseCtx->state == PAUSE_STATE_MAIN) && + (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) && + CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) && (msgCtx->msgLength == 0)) { // Give description on item through a message box pauseCtx->itemDescriptionOn = true; if (pauseCtx->cursorYIndex[PAUSE_ITEM] < 2) { @@ -690,7 +692,7 @@ void KaleidoScope_UpdateItemCursor(PlayState* play) { if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_ITEM]) { play_sound(NA_SE_SY_CURSOR); } - } else if ((pauseCtx->unk_200 == 3) && (pauseCtx->pageIndex == PAUSE_ITEM)) { + } else if ((pauseCtx->mainState == PAUSE_MAIN_STATE_EQUIP_ITEM) && (pauseCtx->pageIndex == PAUSE_ITEM)) { pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_YELLOW; } } @@ -983,7 +985,7 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { } // Reset params - pauseCtx->unk_200 = 0; + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; sEquipAnimTimer = 10; pauseCtx->equipAnimScale = 320; pauseCtx->equipAnimShrinkRate = 40; diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c index 823a3d63f..e0c82a1bb 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_map.c @@ -13,7 +13,7 @@ extern s16 D_8082B7F0[]; extern s16 D_8082B838[]; -extern TexturePtr D_09007500; // gPlayerFace +extern TexturePtr D_09007500; // gPlayerFaceIcon #define WORLD_MAP_IMAGE_TEX_WIDTH 216 #define WORLD_MAP_IMAGE_TEX_HEIGHT 128 @@ -168,11 +168,11 @@ void KaleidoScope_DrawDungeonMap(PlayState* play) { // Loop over dungeonItems (i) and vtxIndex (j) for (i = DUNGEON_BOSS_KEY, j = 4; i <= DUNGEON_STRAY_FAIRIES; i++, j += 4) { if (i == DUNGEON_STRAY_FAIRIES) { - if ((pauseCtx->pageIndex == PAUSE_MAP) && (pauseCtx->unk_200 == 0)) { - // If (pauseCtx->state == 6), then the other conditions are redundant and + if ((pauseCtx->pageIndex == PAUSE_MAP) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE)) { + // If (pauseCtx->state == PAUSE_STATE_MAIN), then the other conditions are redundant and // always return true - if ((pauseCtx->state == 6) && (pauseCtx->state != 7) && - !((pauseCtx->state >= 8) && (pauseCtx->state <= 0x12))) { + if ((pauseCtx->state == PAUSE_STATE_MAIN) && (pauseCtx->state != PAUSE_STATE_SAVEPROMPT) && + !IS_PAUSE_STATE_GAMEOVER) { KaleidoScope_SetView(pauseCtx, 0.0f, 0.0f, 64.0f); if (!sStrayFairyIconAlphaScaleState) { @@ -264,11 +264,11 @@ void KaleidoScope_DrawDungeonMap(PlayState* play) { func_80108AF8(play); - if ((pauseCtx->pageIndex == PAUSE_MAP) && (pauseCtx->unk_200 == 0)) { - // If (pauseCtx->state == 6), then the other conditions are redundant and always return + if ((pauseCtx->pageIndex == PAUSE_MAP) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE)) { + // If (pauseCtx->state == PAUSE_STATE_MAIN), then the other conditions are redundant and always return // true - if ((pauseCtx->state == 6) && (pauseCtx->state != 7) && - !((pauseCtx->state >= 8) && (pauseCtx->state <= 0x12))) { + if ((pauseCtx->state == PAUSE_STATE_MAIN) && (pauseCtx->state != PAUSE_STATE_SAVEPROMPT) && + !IS_PAUSE_STATE_GAMEOVER) { func_8012C628(play->state.gfxCtx); @@ -304,8 +304,8 @@ void KaleidoScope_UpdateDungeonCursor(PlayState* play) { s16 i; s16 oldCursorPoint; - if (pauseCtx->state == 6) { - if ((pauseCtx->unk_200 == 0) && (pauseCtx->pageIndex == PAUSE_MAP)) { + if (pauseCtx->state == PAUSE_STATE_MAIN) { + if ((pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) && (pauseCtx->pageIndex == PAUSE_MAP)) { pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_WHITE; oldCursorPoint = pauseCtx->cursorPoint[PAUSE_MAP]; if (pauseCtx->stickAdjX > 30) { @@ -539,9 +539,9 @@ void KaleidoScope_DrawWorldMap(PlayState* play) { KaleidoScope_SetCursorVtx(pauseCtx, pauseCtx->cursorSlot[PAUSE_MAP] * 4, pauseCtx->mapPageVtx); // Draw the world map image - if ((pauseCtx->pageIndex == PAUSE_MAP) && (pauseCtx->state == 6) && - ((pauseCtx->unk_200 == 0) || (pauseCtx->unk_200 == 3)) && YREG(6) && (pauseCtx->state != 7) && - !((pauseCtx->state >= 8) && (pauseCtx->state <= 0x12))) { + if ((pauseCtx->pageIndex == PAUSE_MAP) && (pauseCtx->state == PAUSE_STATE_MAIN) && + ((pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) || (pauseCtx->mainState == PAUSE_MAIN_STATE_EQUIP_ITEM)) && + YREG(6) && (pauseCtx->state != PAUSE_STATE_SAVEPROMPT) && !IS_PAUSE_STATE_GAMEOVER) { // Draw the world map image flat // Because it is flat, the texture is loaded by filling it in 8 rows at a time. @@ -649,7 +649,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play) { } } - if ((pauseCtx->state >= 0x15) && (pauseCtx->state <= 0x19)) { + if (IS_PAUSE_STATE_OWLWARP) { gDPPipeSync(POLY_OPA_DISP++); gDPSetRenderMode(POLY_OPA_DISP++, G_RM_XLU_SURF, G_RM_XLU_SURF2); gDPSetCombineMode(POLY_OPA_DISP++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); @@ -659,7 +659,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play) { func_8012C8AC(play->state.gfxCtx); - if (!((pauseCtx->state >= 0x15) && (pauseCtx->state <= 0x19))) { + if (!IS_PAUSE_STATE_OWLWARP) { // Browsing the world map regions on the pause menu gDPLoadTextureBlock(POLY_OPA_DISP++, gWorldMapDotTex, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, @@ -728,10 +728,11 @@ void KaleidoScope_DrawWorldMap(PlayState* play) { } // Find and draw Player's face at the current region based on the current scene - // If (pauseCtx->state == 6), then the other pauseCtx->state conditions are redundant + // If (pauseCtx->state == PAUSE_STATE_MAIN), then the other pauseCtx->state conditions are redundant // and always return true - if ((pauseCtx->pageIndex == PAUSE_MAP) && (pauseCtx->unk_200 == 0) && (pauseCtx->state == 6) && - (pauseCtx->state != 7) && !((pauseCtx->state >= 8) && (pauseCtx->state <= 0x12))) { + if ((pauseCtx->pageIndex == PAUSE_MAP) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) && + (pauseCtx->state == PAUSE_STATE_MAIN) && (pauseCtx->state != PAUSE_STATE_SAVEPROMPT) && + !IS_PAUSE_STATE_GAMEOVER) { j = 0; n = 0; @@ -825,7 +826,8 @@ void KaleidoScope_UpdateWorldMapCursor(PlayState* play) { PauseContext* pauseCtx = &play->pauseCtx; s16 oldCursorPoint; - if ((pauseCtx->state == 6) && (pauseCtx->unk_200 == 0) && (pauseCtx->pageIndex == PAUSE_MAP)) { + if ((pauseCtx->state == PAUSE_STATE_MAIN) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) && + (pauseCtx->pageIndex == PAUSE_MAP)) { pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_WHITE; oldCursorPoint = pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; @@ -936,7 +938,7 @@ void KaleidoScope_UpdateWorldMapCursor(PlayState* play) { if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_WORLD_MAP]) { play_sound(NA_SE_SY_CURSOR); } - } else if (pauseCtx->state == 0x17) { + } else if (pauseCtx->state == PAUSE_STATE_OWLWARP_SELECT) { pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_BLUE; oldCursorPoint = pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c index 77835026f..6e9f17843 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_mask.c @@ -223,7 +223,7 @@ void KaleidoScope_DrawMaskSelect(PlayState* play) { if (((void)0, gSaveContext.save.inventory.items[i + NUM_ITEM_SLOTS]) != ITEM_NONE) { if (!CHECK_GIVEN_MASK_ON_MOON(i)) { - if ((pauseCtx->unk_200 == 0) && (pauseCtx->pageIndex == PAUSE_MASK) && + if ((pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) && (pauseCtx->pageIndex == PAUSE_MASK) && (pauseCtx->cursorSpecialPos == 0) && gMaskPlayerFormSlotRestrictions[(void)0, gSaveContext.save.playerForm][i]) { if ((sMaskEquipState == EQUIP_STATE_MAGIC_ARROW_HOVER_OVER_BOW_SLOT) && (i == SLOT_ARROW_ICE)) { @@ -288,8 +288,8 @@ void KaleidoScope_UpdateMaskCursor(PlayState* play) { pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_WHITE; pauseCtx->nameColorSet = PAUSE_NAME_COLOR_SET_WHITE; - if ((pauseCtx->state == 6) && (pauseCtx->unk_200 == 0) && (pauseCtx->pageIndex == PAUSE_MASK) && - !pauseCtx->itemDescriptionOn) { + if ((pauseCtx->state == PAUSE_STATE_MAIN) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) && + (pauseCtx->pageIndex == PAUSE_MASK) && !pauseCtx->itemDescriptionOn) { moveCursorResult = PAUSE_CURSOR_RESULT_NONE; oldCursorPoint = pauseCtx->cursorPoint[PAUSE_MASK]; @@ -533,7 +533,7 @@ void KaleidoScope_UpdateMaskCursor(PlayState* play) { if (cursorItem != PAUSE_ITEM_NONE) { // Equip item to the C buttons if ((pauseCtx->debugEditor == DEBUG_EDITOR_NONE) && !pauseCtx->itemDescriptionOn && - (pauseCtx->state == 6) && (pauseCtx->unk_200 == 0) && + (pauseCtx->state == PAUSE_STATE_MAIN) && (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) && CHECK_BTN_ANY(input->press.button, BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT)) { // Ensure that a mask is not unequipped while being used @@ -585,7 +585,7 @@ void KaleidoScope_UpdateMaskCursor(PlayState* play) { // Equip item to the C buttons pauseCtx->equipTargetItem = cursorItem; pauseCtx->equipTargetSlot = cursorSlot + NUM_ITEM_SLOTS; - pauseCtx->unk_200 = 0xF; + pauseCtx->mainState = PAUSE_MAIN_STATE_EQUIP_MASK; vtxIndex = cursorSlot * 4; pauseCtx->equipAnimX = pauseCtx->maskVtx[vtxIndex].v.ob[0] * 10; pauseCtx->equipAnimY = pauseCtx->maskVtx[vtxIndex].v.ob[1] * 10; @@ -594,9 +594,9 @@ void KaleidoScope_UpdateMaskCursor(PlayState* play) { sMaskEquipState = EQUIP_STATE_MOVE_TO_C_BTN; sMaskEquipAnimTimer = 10; play_sound(NA_SE_SY_DECIDE); - } else if ((pauseCtx->debugEditor == DEBUG_EDITOR_NONE) && (pauseCtx->state == 6) && - (pauseCtx->unk_200 == 0) && CHECK_BTN_ALL(input->press.button, BTN_A) && - (msgCtx->msgLength == 0)) { + } else if ((pauseCtx->debugEditor == DEBUG_EDITOR_NONE) && (pauseCtx->state == PAUSE_STATE_MAIN) && + (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) && + CHECK_BTN_ALL(input->press.button, BTN_A) && (msgCtx->msgLength == 0)) { // Give description on item through a message box pauseCtx->itemDescriptionOn = true; if (pauseCtx->cursorYIndex[PAUSE_MASK] < 2) { @@ -613,7 +613,7 @@ void KaleidoScope_UpdateMaskCursor(PlayState* play) { if (oldCursorPoint != pauseCtx->cursorPoint[PAUSE_MASK]) { play_sound(NA_SE_SY_CURSOR); } - } else if ((pauseCtx->unk_200 == 0xF) && (pauseCtx->pageIndex == PAUSE_MASK)) { + } else if ((pauseCtx->mainState == PAUSE_MAIN_STATE_EQUIP_MASK) && (pauseCtx->pageIndex == PAUSE_MASK)) { pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_YELLOW; } } @@ -796,7 +796,7 @@ void KaleidoScope_UpdateMaskEquip(PlayState* play) { } // Reset params - pauseCtx->unk_200 = 0; + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; sMaskEquipAnimTimer = 10; pauseCtx->equipAnimScale = 320; pauseCtx->equipAnimShrinkRate = 40; diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_prompt.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_prompt.c index 53453e8e7..13e233b58 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_prompt.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_prompt.c @@ -17,7 +17,9 @@ void KaleidoScope_UpdatePrompt(PlayState* play) { s8 relStickX = input->rel.stick_x; s16 alphaStep; - if (((pauseCtx->state == 7) && (pauseCtx->unk_208 == 1)) || (pauseCtx->state == 0xE) || (pauseCtx->state == 0x11)) { + if (((pauseCtx->state == PAUSE_STATE_SAVEPROMPT) && (pauseCtx->savePromptState == PAUSE_SAVEPROMPT_STATE_1)) || + (pauseCtx->state == PAUSE_STATE_GAMEOVER_SAVE_PROMPT) || + (pauseCtx->state == PAUSE_STATE_GAMEOVER_CONTINUE_PROMPT)) { // Move the prompt if ((pauseCtx->promptChoice == PAUSE_PROMPT_YES) && (relStickX >= 30)) { diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h index 14c16ddcd..7349db241 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h @@ -16,6 +16,86 @@ typedef enum { /* 4 */ PAUSE_WORLD_MAP } PauseMenuPage; +// Direction of pause pages +#define PAUSE_ITEM_X (0) +#define PAUSE_ITEM_Z (-1) +#define PAUSE_MAP_X (1) +#define PAUSE_MAP_Z (0) +#define PAUSE_QUEST_X (0) +#define PAUSE_QUEST_Z (1) +#define PAUSE_MASK_X (-1) +#define PAUSE_MASK_Z (0) + +#define PAUSE_EYE_DIST (64.0f) + +typedef enum { + /* 0x00 */ PAUSE_STATE_OFF, + /* 0x01 */ PAUSE_STATE_OPENING_0, + /* 0x02 */ PAUSE_STATE_OPENING_1, + /* 0x03 */ PAUSE_STATE_OPENING_2, + /* 0x04 */ PAUSE_STATE_OPENING_3, + /* 0x05 */ PAUSE_STATE_OPENING_4, + /* 0x06 */ PAUSE_STATE_MAIN, // Pause menu ready for player inputs. + /* 0x07 */ PAUSE_STATE_SAVEPROMPT, + /* 0x08 */ PAUSE_STATE_GAMEOVER_0, + /* 0x09 */ PAUSE_STATE_GAMEOVER_1, + /* 0x0A */ PAUSE_STATE_GAMEOVER_2, + /* 0x0B */ PAUSE_STATE_GAMEOVER_3, + /* 0x0C */ PAUSE_STATE_GAMEOVER_4, + /* 0x0D */ PAUSE_STATE_GAMEOVER_5, + /* 0x0E */ PAUSE_STATE_GAMEOVER_SAVE_PROMPT, + /* 0x0F */ PAUSE_STATE_GAMEOVER_7, + /* 0x10 */ PAUSE_STATE_GAMEOVER_8, + /* 0x11 */ PAUSE_STATE_GAMEOVER_CONTINUE_PROMPT, + /* 0x12 */ PAUSE_STATE_GAMEOVER_10, + /* 0x13 */ PAUSE_STATE_OWLWARP_0, + /* 0x14 */ PAUSE_STATE_OWLWARP_1, + /* 0x15 */ PAUSE_STATE_OWLWARP_2, + /* 0x16 */ PAUSE_STATE_OWLWARP_3, + /* 0x17 */ PAUSE_STATE_OWLWARP_SELECT, // Selecting the destination + /* 0x18 */ PAUSE_STATE_OWLWARP_CONFIRM, // Confirming the choice given + /* 0x19 */ PAUSE_STATE_OWLWARP_6, + /* 0x1A */ PAUSE_STATE_UNPAUSE_SETUP, // Unpause + /* 0x1B */ PAUSE_STATE_UNPAUSE_CLOSE +} PauseState; + +typedef enum { + /* 0x00 */ PAUSE_MAIN_STATE_IDLE, // Await input for the next action + /* 0x01 */ PAUSE_MAIN_STATE_SWITCHING_PAGE, + /* 0x02 */ PAUSE_MAIN_STATE_SONG_PLAYBACK, + /* 0x03 */ PAUSE_MAIN_STATE_EQUIP_ITEM, + /* 0x04 */ PAUSE_MAIN_STATE_SONG_PROMPT_INIT, + /* 0x05 */ PAUSE_MAIN_STATE_SONG_PROMPT, + /* 0x06 */ PAUSE_MAIN_STATE_SONG_PROMPT_DONE, + /* 0x07 */ PAUSE_MAIN_STATE_SONG_PROMPT_UNUSED, + /* 0x08 */ PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG, // Await input but the cursor is on a song + /* 0x09 */ PAUSE_MAIN_STATE_SONG_PLAYBACK_INIT, + /* 0x0F */ PAUSE_MAIN_STATE_EQUIP_MASK = 0xF, + /* 0x10 */ PAUSE_MAIN_STATE_BOMBERS_NOTEBOOK_OPEN, + /* 0x11 */ PAUSE_MAIN_STATE_UNK +} PauseMainState; + +typedef enum { + /* 0x00 */ PAUSE_SAVEPROMPT_STATE_0, + /* 0x01 */ PAUSE_SAVEPROMPT_STATE_1, + /* 0x02 */ PAUSE_SAVEPROMPT_STATE_2, + /* 0x03 */ PAUSE_SAVEPROMPT_STATE_3, + /* 0x04 */ PAUSE_SAVEPROMPT_STATE_4, + /* 0x05 */ PAUSE_SAVEPROMPT_STATE_5, + /* 0x06 */ PAUSE_SAVEPROMPT_STATE_6, + /* 0x07 */ PAUSE_SAVEPROMPT_STATE_7 +} PauseSavePromptState; + +#define IS_PAUSE_STATE_GAMEOVER \ + ((pauseCtx->state >= PAUSE_STATE_GAMEOVER_0) && (pauseCtx->state <= PAUSE_STATE_GAMEOVER_10)) + +#define IS_PAUSE_STATE_OWLWARP \ + ((pauseCtx->state >= PAUSE_STATE_OWLWARP_2) && (pauseCtx->state <= PAUSE_STATE_OWLWARP_6)) + +#define IS_PAUSE_MAIN_STATE_SAVE_PROMPT \ + ((pauseCtx->mainState >= PAUSE_MAIN_STATE_SONG_PROMPT_INIT) && \ + (pauseCtx->mainState <= PAUSE_MAIN_STATE_SONG_PROMPT_DONE)) + typedef enum { /* 0 */ PAUSE_EQUIP_C_LEFT, /* 1 */ PAUSE_EQUIP_C_DOWN, @@ -36,6 +116,15 @@ typedef enum { /* 3 */ DEBUG_EDITOR_EVENTS } DebugEditor; +typedef enum { + /* 0 */ PAUSE_BG_PRERENDER_OFF, + /* 1 */ PAUSE_BG_PRERENDER_SETUP, // The current frame is only drawn for the purpose of serving as the pause background. + /* 2 */ PAUSE_BG_PRERENDER_PROCESS, // The previous frame was PAUSE_BG_PRERENDER_DRAW, now apply prerender filters. + /* 3 */ PAUSE_BG_PRERENDER_DONE, // The pause background is ready to be used. + /* 4 */ PAUSE_BG_PRERENDER_UNK4, + /* 5 */ PAUSE_BG_PRERENDER_MAX +} PauseBgPreRenderState; + #define PAUSE_NAME_COLOR_SET_WHITE 0 #define PAUSE_NAME_COLOR_SET_GREY 1 @@ -70,7 +159,7 @@ void KaleidoScope_UpdateWorldMapCursor(PlayState* play); // Collect void KaleidoScope_DrawQuestStatus(PlayState* play); -void KaleidoScope_UpdateQuestCursor(PlayState* play); +void KaleidoScope_UpdateQuestCursor(PlayState* play); // Item void KaleidoScope_SetCursorVtx(PauseContext* pauseCtx, u16 index, Vtx* vtx); diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c index a322fda1f..77f0a37c4 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c @@ -5,6 +5,7 @@ */ #include "z_kaleido_scope.h" +#include "overlays/gamestates/ovl_opening/z_opening.h" #include "z64view.h" extern UNK_TYPE D_02001360; @@ -17,6 +18,8 @@ extern UNK_TYPE D_0B000000; extern UNK_TYPE D_0C000000; extern UNK_TYPE D_0C006C00; +extern u8 sUnpausedButtonStatus[5]; + void* D_8082B700[] = { 0x08064440, 0x0806E440, 0x08077A40, 0x08081040, 0x0808A640, 0x0D003A00, 0x0806EE40, 0x08078440, 0x08081A40, 0x0808B040, 0x08065840, 0x0806F840, 0x08078E40, 0x08082440, 0x0808BA40, @@ -45,42 +48,62 @@ s16 D_8082B838[] = { 0x0008, 0x0008, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, }; -s16 D_8082B880 = 0; -s16 D_8082B884 = 0; -s16 D_8082B888 = 0; -s16 D_8082B88C = 255; -s16 D_8082B890 = 0; -s16 D_8082B894 = 0; -s16 D_8082B898 = 0; -s16 D_8082B89C = 0; -s16 D_8082B8A0 = 0; -s16 D_8082B8A4 = 0; -s16 D_8082B8A8 = 255; -s16 D_8082B8AC = 0; -s16 D_8082B8B0 = 0; +s16 sGameOverPrimR = 0; +s16 sGameOverPrimG = 0; +s16 sGameOverPrimB = 0; +s16 sGameOverPrimAlpha = 255; +s16 sCursorPrimR = 0; +s16 sCursorPrimG = 0; +s16 sCursorPrimB = 0; +s16 sCursorEnvR = 0; +s16 sCursorEnvG = 0; +s16 sCursorEnvB = 0; +s16 sGameOverEnvR = 255; +s16 sGameOverEnvG = 0; +s16 sGameOverEnvB = 0; -s16 D_8082B8B4 = false; +s16 sInDungeonScene = false; -f32 D_8082B8B8[] = { - -4.0f, 4.0f, 4.0f, 4.0f, 4.0f, -4.0f, -4.0f, -4.0f, +f32 sPageSwitchEyeDx[] = { + -PAUSE_EYE_DIST * (PAUSE_MAP_X - PAUSE_ITEM_X) / 16, // From PAUSE_ITEM to PAUSE_MAP (switching right) + -PAUSE_EYE_DIST*(PAUSE_MASK_X - PAUSE_ITEM_X) / 16, // From PAUSE_ITEM to PAUSE_MASK (switching left) + -PAUSE_EYE_DIST*(PAUSE_QUEST_X - PAUSE_MAP_X) / 16, // From PAUSE_MAP to PAUSE_QUEST (switching right) + -PAUSE_EYE_DIST*(PAUSE_ITEM_X - PAUSE_MAP_X) / 16, // From PAUSE_MAP to PAUSE_ITEM (switching left) + -PAUSE_EYE_DIST*(PAUSE_MASK_X - PAUSE_QUEST_X) / 16, // From PAUSE_QUEST to PAUSE_MASK (switching right) + -PAUSE_EYE_DIST*(PAUSE_MAP_X - PAUSE_QUEST_X) / 16, // From PAUSE_QUEST to PAUSE_MAP (switching left) + -PAUSE_EYE_DIST*(PAUSE_ITEM_X - PAUSE_MASK_X) / 16, // From PAUSE_MASK to PAUSE_ITEM (switching right) + -PAUSE_EYE_DIST*(PAUSE_QUEST_X - PAUSE_MASK_X) / 16, // From PAUSE_MASK to PAUSE_QUEST (switching left) }; -f32 D_8082B8D8[] = { - -4.0f, -4.0f, -4.0f, 4.0f, 4.0f, 4.0f, 4.0f, -4.0f, +f32 sPageSwitchEyeDz[] = { + -PAUSE_EYE_DIST * (PAUSE_MAP_Z - PAUSE_ITEM_Z) / 16, // From PAUSE_ITEM to PAUSE_MAP (switching right) + -PAUSE_EYE_DIST*(PAUSE_MASK_Z - PAUSE_ITEM_Z) / 16, // From PAUSE_ITEM to PAUSE_MASK (switching left) + -PAUSE_EYE_DIST*(PAUSE_QUEST_Z - PAUSE_MAP_Z) / 16, // From PAUSE_MAP to PAUSE_QUEST (switching right) + -PAUSE_EYE_DIST*(PAUSE_ITEM_Z - PAUSE_MAP_Z) / 16, // From PAUSE_MAP to PAUSE_ITEM (switching left) + -PAUSE_EYE_DIST*(PAUSE_MASK_Z - PAUSE_QUEST_Z) / 16, // From PAUSE_QUEST to PAUSE_MASK (switching right) + -PAUSE_EYE_DIST*(PAUSE_MAP_Z - PAUSE_QUEST_Z) / 16, // From PAUSE_QUEST to PAUSE_MAP (switching left) + -PAUSE_EYE_DIST*(PAUSE_ITEM_Z - PAUSE_MASK_Z) / 16, // From PAUSE_MASK to PAUSE_ITEM (switching right) + -PAUSE_EYE_DIST*(PAUSE_QUEST_Z - PAUSE_MASK_Z) / 16, // From PAUSE_MASK to PAUSE_QUEST (switching left) }; -s16 D_8082B8F8[] = { - PAUSE_MAP, PAUSE_MASK, PAUSE_QUEST, PAUSE_ITEM, PAUSE_MASK, PAUSE_MAP, PAUSE_ITEM, PAUSE_QUEST, +u16 sPageSwitchNextPageIndex[] = { + PAUSE_MAP, // From PAUSE_ITEM (switching right) + PAUSE_MASK, // From PAUSE_ITEM (switching left) + PAUSE_QUEST, // From PAUSE_MAP (switching right) + PAUSE_ITEM, // From PAUSE_MAP (switching left) + PAUSE_MASK, // From PAUSE_QUEST (switching right) + PAUSE_MAP, // From PAUSE_QUEST (switching left) + PAUSE_ITEM, // From PAUSE_MASK (switching right) + PAUSE_QUEST, // From PAUSE_MASK (switching left) }; -f32 D_8082B908 = 0.0f; +f32 sPauseMenuVerticalOffset = 0.0f; f32 D_8082B90C = 0.0f; -f32 D_8082B910 = 40.0f; -f32 D_8082B914 = -40.0f; +f32 sPauseCursorLeftMoveOffsetX = 40.0f; +f32 sPauseCursorRightMoveOffsetX = -40.0f; -s32 D_8082B918 = 0; - -s32 D_8082B91C = 0; +s16 sPauseCursorLeftX = 0; +s16 sPauseCursorRightX = 0; s16 D_8082B920 = 10; @@ -89,7 +112,8 @@ u8 D_8082B924[] = { 0x07, 0x07, 0x03, 0x0F, 0x07, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0x1F, 0x0F, 0x03, 0x0F, 0x00, 0x00, }; -s16 D_8082B944 = 0x42; +// TODO: Also applies to owl warps +s16 sGameOverRectPosY = 66; s16 D_8082B948[][3] = { { 0x00FF, 0x00FF, 0x00FF }, { 0x00FF, 0x00FF, 0x00FF }, { 0x00FF, 0x00FF, 0x0000 }, @@ -436,31 +460,17 @@ f32 D_8082BE28[] = { s16 D_8082BE84 = 0; -s16 D_8082BE88[] = { - 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, -}; +void func_80821900(void* segment, u32 texIndex) { + func_80178E3C(SEGMENT_ROM_START(map_name_static), texIndex, segment, 0x400); +} -s32 D_8082BE9C = 0; +void func_8082192C(void* segment, u32 texIndex) { + func_80178E3C(SEGMENT_ROM_START(map_name_static), texIndex, segment, 0xA00); +} -s32 D_8082BEA0 = 0; - -s16 D_8082BEA4 = 10; - -s32 D_8082BEA8 = 0; - -s32 D_8082BEAC = 0; - -s32 D_8082BEB0 = 0; - -s32 D_8082BEB4 = 0; - -s32 D_8082BEB8[] = { 0, 0 }; - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80821900.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_8082192C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80821958.s") +void func_80821958(void* segment, u32 texIndex) { + func_80178E3C(SEGMENT_ROM_START(item_name_static), texIndex, segment, 0x400); +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/KaleidoScope_MoveCursorToSpecialPos.s") @@ -470,7 +480,8 @@ s32 D_8082BEB8[] = { 0, 0 }; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80821CC4.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80821D84.s") +void KaleidoScope_HandlePageToggles(PlayState* play, Input* input); +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/KaleidoScope_HandlePageToggles.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80821F30.s") @@ -478,15 +489,18 @@ s32 D_8082BEB8[] = { 0, 0 }; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80823350.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80824738.s") +void KaleidoScope_UpdateNamePanel(PlayState* play); +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/KaleidoScope_UpdateNamePanel.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_808248D0.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80824B90.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_808256E4.s") +void KaleidoScope_UpdateOwlWarpNamePanel(PlayState* play); +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/KaleidoScope_UpdateOwlWarpNamePanel.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_8082585C.s") +void KaleidoScope_UpdateSwitchPage(PlayState* play, Input* input); +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/KaleidoScope_UpdateSwitchPage.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/KaleidoScope_SetView.s") @@ -502,8 +516,964 @@ s32 D_8082BEB8[] = { 0, 0 }; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/KaleidoScope_Draw.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_808286D8.s") +void KaleidoScope_GrayOutTextureRGBA32(u32* texture, u16 pixelCount); +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/KaleidoScope_GrayOutTextureRGBA32.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/func_80828788.s") +void KaleidoScope_UpdateOpening(PlayState* play) { + PauseContext* pauseCtx = &play->pauseCtx; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_kaleido_scope/KaleidoScope_Update.s") + pauseCtx->eye.x += sPageSwitchEyeDx[pauseCtx->nextPageMode] * 2.0f; + pauseCtx->eye.z += sPageSwitchEyeDz[pauseCtx->nextPageMode] * 2.0f; + pauseCtx->switchPageTimer += 8; + + if (pauseCtx->switchPageTimer == 64) { + // Finished opening + func_80112C0C(play, 1); + + if (pauseCtx->cursorSpecialPos == 0) { + gSaveContext.buttonStatus[EQUIP_SLOT_B] = D_801C6A98[pauseCtx->pageIndex][0]; + gSaveContext.buttonStatus[EQUIP_SLOT_C_LEFT] = D_801C6A98[pauseCtx->pageIndex][1]; + gSaveContext.buttonStatus[EQUIP_SLOT_C_DOWN] = D_801C6A98[pauseCtx->pageIndex][1]; + gSaveContext.buttonStatus[EQUIP_SLOT_C_RIGHT] = D_801C6A98[pauseCtx->pageIndex][1]; + gSaveContext.buttonStatus[EQUIP_SLOT_A] = BTN_ENABLED; + } else { + gSaveContext.buttonStatus[EQUIP_SLOT_B] = BTN_ENABLED; + gSaveContext.buttonStatus[EQUIP_SLOT_C_LEFT] = BTN_DISABLED; + gSaveContext.buttonStatus[EQUIP_SLOT_C_DOWN] = BTN_DISABLED; + gSaveContext.buttonStatus[EQUIP_SLOT_C_RIGHT] = BTN_DISABLED; + gSaveContext.buttonStatus[EQUIP_SLOT_A] = BTN_DISABLED; + } + + pauseCtx->pageIndex = sPageSwitchNextPageIndex[pauseCtx->nextPageMode]; + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; + pauseCtx->state++; // PAUSE_STATE_MAIN + pauseCtx->alpha = 255; + func_80115844(play, 3); + } else if (pauseCtx->switchPageTimer == 64) { + pauseCtx->pageIndex = sPageSwitchNextPageIndex[pauseCtx->nextPageMode]; + pauseCtx->nextPageMode = (pauseCtx->pageIndex * 2) + 1; + } +} + +void KaleidoScope_Update(PlayState* play) { + static u16 sCursorPointsToOcarinaModes[] = { + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + }; + static s16 sUnpausedHudVisibility = HUD_VISIBILITY_IDLE; + static s16 sNextMainState = PAUSE_MAIN_STATE_IDLE; + static s16 sDelayTimer = 10; + static s16 sGameOverColorTimer = 0; + static s16 sStickXRepeatTimer = 0; + static s16 sStickYRepeatTimer = 0; + static s16 sStickXRepeatState = 0; + static s16 sStickYRepeatState = 0; + PauseContext* pauseCtx = &play->pauseCtx; + InterfaceContext* interfaceCtx = &play->interfaceCtx; + MessageContext* msgCtx = &play->msgCtx; + GameOverContext* gameOverCtx = &play->gameOverCtx; + SramContext* sramCtx = &play->sramCtx; + Input* input = CONTROLLER1(&play->state); + size_t size0; + size_t size1; + size_t size2; + u16 itemId; + u16 worldMapCursorPoint; + void* iconItemLangSegment; + s16 stepR; + s16 stepG; + s16 stepB; + s16 stepA; + s16 stickAdjX = input->rel.stick_x; + + func_80109428(play); + + pauseCtx->stickAdjX = input->rel.stick_x; + pauseCtx->stickAdjY = input->rel.stick_y; + + switch (pauseCtx->state) { + case PAUSE_STATE_OPENING_2: + sUnpausedHudVisibility = gSaveContext.hudVisibility; + sPauseMenuVerticalOffset = -6240.0f; + + sUnpausedButtonStatus[EQUIP_SLOT_B] = gSaveContext.buttonStatus[EQUIP_SLOT_B]; + sUnpausedButtonStatus[EQUIP_SLOT_C_LEFT] = gSaveContext.buttonStatus[EQUIP_SLOT_C_LEFT]; + sUnpausedButtonStatus[EQUIP_SLOT_C_DOWN] = gSaveContext.buttonStatus[EQUIP_SLOT_C_DOWN]; + sUnpausedButtonStatus[EQUIP_SLOT_C_RIGHT] = gSaveContext.buttonStatus[EQUIP_SLOT_C_RIGHT]; + sUnpausedButtonStatus[EQUIP_SLOT_A] = gSaveContext.buttonStatus[EQUIP_SLOT_A]; + + pauseCtx->cursorXIndex[PAUSE_MAP] = 0; + pauseCtx->cursorSlot[PAUSE_MAP] = R_REVERSE_FLOOR_INDEX + DUNGEON_FLOOR_INDEX_4; + pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->unk_256 = R_REVERSE_FLOOR_INDEX + DUNGEON_FLOOR_INDEX_4; + + sPauseCursorLeftX = -175; + sPauseCursorRightX = 155; + pauseCtx->roll = -314.0f; + + pauseCtx->iconItemSegment = (void*)ALIGN16((uintptr_t)play->objectCtx.spaceStart); + size0 = SEGMENT_ROM_SIZE(icon_item_static_old); + func_80178E7C((uintptr_t)SEGMENT_ROM_START(icon_item_static_test), pauseCtx->iconItemSegment, size0); + + gSegments[0x08] = PHYSICAL_TO_VIRTUAL(pauseCtx->iconItemSegment); + + for (itemId = 0; itemId <= ITEM_BOW_ARROW_FIRE; itemId++) { + if (!gPlayerFormItemRestrictions[(void)0, gSaveContext.save.playerForm][(s32)itemId]) { + KaleidoScope_GrayOutTextureRGBA32(Lib_SegmentedToVirtual(gItemIcons[(s32)itemId]), 0x400); + } + } + + pauseCtx->iconItem24Segment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemSegment + size0); + size1 = SEGMENT_ROM_SIZE(icon_item_24_static_old); + func_80178E7C((uintptr_t)SEGMENT_ROM_START(icon_item_24_static_test), pauseCtx->iconItem24Segment, size1); + + pauseCtx->iconItemAltSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItem24Segment + size1); + if (func_8010A0A4(play)) { + size_t size = SEGMENT_ROM_SIZE(icon_item_dungeon_static); + + DmaMgr_SendRequest0(pauseCtx->iconItemAltSegment, SEGMENT_ROM_START(icon_item_dungeon_static), size); + iconItemLangSegment = + func_801068FC(play, (void*)ALIGN16((uintptr_t)pauseCtx->iconItemAltSegment + size), size); + sInDungeonScene = true; + } else { + size_t size; + + sInDungeonScene = false; + size = SEGMENT_ROM_SIZE(icon_item_field_static); + DmaMgr_SendRequest0(pauseCtx->iconItemAltSegment, _icon_item_field_staticSegmentRomStart, size); + iconItemLangSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemAltSegment + size); + } + + pauseCtx->iconItemLangSegment = iconItemLangSegment; + size2 = SEGMENT_ROM_SIZE(icon_item_jpn_static); + DmaMgr_SendRequest0(pauseCtx->iconItemLangSegment, SEGMENT_ROM_START(icon_item_jpn_static), size2); + + pauseCtx->nameSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemLangSegment + size2); + func_8011552C(play, 0x15); + if (((void)0, gSaveContext.worldMapArea) < 0x16) { + func_8082192C(pauseCtx->nameSegment + 0x400, ((void)0, gSaveContext.worldMapArea)); + } + + pauseCtx->iconItemVtxSegment = (void*)ALIGN16((uintptr_t)pauseCtx->nameSegment + 0xA00); + DmaMgr_SendRequest0(pauseCtx->iconItemVtxSegment, SEGMENT_ROM_START(icon_item_vtx_static), + SEGMENT_ROM_SIZE(icon_item_vtx_static)); + + pauseCtx->unk_2B6 = 255; + pauseCtx->unk_2B7 = 255; + pauseCtx->unk_2B8 = 255; + pauseCtx->state = PAUSE_STATE_OPENING_3; + break; + + case PAUSE_STATE_OPENING_3: + pauseCtx->infoPanelOffsetY += 10; + pauseCtx->itemPageRoll = pauseCtx->mapPageRoll = pauseCtx->questPageRoll = pauseCtx->maskPageRoll -= 40.0f; + + interfaceCtx->startAlpha += 63; + sPauseCursorLeftX += (s16)(sPauseCursorLeftMoveOffsetX / 4); + sPauseCursorRightX += (s16)(sPauseCursorRightMoveOffsetX / 4); + pauseCtx->alpha += 31; + if (pauseCtx->itemPageRoll == 0) { + interfaceCtx->startAlpha = 255; + sPauseMenuVerticalOffset = 0.0f; + pauseCtx->state = PAUSE_STATE_OPENING_4; + } + + KaleidoScope_UpdateOpening(play); + break; + + case PAUSE_STATE_OPENING_4: + pauseCtx->alpha += 31; + KaleidoScope_UpdateOpening(play); + + if (pauseCtx->state == PAUSE_STATE_MAIN) { + KaleidoScope_UpdateNamePanel(play); + } + break; + + case PAUSE_STATE_MAIN: + switch (pauseCtx->mainState) { + case PAUSE_MAIN_STATE_IDLE: + if (!pauseCtx->itemDescriptionOn && + (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_B))) { + func_8011552C(play, 0xA); + pauseCtx->state = PAUSE_STATE_UNPAUSE_SETUP; + sPauseMenuVerticalOffset = -6240.0f; + func_801A3AEC(0); + } + break; + + case PAUSE_MAIN_STATE_SWITCHING_PAGE: + KaleidoScope_UpdateSwitchPage(play, input); + break; + + case PAUSE_MAIN_STATE_SONG_PLAYBACK: + // Song is in playback + pauseCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); + if (pauseCtx->ocarinaStaff->state == 0) { + // Song playback is finished, give song prompt to player + pauseCtx->mainState = PAUSE_MAIN_STATE_SONG_PROMPT_INIT; + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); + } + break; + + case PAUSE_MAIN_STATE_EQUIP_ITEM: + KaleidoScope_UpdateItemEquip(play); + break; + + case PAUSE_MAIN_STATE_SONG_PROMPT_INIT: + break; + + case PAUSE_MAIN_STATE_SONG_PROMPT: + pauseCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff(); + + if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_B)) { + // Abort having the player play the song and close the pause menu + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); + func_8011552C(play, 0xA); + pauseCtx->state = PAUSE_STATE_UNPAUSE_SETUP; + sPauseMenuVerticalOffset = -6240.0f; + func_801A3AEC(0); + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; + } else if (pauseCtx->ocarinaStaff->state == pauseCtx->ocarinaSongIndex) { + // The player successfully played the song + play_sound(NA_SE_SY_TRE_BOX_APPEAR); + sNextMainState = PAUSE_MAIN_STATE_IDLE; + sDelayTimer = 30; + pauseCtx->mainState = PAUSE_MAIN_STATE_SONG_PROMPT_DONE; + } else if (pauseCtx->ocarinaStaff->state == 0xFF) { + // The player failed to play the song + play_sound(NA_SE_SY_OCARINA_ERROR); + sNextMainState = PAUSE_MAIN_STATE_SONG_PROMPT_INIT; + sDelayTimer = 20; + pauseCtx->mainState = PAUSE_MAIN_STATE_SONG_PROMPT_DONE; + } + break; + + case PAUSE_MAIN_STATE_SONG_PROMPT_DONE: + sDelayTimer--; + if (sDelayTimer == 0) { + pauseCtx->mainState = sNextMainState; + if (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) { + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); + } + } + break; + + case PAUSE_MAIN_STATE_SONG_PROMPT_UNUSED: + break; + + case PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG: + if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_B)) { + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); + func_8011552C(play, 0xA); + pauseCtx->state = PAUSE_STATE_UNPAUSE_SETUP; + sPauseMenuVerticalOffset = -6240.0f; + func_801A3AEC(0); + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; + } + break; + + case PAUSE_MAIN_STATE_SONG_PLAYBACK_INIT: + break; + + case PAUSE_MAIN_STATE_EQUIP_MASK: + KaleidoScope_UpdateMaskEquip(play); + break; + + case PAUSE_MAIN_STATE_BOMBERS_NOTEBOOK_OPEN: + if (!play->pauseCtx.bombersNotebookOpen) { + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; + } + break; + + default: + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; + break; + } + break; + + case PAUSE_STATE_SAVEPROMPT: + switch (pauseCtx->savePromptState) { + case PAUSE_SAVEPROMPT_STATE_0: + pauseCtx->roll -= 78.5f; + sPauseCursorLeftX -= (s16)(sPauseCursorLeftMoveOffsetX / 4); + sPauseCursorRightX -= (s16)(sPauseCursorRightMoveOffsetX / 4); + if (pauseCtx->roll <= -628.0f) { + pauseCtx->roll = -628.0f; + pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_1; + } + break; + + case PAUSE_SAVEPROMPT_STATE_1: + if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_CUP)) { + if (pauseCtx->promptChoice != PAUSE_PROMPT_YES) { + func_8011552C(play, 0xA); + pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_2; + } else { + play_sound(NA_SE_SY_PIECE_OF_HEART); + Play_SaveCycleSceneFlags(&play->state); + gSaveContext.save.playerData.savedSceneId = play->sceneId; + func_8014546C(sramCtx); + if (gSaveContext.unk_3F3F == 0) { + pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_5; + } else { + func_80147008(sramCtx, D_801C67C8[gSaveContext.fileNum], + D_801C67F0[gSaveContext.fileNum]); + func_80147020(sramCtx); + pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_4; + } + sDelayTimer = 90; + } + } else if (CHECK_BTN_ALL(input->press.button, BTN_START)) { + func_8011552C(play, 0xA); + pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_3; + sPauseMenuVerticalOffset = -6240.0f; + D_8082B90C = pauseCtx->roll; + func_801A3AEC(0); + } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { + func_8011552C(play, 0xA); + pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_2; + D_8082B90C = pauseCtx->roll; + } + break; + + case PAUSE_SAVEPROMPT_STATE_4: + if (sramCtx->status == 0) { + pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_5; + } + break; + + case PAUSE_SAVEPROMPT_STATE_5: + if (CHECK_BTN_ALL(input->press.button, BTN_B) || CHECK_BTN_ALL(input->press.button, BTN_A) || + CHECK_BTN_ALL(input->press.button, BTN_START) || (--sDelayTimer == 0)) { + func_8011552C(play, 0xA); + pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_3; + sPauseMenuVerticalOffset = -6240.0f; + D_8082B90C = pauseCtx->roll; + func_801A3AEC(0); + } + break; + + case PAUSE_SAVEPROMPT_STATE_3: + case PAUSE_SAVEPROMPT_STATE_7: + if (pauseCtx->roll != (D_8082B90C + 160.0f)) { + pauseCtx->itemPageRoll = pauseCtx->mapPageRoll = pauseCtx->questPageRoll = + pauseCtx->maskPageRoll += 40.0f; + pauseCtx->roll += 40.0f; + pauseCtx->infoPanelOffsetY -= 10; + sPauseCursorLeftX -= (s16)(sPauseCursorLeftMoveOffsetX / 4); + sPauseCursorRightX -= (s16)(sPauseCursorRightMoveOffsetX / 4); + pauseCtx->alpha -= 63; + if (pauseCtx->roll == (D_8082B90C + 160.0f)) { + pauseCtx->alpha = 0; + } + } else { + pauseCtx->debugEditor = DEBUG_EDITOR_NONE; + pauseCtx->state = PAUSE_STATE_UNPAUSE_CLOSE; + pauseCtx->itemPageRoll = pauseCtx->mapPageRoll = pauseCtx->questPageRoll = + pauseCtx->maskPageRoll = 160.0f; + pauseCtx->roll = -434.0f; + pauseCtx->namedItem = PAUSE_ITEM_NONE; + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; + } + break; + + case PAUSE_SAVEPROMPT_STATE_2: + pauseCtx->roll += 78.5f; + sPauseCursorLeftX += (s16)(sPauseCursorLeftMoveOffsetX / 4); + sPauseCursorRightX += (s16)(sPauseCursorRightMoveOffsetX / 4); + if (pauseCtx->roll >= -314.0f) { + pauseCtx->state = PAUSE_STATE_MAIN; + pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_0; + pauseCtx->roll = -314.0f; + pauseCtx->itemPageRoll = pauseCtx->mapPageRoll = pauseCtx->questPageRoll = + pauseCtx->maskPageRoll = 0.0f; + func_8011552C(play, 0x15); + gSaveContext.buttonStatus[EQUIP_SLOT_B] = D_801C6A98[pauseCtx->pageIndex + 1][0]; + gSaveContext.buttonStatus[EQUIP_SLOT_C_LEFT] = D_801C6A98[pauseCtx->pageIndex + 1][1]; + gSaveContext.buttonStatus[EQUIP_SLOT_C_DOWN] = D_801C6A98[pauseCtx->pageIndex + 1][1]; + gSaveContext.buttonStatus[EQUIP_SLOT_C_RIGHT] = D_801C6A98[pauseCtx->pageIndex + 1][1]; + if ((pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) || + (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_RIGHT)) { + KaleidoScope_MoveCursorToSpecialPos(play, pauseCtx->cursorSpecialPos); + } else { + func_80821A04(play); + } + } + break; + + case PAUSE_SAVEPROMPT_STATE_6: + if (interfaceCtx->unk_264 != 255) { + interfaceCtx->unk_264 += 10; + if (interfaceCtx->unk_264 >= 255) { + interfaceCtx->unk_264 = 255; + pauseCtx->state = PAUSE_STATE_OFF; + Game_SetFramerateDivisor(&play->state, 3); + R_PAUSE_BG_PRERENDER_STATE = PAUSE_BG_PRERENDER_UNK4; + Object_LoadAll(&play->objectCtx); + BgCheck_InitCollisionHeaders(&play->colCtx, play); + STOP_GAMESTATE(&play->state); + SET_NEXT_GAMESTATE(&play->state, TitleSetup_Init, sizeof(TitleSetupState)); + func_801A4058(0x14); + gSaveContext.seqId = (u8)NA_BGM_DISABLED; + gSaveContext.ambienceId = AMBIENCE_ID_DISABLED; + } + } + break; + } + break; + + case PAUSE_STATE_GAMEOVER_2: + pauseCtx->cursorSlot[PAUSE_MAP] = R_REVERSE_FLOOR_INDEX + DUNGEON_FLOOR_INDEX_4; + pauseCtx->cursorPoint[PAUSE_MAP] = R_REVERSE_FLOOR_INDEX + DUNGEON_FLOOR_INDEX_4; + sPauseCursorLeftX = -175; + sPauseCursorRightX = 155; + pauseCtx->roll = -434.0f; + Interface_SetHudVisibility(HUD_VISIBILITY_NONE); + + pauseCtx->iconItemSegment = + (void*)(((uintptr_t)play->objectCtx.spaceStart + 0x30) & ~0x3F); // Messed up ALIGN64 + size0 = SEGMENT_ROM_SIZE(icon_item_static_old); + func_80178E7C(SEGMENT_ROM_START(icon_item_static_test), pauseCtx->iconItemSegment, size0); + + pauseCtx->iconItem24Segment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemSegment + size0); + size1 = SEGMENT_ROM_SIZE(icon_item_24_static_old); + func_80178E7C(SEGMENT_ROM_START(icon_item_24_static_test), pauseCtx->iconItem24Segment, size1); + + pauseCtx->iconItemAltSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItem24Segment + size1); + size2 = SEGMENT_ROM_SIZE(icon_item_gameover_static); + DmaMgr_SendRequest0(pauseCtx->iconItemAltSegment, SEGMENT_ROM_START(icon_item_gameover_static), size2); + + pauseCtx->iconItemLangSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemAltSegment + size2); + DmaMgr_SendRequest0(pauseCtx->iconItemLangSegment, SEGMENT_ROM_START(icon_item_jpn_static), + SEGMENT_ROM_SIZE(icon_item_jpn_static)); + + gSaveContext.timerStates[TIMER_ID_MOON_CRASH] = TIMER_STATE_OFF; + + sGameOverPrimR = 255; + sGameOverPrimG = 130; + sGameOverPrimB = 0; + sGameOverPrimAlpha = 0; + sGameOverEnvR = 30; + sGameOverEnvG = 0; + sGameOverEnvB = 0; + sGameOverRectPosY = 98; + sGameOverColorTimer = 30; + + pauseCtx->promptChoice = PAUSE_PROMPT_YES; + pauseCtx->state++; + if (gameOverCtx->state == GAMEOVER_INACTIVE) { + pauseCtx->state++; + } + break; + + case PAUSE_STATE_GAMEOVER_3: + stepR = ABS_ALT(sGameOverPrimR - 30) / sGameOverColorTimer; + stepG = ABS_ALT(sGameOverPrimG - 0) / sGameOverColorTimer; + stepB = ABS_ALT(sGameOverPrimB - 0) / sGameOverColorTimer; + stepA = ABS_ALT(sGameOverPrimAlpha - 255) / sGameOverColorTimer; + if (sGameOverPrimR >= 30) { + sGameOverPrimR -= stepR; + } else { + sGameOverPrimR += stepR; + } + if (sGameOverPrimG >= 0) { + sGameOverPrimG -= stepG; + } else { + sGameOverPrimG += stepG; + } + if (sGameOverPrimB >= 0) { + sGameOverPrimB -= stepB; + } else { + sGameOverPrimB += stepB; + } + if (sGameOverPrimAlpha >= 255) { + sGameOverPrimAlpha -= stepA; + } else { + sGameOverPrimAlpha += stepA; + } + + stepR = ABS_ALT(sGameOverEnvR - 255) / sGameOverColorTimer; + stepG = ABS_ALT(sGameOverEnvG - 130) / sGameOverColorTimer; + stepB = ABS_ALT(sGameOverEnvB - 0) / sGameOverColorTimer; + if (sGameOverEnvR >= 255) { + sGameOverEnvR -= stepR; + } else { + sGameOverEnvR += stepR; + } + if (sGameOverEnvG >= 130) { + sGameOverEnvG -= stepG; + } else { + sGameOverEnvG += stepG; + } + if (sGameOverEnvB >= 0) { + sGameOverEnvB -= stepB; + } else { + sGameOverEnvB += stepB; + } + + sGameOverColorTimer--; + if (sGameOverColorTimer == 0) { + sGameOverPrimR = 30; + sGameOverPrimG = 0; + sGameOverPrimB = 0; + sGameOverPrimAlpha = 255; + + sGameOverEnvR = 255; + sGameOverEnvG = 130; + sGameOverEnvB = 0; + + sGameOverColorTimer = 40; + pauseCtx->state++; + } + break; + + case PAUSE_STATE_GAMEOVER_4: + sGameOverColorTimer--; + if (sGameOverColorTimer == 0) { + pauseCtx->state = PAUSE_STATE_GAMEOVER_5; + } + break; + + case PAUSE_STATE_GAMEOVER_5: + pauseCtx->infoPanelOffsetY += 10; + pauseCtx->roll -= 40.0f; + pauseCtx->itemPageRoll = pauseCtx->mapPageRoll = pauseCtx->questPageRoll = pauseCtx->maskPageRoll = + pauseCtx->roll; + interfaceCtx->startAlpha += 63; + sGameOverRectPosY -= 3; + sPauseCursorLeftX += (s16)(sPauseCursorLeftMoveOffsetX / 4); + sPauseCursorRightX += (s16)(sPauseCursorRightMoveOffsetX / 4); + pauseCtx->alpha += 31; + if (pauseCtx->roll < -628.0f) { + pauseCtx->roll = -628.0f; + interfaceCtx->startAlpha = 255; + sGameOverRectPosY = 66; + sPauseMenuVerticalOffset = 0.0f; + pauseCtx->alpha = 255; + if (gameOverCtx->state == GAMEOVER_INACTIVE) { + pauseCtx->state = PAUSE_STATE_GAMEOVER_SAVE_PROMPT; + } else { + pauseCtx->state = PAUSE_STATE_GAMEOVER_CONTINUE_PROMPT; + } + } + break; + + case PAUSE_STATE_GAMEOVER_SAVE_PROMPT: + if (CHECK_BTN_ALL(input->press.button, BTN_A)) { + if (pauseCtx->promptChoice != PAUSE_PROMPT_YES) { + pauseCtx->promptChoice = PAUSE_PROMPT_YES; + play_sound(NA_SE_SY_DECIDE); + pauseCtx->state = PAUSE_STATE_OFF; + Game_SetFramerateDivisor(&play->state, 3); + R_PAUSE_BG_PRERENDER_STATE = PAUSE_BG_PRERENDER_UNK4; + Object_LoadAll(&play->objectCtx); + BgCheck_InitCollisionHeaders(&play->colCtx, play); + } else { + play_sound(NA_SE_SY_PIECE_OF_HEART); + pauseCtx->promptChoice = PAUSE_PROMPT_YES; + Play_SaveCycleSceneFlags(&play->state); + gSaveContext.save.playerData.savedSceneId = play->sceneId; + gSaveContext.save.playerData.health = 0x30; + func_8014546C(sramCtx); + if (gSaveContext.unk_3F3F == 0) { + pauseCtx->state = PAUSE_STATE_GAMEOVER_8; + } else { + func_80147008(sramCtx, D_801C67C8[gSaveContext.fileNum], D_801C67F0[gSaveContext.fileNum]); + func_80147020(sramCtx); + pauseCtx->state = PAUSE_STATE_GAMEOVER_7; + } + sDelayTimer = 90; + } + } else if ((pauseCtx->promptChoice == PAUSE_PROMPT_YES) && (stickAdjX >= 30)) { + play_sound(NA_SE_SY_CURSOR); + pauseCtx->promptChoice = PAUSE_PROMPT_NO; + } else if ((pauseCtx->promptChoice != PAUSE_PROMPT_YES) && (stickAdjX <= -30)) { + play_sound(NA_SE_SY_CURSOR); + pauseCtx->promptChoice = PAUSE_PROMPT_YES; + } + break; + + case PAUSE_STATE_GAMEOVER_7: + if (sramCtx->status == 0) { + pauseCtx->state = PAUSE_STATE_OFF; + Game_SetFramerateDivisor(&play->state, 3); + R_PAUSE_BG_PRERENDER_STATE = PAUSE_BG_PRERENDER_UNK4; + Object_LoadAll(&play->objectCtx); + BgCheck_InitCollisionHeaders(&play->colCtx, play); + } + break; + + case PAUSE_STATE_GAMEOVER_8: + sDelayTimer--; + if (sDelayTimer == 0) { + pauseCtx->state = PAUSE_STATE_GAMEOVER_CONTINUE_PROMPT; + gameOverCtx->state++; + } else if ((sDelayTimer <= 80) && + (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_START))) { + pauseCtx->state = PAUSE_STATE_GAMEOVER_CONTINUE_PROMPT; + gameOverCtx->state++; + func_801A3AEC(0); + } + break; + + case PAUSE_STATE_GAMEOVER_CONTINUE_PROMPT: + if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_START)) { + if (pauseCtx->promptChoice == PAUSE_PROMPT_YES) { + play_sound(NA_SE_SY_PIECE_OF_HEART); + Play_SaveCycleSceneFlags(&play->state); + if (gSaveContext.save.entrance == ENTRANCE(UNSET_0D, 0)) {} + } else { // PAUSE_PROMPT_NO + play_sound(NA_SE_SY_DECIDE); + } + pauseCtx->state = PAUSE_STATE_GAMEOVER_10; + } + break; + + case PAUSE_STATE_GAMEOVER_10: + if (interfaceCtx->unk_264 != 255) { + interfaceCtx->unk_264 += 10; + if (interfaceCtx->unk_264 >= 255) { + interfaceCtx->unk_264 = 255; + + pauseCtx->state = PAUSE_STATE_OFF; + Game_SetFramerateDivisor(&play->state, 3); + R_PAUSE_BG_PRERENDER_STATE = PAUSE_BG_PRERENDER_UNK4; + Object_LoadAll(&play->objectCtx); + BgCheck_InitCollisionHeaders(&play->colCtx, play); + + if (pauseCtx->promptChoice == PAUSE_PROMPT_YES) { + func_80169FDC(&play->state); + gSaveContext.respawnFlag = -2; + gSaveContext.nextTransitionType = TRANS_TYPE_02; + gSaveContext.save.playerData.health = 0x30; + Audio_SetSpec(0xA); + gSaveContext.healthAccumulator = 0; + gSaveContext.magicState = MAGIC_STATE_IDLE; + gSaveContext.magicFlag = 0; + gSaveContext.magicCapacity = 0; + gSaveContext.magicFillTarget = gSaveContext.save.playerData.magic; + gSaveContext.save.playerData.magicLevel = 0; + gSaveContext.save.playerData.magic = 0; + } else { // PAUSE_PROMPT_NO + STOP_GAMESTATE(&play->state); + SET_NEXT_GAMESTATE(&play->state, TitleSetup_Init, sizeof(TitleSetupState)); + } + } + } + break; + + case PAUSE_STATE_OWLWARP_2: + sPauseMenuVerticalOffset = -6240.0f; + + sUnpausedButtonStatus[EQUIP_SLOT_B] = gSaveContext.buttonStatus[EQUIP_SLOT_B]; + sUnpausedButtonStatus[EQUIP_SLOT_C_LEFT] = gSaveContext.buttonStatus[EQUIP_SLOT_C_LEFT]; + sUnpausedButtonStatus[EQUIP_SLOT_C_DOWN] = gSaveContext.buttonStatus[EQUIP_SLOT_C_DOWN]; + sUnpausedButtonStatus[EQUIP_SLOT_C_RIGHT] = gSaveContext.buttonStatus[EQUIP_SLOT_C_RIGHT]; + sUnpausedButtonStatus[EQUIP_SLOT_A] = gSaveContext.buttonStatus[EQUIP_SLOT_A]; + + pauseCtx->cursorXIndex[PAUSE_MAP] = 0; + pauseCtx->cursorSlot[PAUSE_MAP] = R_REVERSE_FLOOR_INDEX + DUNGEON_FLOOR_INDEX_4; + pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->unk_256 = R_REVERSE_FLOOR_INDEX + DUNGEON_FLOOR_INDEX_4; + + sPauseCursorLeftX = -175; + sPauseCursorRightX = 155; + + pauseCtx->iconItemSegment = (void*)ALIGN16((uintptr_t)play->objectCtx.spaceStart); + size0 = SEGMENT_ROM_SIZE(icon_item_static_old); + func_80178E7C(SEGMENT_ROM_START(icon_item_static_test), pauseCtx->iconItemSegment, size0); + + pauseCtx->iconItemAltSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemSegment + size0); + sInDungeonScene = false; + size1 = SEGMENT_ROM_SIZE(icon_item_field_static); + DmaMgr_SendRequest0(pauseCtx->iconItemAltSegment, SEGMENT_ROM_START(icon_item_field_static), size1); + + pauseCtx->iconItemLangSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemAltSegment + size1); + size2 = SEGMENT_ROM_SIZE(icon_item_jpn_static); + DmaMgr_SendRequest0(pauseCtx->iconItemLangSegment, SEGMENT_ROM_START(icon_item_jpn_static), size2); + + pauseCtx->nameSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemLangSegment + size2); + func_8011552C(play, 0x16); + worldMapCursorPoint = pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; + func_80821900(pauseCtx->nameSegment, worldMapCursorPoint); + + pauseCtx->iconItemVtxSegment = (void*)ALIGN16((uintptr_t)pauseCtx->nameSegment + 0xA00); + DmaMgr_SendRequest0(pauseCtx->iconItemVtxSegment, SEGMENT_ROM_START(icon_item_vtx_static), + SEGMENT_ROM_SIZE(icon_item_vtx_static)); + + pauseCtx->state = PAUSE_STATE_OWLWARP_3; + sGameOverRectPosY = 98; + pauseCtx->promptChoice = PAUSE_PROMPT_YES; + break; + + case PAUSE_STATE_OWLWARP_3: + R_PAUSE_OWLWARP_ALPHA += 20; + pauseCtx->infoPanelOffsetY += 10; + pauseCtx->mapPageRoll -= 40.0f; + interfaceCtx->startAlpha += 63; + sGameOverRectPosY -= 3; + sPauseCursorLeftX += (s16)(sPauseCursorLeftMoveOffsetX / 4); + sPauseCursorRightX += (s16)(sPauseCursorRightMoveOffsetX / 4); + pauseCtx->alpha += 31; + + if (pauseCtx->mapPageRoll == 0) { + interfaceCtx->startAlpha = 255; + sPauseMenuVerticalOffset = 0.0f; + pauseCtx->alpha = 255; + pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; + pauseCtx->cursorSpecialPos = 0; + pauseCtx->state = PAUSE_STATE_OWLWARP_SELECT; + R_PAUSE_OWLWARP_ALPHA = 120; + } + break; + + case PAUSE_STATE_OWLWARP_SELECT: + if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_B)) { + func_8011552C(play, 0xA); + pauseCtx->state = PAUSE_STATE_OWLWARP_6; + sPauseMenuVerticalOffset = -6240.0f; + func_801A3AEC(0); + play->msgCtx.ocarinaMode = 4; + gSaveContext.prevHudVisibility = HUD_VISIBILITY_ALL; + } else if (CHECK_BTN_ALL(input->press.button, BTN_A)) { + play_sound(NA_SE_SY_DECIDE); + Message_StartTextbox(play, 0x1B93, NULL); + pauseCtx->state = PAUSE_STATE_OWLWARP_CONFIRM; + } else { + KaleidoScope_UpdateOwlWarpNamePanel(play); + } + break; + + case PAUSE_STATE_OWLWARP_CONFIRM: + if (CHECK_BTN_ALL(input->press.button, BTN_A)) { + msgCtx->msgLength = 0; + msgCtx->msgMode = 0; + if (msgCtx->choiceIndex == 0) { + func_8011552C(play, 0xA); + pauseCtx->state = PAUSE_STATE_OWLWARP_6; + sPauseMenuVerticalOffset = -6240.0f; + func_801A3AEC(0); + play->msgCtx.ocarinaMode = sCursorPointsToOcarinaModes[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]]; + play_sound(NA_SE_SY_DECIDE); + } else { + pauseCtx->state = PAUSE_STATE_OWLWARP_SELECT; + func_8011552C(play, 0x16); + play_sound(NA_SE_SY_MESSAGE_PASS); + } + } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { + msgCtx->msgLength = 0; + msgCtx->msgMode = 0; + pauseCtx->state = PAUSE_STATE_OWLWARP_SELECT; + play_sound(NA_SE_SY_MESSAGE_PASS); + } else if (CHECK_BTN_ALL(input->press.button, BTN_START)) { + msgCtx->msgLength = 0; + msgCtx->msgMode = 0; + func_8011552C(play, 0xA); + pauseCtx->state = PAUSE_STATE_OWLWARP_6; + sPauseMenuVerticalOffset = -6240.0f; + func_801A3AEC(0); + play->msgCtx.ocarinaMode = 4; + gSaveContext.prevHudVisibility = HUD_VISIBILITY_ALL; + } + break; + + case PAUSE_STATE_OWLWARP_6: + if (pauseCtx->mapPageRoll != 160.0f) { + R_PAUSE_OWLWARP_ALPHA -= 60; + if (R_PAUSE_OWLWARP_ALPHA <= 0) { + R_PAUSE_OWLWARP_ALPHA = 0; + } + pauseCtx->infoPanelOffsetY -= 10; + pauseCtx->mapPageRoll += 40.0f; + interfaceCtx->startAlpha -= 63; + sPauseCursorLeftX -= (s16)(sPauseCursorLeftMoveOffsetX / 4); + sPauseCursorRightX -= (s16)(sPauseCursorRightMoveOffsetX / 4); + pauseCtx->alpha -= 63; + if (pauseCtx->mapPageRoll == 160.0f) { + pauseCtx->alpha = 0; + } + } else { + pauseCtx->debugEditor = DEBUG_EDITOR_NONE; + pauseCtx->state = PAUSE_STATE_UNPAUSE_CLOSE; + pauseCtx->itemPageRoll = pauseCtx->mapPageRoll = pauseCtx->questPageRoll = pauseCtx->maskPageRoll = + 160.0f; + pauseCtx->namedItem = PAUSE_ITEM_NONE; + interfaceCtx->startAlpha = 0; + pauseCtx->pageIndex = pauseCtx->unk_2C8; + pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = pauseCtx->unk_2CA; + } + break; + + case PAUSE_STATE_UNPAUSE_SETUP: + if (pauseCtx->itemPageRoll != 160.0f) { + pauseCtx->infoPanelOffsetY -= 10; + pauseCtx->itemPageRoll = pauseCtx->mapPageRoll = pauseCtx->questPageRoll = pauseCtx->maskPageRoll += + 40.0f; + interfaceCtx->startAlpha -= 63; + sPauseCursorLeftX -= (s16)(sPauseCursorLeftMoveOffsetX / 4); + sPauseCursorRightX -= (s16)(sPauseCursorRightMoveOffsetX / 4); + pauseCtx->alpha -= 63; + if (pauseCtx->itemPageRoll == 160.0f) { + pauseCtx->alpha = 0; + } + } else { + pauseCtx->debugEditor = DEBUG_EDITOR_NONE; + pauseCtx->state = PAUSE_STATE_UNPAUSE_CLOSE; + pauseCtx->maskPageRoll = 160.0f; + pauseCtx->questPageRoll = 160.0f; + pauseCtx->mapPageRoll = 160.0f; + pauseCtx->itemPageRoll = 160.0f; + pauseCtx->namedItem = PAUSE_ITEM_NONE; + interfaceCtx->startAlpha = 0; + } + break; + + case PAUSE_STATE_UNPAUSE_CLOSE: + pauseCtx->state = PAUSE_STATE_OFF; + Game_SetFramerateDivisor(&play->state, 3); + R_PAUSE_BG_PRERENDER_STATE = PAUSE_BG_PRERENDER_UNK4; + Object_LoadAll(&play->objectCtx); + BgCheck_InitCollisionHeaders(&play->colCtx, play); + + gSaveContext.buttonStatus[EQUIP_SLOT_B] = sUnpausedButtonStatus[EQUIP_SLOT_B]; + gSaveContext.buttonStatus[EQUIP_SLOT_C_LEFT] = sUnpausedButtonStatus[EQUIP_SLOT_C_LEFT]; + gSaveContext.buttonStatus[EQUIP_SLOT_C_DOWN] = sUnpausedButtonStatus[EQUIP_SLOT_C_DOWN]; + gSaveContext.buttonStatus[EQUIP_SLOT_C_RIGHT] = sUnpausedButtonStatus[EQUIP_SLOT_C_RIGHT]; + gSaveContext.buttonStatus[EQUIP_SLOT_A] = sUnpausedButtonStatus[EQUIP_SLOT_A]; + + func_80110038(play); + gSaveContext.hudVisibility = HUD_VISIBILITY_IDLE; + Interface_SetHudVisibility(HUD_VISIBILITY_ALL); + MsgEvent_SendNullTask(); + func_80143324(play, &play->skyboxCtx, play->skyboxId); + + if ((msgCtx->msgMode != 0) && (msgCtx->currentTextId == 0xFF)) { + func_80115844(play, 0x12); + func_8011552C(play, 0x12); + Interface_SetHudVisibility(HUD_VISIBILITY_A_B_C); + } else { + interfaceCtx->unk_222 = interfaceCtx->unk_224 = 0; + } + gSaveContext.hudVisibility = HUD_VISIBILITY_IDLE; + Interface_SetHudVisibility(sUnpausedHudVisibility); + func_801A3A7C(0); + break; + } + + // If stickAdj is held, set a delay to allow the cursor to read the next input. + // The first delay is given a longer time than all subsequent delays. + if (!IS_PAUSE_STATE_GAMEOVER && (pauseCtx->state != PAUSE_STATE_SAVEPROMPT)) { + if (pauseCtx->stickAdjX < -30) { + if (sStickXRepeatState == -1) { + sStickXRepeatTimer--; + if (sStickXRepeatTimer < 0) { + // Allow the input to register and apply the delay for all subsequent repeated inputs + sStickXRepeatTimer = 2; + } else { + // Cancel the current input + pauseCtx->stickAdjX = 0; + } + } else { + // Allow the input to register and apply the delay for the first repeated input + sStickXRepeatTimer = 10; + sStickXRepeatState = -1; + } + } else if (pauseCtx->stickAdjX > 30) { + if (sStickXRepeatState == 1) { + sStickXRepeatTimer--; + if (sStickXRepeatTimer < 0) { + // Allow the input to register and apply the delay for all subsequent repeated inputs + sStickXRepeatTimer = 2; + } else { + // Cancel the current input + pauseCtx->stickAdjX = 0; + } + } else { + // Allow the input to register and apply the delay for the first repeated input + sStickXRepeatTimer = 10; + sStickXRepeatState = 1; + } + } else { + sStickXRepeatState = 0; + } + + if (pauseCtx->stickAdjY < -30) { + if (sStickYRepeatState == -1) { + sStickYRepeatTimer--; + if (sStickYRepeatTimer < 0) { + // Allow the input to register and apply the delay for all subsequent repeated inputs + sStickYRepeatTimer = 2; + } else { + // Cancel the current input + pauseCtx->stickAdjY = 0; + } + } else { + // Allow the input to register and apply the delay for the first repeated input + sStickYRepeatTimer = 10; + sStickYRepeatState = -1; + } + } else if (pauseCtx->stickAdjY > 30) { + if (sStickYRepeatState == 1) { + sStickYRepeatTimer--; + if (sStickYRepeatTimer < 0) { + // Allow the input to register and apply the delay for all subsequent repeated inputs + sStickYRepeatTimer = 2; + } else { + // Cancel the current input + pauseCtx->stickAdjY = 0; + } + } else { + // Allow the input to register and apply the delay for the first repeated input + sStickYRepeatTimer = 10; + sStickYRepeatState = 1; + } + } else { + sStickYRepeatState = 0; + } + } + + // Process the Cursor input + if ((R_PAUSE_BG_PRERENDER_STATE == PAUSE_BG_PRERENDER_DONE) && (pauseCtx->debugEditor == DEBUG_EDITOR_NONE) && + !IS_PAUSE_STATE_OWLWARP && + (((pauseCtx->state >= PAUSE_STATE_OPENING_3) && (pauseCtx->state <= PAUSE_STATE_SAVEPROMPT)) || + ((pauseCtx->state >= PAUSE_STATE_GAMEOVER_2) && (pauseCtx->state <= PAUSE_STATE_UNPAUSE_SETUP)))) { + if (!IS_PAUSE_STATE_GAMEOVER) { + switch (pauseCtx->pageIndex) { + case PAUSE_ITEM: + KaleidoScope_UpdateItemCursor(play); + break; + + case PAUSE_MAP: + if (sInDungeonScene) { + KaleidoScope_UpdateDungeonCursor(play); + } else { + KaleidoScope_UpdateWorldMapCursor(play); + } + break; + + case PAUSE_QUEST: + KaleidoScope_UpdateQuestCursor(play); + break; + + case PAUSE_MASK: + KaleidoScope_UpdateMaskCursor(play); + break; + } + + if ((pauseCtx->state == PAUSE_STATE_MAIN) && + ((pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE) || + (pauseCtx->mainState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG))) { + KaleidoScope_HandlePageToggles(play, input); + } + } + if (pauseCtx->state == PAUSE_STATE_MAIN) { + KaleidoScope_UpdateNamePanel(play); + } + } else if (pauseCtx->state == PAUSE_STATE_OWLWARP_SELECT) { + KaleidoScope_UpdateWorldMapCursor(play); + KaleidoScope_UpdateNamePanel(play); + } + + // Update the inventory editor + if ((pauseCtx->debugEditor == DEBUG_EDITOR_INVENTORY_INIT) || (pauseCtx->debugEditor == DEBUG_EDITOR_INVENTORY)) { + KaleidoScope_UpdateInventoryEditor(play); + } +} diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index cacce741d..42ca92a72 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -703,7 +703,7 @@ 0x800B6584:("func_800B6584",), 0x800B6608:("func_800B6608",), 0x800B6680:("func_800B6680",), - 0x800B670C:("Actor_MarkForDeath",), + 0x800B670C:("Actor_Kill",), 0x800B672C:("Actor_SetWorldToHome",), 0x800B675C:("Actor_SetFocus",), 0x800B67A0:("Actor_SetWorldRotToShape",), @@ -1525,8 +1525,8 @@ 0x800E9564:("DebugDisplay_DrawObjects",), 0x800E95F4:("DebugDisplay_DrawSpriteI8",), 0x800E97D8:("DebugDisplay_DrawPolygon",), - 0x800E992C:("func_800E992C",), - 0x800E99B0:("func_800E99B0",), + 0x800E992C:("DebugDisplay_DrawPath",), + 0x800E99B0:("DebugDisplay_PathDisplayList",), 0x800E9C90:("func_800E9C90",), 0x800E9CA0:("func_800E9CA0",), 0x800E9CFC:("func_800E9CFC",), @@ -1615,7 +1615,7 @@ 0x800F048C:("SoundSource_Add",), 0x800F0568:("SoundSource_PlaySfxAtFixedWorldPos",), 0x800F0590:("SoundSource_PlaySfxEachFrameAtFixedWorldPos",), - 0x800F05C0:("ElfMessage_GetFirstCycleHint",), + 0x800F05C0:("QuestHint_GetTatlTextId",), 0x800F07C0:("EnHy_ChangeAnim",), 0x800F0888:("EnHy_FindNearestDoor",), 0x800F0944:("EnHy_ChangeObjectAndAnim",), @@ -2202,7 +2202,7 @@ 0x8012364C:("func_8012364C",), 0x80123810:("func_80123810",), 0x80123960:("Player_ActionToModelGroup",), - 0x801239AC:("func_801239AC",), + 0x801239AC:("Player_SetModelsForHoldingShield",), 0x80123AA4:("Player_SetModels",), 0x80123BD4:("Player_SetModelGroup",), 0x80123C58:("func_80123C58",), @@ -2230,12 +2230,12 @@ 0x8012420C:("Player_GetBottleHeld",), 0x8012422C:("Player_ActionToExplosive",), 0x80124258:("Player_GetExplosiveHeld",), - 0x80124278:("func_80124278",), + 0x80124278:("Player_ActionToSword",), 0x801242B4:("func_801242B4",), 0x801242DC:("Player_GetEnvTimerType",), 0x80124420:("func_80124420",), 0x80124618:("func_80124618",), - 0x801246F4:("func_801246F4",), + 0x801246F4:("Player_DrawImpl",), 0x80124870:("func_80124870",), 0x80124CC4:("func_80124CC4",), 0x80124F18:("func_80124F18",), @@ -2263,14 +2263,14 @@ 0x80127438:("func_80127438",), 0x80127488:("func_80127488",), 0x8012754C:("Player_DrawCouplesMask",), - 0x80127594:("func_80127594",), - 0x801278F8:("func_801278F8",), - 0x80127A60:("func_80127A60",), + 0x80127594:("Player_DrawCircusLeadersMask",), + 0x801278F8:("Player_DrawBlastMask",), + 0x80127A60:("Player_DrawBunnyHood",), 0x80127B64:("func_80127B64",), 0x80127BE8:("func_80127BE8",), 0x80127DA4:("func_80127DA4",), 0x80128388:("func_80128388",), - 0x801284A0:("func_801284A0",), + 0x801284A0:("Player_DrawGreatFairysMask",), 0x80128640:("func_80128640",), 0x80128B74:("func_80128B74",), 0x80128BD0:("func_80128BD0",), @@ -3038,7 +3038,7 @@ 0x8016A0AC:("Play_IsUnderwater",), 0x8016A168:("Play_IsDebugCamEnabled",), 0x8016A178:("Play_AssignPlayerActorCsIdsFromScene",), - 0x8016A268:("func_8016A268",), + 0x8016A268:("Play_FillScreen",), 0x8016A2C8:("Play_Init",), 0x8016AC10:("func_8016AC10",), 0x8016AE1C:("func_8016AE1C",), @@ -4225,15 +4225,15 @@ 0x80821A04:("func_80821A04",), 0x80821AD4:("KaleidoScope_DrawTexQuadRGBA32",), 0x80821CC4:("func_80821CC4",), - 0x80821D84:("func_80821D84",), + 0x80821D84:("KaleidoScope_HandlePageToggles",), 0x80821F30:("func_80821F30",), 0x808221DC:("func_808221DC",), 0x80823350:("func_80823350",), - 0x80824738:("func_80824738",), + 0x80824738:("KaleidoScope_UpdateNamePanel",), 0x808248D0:("func_808248D0",), 0x80824B90:("func_80824B90",), - 0x808256E4:("func_808256E4",), - 0x8082585C:("func_8082585C",), + 0x808256E4:("KaleidoScope_UpdateOwlWarpNamePanel",), + 0x8082585C:("KaleidoScope_UpdateSwitchPage",), 0x808259D4:("KaleidoScope_SetView",), 0x80825A50:("func_80825A50",), 0x80825E28:("func_80825E28",), @@ -4241,8 +4241,8 @@ 0x80827A8C:("func_80827A8C",), 0x80827E08:("func_80827E08",), 0x808283D8:("KaleidoScope_Draw",), - 0x808286D8:("func_808286D8",), - 0x80828788:("func_80828788",), + 0x808286D8:("KaleidoScope_GrayOutTextureRGBA32",), + 0x80828788:("KaleidoScope_UpdateOpening",), 0x8082895C:("KaleidoScope_Update",), 0x8082DA90:("func_8082DA90",), 0x8082DABC:("func_8082DABC",), @@ -12135,21 +12135,21 @@ 0x80AD02FC:("EnFuKago_Update",), 0x80AD0340:("func_80AD0340",), 0x80AD04A4:("EnFuKago_Draw",), - 0x80AD0830:("func_80AD0830",), - 0x80AD08B0:("func_80AD08B0",), - 0x80AD0998:("func_80AD0998",), - 0x80AD0A24:("func_80AD0A24",), - 0x80AD0AB0:("func_80AD0AB0",), - 0x80AD0B38:("func_80AD0B38",), - 0x80AD0E10:("func_80AD0E10",), - 0x80AD10FC:("func_80AD10FC",), - 0x80AD1398:("func_80AD1398",), - 0x80AD144C:("func_80AD144C",), - 0x80AD14C8:("func_80AD14C8",), - 0x80AD1634:("func_80AD1634",), - 0x80AD16A8:("func_80AD16A8",), - 0x80AD19A0:("func_80AD19A0",), - 0x80AD1A4C:("EnOsn_Idle",), + 0x80AD0830:("EnOsn_UpdateCollider",), + 0x80AD08B0:("EnOsn_GetMaskText",), + 0x80AD0998:("EnOsn_TurnAround",), + 0x80AD0A24:("EnOsn_LookFromMask",), + 0x80AD0AB0:("EnOsn_FadeOut",), + 0x80AD0B38:("EnOsn_GetInitialMaskText",), + 0x80AD0E10:("EnOsn_GetInitialText",), + 0x80AD10FC:("EnOsn_HandleConversation",), + 0x80AD1398:("EnOsn_InitCutscene",), + 0x80AD144C:("EnOsn_ChooseAction",), + 0x80AD14C8:("EnOsn_Idle",), + 0x80AD1634:("EnOsn_StartCutscene",), + 0x80AD16A8:("EnOsn_HandleCsAction",), + 0x80AD19A0:("EnOsn_Talk",), + 0x80AD1A4C:("EnOsn_DoNothing",), 0x80AD1A5C:("EnOsn_Init",), 0x80AD1C88:("EnOsn_Destroy",), 0x80AD1CC8:("EnOsn_Update",), @@ -12330,15 +12330,15 @@ 0x80ADD7B4:("func_80ADD7B4",), 0x80ADD7CC:("EnSellnuts_TransformLimbDraw",), 0x80ADD8A4:("EnSellnuts_Draw",), - 0x80ADE230:("func_80ADE230",), + 0x80ADE230:("BgDkjailIvy_IvyCutEffects",), 0x80ADE5A4:("BgDkjailIvy_Init",), 0x80ADE664:("BgDkjailIvy_Destroy",), - 0x80ADE6AC:("func_80ADE6AC",), - 0x80ADE6C0:("func_80ADE6C0",), - 0x80ADE734:("func_80ADE734",), - 0x80ADE748:("func_80ADE748",), - 0x80ADE7E0:("func_80ADE7E0",), - 0x80ADE7F4:("func_80ADE7F4",), + 0x80ADE6AC:("BgDkjailIvy_SetupWaitForCut",), + 0x80ADE6C0:("BgDkjailIvy_WaitForCut",), + 0x80ADE734:("BgDkjailIvy_SetupCutscene",), + 0x80ADE748:("BgDkjailIvy_BeginCutscene",), + 0x80ADE7E0:("BgDkjailIvy_SetupFadeOut",), + 0x80ADE7F4:("BgDkjailIvy_FadeOut",), 0x80ADE850:("BgDkjailIvy_Update",), 0x80ADE874:("BgDkjailIvy_Draw",), 0x80ADEA70:("ObjVisiblock_Init",), @@ -13136,8 +13136,8 @@ 0x80B1861C:("EnSnowman_Dead",), 0x80B18908:("EnSnowman_SetupSplitDoNothing",), 0x80B189C4:("EnSnowman_SplitDoNothing",), - 0x80B189D4:("EnSnowman_SetupMarkForDeath",), - 0x80B18A04:("EnSnowman_MarkForDeath",), + 0x80B189D4:("EnSnowman_SetupKill",), + 0x80B18A04:("EnSnowman_Kill",), 0x80B18A28:("EnSnowman_CreateSplitEeno",), 0x80B18B30:("EnSnowman_AbsorbEeno",), 0x80B18BB4:("EnSnowman_SetupCombine",), @@ -13616,7 +13616,7 @@ 0x80B3C80C:("ObjGhaka_Update",), 0x80B3C858:("ObjGhaka_Draw",), 0x80B3CA20:("func_80B3CA20",), - 0x80B3CC38:("func_80B3CC38",), + 0x80B3CC38:("EnDnp_ChangeAnim",), 0x80B3CC80:("func_80B3CC80",), 0x80B3CD1C:("func_80B3CD1C",), 0x80B3CDA4:("func_80B3CDA4",), @@ -15451,9 +15451,9 @@ 0x80BBF5F0:("EnSGoro_DrawUnrolled",), 0x80BBF6BC:("EnSGoro_DrawRolledUp",), 0x80BBF7BC:("EnSGoro_Draw",), - 0x80BBFDB0:("func_80BBFDB0",), - 0x80BBFE60:("func_80BBFE60",), - 0x80BBFE8C:("func_80BBFE8C",), + 0x80BBFDB0:("EnNb_FindActor",), + 0x80BBFE60:("EnNb_UpdateSkelAnime",), + 0x80BBFE8C:("EnNb_ChangeAnim",), 0x80BBFF24:("func_80BBFF24",), 0x80BBFF90:("func_80BBFF90",), 0x80BBFFD4:("func_80BBFFD4",), @@ -15470,17 +15470,17 @@ 0x80BC0A18:("func_80BC0A18",), 0x80BC0B98:("func_80BC0B98",), 0x80BC0C0C:("func_80BC0C0C",), - 0x80BC0C80:("func_80BC0C80",), + 0x80BC0C80:("EnNb_ProcessScheduleOutput",), 0x80BC0D08:("func_80BC0D08",), - 0x80BC0D1C:("func_80BC0D1C",), - 0x80BC0D84:("func_80BC0D84",), + 0x80BC0D1C:("EnNb_HandleSchedule",), + 0x80BC0D84:("EnNb_FollowSchedule",), 0x80BC0EAC:("func_80BC0EAC",), 0x80BC0F60:("EnNb_Init",), 0x80BC1080:("EnNb_Destroy",), 0x80BC10C0:("EnNb_Update",), - 0x80BC1174:("func_80BC1174",), - 0x80BC11B4:("func_80BC11B4",), - 0x80BC1278:("func_80BC1278",), + 0x80BC1174:("EnNb_OverrideLimbDraw",), + 0x80BC11B4:("EnNb_PostLimbDraw",), + 0x80BC1278:("EnNb_TransformLimbDraw",), 0x80BC1374:("EnNb_Draw",), 0x80BC1900:("func_80BC1900",), 0x80BC192C:("func_80BC192C",), @@ -15672,39 +15672,39 @@ 0x80BCEF0C:("EffKamejimaWave_Draw",), 0x80BCF1D0:("EnHg_Init",), 0x80BCF328:("EnHg_Destroy",), - 0x80BCF354:("func_80BCF354",), - 0x80BCF398:("func_80BCF398",), - 0x80BCF468:("func_80BCF468",), - 0x80BCF4AC:("func_80BCF4AC",), - 0x80BCF5F0:("func_80BCF5F0",), - 0x80BCF634:("func_80BCF634",), - 0x80BCF68C:("func_80BCF68C",), - 0x80BCF6D0:("func_80BCF6D0",), - 0x80BCF710:("func_80BCF710",), - 0x80BCF778:("func_80BCF778",), - 0x80BCF7D8:("func_80BCF7D8",), - 0x80BCF88C:("func_80BCF88C",), - 0x80BCF8A0:("func_80BCF8A0",), - 0x80BCF93C:("func_80BCF93C",), - 0x80BCF95C:("func_80BCF95C",), - 0x80BCFC0C:("func_80BCFC0C",), + 0x80BCF354:("EnHg_SetupWait",), + 0x80BCF398:("EnHg_Wait",), + 0x80BCF468:("EnHg_SetupChasePlayer",), + 0x80BCF4AC:("EnHg_ChasePlayer",), + 0x80BCF5F0:("EnHg_SetupChasePlayerWait",), + 0x80BCF634:("EnHg_ChasePlayerWait",), + 0x80BCF68C:("EnHg_SetupReactToHit",), + 0x80BCF6D0:("EnHg_ReactToHit",), + 0x80BCF710:("EnHg_HandleTatlDialog",), + 0x80BCF778:("EnHg_PlayRedeadSfx",), + 0x80BCF7D8:("EnHg_UpdateCollision",), + 0x80BCF88C:("EnHg_SetupCutscene",), + 0x80BCF8A0:("EnHg_PlayCutscene",), + 0x80BCF93C:("EnHg_SetupCsAction",), + 0x80BCF95C:("EnHg_HandleCsAction",), + 0x80BCFC0C:("EnHg_WaitForPlayerAction",), 0x80BCFDC4:("EnHg_Update",), 0x80BCFE54:("EnHg_OverrideLimbDraw",), 0x80BCFE70:("EnHg_PostLimbDraw",), 0x80BCFEC4:("EnHg_Draw",), 0x80BD02B0:("EnHgo_Init",), 0x80BD03C0:("EnHgo_Destroy",), - 0x80BD03EC:("func_80BD03EC",), - 0x80BD0410:("func_80BD0410",), - 0x80BD0420:("func_80BD0420",), - 0x80BD0434:("func_80BD0434",), - 0x80BD049C:("func_80BD049C",), - 0x80BD04E0:("func_80BD04E0",), + 0x80BD03EC:("EnHgo_SetupDoNothing",), + 0x80BD0410:("EnHgo_DoNothing",), + 0x80BD0420:("EnHgo_SetupInitCollision",), + 0x80BD0434:("EnHgo_UpdateCollision",), + 0x80BD049C:("EnHgo_SetupTalk",), + 0x80BD04E0:("EnHgo_Talk",), 0x80BD064C:("EnHgo_SetupDialogueHandler",), 0x80BD0660:("EnHgo_DefaultDialogueHandler",), - 0x80BD06FC:("func_80BD06FC",), - 0x80BD0898:("func_80BD0898",), - 0x80BD0B8C:("func_80BD0B8C",), + 0x80BD06FC:("EnHgo_HandlePlayerChoice",), + 0x80BD0898:("EnHgo_HandleCsAction",), + 0x80BD0B8C:("EnHgo_UpdateModel",), 0x80BD0C30:("EnHgo_Update",), 0x80BD0CF0:("EnHgo_OverrideLimbDraw",), 0x80BD0D38:("EnHgo_PostLimbDraw",), @@ -16399,16 +16399,16 @@ 0x80BFB0E0:("EnYb_PostLimbDrawXlu",), 0x80BFB14C:("EnYb_Draw",), 0x80BFB480:("EnRz_Init",), - 0x80BFB780:("func_80BFB780",), - 0x80BFB864:("func_80BFB864",), + 0x80BFB780:("EnRz_ActorShadowFunc",), + 0x80BFB864:("EnRz_ChangeAnim",), 0x80BFB9E4:("func_80BFB9E4",), 0x80BFBA1C:("func_80BFBA1C",), - 0x80BFBA50:("func_80BFBA50",), - 0x80BFBB44:("func_80BFBB44",), - 0x80BFBC78:("func_80BFBC78",), + 0x80BFBA50:("EnRz_SetupPath",), + 0x80BFBB44:("EnRz_GetPathStatus",), + 0x80BFBC78:("EnRz_CanTalk",), 0x80BFBCEC:("func_80BFBCEC",), - 0x80BFBD54:("func_80BFBD54",), - 0x80BFBDA0:("func_80BFBDA0",), + 0x80BFBD54:("EnRz_UpdateSkelAnime",), + 0x80BFBDA0:("EnRz_FindSister",), 0x80BFBDFC:("func_80BFBDFC",), 0x80BFBE44:("EnRz_Destroy",), 0x80BFBE70:("func_80BFBE70",), @@ -16425,10 +16425,10 @@ 0x80BFC674:("func_80BFC674",), 0x80BFC728:("func_80BFC728",), 0x80BFC7E0:("func_80BFC7E0",), - 0x80BFC8AC:("func_80BFC8AC",), - 0x80BFC8F8:("func_80BFC8F8",), + 0x80BFC8AC:("EnRz_StopToThink",), + 0x80BFC8F8:("EnRz_Walk",), 0x80BFC9E4:("EnRz_Update",), - 0x80BFCAD0:("func_80BFCAD0",), + 0x80BFCAD0:("EnRz_PostLimbDraw",), 0x80BFCB3C:("EnRz_Draw",), 0x80BFCFA0:("EnScopecoin_Spin",), 0x80BFCFB8:("EnScopecoin_CheckCollectible",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 5ab4106ce..49af1b3fc 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -971,9 +971,9 @@ 0x801BDACC:("D_801BDACC","UNK_TYPE4","",0x4), 0x801BDAF0:("D_801BDAF0","UNK_TYPE4","",0x4), 0x801BDAF8:("D_801BDAF8","UNK_TYPE4","",0x4), - 0x801BDB00:("D_801BDB00","UNK_TYPE1","",0x1), - 0x801BDB08:("sKaleidoSetupEyeX","UNK_TYPE1","",0x1), - 0x801BDB18:("sKaleidoSetupEyeZ","UNK_TYPE1","",0x1), + 0x801BDB00:("sKaleidoSetupRightPageIndex","UNK_TYPE1","",0x1), + 0x801BDB08:("sKaleidoSetupRightPageEyeX","UNK_TYPE1","",0x1), + 0x801BDB18:("sKaleidoSetupRightPageEyeZ","UNK_TYPE1","",0x1), 0x801BDB30:("kanfontOrdering","u8","[92]",0x5c), 0x801BDB90:("D_801BDB90","f32","",0x4), 0x801BDB94:("D_801BDB94","UNK_TYPE4","",0x4), @@ -1192,33 +1192,33 @@ 0x801BFDA0:("sMaskObjectIds","s16","[24]",0x30), 0x801BFDD0:("D_801BFDD0","UNK_TYPE1","",0x1), 0x801BFDE8:("sMaskItemIds","UNK_TYPE1","",0x1), - 0x801BFE00:("D_801BFE00","UNK_TYPE1","",0x1), + 0x801BFE00:("gPlayerSkeletons","FlexSkeletonHeader*","[5]",0x14), 0x801BFE14:("D_801BFE14","UNK_TYPE1","",0x1), - 0x801BFF34:("D_801BFF34","UNK_TYPE2","",0x2), + 0x801BFF34:("sCItemButtons","UNK_TYPE2","",0x2), 0x801BFF3C:("sActionModelGroups","UNK_TYPE1","",0x1), 0x801BFF90:("D_801BFF90","UNK_TYPE1","",0x1), 0x801BFF98:("sPlayerStrengths","UNK_TYPE1","",0x1), 0x801BFFA0:("sEnvironmentTextTriggers","UNK_TYPE1","",0x1), 0x801BFFB0:("gPlayerModelTypes","UNK_TYPE1","",0x1), - 0x801BFFFC:("D_801BFFFC","UNK_TYPE1","",0x1), - 0x801C0024:("D_801C0024","UNK_TYPE1","",0x1), - 0x801C0034:("D_801C0034","UNK_TYPE1","",0x1), - 0x801C005C:("D_801C005C","UNK_TYPE1","",0x1), - 0x801C0084:("D_801C0084","UNK_TYPE1","",0x1), - 0x801C00AC:("D_801C00AC","UNK_TYPE1","",0x1), - 0x801C00BC:("D_801C00BC","UNK_TYPE1","",0x1), - 0x801C00D4:("D_801C00D4","UNK_TYPE1","",0x1), - 0x801C00EC:("D_801C00EC","UNK_TYPE1","",0x1), - 0x801C0114:("D_801C0114","UNK_TYPE1","",0x1), - 0x801C013C:("D_801C013C","UNK_TYPE1","",0x1), - 0x801C0164:("D_801C0164","UNK_TYPE1","",0x1), + 0x801BFFFC:("gPlayerWaistDLs","UNK_TYPE1","",0x1), + 0x801C0024:("gPlayerHandHoldingShields","UNK_TYPE1","",0x1), + 0x801C0034:("gPlayerSheath12DLs","UNK_TYPE1","",0x1), + 0x801C005C:("gPlayerSheath13DLs","UNK_TYPE1","",0x1), + 0x801C0084:("gPlayerSheath14DLs","UNK_TYPE1","",0x1), + 0x801C00AC:("gPlayerShields","UNK_TYPE1","",0x1), + 0x801C00BC:("gPlayerSheathedSwords","UNK_TYPE1","",0x1), + 0x801C00D4:("gPlayerSwordSheaths","UNK_TYPE1","",0x1), + 0x801C00EC:("gPlayerLeftHandTwoHandSwordDLs","UNK_TYPE1","",0x1), + 0x801C0114:("gPlayerLeftHandOpenDLs","UNK_TYPE1","",0x1), + 0x801C013C:("gPlayerLeftHandClosedDLs","UNK_TYPE1","",0x1), + 0x801C0164:("gPlayerLeftHandOneHandSwordDLs","UNK_TYPE1","",0x1), 0x801C018C:("D_801C018C","UNK_TYPE1","",0x1), - 0x801C01A4:("D_801C01A4","UNK_TYPE1","",0x1), - 0x801C01CC:("D_801C01CC","UNK_TYPE1","",0x1), - 0x801C01F4:("D_801C01F4","UNK_TYPE1","",0x1), - 0x801C021C:("D_801C021C","UNK_TYPE1","",0x1), - 0x801C0244:("D_801C0244","UNK_TYPE1","",0x1), - 0x801C026C:("D_801C026C","UNK_TYPE1","",0x1), + 0x801C01A4:("gPlayerRightHandOpenDLs","UNK_TYPE1","",0x1), + 0x801C01CC:("gPlayerRightHandClosedDLs","UNK_TYPE1","",0x1), + 0x801C01F4:("gPlayerRightHandBowDLs","UNK_TYPE1","",0x1), + 0x801C021C:("gPlayerRightHandInstrumentDLs","UNK_TYPE1","",0x1), + 0x801C0244:("gPlayerRightHandHookshotDLs","UNK_TYPE1","",0x1), + 0x801C026C:("gPlayerLeftHandBottleDLs","UNK_TYPE1","",0x1), 0x801C0294:("D_801C0294","UNK_TYPE1","",0x1), 0x801C02A8:("D_801C02A8","UNK_TYPE1","",0x1), 0x801C02BC:("D_801C02BC","UNK_TYPE1","",0x1), @@ -1260,11 +1260,11 @@ 0x801C07F0:("D_801C07F0","UNK_TYPE1","",0x1), 0x801C0820:("D_801C0820","UNK_TYPE1","",0x1), 0x801C0838:("D_801C0838","UNK_TYPE1","",0x1), - 0x801C0850:("D_801C0850","UNK_TYPE1","",0x1), - 0x801C0860:("D_801C0860","UNK_TYPE1","",0x1), - 0x801C0870:("D_801C0870","UNK_PTR","",0x4), - 0x801C0890:("D_801C0890","UNK_TYPE1","",0x1), - 0x801C08A0:("D_801C08A0","UNK_TYPE1","",0x20), + 0x801C0850:("gCullBackDList","UNK_TYPE1","",0x1), + 0x801C0860:("gCullFrontDList","UNK_TYPE1","",0x1), + 0x801C0870:("sPlayerEyesTextures","UNK_PTR","",0x4), + 0x801C0890:("sPlayerMouthTextures","UNK_TYPE1","",0x1), + 0x801C08A0:("sPlayerFaces","UNK_TYPE1","",0x20), 0x801C08C0:("D_801C08C0","UNK_TYPE1","",0x1), 0x801C08FC:("D_801C08FC","UNK_TYPE1","",0x1), 0x801C0910:("D_801C0910","UNK_TYPE1","",0x1), @@ -1356,7 +1356,7 @@ 0x801C20C8:("gItemPrices","UNK_TYPE1","",0x1), 0x801C212C:("gSceneIdsPerRegion","SceneIdList","[]",0x252), 0x801C2380:("sSceneIdsPerTingleMap","u16","[]",0x90), - 0x801C2410:("D_801C2410","UNK_TYPE1","",0x1), + 0x801C2410:("gPlayerFormItemRestrictions","UNK_TYPE1","",0x1), 0x801C2650:("tatlMessageFiles","RomFile","[2]",0x10), 0x801C2660:("sceneTextureFiles","RomFile","[9]",0x48), 0x801C26A8:("sceneHeaderFuncTable","scene_header_func","[31]",0x7c), @@ -4003,17 +4003,17 @@ 0x801F5834:("D_801F5834","UNK_TYPE1","",0x1), 0x801F5840:("gNMIBuffer","s32*","",0x4), 0x801F5850:("sPostmanTimerInput","UNK_TYPE1","",0x1), - 0x801F58B0:("D_801F58B0","UNK_TYPE1","",0x1), + 0x801F58B0:("D_801F58B0","struct_801F58B0","[3][3]",0xFC), 0x801F59AC:("D_801F59AC","UNK_TYPE1","",0x1), - 0x801F59B0:("D_801F59B0","UNK_TYPE1","",0x1), - 0x801F59C8:("D_801F59C8","UNK_TYPE1","",0x1), - 0x801F59D0:("D_801F59D0","UNK_TYPE1","",0x1), - 0x801F59DC:("D_801F59DC","UNK_TYPE1","",0x1), - 0x801F59E0:("D_801F59E0","UNK_TYPE1","",0x1), - 0x801F59E4:("D_801F59E4","UNK_TYPE1","",0x1), + 0x801F59B0:("D_801F59B0","Vec3f","[2]",0x18), + 0x801F59C8:("D_801F59C8","s32","[2]",0x8), + 0x801F59D0:("D_801F59D0","struct_801F59D0","",0x0A), + 0x801F59DC:("D_801F59DC","Vec3f*","",0x4), + 0x801F59E0:("D_801F59E0","s32","",0x4), + 0x801F59E4:("D_801F59E4","s32","",0x4), 0x801F59E8:("D_801F59E8","Vec3f","",0xC), - 0x801F59F4:("D_801F59F4","UNK_TYPE1","",0x1), - 0x801F59F8:("D_801F59F8","UNK_TYPE1","",0x1), + 0x801F59F4:("D_801F59F4","s32","",0x4), + 0x801F59F8:("D_801F59F8","s32","",0x4), 0x801F5A00:("sQuakeRequest","QuakeRequest","[4]",0x90), 0x801F5A90:("sDistortionRequest","DistortionRequest","",0xc), 0x801F5AA0:("sMatAnimStep","s32","",0x4), @@ -4743,32 +4743,32 @@ 0x8082B7B4:("D_8082B7B4","UNK_TYPE1","",0x1), 0x8082B7F0:("D_8082B7F0","UNK_TYPE2","",0x2), 0x8082B838:("D_8082B838","UNK_TYPE2","",0x2), - 0x8082B880:("D_8082B880","UNK_TYPE2","",0x2), - 0x8082B884:("D_8082B884","UNK_TYPE2","",0x2), - 0x8082B888:("D_8082B888","UNK_TYPE2","",0x2), - 0x8082B88C:("D_8082B88C","UNK_TYPE2","",0x2), - 0x8082B890:("D_8082B890","UNK_TYPE2","",0x2), - 0x8082B894:("D_8082B894","UNK_TYPE2","",0x2), - 0x8082B898:("D_8082B898","UNK_TYPE2","",0x2), - 0x8082B89C:("D_8082B89C","UNK_TYPE2","",0x2), - 0x8082B8A0:("D_8082B8A0","UNK_TYPE2","",0x2), - 0x8082B8A4:("D_8082B8A4","UNK_TYPE2","",0x2), - 0x8082B8A8:("D_8082B8A8","UNK_TYPE2","",0x2), - 0x8082B8AC:("D_8082B8AC","UNK_TYPE2","",0x2), - 0x8082B8B0:("D_8082B8B0","UNK_TYPE2","",0x2), - 0x8082B8B4:("D_8082B8B4","UNK_TYPE2","",0x2), - 0x8082B8B8:("D_8082B8B8","UNK_TYPE1","",0x1), - 0x8082B8D8:("D_8082B8D8","UNK_TYPE1","",0x1), - 0x8082B8F8:("D_8082B8F8","UNK_TYPE1","",0x1), - 0x8082B908:("D_8082B908","f32","",0x4), + 0x8082B880:("sGameOverPrimR","UNK_TYPE2","",0x2), + 0x8082B884:("sGameOverPrimG","UNK_TYPE2","",0x2), + 0x8082B888:("sGameOverPrimB","UNK_TYPE2","",0x2), + 0x8082B88C:("sGameOverPrimAlpha","UNK_TYPE2","",0x2), + 0x8082B890:("sCursorPrimR","UNK_TYPE2","",0x2), + 0x8082B894:("sCursorPrimG","UNK_TYPE2","",0x2), + 0x8082B898:("sCursorPrimB","UNK_TYPE2","",0x2), + 0x8082B89C:("sCursorEnvR","UNK_TYPE2","",0x2), + 0x8082B8A0:("sCursorEnvG","UNK_TYPE2","",0x2), + 0x8082B8A4:("sCursorEnvB","UNK_TYPE2","",0x2), + 0x8082B8A8:("sGameOverEnvR","UNK_TYPE2","",0x2), + 0x8082B8AC:("sGameOverEnvG","UNK_TYPE2","",0x2), + 0x8082B8B0:("sGameOverEnvB","UNK_TYPE2","",0x2), + 0x8082B8B4:("sInDungeonScene","UNK_TYPE2","",0x2), + 0x8082B8B8:("sPageSwitchEyeDx","UNK_TYPE1","",0x1), + 0x8082B8D8:("sPageSwitchEyeDz","UNK_TYPE1","",0x1), + 0x8082B8F8:("sPageSwitchNextPageIndex","UNK_TYPE1","",0x1), + 0x8082B908:("sPauseMenuVerticalOffset","f32","",0x4), 0x8082B90C:("D_8082B90C","f32","",0x4), - 0x8082B910:("D_8082B910","f32","",0x4), - 0x8082B914:("D_8082B914","f32","",0x4), - 0x8082B918:("D_8082B918","UNK_TYPE2","",0x2), - 0x8082B91C:("D_8082B91C","UNK_TYPE2","",0x2), + 0x8082B910:("sPauseCursorLeftMoveOffsetX","f32","",0x4), + 0x8082B914:("sPauseCursorRightMoveOffsetX","f32","",0x4), + 0x8082B918:("sPauseCursorLeftX","UNK_TYPE2","",0x2), + 0x8082B91C:("sPauseCursorRightX","UNK_TYPE2","",0x2), 0x8082B920:("D_8082B920","UNK_TYPE2","",0x2), 0x8082B924:("D_8082B924","UNK_TYPE2","",0x2), - 0x8082B944:("D_8082B944","UNK_TYPE2","",0x2), + 0x8082B944:("sGameOverRectPosY","UNK_TYPE2","",0x2), 0x8082B948:("D_8082B948","UNK_TYPE2","",0x2), 0x8082B96C:("D_8082B96C","UNK_TYPE2","",0x2), 0x8082B990:("D_8082B990","UNK_TYPE2","",0x2), @@ -4823,15 +4823,15 @@ 0x8082BDCC:("D_8082BDCC","UNK_TYPE1","",0x1), 0x8082BE28:("D_8082BE28","UNK_TYPE1","",0x1), 0x8082BE84:("D_8082BE84","UNK_TYPE2","",0x2), - 0x8082BE88:("D_8082BE88","UNK_TYPE1","",0x1), - 0x8082BE9C:("D_8082BE9C","UNK_TYPE2","",0x2), - 0x8082BEA0:("D_8082BEA0","UNK_TYPE2","",0x2), - 0x8082BEA4:("D_8082BEA4","UNK_TYPE2","",0x2), - 0x8082BEA8:("D_8082BEA8","UNK_TYPE2","",0x2), - 0x8082BEAC:("D_8082BEAC","UNK_TYPE2","",0x2), - 0x8082BEB0:("D_8082BEB0","UNK_TYPE2","",0x2), - 0x8082BEB4:("D_8082BEB4","UNK_TYPE2","",0x2), - 0x8082BEB8:("D_8082BEB8","UNK_TYPE2","",0x2), + 0x8082BE88:("sCursorPointsToOcarinaModes","UNK_TYPE1","",0x1), + 0x8082BE9C:("sUnpausedHudVisibility","UNK_TYPE2","",0x2), + 0x8082BEA0:("sNextMainState","UNK_TYPE2","",0x2), + 0x8082BEA4:("sDelayTimer","UNK_TYPE2","",0x2), + 0x8082BEA8:("sGameOverColorTimer","UNK_TYPE2","",0x2), + 0x8082BEAC:("sStickXRepeatTimer","UNK_TYPE2","",0x2), + 0x8082BEB0:("sStickYRepeatTimer","UNK_TYPE2","",0x2), + 0x8082BEB4:("sStickXRepeatState","UNK_TYPE2","",0x2), + 0x8082BEB8:("sStickYRepeatState","UNK_TYPE2","",0x2), 0x8082BEC0:("D_8082BEC0","char","[]",0x1), 0x8082BEC4:("D_8082BEC4","char","[]",0x1), 0x8082BED0:("D_8082BED0","char","[]",0x1), @@ -4948,7 +4948,7 @@ 0x8082DA52:("D_8082DA52","UNK_TYPE1","",0x1), 0x8082DA54:("D_8082DA54","UNK_TYPE1","",0x1), 0x8082DA56:("D_8082DA56","UNK_TYPE1","",0x1), - 0x8082DA58:("D_8082DA58","UNK_TYPE1","",0x1), + 0x8082DA58:("sUnpausedButtonStatus","UNK_TYPE1","",0x1), 0x8082DA60:("D_8082DA60","f32","",0x4), 0x8082DA64:("D_8082DA64","f32","",0x4), 0x8082DA68:("D_8082DA68","f32","",0x4), @@ -14273,8 +14273,8 @@ 0x80B3DCAC:("D_80B3DCAC","UNK_TYPE1","",0x1), 0x80B3DCB8:("sAnimations","UNK_TYPE1","",0x1), 0x80B3DE58:("D_80B3DE58","UNK_TYPE1","",0x1), - 0x80B3DE74:("D_80B3DE74","UNK_TYPE1","",0x1), - 0x80B3DEAC:("D_80B3DEAC","UNK_TYPE1","",0x1), + 0x80B3DE74:("sCsAnimations","UNK_TYPE1","",0x1), + 0x80B3DEAC:("sEyeTextures","UNK_TYPE1","",0x1), 0x80B3DEC0:("D_80B3DEC0","f32","",0x4), 0x80B3DEC4:("D_80B3DEC4","f32","",0x4), 0x80B3DEC8:("D_80B3DEC8","f32","",0x4), @@ -15621,7 +15621,7 @@ 0x80BC15D0:("En_Nb_InitVars","UNK_TYPE1","",0x1), 0x80BC15F0:("D_80BC15F0","UNK_TYPE1","",0x1), 0x80BC161C:("D_80BC161C","UNK_TYPE1","",0x1), - 0x80BC1628:("D_80BC1628","UNK_TYPE1","",0x1), + 0x80BC1628:("sAnimationInfo","UNK_TYPE1","",0x1), 0x80BC1690:("jtbl_80BC1690","UNK_PTR","",0x4), 0x80BC16B8:("jtbl_80BC16B8","UNK_PTR","",0x4), 0x80BC16D0:("jtbl_80BC16D0","UNK_PTR","",0x4), diff --git a/tools/namefixer.py b/tools/namefixer.py index 1aed5ead3..a60e58311 100755 --- a/tools/namefixer.py +++ b/tools/namefixer.py @@ -114,6 +114,7 @@ wordReplace = { "Actor_IsActorFacingActorAndWithinRange": "Actor_ActorAIsFacingAndNearActorB", "Actor_IsActorFacingActor": "Actor_ActorAIsFacingActorB", "Actor_IsActorFacedByActor": "Actor_ActorBIsFacingActorA", + "Actor_MarkForDeath": "Actor_Kill", "func_800B84D0": "Actor_ProcessTalkRequest", "func_8017D668": "Math3D_PointDistToLine2D", "func_800BDFC0": "Gfx_DrawDListOpa", @@ -296,6 +297,7 @@ wordReplace = { "func_800B86C8": "Actor_ChangeFocus", "func_800B90F4": "Actor_DeactivateLens", "func_800BC770": "Actor_AddQuake", + "func_800DF840": "Camera_ChangeMode", "zelda_malloc": "ZeldaArena_Malloc", "zelda_mallocR": "ZeldaArena_MallocR", "zelda_realloc": "ZeldaArena_Realloc", @@ -605,6 +607,7 @@ wordReplace = { "EffectSsKiraKira_SpawnSmall": "EffectSsKirakira_SpawnSmall", "EffectSsKiraKira_SpawnDispersed": "EffectSsKirakira_SpawnDispersed", "EffectSsKiraKira_SpawnFocused": "EffectSsKirakira_SpawnFocused", + "Effect_Getplay": "Effect_GetPlayState", "Effect_GetGlobalCtx": "Effect_GetPlayState", "EffectSsHitMark_Spawn": "EffectSsHitmark_Spawn", "EffectSsHitMark_SpawnFixedScale": "EffectSsHitmark_SpawnFixedScale", @@ -698,6 +701,7 @@ wordReplace = { "gSaveContext.equips": "gSaveContext.save.equips", "gSaveContext.unk_1016": "gSaveContext.jinxTimer", "gSaveContext.unk_3F58": "gSaveContext.sunsSongState", + "gSaveContext.equips.buttonItems": "gSaveContext.save.equips.buttonItems", "gSaveContext.unk_48C8": "gSaveContext.dungeonIndex", "gSaveContext.save.playerData.magicAcquired": "gSaveContext.save.playerData.isMagicAcquired", "gSaveContext.save.playerDatadoubleMagic": "gSaveContext.save.playerData.isDoubleMagicAcquired", @@ -722,6 +726,7 @@ wordReplace = { "player->swordAnimation": "player->meleeWeaponAnimation", "player->swordState": "player->meleeWeaponState", "player->swordInfo": "player->meleeWeaponInfo", + "csCtx.npcActions": "csCtx.actorActions", "csCtx->npcActions": "csCtx->actorActions", "csCtx.unk_12": "csCtx.currentCsIndex", @@ -734,6 +739,8 @@ wordReplace = { "globalCtx->envCtx.unk_C3": "play->envCtx.lightSettingOverride", "globalCtx->envCtx.unk_DC": "play->envCtx.lightBlend", "globalCtx->interfaceCtx.unk_21E": "play->interfaceCtx.bButtonDoAction", + "play->interfaceCtx.unk_31A": "play->interfaceCtx.storyState", + "play->interfaceCtx.unk_31B": "play->interfaceCtx.storyType", # "play->actorCtx.flags": "play->actorCtx.sceneFlags", # "play->actorCtx.unk5": "play->actorCtx.flags", @@ -767,13 +774,10 @@ wordReplace = { "gSaveContext.fadeDuration": "gSaveContext.transFadeDuration", "gSaveContext.fadeSpeed": "gSaveContext.transWipeSpeed", - "D_801D15B0" : "gZeroVec3f", - "D_801D15BC" : "gZeroVec3s", - "D_801D1DE0" : "gIdentityMtx", - "D_801D1E20" : "gIdentityMtxF", - "D_04020658" : "gameplay_keep_Anim_020658", - "D_04022B28" : "gDoorSkel", - "D_04023100" : "gDoorCol", + "D_801D15B0": "gZeroVec3f", + "D_801D15BC": "gZeroVec3s", + "D_801D1DE0": "gIdentityMtx", + "D_801D1E20": "gIdentityMtxF", # Macros "CUR_EQUIP_VALUE_VOID": "GET_CUR_EQUIP_VALUE", diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index f1d994d11..19f625dbf 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -217,7 +217,7 @@ asm/non_matchings/code/z_actor/func_800B64FC.s,func_800B64FC,0x800B64FC,0x22 asm/non_matchings/code/z_actor/func_800B6584.s,func_800B6584,0x800B6584,0x21 asm/non_matchings/code/z_actor/func_800B6608.s,func_800B6608,0x800B6608,0x1E asm/non_matchings/code/z_actor/func_800B6680.s,func_800B6680,0x800B6680,0x23 -asm/non_matchings/code/z_actor/Actor_MarkForDeath.s,Actor_MarkForDeath,0x800B670C,0x8 +asm/non_matchings/code/z_actor/Actor_Kill.s,Actor_Kill,0x800B670C,0x8 asm/non_matchings/code/z_actor/Actor_SetWorldToHome.s,Actor_SetWorldToHome,0x800B672C,0xC asm/non_matchings/code/z_actor/Actor_SetFocus.s,Actor_SetFocus,0x800B675C,0x11 asm/non_matchings/code/z_actor/Actor_SetWorldRotToShape.s,Actor_SetWorldRotToShape,0x800B67A0,0x8 @@ -1716,7 +1716,7 @@ asm/non_matchings/code/z_player_lib/func_801235DC.s,func_801235DC,0x801235DC,0x1 asm/non_matchings/code/z_player_lib/func_8012364C.s,func_8012364C,0x8012364C,0x71 asm/non_matchings/code/z_player_lib/func_80123810.s,func_80123810,0x80123810,0x54 asm/non_matchings/code/z_player_lib/Player_ActionToModelGroup.s,Player_ActionToModelGroup,0x80123960,0x13 -asm/non_matchings/code/z_player_lib/func_801239AC.s,func_801239AC,0x801239AC,0x3E +asm/non_matchings/code/z_player_lib/Player_SetModelsForHoldingShield.s,Player_SetModelsForHoldingShield,0x801239AC,0x3E asm/non_matchings/code/z_player_lib/Player_SetModels.s,Player_SetModels,0x80123AA4,0x4C asm/non_matchings/code/z_player_lib/Player_SetModelGroup.s,Player_SetModelGroup,0x80123BD4,0x21 asm/non_matchings/code/z_player_lib/func_80123C58.s,func_80123C58,0x80123C58,0xE @@ -1744,12 +1744,12 @@ asm/non_matchings/code/z_player_lib/Player_ActionToBottle.s,Player_ActionToBottl asm/non_matchings/code/z_player_lib/Player_GetBottleHeld.s,Player_GetBottleHeld,0x8012420C,0x8 asm/non_matchings/code/z_player_lib/Player_ActionToExplosive.s,Player_ActionToExplosive,0x8012422C,0xB asm/non_matchings/code/z_player_lib/Player_GetExplosiveHeld.s,Player_GetExplosiveHeld,0x80124258,0x8 -asm/non_matchings/code/z_player_lib/func_80124278.s,func_80124278,0x80124278,0xF +asm/non_matchings/code/z_player_lib/Player_ActionToSword.s,Player_ActionToSword,0x80124278,0xF asm/non_matchings/code/z_player_lib/func_801242B4.s,func_801242B4,0x801242B4,0xA asm/non_matchings/code/z_player_lib/Player_GetEnvTimerType.s,Player_GetEnvTimerType,0x801242DC,0x51 asm/non_matchings/code/z_player_lib/func_80124420.s,func_80124420,0x80124420,0x7E asm/non_matchings/code/z_player_lib/func_80124618.s,func_80124618,0x80124618,0x37 -asm/non_matchings/code/z_player_lib/func_801246F4.s,func_801246F4,0x801246F4,0x5F +asm/non_matchings/code/z_player_lib/Player_DrawImpl.s,Player_DrawImpl,0x801246F4,0x5F asm/non_matchings/code/z_player_lib/func_80124870.s,func_80124870,0x80124870,0x115 asm/non_matchings/code/z_player_lib/func_80124CC4.s,func_80124CC4,0x80124CC4,0x95 asm/non_matchings/code/z_player_lib/func_80124F18.s,func_80124F18,0x80124F18,0x36 @@ -1777,14 +1777,14 @@ asm/non_matchings/code/z_player_lib/func_801271B0.s,func_801271B0,0x801271B0,0xA asm/non_matchings/code/z_player_lib/func_80127438.s,func_80127438,0x80127438,0x14 asm/non_matchings/code/z_player_lib/func_80127488.s,func_80127488,0x80127488,0x31 asm/non_matchings/code/z_player_lib/Player_DrawCouplesMask.s,Player_DrawCouplesMask,0x8012754C,0x12 -asm/non_matchings/code/z_player_lib/func_80127594.s,func_80127594,0x80127594,0xD9 -asm/non_matchings/code/z_player_lib/func_801278F8.s,func_801278F8,0x801278F8,0x5A -asm/non_matchings/code/z_player_lib/func_80127A60.s,func_80127A60,0x80127A60,0x41 +asm/non_matchings/code/z_player_lib/Player_DrawCircusLeadersMask.s,Player_DrawCircusLeadersMask,0x80127594,0xD9 +asm/non_matchings/code/z_player_lib/Player_DrawBlastMask.s,Player_DrawBlastMask,0x801278F8,0x5A +asm/non_matchings/code/z_player_lib/Player_DrawBunnyHood.s,Player_DrawBunnyHood,0x80127A60,0x41 asm/non_matchings/code/z_player_lib/func_80127B64.s,func_80127B64,0x80127B64,0x21 asm/non_matchings/code/z_player_lib/func_80127BE8.s,func_80127BE8,0x80127BE8,0x6F asm/non_matchings/code/z_player_lib/func_80127DA4.s,func_80127DA4,0x80127DA4,0x179 asm/non_matchings/code/z_player_lib/func_80128388.s,func_80128388,0x80128388,0x46 -asm/non_matchings/code/z_player_lib/func_801284A0.s,func_801284A0,0x801284A0,0x68 +asm/non_matchings/code/z_player_lib/Player_DrawGreatFairysMask.s,Player_DrawGreatFairysMask,0x801284A0,0x68 asm/non_matchings/code/z_player_lib/func_80128640.s,func_80128640,0x80128640,0x14D asm/non_matchings/code/z_player_lib/func_80128B74.s,func_80128B74,0x80128B74,0x17 asm/non_matchings/code/z_player_lib/func_80128BD0.s,func_80128BD0,0x80128BD0,0x4C8 @@ -2552,7 +2552,7 @@ asm/non_matchings/code/z_play/func_8016A02C.s,func_8016A02C,0x8016A02C,0x20 asm/non_matchings/code/z_play/Play_IsUnderwater.s,Play_IsUnderwater,0x8016A0AC,0x2F asm/non_matchings/code/z_play/Play_IsDebugCamEnabled.s,Play_IsDebugCamEnabled,0x8016A168,0x4 asm/non_matchings/code/z_play/func_8016A178.s,func_8016A178,0x8016A178,0x3C -asm/non_matchings/code/z_play/func_8016A268.s,func_8016A268,0x8016A268,0x18 +asm/non_matchings/code/z_play/Play_FillScreen.s,Play_FillScreen,0x8016A268,0x18 asm/non_matchings/code/z_play/Play_Init.s,Play_Init,0x8016A2C8,0x252 asm/non_matchings/code/z_play_hireso/func_8016AC10.s,func_8016AC10,0x8016AC10,0x83 asm/non_matchings/code/z_play_hireso/func_8016AE1C.s,func_8016AE1C,0x8016AE1C,0x117 diff --git a/undefined_syms.txt b/undefined_syms.txt index cbe935186..ebbdd5b07 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -1217,10 +1217,6 @@ D_060105DC = 0x060105DC; D_06019B88 = 0x06019B88; D_0601D518 = 0x0601D518; -// ovl_En_Nb - -D_06008C40 = 0x06008C40; - // ovl_En_Neo_Reeba D_060001E4 = 0x060001E4;