From 38edda8508cc04c2623c6a455a2e1503a2bed787 Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Tue, 7 Feb 2023 16:29:17 -0800 Subject: [PATCH 01/29] Fix Website 404 and Format script error message (#1161) * Fix Website 404 * format script fix --- docs/CONTRIBUTING.md | 2 +- format.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 493486e79d..2f4c9854a6 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -14,7 +14,7 @@ Most discussions happen on our [Discord Server](https://discord.zelda64.dev) whe - [Style Guide](STYLE.md) - Description of the project style that we ask contributors to adhere to. - [Code Review Guidelines](REVIEWING.md) - These are the guidelines that reviewers will be using when reviewing your code. Good to be familiar with these before submitting your code. -- [Zelda 64 Reverse Engineering Website](https://zelda64.dev/mm) - Our homepage, with FAQ and progress graph :chart_with_upwards_trend:. +- [Zelda 64 Reverse Engineering Website](https://zelda64.dev/games/mm) - Our homepage, with FAQ and progress graph :chart_with_upwards_trend:. - [MM decomp tutorial](tutorial/contents.md) Detailed tutorial for learning in general how decomp works and how to decompile a small, simple file. - [Introduction to OOT decomp](https://github.com/zeldaret/oot/blob/master/docs/tutorial/contents.md) - The tutorial the MM one was based on. For OOT, but largely applicable to MM as well. Covers slightly different topics, including how to get your data OK with `vbindiff`. - The `#resources` channel on the Discord contains many more links on specific details of decompiling IDO MIPS code. diff --git a/format.py b/format.py index 5b3cd31580..5e2c29febe 100755 --- a/format.py +++ b/format.py @@ -52,7 +52,7 @@ def get_tidy_version(tidy_executable: str): CLANG_FORMAT = get_clang_executable([f"clang-format-{CLANG_VER}"]) if CLANG_FORMAT is None: - sys.exit(f"Error: clang-format-{CLANG_VER} found") + sys.exit(f"Error: clang-format-{CLANG_VER} not found") CLANG_TIDY = get_clang_executable([f"clang-tidy-{CLANG_VER}", "clang-tidy"]) if CLANG_TIDY is None: From 9297e6dd5220dd4aac84ab67e99d4a1a64f77b02 Mon Sep 17 00:00:00 2001 From: EllipticEllipsis Date: Tue, 21 Feb 2023 17:30:09 +0000 Subject: [PATCH 02/29] EnDekubaba OK and documented, object_dekubaba documented, EnKarebaba documented (#1088) * OK, struct documented * Data imported, update spec * Name data * Name all functions and variables * Document object * Bit more documentation * Document Karebaba * Add note to object_dekubaba * Bit more cleanup * Review * Shadow * Review * Rename functions, add hit enum * Figured out the enum * Review * MarkForDeath -> Kill --- assets/xml/objects/object_dekubaba.xml | 59 +- spec | 3 +- .../actors/ovl_En_Dekubaba/z_en_dekubaba.c | 1400 +++++++++++++++-- .../actors/ovl_En_Dekubaba/z_en_dekubaba.h | 23 +- .../actors/ovl_En_Karebaba/z_en_karebaba.c | 585 ++++--- .../actors/ovl_En_Karebaba/z_en_karebaba.h | 25 +- tools/disasm/functions.txt | 134 +- tools/disasm/variables.txt | 22 +- undefined_syms.txt | 10 - 9 files changed, 1718 insertions(+), 543 deletions(-) diff --git a/assets/xml/objects/object_dekubaba.xml b/assets/xml/objects/object_dekubaba.xml index eb80e770b7..87634d654c 100644 --- a/assets/xml/objects/object_dekubaba.xml +++ b/assets/xml/objects/object_dekubaba.xml @@ -1,27 +1,40 @@  + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spec b/spec index bef1b4654f..0b50e32ac8 100644 --- a/spec +++ b/spec @@ -963,8 +963,7 @@ beginseg name "ovl_En_Dekubaba" compress include "build/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.o" - include "build/data/ovl_En_Dekubaba/ovl_En_Dekubaba.data.o" - include "build/data/ovl_En_Dekubaba/ovl_En_Dekubaba.reloc.o" + include "build/src/overlays/actors/ovl_En_Dekubaba/ovl_En_Dekubaba_reloc.o" endseg beginseg 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 93d4952670..45b851271a 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -5,6 +5,8 @@ */ #include "z_en_dekubaba.h" +#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_400) @@ -15,23 +17,31 @@ void EnDekubaba_Destroy(Actor* thisx, PlayState* play); void EnDekubaba_Update(Actor* thisx, PlayState* play); void EnDekubaba_Draw(Actor* thisx, PlayState* play); -void func_808B1B14(EnDekubaba* this, PlayState* play); -void func_808B1CF0(EnDekubaba* this, PlayState* play); -void func_808B2240(EnDekubaba* this, PlayState* play); -void func_808B2660(EnDekubaba* this, PlayState* play); -void func_808B28B4(EnDekubaba* this, PlayState* play); -void func_808B29C4(EnDekubaba* this, PlayState* play); -void func_808B2CB8(EnDekubaba* this, PlayState* play); -void func_808B3078(EnDekubaba* this, PlayState* play); -void func_808B3280(EnDekubaba* this, PlayState* play); -void func_808B3404(EnDekubaba* this, PlayState* play); -void func_808B37E8(EnDekubaba* this, PlayState* play); -void func_808B3B48(EnDekubaba* this, PlayState* play); -void func_808B3C50(EnDekubaba* this, PlayState* play); -void func_808B3DA8(EnDekubaba* this, PlayState* play); -void func_808B3EE8(EnDekubaba* this, PlayState* play); +void EnDekubaba_SetupWait(EnDekubaba* this); +void EnDekubaba_Wait(EnDekubaba* this, PlayState* play); +void EnDekubaba_SetupGrow(EnDekubaba* this); +void EnDekubaba_Grow(EnDekubaba* this, PlayState* play); +void EnDekubaba_SetupRetract(EnDekubaba* this); +void EnDekubaba_Retract(EnDekubaba* this, PlayState* play); +void EnDekubaba_DecideLunge(EnDekubaba* this, PlayState* play); +void EnDekubaba_SetupPrepareLunge(EnDekubaba* this); +void EnDekubaba_PrepareLunge(EnDekubaba* this, PlayState* play); +void EnDekubaba_SetupLunge(EnDekubaba* this); +void EnDekubaba_Lunge(EnDekubaba* this, PlayState* play); +void EnDekubaba_SetupPullBack(EnDekubaba* this); +void EnDekubaba_PullBack(EnDekubaba* this, PlayState* play); +void EnDekubaba_Recover(EnDekubaba* this, PlayState* play); +void EnDekubaba_Hit(EnDekubaba* this, PlayState* play); +void EnDekubaba_PrunedSomersaultDie(EnDekubaba* this, PlayState* play); +void EnDekubaba_SetupShrinkDie(EnDekubaba* this); +void EnDekubaba_ShrinkDie(EnDekubaba* this, PlayState* play); +void EnDekubaba_SetupStunnedVertical(EnDekubaba* this); +void EnDekubaba_StunnedVertical(EnDekubaba* this, PlayState* play); +void EnDekubaba_Sway(EnDekubaba* this, PlayState* play); +void EnDekubaba_Frozen(EnDekubaba* this, PlayState* play); +void EnDekubaba_SetupDeadStickDrop(EnDekubaba* this, PlayState* play); +void EnDekubaba_DeadStickDrop(EnDekubaba* this, PlayState* play); -#if 0 ActorInit En_Dekubaba_InitVars = { ACTOR_EN_DEKUBABA, ACTORCAT_ENEMY, @@ -44,188 +54,1332 @@ ActorInit En_Dekubaba_InitVars = { (ActorFunc)EnDekubaba_Draw, }; -// static ColliderJntSphElementInit sJntSphElementsInit[7] = { -static ColliderJntSphElementInit D_808B4D60[7] = { +static ColliderJntSphElementInit sJntSphElementsInit[7] = { { - { ELEMTYPE_UNK0, { 0xF7CFFFFF, 0x00, 0x08 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_HARD, BUMP_ON | BUMP_HOOKABLE, OCELEM_ON, }, + { + ELEMTYPE_UNK0, + { 0xF7CFFFFF, 0x00, 0x08 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 1, { { 0, 100, 1000 }, 15 }, 100 }, }, { - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 51, { { 0, 0, 1500 }, 8 }, 100 }, }, { - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_NONE, }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { 52, { { 0, 0, 500 }, 8 }, 100 }, }, { - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_NONE, }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { 53, { { 0, 0, 1500 }, 8 }, 100 }, }, { - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_NONE, }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { 54, { { 0, 0, 500 }, 8 }, 100 }, }, { - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_NONE, }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { 55, { { 0, 0, 1500 }, 8 }, 100 }, }, { - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_NONE, }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { 56, { { 0, 0, 500 }, 8 }, 100 }, }, }; -// static ColliderJntSphInit sJntSphInit = { -static ColliderJntSphInit D_808B4E5C = { - { COLTYPE_HIT6, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_JNTSPH, }, - ARRAY_COUNT(sJntSphElementsInit), D_808B4D60, // sJntSphElementsInit, +static ColliderJntSphInit sJntSphInit = { + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + ARRAY_COUNT(sJntSphElementsInit), + sJntSphElementsInit, }; -// sColChkInfoInit -static CollisionCheckInfoInit D_808B4E6C = { 2, 25, 25, MASS_IMMOVABLE }; +static CollisionCheckInfoInit sColChkInfoInit = { 2, 25, 25, MASS_IMMOVABLE }; -// static DamageTable sDamageTable = { -static DamageTable D_808B4E74 = { - /* Deku Nut */ DMG_ENTRY(0, 0x1), - /* Deku Stick */ DMG_ENTRY(3, 0x0), - /* Horse trample */ DMG_ENTRY(1, 0x0), - /* Explosives */ DMG_ENTRY(1, 0x0), - /* Zora boomerang */ DMG_ENTRY(1, 0xF), - /* Normal arrow */ DMG_ENTRY(3, 0x0), - /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), - /* Hookshot */ DMG_ENTRY(0, 0xD), - /* Goron punch */ DMG_ENTRY(2, 0x0), - /* Sword */ DMG_ENTRY(1, 0xF), - /* Goron pound */ DMG_ENTRY(4, 0x0), - /* Fire arrow */ DMG_ENTRY(1, 0x2), - /* Ice arrow */ DMG_ENTRY(3, 0x3), - /* Light arrow */ DMG_ENTRY(3, 0x4), - /* Goron spikes */ DMG_ENTRY(1, 0x0), - /* Deku spin */ DMG_ENTRY(1, 0xF), - /* Deku bubble */ DMG_ENTRY(3, 0x0), - /* Deku launch */ DMG_ENTRY(2, 0x0), - /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x1), - /* Zora barrier */ DMG_ENTRY(0, 0x5), - /* Normal shield */ DMG_ENTRY(0, 0x0), - /* Light ray */ DMG_ENTRY(0, 0x0), - /* Thrown object */ DMG_ENTRY(1, 0x0), - /* Zora punch */ DMG_ENTRY(1, 0x0), - /* Spin attack */ DMG_ENTRY(1, 0xF), - /* Sword beam */ DMG_ENTRY(0, 0x0), - /* Normal Roll */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0x0), - /* Unblockable */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0x0), - /* Powder Keg */ DMG_ENTRY(1, 0x0), +typedef enum { + /* 0x0 */ DEKUBABA_DMGEFF_NONE, + /* 0x1 */ DEKUBABA_DMGEFF_NUT, + /* 0x2 */ DEKUBABA_DMGEFF_FIRE, + /* 0x3 */ DEKUBABA_DMGEFF_ICE, + /* 0x4 */ DEKUBABA_DMGEFF_LIGHT, + /* 0x5 */ DEKUBABA_DMGEFF_ELECTRIC, + /* 0xD */ DEKUBABA_DMGEFF_HOOKSHOT = 0xD, + /* 0xF */ DEKUBABA_DMGEFF_CUT = 0xF +} DekuBabaDamageEffect; + +static DamageTable sDamageTable = { + /* Deku Nut */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NUT), + /* Deku Stick */ DMG_ENTRY(3, DEKUBABA_DMGEFF_NONE), + /* Horse trample */ DMG_ENTRY(1, DEKUBABA_DMGEFF_NONE), + /* Explosives */ DMG_ENTRY(1, DEKUBABA_DMGEFF_NONE), + /* Zora boomerang */ DMG_ENTRY(1, DEKUBABA_DMGEFF_CUT), + /* Normal arrow */ DMG_ENTRY(3, DEKUBABA_DMGEFF_NONE), + /* UNK_DMG_0x06 */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), + /* Hookshot */ DMG_ENTRY(0, DEKUBABA_DMGEFF_HOOKSHOT), + /* Goron punch */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), + /* Sword */ DMG_ENTRY(1, DEKUBABA_DMGEFF_CUT), + /* Goron pound */ DMG_ENTRY(4, DEKUBABA_DMGEFF_NONE), + /* Fire arrow */ DMG_ENTRY(1, DEKUBABA_DMGEFF_FIRE), + /* Ice arrow */ DMG_ENTRY(3, DEKUBABA_DMGEFF_ICE), + /* Light arrow */ DMG_ENTRY(3, DEKUBABA_DMGEFF_LIGHT), + /* Goron spikes */ DMG_ENTRY(1, DEKUBABA_DMGEFF_NONE), + /* Deku spin */ DMG_ENTRY(1, DEKUBABA_DMGEFF_CUT), + /* Deku bubble */ DMG_ENTRY(3, DEKUBABA_DMGEFF_NONE), + /* Deku launch */ DMG_ENTRY(2, DEKUBABA_DMGEFF_NONE), + /* UNK_DMG_0x12 */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NUT), + /* Zora barrier */ DMG_ENTRY(0, DEKUBABA_DMGEFF_ELECTRIC), + /* Normal shield */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), + /* Light ray */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), + /* Thrown object */ DMG_ENTRY(1, DEKUBABA_DMGEFF_NONE), + /* Zora punch */ DMG_ENTRY(1, DEKUBABA_DMGEFF_NONE), + /* Spin attack */ DMG_ENTRY(1, DEKUBABA_DMGEFF_CUT), + /* Sword beam */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), + /* Normal Roll */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), + /* UNK_DMG_0x1B */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), + /* UNK_DMG_0x1C */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), + /* Unblockable */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), + /* UNK_DMG_0x1E */ DMG_ENTRY(0, DEKUBABA_DMGEFF_NONE), + /* Powder Keg */ DMG_ENTRY(1, DEKUBABA_DMGEFF_NONE), }; -// static InitChainEntry sInitChain[] = { -static InitChainEntry D_808B4E94[] = { +static InitChainEntry sInitChain[] = { ICHAIN_F32(targetArrowOffset, 1500, ICHAIN_STOP), }; -#endif +void EnDekubaba_Init(Actor* thisx, PlayState* play) { + EnDekubaba* this = THIS; + s32 i; -extern ColliderJntSphElementInit D_808B4D60[7]; -extern ColliderJntSphInit D_808B4E5C; -extern CollisionCheckInfoInit D_808B4E6C; -extern DamageTable D_808B4E74; -extern InitChainEntry D_808B4E94[]; + Actor_ProcessInitChain(&this->actor, sInitChain); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 22.0f); + SkelAnime_Init(play, &this->skelAnime, &gDekuBabaSkel, &gDekuBabaFastChompAnim, this->jointTable, this->morphTable, + DEKUBABA_LIMB_MAX); + Collider_InitAndSetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements); + CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); -extern UNK_TYPE D_06000208; -extern UNK_TYPE D_060002B8; -extern UNK_TYPE D_060010F0; -extern UNK_TYPE D_06001330; -extern UNK_TYPE D_06001828; + if (this->actor.params == DEKUBABA_BIG) { + this->size = 2.5f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/EnDekubaba_Init.s") + for (i = 0; i < sJntSphInit.count; i++) { + this->collider.elements[i].dim.worldSphere.radius = this->collider.elements[i].dim.modelSphere.radius = + (sJntSphElementsInit[i].dim.modelSphere.radius * 2.50f); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/EnDekubaba_Destroy.s") + this->actor.colChkInfo.health = 4; + // Big Deku Baba hint does not exist in MM + this->actor.hintId = TATL_HINT_ID_BIO_DEKU_BABA; + this->actor.targetMode = 2; + } else { + this->size = 1.0f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B1530.s") + for (i = 0; i < sJntSphInit.count; i++) { + this->collider.elements[i].dim.worldSphere.radius = this->collider.elements[i].dim.modelSphere.radius; + } + this->actor.hintId = TATL_HINT_ID_DEKU_BABA; + this->actor.targetMode = 1; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B15B8.s") + EnDekubaba_SetupWait(this); + this->timer = 0; + this->boundFloor = NULL; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B16BC.s") +void EnDekubaba_Destroy(Actor* thisx, PlayState* play) { + EnDekubaba* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B1798.s") + Collider_DestroyJntSph(play, &this->collider); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B1814.s") +void EnDekubaba_DisableHitboxes(EnDekubaba* this) { + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B18A8.s") + for (i = 1; i < ARRAY_COUNT(this->colliderElements); i++) { + this->collider.elements[i].info.bumperFlags &= ~BUMP_ON; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B1B14.s") +void EnDekubaba_UpdateHeadPosition(EnDekubaba* this) { + f32 horizontalHeadShift = (Math_CosS(this->stemSectionAngle[0]) + Math_CosS(this->stemSectionAngle[1]) + + Math_CosS(this->stemSectionAngle[2])) * + 20.0f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B1BC0.s") + this->actor.world.pos.x = + this->actor.home.pos.x + Math_SinS(this->actor.shape.rot.y) * (horizontalHeadShift * this->size); + this->actor.world.pos.y = + this->actor.home.pos.y - (Math_SinS(this->stemSectionAngle[0]) + Math_SinS(this->stemSectionAngle[1]) + + Math_SinS(this->stemSectionAngle[2])) * + 20.0f * this->size; + this->actor.world.pos.z = + this->actor.home.pos.z + Math_CosS(this->actor.shape.rot.y) * (horizontalHeadShift * this->size); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B1CF0.s") +void EnDekubaba_SetFireLightEffects(EnDekubaba* this, PlayState* play, s32 index) { + ColliderJntSphElement* sphElement; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B2158.s") + if (this->actor.colChkInfo.damageEffect == DEKUBABA_DMGEFF_FIRE) { + this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE; + this->drawDmgEffScale = 0.75f; + this->drawDmgEffAlpha = 4.0f; + } else if (this->actor.colChkInfo.damageEffect == DEKUBABA_DMGEFF_LIGHT) { + this->drawDmgEffType = ACTOR_DRAW_DMGEFF_LIGHT_ORBS; + this->drawDmgEffScale = 0.75f; + this->drawDmgEffAlpha = 4.0f; + sphElement = &this->collider.elements[index]; + Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, sphElement->info.bumper.hitPos.x, + sphElement->info.bumper.hitPos.y, sphElement->info.bumper.hitPos.z, 0, 0, 0, + CLEAR_TAG_SMALL_LIGHT_RAYS); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B2240.s") +void EnDekubaba_SetFrozenEffects(EnDekubaba* this) { + this->drawDmgEffScale = 0.75f; + this->drawDmgEffFrozenSteamScale = 1.125f; + this->drawDmgEffAlpha = 1.0f; + this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX; + this->collider.base.colType = COLTYPE_HIT3; + this->timer = 80; + this->actor.flags &= ~ACTOR_FLAG_400; + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 80); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B2608.s") +void EnDekubaba_SpawnIceEffects(EnDekubaba* this, PlayState* play) { + if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { + this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE; + this->collider.base.colType = COLTYPE_HIT6; + this->drawDmgEffAlpha = 0.0f; + Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos), 4, + this->size * 0.3f, this->size * 0.2f); + this->actor.flags |= ACTOR_FLAG_400; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B2660.s") +void EnDekubaba_SetupWait(EnDekubaba* this) { + s32 i; + ColliderJntSphElement* element; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B2890.s") + this->actor.shape.rot.x = -0x4000; + this->stemSectionAngle[0] = this->stemSectionAngle[1] = this->stemSectionAngle[2] = this->actor.shape.rot.x; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B28B4.s") + this->actor.world.pos.x = this->actor.home.pos.x; + this->actor.world.pos.z = this->actor.home.pos.z; + this->actor.world.pos.y = this->actor.home.pos.y + 14.0f * this->size; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B2980.s") + Actor_SetScale(&this->actor, this->size * 0.01f * 0.5f); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B29C4.s") + this->collider.base.colType = COLTYPE_HARD; + this->collider.base.acFlags |= AC_HARD; + this->timer = 45; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B2C40.s") + for (i = 1; i < ARRAY_COUNT(this->colliderElements); i++) { + element = &this->collider.elements[i]; + element->dim.worldSphere.center.x = this->actor.world.pos.x; + element->dim.worldSphere.center.y = (s32)this->actor.world.pos.y - 7; + element->dim.worldSphere.center.z = this->actor.world.pos.z; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B2CB8.s") + this->actionFunc = EnDekubaba_Wait; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B3044.s") +void EnDekubaba_Wait(EnDekubaba* this, PlayState* play) { + if (this->timer != 0) { + this->timer--; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B3078.s") + this->actor.world.pos.x = this->actor.home.pos.x; + this->actor.world.pos.z = this->actor.home.pos.z; + this->actor.world.pos.y = this->actor.home.pos.y + 14.0f * this->size; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B3170.s") + if ((this->timer == 0) && (this->actor.xzDistToPlayer < 200.0f * this->size) && + (fabsf(this->actor.playerHeightRel) < 30.0f * this->size)) { + EnDekubaba_SetupGrow(this); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B3280.s") +void EnDekubaba_SetupGrow(EnDekubaba* this) { + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B3390.s") + Animation_Change(&this->skelAnime, &gDekuBabaFastChompAnim, + Animation_GetLastFrame(&gDekuBabaFastChompAnim) * (1.0f / 15), 0.0f, + Animation_GetLastFrame(&gDekuBabaFastChompAnim), ANIMMODE_ONCE, 0.0f); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B3404.s") + this->timer = 15; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B3768.s") + for (i = 2; i < ARRAY_COUNT(this->colliderElements); i++) { + this->collider.elements[i].info.ocElemFlags |= OCELEM_ON; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B37E8.s") + this->collider.base.colType = COLTYPE_HIT6; + this->collider.base.acFlags &= ~AC_HARD; + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_WAKEUP); + this->actionFunc = EnDekubaba_Grow; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B39AC.s") +void EnDekubaba_Grow(EnDekubaba* this, PlayState* play) { + Player* player = GET_PLAYER(play); + f32 headDistHorizontal; + f32 headDistVertical; + f32 headShiftX; + f32 headShiftZ; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B3B48.s") + if (this->timer != 0) { + this->timer--; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B3BE4.s") + SkelAnime_Update(&this->skelAnime); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B3C50.s") + this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = + this->size * 0.01f * (0.5f + (15 - this->timer) * 0.5f / 15.0f); + Math_ScaledStepToS(&this->actor.shape.rot.x, 0x1800, 0x800); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B3D74.s") + headDistVertical = sin_rad(CLAMP_MAX((15 - this->timer) * (1.0f / 15), 0.7f) * M_PI) * 32.0f + 14.0f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B3DA8.s") + if (this->actor.shape.rot.x < -0x38E3) { + headDistHorizontal = 0.0f; + } else if (this->actor.shape.rot.x < -0x238E) { + Math_ScaledStepToS(&this->stemSectionAngle[0], -0x5555, 0x38E); + headDistHorizontal = Math_CosS(this->stemSectionAngle[0]) * 20.0f; + } else if (this->actor.shape.rot.x < -0xE38) { + Math_ScaledStepToS(&this->stemSectionAngle[0], -0xAAA, 0x38E); + Math_ScaledStepToS(&this->stemSectionAngle[1], -0x5555, 0x38E); + Math_ScaledStepToS(&this->stemSectionAngle[2], -0x5555, 0x222); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B3E40.s") + headDistHorizontal = 20.0f * (Math_CosS(this->stemSectionAngle[0]) + Math_CosS(this->stemSectionAngle[1])) + + (headDistVertical - + 20.0f * (-Math_SinS(this->stemSectionAngle[0]) - Math_SinS(this->stemSectionAngle[1]))) * + Math_CosS(this->stemSectionAngle[2]) / -Math_SinS(this->stemSectionAngle[2]); + } else { + Math_ScaledStepToS(&this->stemSectionAngle[0], -0xAAA, 0x38E); + Math_ScaledStepToS(&this->stemSectionAngle[1], -0x31C7, 0x222); + Math_ScaledStepToS(&this->stemSectionAngle[2], -0x5555, 0x222); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B3EE8.s") + headDistHorizontal = 20.0f * (Math_CosS(this->stemSectionAngle[0]) + Math_CosS(this->stemSectionAngle[1])) + + (headDistVertical - + 20.0f * (-Math_SinS(this->stemSectionAngle[0]) - Math_SinS(this->stemSectionAngle[1]))) * + Math_CosS(this->stemSectionAngle[2]) / -Math_SinS(this->stemSectionAngle[2]); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B3F50.s") + if (this->timer < 10) { + Math_ApproachS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&this->actor.home.pos, &player->actor.world.pos), 2, + 0xE38); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/EnDekubaba_Update.s") + this->actor.world.pos.y = this->actor.home.pos.y + (headDistVertical * this->size); + //! FAKE: + headShiftX = headDistHorizontal; + headShiftX = headShiftX * this->size * Math_SinS(this->actor.shape.rot.y); + headShiftZ = headDistHorizontal; + headShiftZ = headShiftZ * this->size * Math_CosS(this->actor.shape.rot.y); + this->actor.world.pos.x = this->actor.home.pos.x + headShiftX; + this->actor.world.pos.z = this->actor.home.pos.z + headShiftZ; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B4548.s") + EffectSsHahen_SpawnBurst(play, &this->actor.home.pos, this->size * 3.0f, 0, this->size * 12.0f, this->size * 5.0f, + 1, HAHEN_OBJECT_DEFAULT, 10, NULL); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B465C.s") + if (this->timer == 0) { + if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 240.0f * this->size) { + EnDekubaba_SetupPrepareLunge(this); + } else { + EnDekubaba_SetupRetract(this); + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B48FC.s") +void EnDekubaba_SetupRetract(EnDekubaba* this) { + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B49C8.s") + Animation_Change(&this->skelAnime, &gDekuBabaFastChompAnim, -1.5f, Animation_GetLastFrame(&gDekuBabaFastChompAnim), + 0.0f, ANIMMODE_ONCE, -3.0f); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/func_808B4ABC.s") + this->timer = 15; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Dekubaba/EnDekubaba_Draw.s") + for (i = 2; i < ARRAY_COUNT(this->colliderElements); i++) { + this->collider.elements[i].info.ocElemFlags &= ~OCELEM_ON; + } + + this->actionFunc = EnDekubaba_Retract; +} + +void EnDekubaba_Retract(EnDekubaba* this, PlayState* play) { + f32 headDistHorizontal; + f32 headDistVertical; + f32 xShift; + f32 zShift; + + if (this->timer != 0) { + this->timer--; + } + + SkelAnime_Update(&this->skelAnime); + + this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = + this->size * 0.01f * (0.5f + this->timer * (1.0f / 30)); + Math_ScaledStepToS(&this->actor.shape.rot.x, -0x4000, 0x300); + + headDistVertical = (sin_rad(CLAMP_MAX(this->timer * 0.033f, 0.7f) * M_PI) * 32.0f) + 14.0f; + + if (this->actor.shape.rot.x < -0x38E3) { + headDistHorizontal = 0.0f; + } else if (this->actor.shape.rot.x < -0x238E) { + Math_ScaledStepToS(&this->stemSectionAngle[0], -0x4000, 0x555); + headDistHorizontal = Math_CosS(this->stemSectionAngle[0]) * 20.0f; + } else if (this->actor.shape.rot.x < -0xE38) { + Math_ScaledStepToS(&this->stemSectionAngle[0], -0x5555, 0x555); + Math_ScaledStepToS(&this->stemSectionAngle[1], -0x4000, 0x555); + Math_ScaledStepToS(&this->stemSectionAngle[2], -0x4000, 0x333); + + headDistHorizontal = 20.0f * (Math_CosS(this->stemSectionAngle[0]) + Math_CosS(this->stemSectionAngle[1])) + + (headDistVertical - + 20.0f * (-Math_SinS(this->stemSectionAngle[0]) - Math_SinS(this->stemSectionAngle[1]))) * + Math_CosS(this->stemSectionAngle[2]) / -Math_SinS(this->stemSectionAngle[2]); + } else { + Math_ScaledStepToS(&this->stemSectionAngle[0], -0x5555, 0x555); + Math_ScaledStepToS(&this->stemSectionAngle[1], -0x5555, 0x333); + Math_ScaledStepToS(&this->stemSectionAngle[2], -0x4000, 0x333); + + headDistHorizontal = 20.0f * (Math_CosS(this->stemSectionAngle[0]) + Math_CosS(this->stemSectionAngle[1])) + + (headDistVertical - + 20.0f * (-Math_SinS(this->stemSectionAngle[0]) - Math_SinS(this->stemSectionAngle[1]))) * + Math_CosS(this->stemSectionAngle[2]) / -Math_SinS(this->stemSectionAngle[2]); + } + + this->actor.world.pos.y = this->actor.home.pos.y + (headDistVertical * this->size); + xShift = headDistHorizontal * this->size * Math_SinS(this->actor.shape.rot.y); + zShift = headDistHorizontal * this->size * Math_CosS(this->actor.shape.rot.y); + this->actor.world.pos.x = this->actor.home.pos.x + xShift; + this->actor.world.pos.z = this->actor.home.pos.z + zShift; + + EffectSsHahen_SpawnBurst(play, &this->actor.home.pos, this->size * 3.0f, 0, this->size * 12.0f, this->size * 5.0f, + 1, HAHEN_OBJECT_DEFAULT, 10, NULL); + if (this->timer == 0) { + EnDekubaba_SetupWait(this); + } +} + +void EnDekubaba_SetupDecideLunge(EnDekubaba* this) { + this->timer = Animation_GetLastFrame(&gDekuBabaFastChompAnim) * 2; + Animation_MorphToLoop(&this->skelAnime, &gDekuBabaFastChompAnim, -3.0f); + this->actionFunc = EnDekubaba_DecideLunge; +} + +void EnDekubaba_DecideLunge(EnDekubaba* this, PlayState* play) { + Player* player = GET_PLAYER(play); + + SkelAnime_Update(&this->skelAnime); + if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f)) { + if (this->actor.params == DEKUBABA_BIG) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_MOUTH); + } else { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIZUBABA1_MOUTH); + } + } + + if (this->timer != 0) { + this->timer--; + } + + Math_ApproachS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&this->actor.home.pos, &player->actor.world.pos), 2, + (this->timer % 5) * 0x222); + + if (this->timer < 10) { + this->stemSectionAngle[0] += 0x16C; + this->stemSectionAngle[1] += 0x16C; + this->stemSectionAngle[2] += 0xB6; + this->actor.shape.rot.x += 0x222; + } else if (this->timer < 20) { + this->stemSectionAngle[0] -= 0x16C; + this->stemSectionAngle[1] += 0x111; + this->actor.shape.rot.x += 0x16C; + } else if (this->timer < 30) { + this->stemSectionAngle[1] -= 0x111; + this->actor.shape.rot.x -= 0xB6; + } else { + this->stemSectionAngle[1] -= 0xB6; + this->stemSectionAngle[2] += 0xB6; + this->actor.shape.rot.x -= 0x16C; + } + + EnDekubaba_UpdateHeadPosition(this); + + if ((240.0f * this->size) < Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos)) { + EnDekubaba_SetupRetract(this); + } else if ((this->timer == 0) || (this->actor.xzDistToPlayer < (80.0f * this->size))) { + EnDekubaba_SetupPrepareLunge(this); + } +} + +void EnDekubaba_SetupPrepareLunge(EnDekubaba* this) { + this->timer = 8; + this->skelAnime.playSpeed = 0.0f; + this->actionFunc = EnDekubaba_PrepareLunge; +} + +void EnDekubaba_PrepareLunge(EnDekubaba* this, PlayState* play) { + Player* player = GET_PLAYER(play); + + if (this->timer != 0) { + this->timer--; + } + + Math_SmoothStepToS(&this->actor.shape.rot.x, 0x1800, 2, 0xE38, 0x71C); + Math_ApproachS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&this->actor.home.pos, &player->actor.world.pos), 2, 0xE38); + Math_ScaledStepToS(this->stemSectionAngle, 0xAAA, 0x444); + Math_ScaledStepToS(&this->stemSectionAngle[1], -0x4718, 0x888); + Math_ScaledStepToS(&this->stemSectionAngle[2], -0x6AA4, 0x888); + + if (this->timer == 0) { + EnDekubaba_SetupLunge(this); + } + + EnDekubaba_UpdateHeadPosition(this); +} + +void EnDekubaba_SetupLunge(EnDekubaba* this) { + Animation_PlayOnce(&this->skelAnime, &gDekuBabaPauseChompAnim); + this->timer = 0; + this->actionFunc = EnDekubaba_Lunge; +} + +void EnDekubaba_Lunge(EnDekubaba* this, PlayState* play) { + static Color_RGBA8 sDustPrimColor = { 105, 255, 105, 255 }; + static Color_RGBA8 sDustEnvColor = { 150, 250, 150, 0 }; + s32 allStepsDone; + s16 curFrame10; + Vec3f velocity; + + SkelAnime_Update(&this->skelAnime); + + if (this->timer == 0) { + if (Animation_OnFrame(&this->skelAnime, 1.0f)) { + if (this->actor.params == DEKUBABA_BIG) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_ATTACK); + } else { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIZUBABA1_ATTACK); + } + } + + Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x222); + + curFrame10 = (s32)(this->skelAnime.curFrame * 10.0f); + + allStepsDone = true; + allStepsDone &= Math_ScaledStepToS(&this->stemSectionAngle[0], -0xE38, curFrame10 + 0x38E); + allStepsDone &= Math_ScaledStepToS(&this->stemSectionAngle[1], -0xE38, curFrame10 + 0x71C); + allStepsDone &= Math_ScaledStepToS(&this->stemSectionAngle[2], -0xE38, curFrame10 + 0xE38); + if (allStepsDone) { + Animation_PlayLoopSetSpeed(&this->skelAnime, &gDekuBabaFastChompAnim, 4.0f); + velocity.x = Math_SinS(this->actor.shape.rot.y) * 5.0f; + velocity.y = 0.0f; + velocity.z = Math_CosS(this->actor.shape.rot.y) * 5.0f; + func_800B0DE0(play, &this->actor.world.pos, &velocity, &gZeroVec3f, &sDustPrimColor, &sDustEnvColor, 1, + (s32)(this->size * 100.0f)); + this->timer = 1; + } + } else if (this->timer > 10) { + EnDekubaba_SetupPullBack(this); + } else { + this->timer++; + + if ((this->timer >= 4) && !Actor_IsFacingPlayer(&this->actor, 0x16C)) { + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xF, 0x71C); + } + + if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f)) { + if (this->actor.params == DEKUBABA_BIG) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_MOUTH); + } else { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIZUBABA1_MOUTH); + } + } + } + + EnDekubaba_UpdateHeadPosition(this); +} + +void EnDekubaba_SetupPullBack(EnDekubaba* this) { + Animation_Change(&this->skelAnime, &gDekuBabaPauseChompAnim, 1.0f, 15.0f, + Animation_GetLastFrame(&gDekuBabaPauseChompAnim), ANIMMODE_ONCE, -3.0f); + this->timer = 0; + this->actionFunc = EnDekubaba_PullBack; +} + +void EnDekubaba_PullBack(EnDekubaba* this, PlayState* play) { + Vec3f dustPos; + f32 xIncr; + f32 zIncr; + s32 i; + + SkelAnime_Update(&this->skelAnime); + + if (this->timer == 0) { + Math_ScaledStepToS(&this->actor.shape.rot.x, -0x93E, 0x38E); + Math_ScaledStepToS(&this->stemSectionAngle[0], -0x888, 0x16C); + Math_ScaledStepToS(&this->stemSectionAngle[1], -0x888, 0x16C); + + if (Math_ScaledStepToS(&this->stemSectionAngle[2], -0x888, 0x16C)) { + xIncr = Math_SinS(this->actor.shape.rot.y) * 30.0f * this->size; + zIncr = Math_CosS(this->actor.shape.rot.y) * 30.0f * this->size; + dustPos = this->actor.home.pos; + + for (i = 0; i < 3; i++) { + func_800B1210(play, &dustPos, &gZeroVec3f, &gZeroVec3f, (s32)(this->size * 500.0f), + (s32)(this->size * 50.0f)); + dustPos.x += xIncr; + dustPos.z += zIncr; + } + + this->timer = 1; + } + } else if (this->timer == 11) { + Math_ScaledStepToS(&this->actor.shape.rot.x, -0x93E, 0x200); + Math_ScaledStepToS(this->stemSectionAngle, -0xAAA, 0x200); + Math_ScaledStepToS(&this->stemSectionAngle[2], -0x5C71, 0x200); + + if (Math_ScaledStepToS(&this->stemSectionAngle[1], 0x238C, 0x200)) { + this->timer = 12; + } + } else if (this->timer == 18) { + Math_ScaledStepToS(&this->actor.shape.rot.x, 0x2AA8, 0xAAA); + + if (Math_ScaledStepToS(&this->stemSectionAngle[0], 0x1554, 0x5B0)) { + this->timer = 25; + } + + Math_ScaledStepToS(&this->stemSectionAngle[1], -0x38E3, 0xAAA); + Math_ScaledStepToS(&this->stemSectionAngle[2], -0x5C71, 0x2D8); + } else if (this->timer == 25) { + Math_ScaledStepToS(&this->actor.shape.rot.x, -0x5550, 0xAAA); + + if (Math_ScaledStepToS(&this->stemSectionAngle[0], -0x6388, 0x93E)) { + this->timer = 26; + } + + Math_ScaledStepToS(&this->stemSectionAngle[1], -0x3FFC, 0x4FA); + Math_ScaledStepToS(&this->stemSectionAngle[2], -0x238C, 0x444); + } else if (this->timer == 26) { + Math_ScaledStepToS(&this->actor.shape.rot.x, 0x1800, 0x93E); + + if (Math_ScaledStepToS(&this->stemSectionAngle[0], -0x1555, 0x71C)) { + this->timer = 27; + } + + Math_ScaledStepToS(&this->stemSectionAngle[1], -0x38E3, 0x2D8); + Math_ScaledStepToS(&this->stemSectionAngle[2], -0x5C71, 0x5B0); + } else if (this->timer >= 27) { + this->timer++; + if (this->timer > 30) { + if (this->actor.xzDistToPlayer < (80.0f * this->size)) { + EnDekubaba_SetupPrepareLunge(this); + } else { + EnDekubaba_SetupDecideLunge(this); + } + } + } else { + this->timer++; + if (this->timer == 10) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_SCRAPE); + } + + if (this->timer >= 12) { + Math_ScaledStepToS(&this->stemSectionAngle[2], -0x5C71, 0x88); + } + } + + EnDekubaba_UpdateHeadPosition(this); +} + +void EnDekubaba_SetupRecover(EnDekubaba* this) { + this->timer = 9; + this->collider.base.acFlags |= AC_ON; + this->skelAnime.playSpeed = -1.0f; + this->actionFunc = EnDekubaba_Recover; +} + +void EnDekubaba_Recover(EnDekubaba* this, PlayState* play) { + s32 anyStepsDone; + + SkelAnime_Update(&this->skelAnime); + + if (this->timer > 8) { + anyStepsDone = Math_SmoothStepToS(&this->actor.shape.rot.x, 0x1800, 1, 0x11C6, 0x71C); + anyStepsDone |= Math_SmoothStepToS(&this->stemSectionAngle[0], -0x1555, 1, 0xAAA, 0x71C); + anyStepsDone |= Math_SmoothStepToS(&this->stemSectionAngle[1], -0x38E3, 1, 0xE38, 0x71C); + anyStepsDone |= Math_SmoothStepToS(&this->stemSectionAngle[2], -0x5C71, 1, 0x11C6, 0x71C); + if (!anyStepsDone) { + this->timer = 8; + } + } else { + if (this->timer != 0) { + this->timer--; + } + + if (this->timer == 0) { + EnDekubaba_SetupDecideLunge(this); + } + } + + EnDekubaba_UpdateHeadPosition(this); +} + +typedef enum { + /* 0 */ DEKUBABA_HIT_NO_STUN, + /* 1 */ DEKUBABA_HIT_STUN_OTHER, + /* 2 */ DEKUBABA_HIT_STUN_NUT, + /* 3 */ DEKUBABA_HIT_STUN_ELECTRIC +} DekuBabaHitType; + +void EnDekubaba_SetupHit(EnDekubaba* this, s32 hitType) { + Animation_MorphToPlayOnce(&this->skelAnime, &gDekuBabaPauseChompAnim, -5.0f); + this->timer = hitType; + this->collider.base.acFlags &= ~AC_ON; + Actor_SetScale(&this->actor, this->size * 0.01f); + + if (hitType == DEKUBABA_HIT_STUN_NUT) { + Actor_SetColorFilter(&this->actor, 0, 155, 0, 42); + } else if (hitType == DEKUBABA_HIT_STUN_ELECTRIC) { + Actor_SetColorFilter(&this->actor, 0, 155, 0, 42); + this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_LARGE; + this->drawDmgEffScale = 0.75f; + this->drawDmgEffAlpha = 2.0f; + } else { + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 42); + } + this->actionFunc = EnDekubaba_Hit; +} + +/** + * Hit by a weapon or hit something when lunging. + */ +void EnDekubaba_Hit(EnDekubaba* this, PlayState* play) { + s32 allStepsDone; + + SkelAnime_Update(&this->skelAnime); + allStepsDone = true; + allStepsDone &= Math_ScaledStepToS(&this->actor.shape.rot.x, -0x4000, 0xE38); + allStepsDone &= Math_ScaledStepToS(this->stemSectionAngle, -0x4000, 0xE38); + allStepsDone &= Math_ScaledStepToS(&this->stemSectionAngle[1], -0x4000, 0xE38); + allStepsDone &= Math_ScaledStepToS(&this->stemSectionAngle[2], -0x4000, 0xE38); + if (allStepsDone) { + if (this->actor.colChkInfo.health == 0) { + EnDekubaba_SetupShrinkDie(this); + } else { + this->collider.base.acFlags |= AC_ON; + + if (this->timer == DEKUBABA_HIT_NO_STUN) { + if (this->actor.xzDistToPlayer < (80.0f * this->size)) { + EnDekubaba_SetupPrepareLunge(this); + } else { + EnDekubaba_SetupRecover(this); + } + } else { + EnDekubaba_SetupStunnedVertical(this); + } + } + } + + EnDekubaba_UpdateHeadPosition(this); +} + +void EnDekubaba_SetupPrunedSomersaultDie(EnDekubaba* this) { + this->timer = 0; + this->skelAnime.playSpeed = 0.0f; + this->actor.gravity = -0.8f; + this->actor.velocity.y = 4.0f; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000; + this->actor.speedXZ = this->size * 3.0f; + this->collider.base.acFlags &= ~AC_ON; + this->actor.flags |= ACTOR_FLAG_10 | ACTOR_FLAG_20; + this->actionFunc = EnDekubaba_PrunedSomersaultDie; +} + +void EnDekubaba_PrunedSomersaultDie(EnDekubaba* this, PlayState* play) { + s32 i; + Vec3f dustPos; + f32 deltaX; + f32 deltaY; + f32 deltaZ; + + Math_StepToF(&this->actor.speedXZ, 0.0f, this->size * 0.1f); + + if (this->timer == 0) { + Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C); + Math_ScaledStepToS(this->stemSectionAngle, 0x4800, 0x71C); + Math_ScaledStepToS(&this->stemSectionAngle[1], 0x4800, 0x71C); + + EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, this->size * 3.0f, 0, (s32)(this->size * 12.0f), + (s32)(this->size * 5.0f), 1, HAHEN_OBJECT_DEFAULT, 10, NULL); + + if ((this->actor.scale.x > 0.005f) && ((this->actor.bgCheckFlags & 2) || (this->actor.bgCheckFlags & 8))) { + this->actor.scale.z = 0.0f; + this->actor.scale.y = 0.0f; + this->actor.scale.x = 0.0f; + this->actor.speedXZ = 0.0f; + this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4); + EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, this->size * 3.0f, 0, (s32)(this->size * 12.0f), + (s32)(this->size * 5.0f), 15, HAHEN_OBJECT_DEFAULT, 10, NULL); + } + + if (this->actor.bgCheckFlags & 2) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + this->timer = 1; + } + } else if (this->timer == 1) { + dustPos = this->actor.world.pos; + + deltaY = 20.0f * Math_SinS(this->actor.shape.rot.x); + deltaX = -20.0f * Math_CosS(this->actor.shape.rot.x) * Math_SinS(this->actor.shape.rot.y); + deltaZ = -20.0f * Math_CosS(this->actor.shape.rot.x) * Math_CosS(this->actor.shape.rot.y); + + for (i = 0; i < 4; i++) { + func_800B1210(play, &dustPos, &gZeroVec3f, &gZeroVec3f, 500, 50); + dustPos.x += deltaX; + dustPos.y += deltaY; + dustPos.z += deltaZ; + } + + func_800B1210(play, &this->actor.home.pos, &gZeroVec3f, &gZeroVec3f, (s32)(this->size * 500.0f), + (s32)(this->size * 100.0f)); + EnDekubaba_SetupDeadStickDrop(this, play); + } +} + +void EnDekubaba_SetupShrinkDie(EnDekubaba* this) { + Animation_Change(&this->skelAnime, &gDekuBabaFastChompAnim, -1.5f, Animation_GetLastFrame(&gDekuBabaFastChompAnim), + 0.0f, ANIMMODE_ONCE, -3.0f); + this->collider.base.acFlags &= ~AC_ON; + this->actionFunc = EnDekubaba_ShrinkDie; +} + +/** + * Die and drop Deku Nuts (Deku Stick drop is handled elsewhere). + */ +void EnDekubaba_ShrinkDie(EnDekubaba* this, PlayState* play) { + Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, this->size * 5.0f); + + if (Math_StepToF(&this->actor.scale.x, this->size * 0.1f * 0.01f, this->size * 0.1f * 0.01f)) { + func_800B1210(play, &this->actor.home.pos, &gZeroVec3f, &gZeroVec3f, (s32)(this->size * 500.0f), + (s32)(this->size * 100.0f)); + + if (!this->actor.dropFlag) { + Item_DropCollectible(play, &this->actor.world.pos, ITEM00_NUTS_1); + if (this->actor.params == DEKUBABA_BIG) { + Item_DropCollectible(play, &this->actor.world.pos, ITEM00_NUTS_1); + Item_DropCollectible(play, &this->actor.world.pos, ITEM00_NUTS_1); + } + } else { + Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x30); + } + Actor_Kill(&this->actor); + } + + this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; + this->actor.shape.rot.z += 0x1C70; + EffectSsHahen_SpawnBurst(play, &this->actor.home.pos, this->size * 3.0f, 0, (s32)(this->size * 12.0f), + (s32)(this->size * 5.0f), 1, HAHEN_OBJECT_DEFAULT, 10, NULL); +} + +void EnDekubaba_SetupStunnedVertical(EnDekubaba* this) { + s32 i; + + for (i = 1; i < ARRAY_COUNT(this->colliderElements); i++) { + this->collider.elements[i].info.bumperFlags |= BUMP_ON; + } + + if (this->timer == 1) { + Animation_Change(&this->skelAnime, &gDekuBabaFastChompAnim, 4.0f, 0.0f, + Animation_GetLastFrame(&gDekuBabaFastChompAnim), ANIMMODE_LOOP, -3.0f); + this->timer = 0x28; + } else { + Animation_Change(&this->skelAnime, &gDekuBabaFastChompAnim, 0.0f, 0.0f, + Animation_GetLastFrame(&gDekuBabaFastChompAnim), ANIMMODE_LOOP, -3.0f); + if (this->timer == 2) { + this->timer = 40; + } else { + this->timer = 40; + } + } + + this->actor.world.pos.x = this->actor.home.pos.x; + this->actor.world.pos.y = this->actor.home.pos.y + (60.0f * this->size); + this->actor.world.pos.z = this->actor.home.pos.z; + this->actionFunc = EnDekubaba_StunnedVertical; +} + +void EnDekubaba_StunnedVertical(EnDekubaba* this, PlayState* play) { + SkelAnime_Update(&this->skelAnime); + + if (this->timer != 0) { + this->timer--; + } + + if (this->timer == 0) { + EnDekubaba_DisableHitboxes(this); + + if (this->actor.xzDistToPlayer < (80.0f * this->size)) { + EnDekubaba_SetupPrepareLunge(this); + } else { + EnDekubaba_SetupRecover(this); + } + } +} + +void EnDekubaba_SetupSway(EnDekubaba* this) { + this->targetSwayAngle = -0x6000; + this->stemSectionAngle[2] = -0x5000; + this->stemSectionAngle[1] = -0x4800; + EnDekubaba_DisableHitboxes(this); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 35); + this->collider.base.acFlags &= ~AC_ON; + this->actionFunc = EnDekubaba_Sway; +} + +/** + * Sway back and forth with decaying amplitude until close enough to vertical. + */ +void EnDekubaba_Sway(EnDekubaba* this, PlayState* play) { + s16 angleToVertical; + + SkelAnime_Update(&this->skelAnime); + Math_ScaledStepToS(&this->actor.shape.rot.x, this->stemSectionAngle[0], 0x71C); + Math_ScaledStepToS(this->stemSectionAngle, this->stemSectionAngle[1], 0x71C); + Math_ScaledStepToS(&this->stemSectionAngle[1], this->stemSectionAngle[2], 0x71C); + if (Math_ScaledStepToS(&this->stemSectionAngle[2], this->targetSwayAngle, 0x71C) != 0) { + this->targetSwayAngle = -0x4000 - (s32)((this->targetSwayAngle + 0x4000) * 0.8f); + } + + angleToVertical = this->targetSwayAngle + 0x4000; + + if (ABS_ALT(angleToVertical) < 0x100) { + this->collider.base.acFlags |= AC_ON; + if (this->actor.xzDistToPlayer < (80.0f * this->size)) { + EnDekubaba_SetupPrepareLunge(this); + } else { + EnDekubaba_SetupRecover(this); + } + } + EnDekubaba_UpdateHeadPosition(this); +} + +void EnDekubaba_SetupFrozen(EnDekubaba* this) { + EnDekubaba_SetFrozenEffects(this); + this->actionFunc = EnDekubaba_Frozen; +} + +void EnDekubaba_Frozen(EnDekubaba* this, PlayState* play) { + if (this->timer != 0) { + this->timer--; + } + if (this->timer == 0) { + EnDekubaba_SpawnIceEffects(this, play); + + if (this->actor.colChkInfo.health == 0) { + EnDekubaba_SetupShrinkDie(this); + } else if (this->actor.xzDistToPlayer < (80.0f * this->size)) { + EnDekubaba_SetupPrepareLunge(this); + } else { + EnDekubaba_SetupRecover(this); + } + } +} + +void EnDekubaba_SetupDeadStickDrop(EnDekubaba* this, PlayState* play) { + Actor_SetScale(&this->actor, 0.03f); + this->actor.shape.rot.x -= 0x4000; + this->actor.shape.yOffset = 1000.0f; + this->actor.gravity = 0.0f; + this->actor.velocity.y = 0.0f; + this->actor.shape.shadowScale = 3.0f; + func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_MISC); + this->actor.flags &= ~ACTOR_FLAG_20; + this->timer = 200; + this->drawDmgEffAlpha = 0.0f; + this->actionFunc = EnDekubaba_DeadStickDrop; +} + +void EnDekubaba_DeadStickDrop(EnDekubaba* this, PlayState* play) { + if (this->timer != 0) { + this->timer--; + } + + if (Actor_HasParent(&this->actor, play) || (this->timer == 0)) { + Actor_Kill(&this->actor); + return; + } + + Actor_PickUpNearby(&this->actor, play, GI_STICKS_1); +} + +/* Update and associated functions */ + +void EnDekubaba_UpdateDamage(EnDekubaba* this, PlayState* play) { + s32 newHealth; + s32 i; + ColliderJntSphElement* sphElement; + + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + Actor_SetDropFlagJntSph(&this->actor, &this->collider); + + if ((this->collider.base.colType != COLTYPE_HARD) && + (this->actor.colChkInfo.damageEffect != DEKUBABA_DMGEFF_HOOKSHOT)) { + sphElement = &this->collider.elements[0]; + for (i = 0; i < ARRAY_COUNT(this->colliderElements); i++, sphElement++) { + if (sphElement->info.bumperFlags & BUMP_HIT) { + break; + } + } + + if ((i != ARRAY_COUNT(this->colliderElements)) && + ((this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) || + (!(sphElement->info.acHitInfo->toucher.dmgFlags & 0xDB0B3)))) { + EnDekubaba_SpawnIceEffects(this, play); + newHealth = this->actor.colChkInfo.health - this->actor.colChkInfo.damage; + + if (this->actionFunc != EnDekubaba_StunnedVertical) { + if (this->actor.colChkInfo.damageEffect == DEKUBABA_DMGEFF_ICE) { + EnDekubaba_SetupFrozen(this); + } else if (this->actor.colChkInfo.damageEffect == DEKUBABA_DMGEFF_ELECTRIC) { + EnDekubaba_SetupHit(this, DEKUBABA_HIT_STUN_ELECTRIC); + } else if (this->actor.colChkInfo.damageEffect == DEKUBABA_DMGEFF_NUT) { + EnDekubaba_SetupHit(this, DEKUBABA_HIT_STUN_NUT); + } else { + EnDekubaba_SetFireLightEffects(this, play, i); + + if (this->actionFunc == EnDekubaba_PullBack) { + if (newHealth <= 0) { + newHealth = 1; + } + + EnDekubaba_SetupHit(this, DEKUBABA_HIT_STUN_OTHER); + } else { + EnDekubaba_SetupHit(this, DEKUBABA_HIT_NO_STUN); + } + } + } else { + if (this->actor.colChkInfo.damageEffect == DEKUBABA_DMGEFF_CUT) { + if (newHealth > 0) { + EnDekubaba_SetupSway(this); + } else { + EnDekubaba_SetupPrunedSomersaultDie(this); + } + } else if (this->actor.colChkInfo.damageEffect == DEKUBABA_DMGEFF_ELECTRIC) { + EnDekubaba_SetupHit(this, DEKUBABA_HIT_STUN_ELECTRIC); + } else if (this->actor.colChkInfo.damageEffect == DEKUBABA_DMGEFF_NUT) { + EnDekubaba_SetupHit(this, DEKUBABA_HIT_STUN_NUT); + } else if (this->actor.colChkInfo.damageEffect == DEKUBABA_DMGEFF_ICE) { + EnDekubaba_SetupFrozen(this); + } else { + EnDekubaba_SetFireLightEffects(this, play, i); + EnDekubaba_SetupHit(this, DEKUBABA_HIT_NO_STUN); + } + } + + if (newHealth < 0) { + this->actor.colChkInfo.health = 0; + } else { + this->actor.colChkInfo.health = newHealth; + } + } else { + return; + } + } else { + return; + } + } else if ((play->actorCtx.unk2 != 0) && (this->actor.xyzDistToPlayerSq < SQ(200.0f)) && + (this->collider.base.colType != COLTYPE_HARD) && (this->actionFunc != EnDekubaba_StunnedVertical) && + (this->actionFunc != EnDekubaba_Hit) && (this->actor.colChkInfo.health != 0)) { + this->actor.colChkInfo.health--; + this->actor.dropFlag = 0; + EnDekubaba_SetupHit(this, DEKUBABA_HIT_STUN_OTHER); + } else { + return; + } + + if (this->actor.colChkInfo.health != 0) { + if ((this->timer == 2) || (this->timer == 3)) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + } else { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_DAMAGE); + } + } else { + Enemy_StartFinishingBlow(play, &this->actor); + + if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { + this->timer = 3; + this->collider.base.acFlags &= ~AC_ON; + } else if (this->drawDmgEffAlpha > 1.5f) { + this->drawDmgEffAlpha = 1.5f; + } + + if (this->actor.params == DEKUBABA_BIG) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_DEAD); + } else { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_JR_DEAD); + } + } +} + +void EnDekubaba_Update(Actor* thisx, PlayState* play) { + s32 pad; + EnDekubaba* this = THIS; + + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; + EnDekubaba_SetupRecover(this); + } + + EnDekubaba_UpdateDamage(this, play); + this->actionFunc(this, play); + + if (this->actionFunc == EnDekubaba_PrunedSomersaultDie) { + Actor_MoveWithGravity(&this->actor); + Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, this->size * 15.0f, 10.0f, 5); + } else if (this->actionFunc != EnDekubaba_DeadStickDrop) { + Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 4); + if (this->boundFloor == NULL) { + this->boundFloor = this->actor.floorPoly; + } + } + + if (this->actionFunc == EnDekubaba_Lunge) { + CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); + this->actor.flags |= ACTOR_FLAG_1000000; + } + + if (this->collider.base.acFlags & AC_ON) { + CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); + } + + if (this->actionFunc != EnDekubaba_DeadStickDrop) { + CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); + } + + if (this->drawDmgEffAlpha > 0.0f) { + if (this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { + Math_StepToF(&this->drawDmgEffAlpha, 0.0f, 0.05f); + this->drawDmgEffScale = (this->drawDmgEffAlpha + 1.0f) * 0.375f; + this->drawDmgEffScale = CLAMP_MAX(this->drawDmgEffScale, 0.75f); + } else if (!Math_StepToF(&this->drawDmgEffFrozenSteamScale, 0.75f, 0.75f / 40)) { + func_800B9010(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); + } + } +} + +/* Draw functions */ + +void EnDekubaba_DrawStemRetracted(EnDekubaba* this, PlayState* play) { + f32 horizontalScale; + s32 i; + + OPEN_DISPS(play->state.gfxCtx); + + horizontalScale = this->size * 0.01f; + + Matrix_Translate(this->actor.home.pos.x, this->actor.home.pos.y + (-6.0f * this->size), this->actor.home.pos.z, + MTXMODE_NEW); + Matrix_RotateZYX(this->stemSectionAngle[0], this->actor.shape.rot.y, 0, MTXMODE_APPLY); + Matrix_Scale(horizontalScale, horizontalScale, horizontalScale, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, gDekuBabaStemTopDL); + + for (i = 1; i < ARRAY_COUNT(this->bodyPartsPos); i++) { + Matrix_MultZero(&this->bodyPartsPos[i]); + } + + Actor_SetFocus(&this->actor, 0.0f); + + CLOSE_DISPS(play->state.gfxCtx); +} + +void EnDekubaba_DrawStemExtended(EnDekubaba* this, PlayState* play) { + static Gfx* sStemDLists[] = { gDekuBabaStemTopDL, gDekuBabaStemMiddleDL, gDekuBabaStemBaseDL }; + MtxF mf; + s32 i; + f32 scale; + f32 horizontalStepSize; + s32 stemSections; + + OPEN_DISPS(play->state.gfxCtx); + + if (this->actionFunc == EnDekubaba_PrunedSomersaultDie) { + stemSections = 2; + } else { + stemSections = 3; + } + + scale = this->size * 0.01f; + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); + Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); + Matrix_Get(&mf); + + for (i = 0; i < stemSections; i++) { + mf.yw += 20.0f * Math_SinS(this->stemSectionAngle[i]) * this->size; + horizontalStepSize = Math_CosS(this->stemSectionAngle[i]) * 20.0f * this->size; + mf.xw -= horizontalStepSize * Math_SinS(this->actor.shape.rot.y); + mf.zw -= horizontalStepSize * Math_CosS(this->actor.shape.rot.y); + + Matrix_Put(&mf); + Matrix_RotateZYX(this->stemSectionAngle[i], this->actor.shape.rot.y, 0, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, sStemDLists[i]); + + Collider_UpdateSpheres(51 + 2 * i, &this->collider); + Collider_UpdateSpheres(52 + 2 * i, &this->collider); + + if (i == 0) { + if (this->actionFunc != EnDekubaba_Sway) { + this->actor.focus.pos.x = mf.xw; + this->actor.focus.pos.y = mf.yw; + this->actor.focus.pos.z = mf.zw; + } else { + this->actor.focus.pos.x = this->actor.home.pos.x; + this->actor.focus.pos.y = this->actor.home.pos.y + (40.0f * this->size); + this->actor.focus.pos.z = this->actor.home.pos.z; + } + } + + Matrix_MultZero(&this->bodyPartsPos[i + 1]); + } + + CLOSE_DISPS(play->state.gfxCtx); +} + +void EnDekubaba_DrawStemBasePruned(EnDekubaba* this, PlayState* play) { + OPEN_DISPS(play->state.gfxCtx); + + Matrix_RotateZYX(this->stemSectionAngle[2], this->actor.shape.rot.y, 0, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, gDekuBabaStemBaseDL); + + Collider_UpdateSpheres(55, &this->collider); + Collider_UpdateSpheres(56, &this->collider); + + Matrix_MultZero(&this->bodyPartsPos[3]); + + CLOSE_DISPS(play->state.gfxCtx); +} + +void EnDekubaba_DrawShadow(EnDekubaba* this, PlayState* play) { + MtxF mf; + f32 horizontalScale; + + OPEN_DISPS(play->state.gfxCtx); + + func_8012C448(play->state.gfxCtx); + + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 255); + + func_800C0094(this->boundFloor, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, &mf); + Matrix_Mult(&mf, MTXMODE_NEW); + horizontalScale = this->size * 0.15f; + Matrix_Scale(horizontalScale, 1.0f, horizontalScale, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_XLU_DISP++, gCircleShadowDL); + + CLOSE_DISPS(play->state.gfxCtx); +} + +void EnDekubaba_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + EnDekubaba* this = THIS; + + if (limbIndex == DEKUBABA_LIMB_ROOT) { + Collider_UpdateSpheres(limbIndex, &this->collider); + } +} + +void EnDekubaba_Draw(Actor* thisx, PlayState* play) { + EnDekubaba* this = THIS; + f32 scale; + + OPEN_DISPS(play->state.gfxCtx); + + func_8012C28C(play->state.gfxCtx); + Math_Vec3f_Copy(&this->bodyPartsPos[0], &this->actor.world.pos); + + if (this->actionFunc != EnDekubaba_DeadStickDrop) { + SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, EnDekubaba_PostLimbDraw, + &this->actor); + if (this->actionFunc == EnDekubaba_Wait) { + EnDekubaba_DrawStemRetracted(this, play); + } else { + EnDekubaba_DrawStemExtended(this, play); + } + + scale = this->size * 0.01f; + Matrix_Translate(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, MTXMODE_NEW); + Matrix_RotateYS(this->actor.home.rot.y, MTXMODE_APPLY); + Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, gDekuBabaBaseLeavesDL); + + if (this->actionFunc == EnDekubaba_PrunedSomersaultDie) { + EnDekubaba_DrawStemBasePruned(this, play); + } + if (this->boundFloor != NULL) { + EnDekubaba_DrawShadow(this, play); + } + + // Display solid until 40 frames left, then blink until killed. + } else if ((this->timer > 40) || ((this->timer % 2) != 0)) { + Matrix_Translate(0.0f, 0.0f, 200.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++, gDekuBabaStickDropDL); + } + + CLOSE_DISPS(play->state.gfxCtx); + Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos), + this->drawDmgEffScale * this->size, this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha, + this->drawDmgEffType); +} 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 848f056bf9..b1c7f98bcc 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h @@ -2,16 +2,35 @@ #define Z_EN_DEKUBABA_H #include "global.h" +#include "objects/object_dekubaba/object_dekubaba.h" struct EnDekubaba; typedef void (*EnDekubabaActionFunc)(struct EnDekubaba*, PlayState*); +typedef enum { + /* 0 */ DEKUBABA_NORMAL, + /* 1 */ DEKUBABA_BIG +} DekuBabaType; + typedef struct EnDekubaba { /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x44]; + /* 0x144 */ SkelAnime skelAnime; /* 0x188 */ EnDekubabaActionFunc actionFunc; - /* 0x18C */ char unk_18C[0x290]; + /* 0x18C */ u8 drawDmgEffType; + /* 0x18E */ s16 timer; + /* 0x190 */ s16 targetSwayAngle; + /* 0x192 */ s16 stemSectionAngle[3]; + /* 0x198 */ Vec3s jointTable[DEKUBABA_LIMB_MAX]; + /* 0x1C8 */ Vec3s morphTable[DEKUBABA_LIMB_MAX]; + /* 0x1F8 */ f32 size; + /* 0x1FC */ f32 drawDmgEffAlpha; + /* 0x200 */ f32 drawDmgEffScale; + /* 0x204 */ f32 drawDmgEffFrozenSteamScale; + /* 0x208 */ Vec3f bodyPartsPos[4]; + /* 0x238 */ CollisionPoly* boundFloor; + /* 0x23C */ ColliderJntSph collider; + /* 0x25C */ ColliderJntSphElement colliderElements[7]; } EnDekubaba; // size = 0x41C #endif // Z_EN_DEKUBABA_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 46ad2c30b7..dd8d513e49 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -1,13 +1,12 @@ /* * File: z_en_karebaba.c * Overlay: ovl_En_Karebaba - * Description: Wilted Deku Baba + * Description: Wilted Deku Baba and Mini Baba */ #include "z_en_karebaba.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "objects/gameplay_keep/gameplay_keep.h" -#include "objects/object_dekubaba/object_dekubaba.h" #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4) @@ -18,27 +17,26 @@ void EnKarebaba_Destroy(Actor* thisx, PlayState* play); void EnKarebaba_Update(Actor* thisx, PlayState* play2); void EnKarebaba_Draw(Actor* thisx, PlayState* play); -void func_808F155C(EnKarebaba* this); -void func_808F15B0(EnKarebaba* this, PlayState* play); -void func_808F1648(EnKarebaba* this); -void func_808F169C(EnKarebaba* this, PlayState* play); -void func_808F16FC(EnKarebaba* this); -void func_808F1778(EnKarebaba* this, PlayState* play); -void func_808F1878(EnKarebaba* this); -void func_808F190C(EnKarebaba* this, PlayState* play); -void func_808F1A3C(EnKarebaba* this); -void func_808F1A58(EnKarebaba* this, PlayState* play); -void func_808F1BF8(EnKarebaba* this); -void func_808F1C84(EnKarebaba* this, PlayState* play); -void func_808F1FAC(EnKarebaba* this); -void func_808F200C(EnKarebaba* this, PlayState* play); -void func_808F20FC(EnKarebaba* this, PlayState* play); -void func_808F21A4(EnKarebaba* this, PlayState* play); -void func_808F220C(EnKarebaba* this); -void func_808F228C(EnKarebaba* this, PlayState* play); -void func_808F238C(EnKarebaba* this); -void func_808F241C(EnKarebaba* this, PlayState* play); -void func_808F254C(EnKarebaba* this, PlayState* play); +void EnKarebaba_SetupGrow(EnKarebaba* this); +void EnKarebaba_Grow(EnKarebaba* this, PlayState* play); +void EnKarebaba_SetupIdle(EnKarebaba* this); +void EnKarebaba_Idle(EnKarebaba* this, PlayState* play); +void EnKarebaba_SetupAwaken(EnKarebaba* this); +void EnKarebaba_Awaken(EnKarebaba* this, PlayState* play); +void EnKarebaba_SetupUpright(EnKarebaba* this); +void EnKarebaba_Upright(EnKarebaba* this, PlayState* play); +void EnKarebaba_SetupSpin(EnKarebaba* this); +void EnKarebaba_Spin(EnKarebaba* this, PlayState* play); +void EnKarebaba_SetupDying(EnKarebaba* this); +void EnKarebaba_Dying(EnKarebaba* this, PlayState* play); +void EnKarebaba_SetupShrinkDie(EnKarebaba* this); +void EnKarebaba_ShrinkDie(EnKarebaba* this, PlayState* play); +void EnKarebaba_SetupDeadItemDrop(EnKarebaba* this, PlayState* play); +void EnKarebaba_DeadItemDrop(EnKarebaba* this, PlayState* play); +void EnKarebaba_SetupRetract(EnKarebaba* this); +void EnKarebaba_Retract(EnKarebaba* this, PlayState* play); +void EnKarebaba_SetupDead(EnKarebaba* this); +void EnKarebaba_Dead(EnKarebaba* this, PlayState* play); ActorInit En_Karebaba_InitVars = { ACTOR_EN_KAREBABA, @@ -52,7 +50,7 @@ ActorInit En_Karebaba_InitVars = { (ActorFunc)EnKarebaba_Draw, }; -static ColliderCylinderInit sCylinderInit1 = { +static ColliderCylinderInit sHurtCylinderInit = { { COLTYPE_HARD, AT_NONE, @@ -72,7 +70,7 @@ static ColliderCylinderInit sCylinderInit1 = { { 7, 25, 0, { 0, 0, 0 } }, }; -static ColliderCylinderInit sCylinderInit2 = { +static ColliderCylinderInit sAttackCylinderInit = { { COLTYPE_HARD, AT_ON | AT_TYPE_ENEMY, @@ -94,39 +92,47 @@ static ColliderCylinderInit sCylinderInit2 = { static CollisionCheckInfoInit sColChkInfoInit = { 1, 15, 80, MASS_HEAVY }; +typedef enum { + /* 0x0 */ KAREBABA_DMGEFF_NONE, + /* 0x2 */ KAREBABA_DMGEFF_FIRE = 2, + /* 0x3 */ KAREBABA_DMGEFF_ICE, + /* 0x4 */ KAREBABA_DMGEFF_LIGHT, + /* 0x5 */ KAREBABA_DMGEFF_ELECTRIC, +} DekuBabaDamageEffect; + static DamageTable sDamageTable = { - /* Deku Nut */ DMG_ENTRY(0, 0x0), - /* Deku Stick */ DMG_ENTRY(3, 0x0), - /* Horse trample */ DMG_ENTRY(1, 0x0), - /* Explosives */ DMG_ENTRY(1, 0x0), - /* Zora boomerang */ DMG_ENTRY(1, 0x0), - /* Normal arrow */ DMG_ENTRY(1, 0x0), - /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), - /* Hookshot */ DMG_ENTRY(1, 0x0), - /* Goron punch */ DMG_ENTRY(2, 0x0), - /* Sword */ DMG_ENTRY(1, 0x0), - /* Goron pound */ DMG_ENTRY(1, 0x0), - /* Fire arrow */ DMG_ENTRY(1, 0x2), - /* Ice arrow */ DMG_ENTRY(2, 0x3), - /* Light arrow */ DMG_ENTRY(2, 0x4), - /* Goron spikes */ DMG_ENTRY(1, 0x0), - /* Deku spin */ DMG_ENTRY(1, 0x0), - /* Deku bubble */ DMG_ENTRY(1, 0x0), - /* Deku launch */ DMG_ENTRY(2, 0x0), - /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0), - /* Zora barrier */ DMG_ENTRY(1, 0x5), - /* Normal shield */ DMG_ENTRY(0, 0x0), - /* Light ray */ DMG_ENTRY(0, 0x0), - /* Thrown object */ DMG_ENTRY(1, 0x0), - /* Zora punch */ DMG_ENTRY(1, 0x0), - /* Spin attack */ DMG_ENTRY(1, 0x0), - /* Sword beam */ DMG_ENTRY(0, 0x0), - /* Normal Roll */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0x0), - /* Unblockable */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0x0), - /* Powder Keg */ DMG_ENTRY(1, 0x0), + /* Deku Nut */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE), + /* Deku Stick */ DMG_ENTRY(3, KAREBABA_DMGEFF_NONE), + /* Horse trample */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE), + /* Explosives */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE), + /* Zora boomerang */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE), + /* Normal arrow */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE), + /* UNK_DMG_0x06 */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE), + /* Hookshot */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE), + /* Goron punch */ DMG_ENTRY(2, KAREBABA_DMGEFF_NONE), + /* Sword */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE), + /* Goron pound */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE), + /* Fire arrow */ DMG_ENTRY(1, KAREBABA_DMGEFF_FIRE), + /* Ice arrow */ DMG_ENTRY(2, KAREBABA_DMGEFF_ICE), + /* Light arrow */ DMG_ENTRY(2, KAREBABA_DMGEFF_LIGHT), + /* Goron spikes */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE), + /* Deku spin */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE), + /* Deku bubble */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE), + /* Deku launch */ DMG_ENTRY(2, KAREBABA_DMGEFF_NONE), + /* UNK_DMG_0x12 */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE), + /* Zora barrier */ DMG_ENTRY(1, KAREBABA_DMGEFF_ELECTRIC), + /* Normal shield */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE), + /* Light ray */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE), + /* Thrown object */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE), + /* Zora punch */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE), + /* Spin attack */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE), + /* Sword beam */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE), + /* Normal Roll */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE), + /* UNK_DMG_0x1B */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE), + /* UNK_DMG_0x1C */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE), + /* Unblockable */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE), + /* UNK_DMG_0x1E */ DMG_ENTRY(0, KAREBABA_DMGEFF_NONE), + /* Powder Keg */ DMG_ENTRY(1, KAREBABA_DMGEFF_NONE), }; static InitChainEntry sInitChain[] = { @@ -134,211 +140,208 @@ static InitChainEntry sInitChain[] = { ICHAIN_U8(targetMode, 1, ICHAIN_STOP), }; -Color_RGBA8 D_808F2E28 = { 0, 0, 0, 0 }; - -Gfx* D_808F2E2C[] = { object_dekubaba_DL_001330, object_dekubaba_DL_001628, object_dekubaba_DL_001828 }; - void EnKarebaba_Init(Actor* thisx, PlayState* play) { EnKarebaba* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 22.0f); - SkelAnime_Init(play, &this->skelAnime, &object_dekubaba_Skel_002A40, &object_dekubaba_Anim_0002B8, this->jointTable, - this->morphTable, 8); + SkelAnime_Init(play, &this->skelAnime, &gDekuBabaSkel, &gDekuBabaFastChompAnim, this->jointTable, this->morphTable, + DEKUBABA_LIMB_MAX); - Collider_InitAndSetCylinder(play, &this->collider2, &this->actor, &sCylinderInit1); - Collider_UpdateCylinder(&this->actor, &this->collider2); - Collider_InitAndSetCylinder(play, &this->collider1, &this->actor, &sCylinderInit2); - Collider_UpdateCylinder(&this->actor, &this->collider1); + Collider_InitAndSetCylinder(play, &this->hurtCollider, &this->actor, &sHurtCylinderInit); + Collider_UpdateCylinder(&this->actor, &this->hurtCollider); + Collider_InitAndSetCylinder(play, &this->attackCollider, &this->actor, &sAttackCylinderInit); + Collider_UpdateCylinder(&this->actor, &this->attackCollider); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); - this->unk_22C = NULL; - if (this->actor.params == ENKAREBABA_2) { + this->boundFloor = NULL; + if (this->actor.params == KAREBABA_MINI) { this->actor.hintId = TATL_HINT_ID_MINI_BABA; } else { this->actor.hintId = TATL_HINT_ID_WILTED_DEKU_BABA; } if (this->actor.params == ENKAREBABA_0) { - func_808F155C(this); + EnKarebaba_SetupGrow(this); } else { - func_808F1648(this); + EnKarebaba_SetupIdle(this); } } void EnKarebaba_Destroy(Actor* thisx, PlayState* play) { EnKarebaba* this = THIS; - Collider_DestroyCylinder(play, &this->collider2); - Collider_DestroyCylinder(play, &this->collider1); + Collider_DestroyCylinder(play, &this->hurtCollider); + Collider_DestroyCylinder(play, &this->attackCollider); } -void func_808F1374(EnKarebaba* this, PlayState* play) { - s32 phi_a3; +void EnKarebaba_SpawnIceEffects(EnKarebaba* this, PlayState* play) { + s32 limbPosCount; if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE; this->drawDmgEffAlpha = 0.0f; - if (this->actor.params == ENKAREBABA_2) { - phi_a3 = 1; + + if (this->actor.params == KAREBABA_MINI) { + limbPosCount = 1; } else { - phi_a3 = 4; + limbPosCount = 4; } - Actor_SpawnIceEffects(play, &this->actor, this->limbPos, phi_a3, 4, 0.3f, 0.2f); + Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, limbPosCount, 4, 0.3f, 0.2f); } } -void func_808F13FC(EnKarebaba* this, PlayState* play) { - if (this->actor.colChkInfo.damageEffect == 2) { +void EnKarebaba_SetDamageEffects(EnKarebaba* this, PlayState* play) { + if (this->actor.colChkInfo.damageEffect == KAREBABA_DMGEFF_FIRE) { this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE; this->drawDmgEffScale = 0.75f; this->drawDmgEffAlpha = 3.0f; - } else if (this->actor.colChkInfo.damageEffect == 4) { + } else if (this->actor.colChkInfo.damageEffect == KAREBABA_DMGEFF_LIGHT) { this->drawDmgEffScale = 0.75f; this->drawDmgEffType = ACTOR_DRAW_DMGEFF_LIGHT_ORBS; this->drawDmgEffAlpha = 3.0f; - Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->collider2.info.bumper.hitPos.x, - this->collider2.info.bumper.hitPos.y, this->collider2.info.bumper.hitPos.z, 0, 0, 0, + + Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->hurtCollider.info.bumper.hitPos.x, + this->hurtCollider.info.bumper.hitPos.y, this->hurtCollider.info.bumper.hitPos.z, 0, 0, 0, CLEAR_TAG_SMALL_LIGHT_RAYS); - } else if (this->actor.colChkInfo.damageEffect == 3) { + } else if (this->actor.colChkInfo.damageEffect == KAREBABA_DMGEFF_ICE) { this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX; this->drawDmgEffScale = 0.75f; this->drawDmgEffAlpha = 1.0f; this->drawDmgEffFrozenSteamScale = 1.125f; - } else if (this->actor.colChkInfo.damageEffect == 5) { + } else if (this->actor.colChkInfo.damageEffect == KAREBABA_DMGEFF_ELECTRIC) { this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_MEDIUM; this->drawDmgEffScale = 0.75f; this->drawDmgEffAlpha = 3.0f; } } -void func_808F152C(EnKarebaba* this) { - this->collider2.dim.radius = 7; - this->collider2.dim.height = 25; - this->collider2.base.colType = COLTYPE_HARD; - this->collider2.base.acFlags |= AC_HARD; - this->collider1.dim.height = 25; +void EnKarebaba_ResetColliders(EnKarebaba* this) { + this->hurtCollider.dim.radius = 7; + this->hurtCollider.dim.height = 25; + this->hurtCollider.base.colType = COLTYPE_HARD; + this->hurtCollider.base.acFlags |= AC_HARD; + this->attackCollider.dim.height = 25; } -void func_808F155C(EnKarebaba* this) { +void EnKarebaba_SetupGrow(EnKarebaba* this) { Actor_SetScale(&this->actor, 0.0f); this->actor.shape.rot.x = -0x4000; - this->unk_1EE = 0; + this->timer = 0; this->actor.world.pos.y = this->actor.home.pos.y + 14.0f; - this->actionFunc = func_808F15B0; + this->actionFunc = EnKarebaba_Grow; } -void func_808F15B0(EnKarebaba* this, PlayState* play) { - f32 sp1C; +void EnKarebaba_Grow(EnKarebaba* this, PlayState* play) { + f32 scale; - this->unk_1EE++; - sp1C = this->unk_1EE * 0.05f; - Actor_SetScale(&this->actor, 0.005f * sp1C); - this->actor.world.pos.y = this->actor.home.pos.y + (14.0f * sp1C); - if (this->unk_1EE == 20) { - func_808F1648(this); + this->timer++; + scale = this->timer * 0.05f; + Actor_SetScale(&this->actor, 0.005f * scale); + this->actor.world.pos.y = this->actor.home.pos.y + (14.0f * scale); + if (this->timer == 20) { + EnKarebaba_SetupIdle(this); } } -void func_808F1648(EnKarebaba* this) { +void EnKarebaba_SetupIdle(EnKarebaba* this) { Actor_SetScale(&this->actor, 0.005f); this->actor.shape.rot.x = -0x4000; this->actor.world.pos.y = this->actor.home.pos.y + 14.0f; - this->actionFunc = func_808F169C; + this->actionFunc = EnKarebaba_Idle; } -void func_808F169C(EnKarebaba* this, PlayState* play) { +void EnKarebaba_Idle(EnKarebaba* this, PlayState* play) { if ((this->actor.xzDistToPlayer < 200.0f) && (fabsf(this->actor.playerHeightRel) < 30.0f)) { - func_808F16FC(this); + EnKarebaba_SetupAwaken(this); } } -void func_808F16FC(EnKarebaba* this) { - Animation_Change(&this->skelAnime, &object_dekubaba_Anim_0002B8, 4.0f, 0.0f, - Animation_GetLastFrame(&object_dekubaba_Anim_0002B8), ANIMMODE_LOOP, -3.0f); +void EnKarebaba_SetupAwaken(EnKarebaba* this) { + Animation_Change(&this->skelAnime, &gDekuBabaFastChompAnim, 4.0f, 0.0f, + Animation_GetLastFrame(&gDekuBabaFastChompAnim), ANIMMODE_LOOP, -3.0f); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_WAKEUP); - this->actionFunc = func_808F1778; + this->actionFunc = EnKarebaba_Awaken; } -void func_808F1778(EnKarebaba* this, PlayState* play) { +void EnKarebaba_Awaken(EnKarebaba* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.0005f) && (this->actor.params == ENKAREBABA_2)) { - func_808F1878(this); + if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.0005f) && (this->actor.params == KAREBABA_MINI)) { + EnKarebaba_SetupUpright(this); } - this->actor.scale.z = this->actor.scale.x; - this->actor.scale.y = this->actor.scale.x; + this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; if ((this->actor.params == ENKAREBABA_1) && Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 60.0f, 5.0f)) { - func_808F1878(this); + EnKarebaba_SetupUpright(this); } - this->actor.shape.rot.y += 0x1999; + this->actor.shape.rot.y += 0x10000 / 10; EffectSsHahen_SpawnBurst(play, &this->actor.home.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); } -void func_808F1878(EnKarebaba* this) { - if (this->actionFunc != func_808F1A58) { +void EnKarebaba_SetupUpright(EnKarebaba* this) { + if (this->actionFunc != EnKarebaba_Spin) { Actor_SetScale(&this->actor, 0.01f); - this->collider2.base.colType = COLTYPE_HIT6; - this->collider2.base.acFlags &= ~AC_HARD; - this->collider2.dim.radius = 15; + this->hurtCollider.base.colType = COLTYPE_HIT6; + this->hurtCollider.base.acFlags &= ~AC_HARD; + this->hurtCollider.dim.radius = 15; if (this->actor.params == ENKAREBABA_1) { - this->collider2.dim.height = 80; - this->collider1.dim.height = 80; + this->hurtCollider.dim.height = 80; + this->attackCollider.dim.height = 80; } else { - this->collider2.dim.height = 35; - this->collider1.dim.height = 35; + this->hurtCollider.dim.height = 35; + this->attackCollider.dim.height = 35; } } - this->unk_1EE = 40; - this->actionFunc = func_808F190C; + this->timer = 40; + this->actionFunc = EnKarebaba_Upright; } -void func_808F190C(EnKarebaba* this, PlayState* play) { +void EnKarebaba_Upright(EnKarebaba* this, PlayState* play) { Player* player = GET_PLAYER(play); SkelAnime_Update(&this->skelAnime); - if (this->unk_1EE != 0) { - this->unk_1EE--; + if (this->timer != 0) { + this->timer--; } if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIZUBABA1_MOUTH); } - if (this->collider2.base.acFlags & AC_HIT) { - func_808F13FC(this, play); + if (this->hurtCollider.base.acFlags & AC_HIT) { + EnKarebaba_SetDamageEffects(this, play); if (this->actor.params == ENKAREBABA_1) { - func_808F1BF8(this); + EnKarebaba_SetupDying(this); } else { - func_808F1FAC(this); + EnKarebaba_SetupShrinkDie(this); } Enemy_StartFinishingBlow(play, &this->actor); } else if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) > 240.0f) { - func_808F220C(this); - } else if ((this->unk_1EE == 0) && (this->actor.params == ENKAREBABA_1)) { - func_808F1A3C(this); + EnKarebaba_SetupRetract(this); + } else if ((this->timer == 0) && (this->actor.params == ENKAREBABA_1)) { + EnKarebaba_SetupSpin(this); } } -void func_808F1A3C(EnKarebaba* this) { - this->unk_1EE = 40; - this->actionFunc = func_808F1A58; +void EnKarebaba_SetupSpin(EnKarebaba* this) { + this->timer = 40; + this->actionFunc = EnKarebaba_Spin; } -void func_808F1A58(EnKarebaba* this, PlayState* play) { - s32 phi_v0; - f32 sp28; +void EnKarebaba_Spin(EnKarebaba* this, PlayState* play) { + s32 temp; // Used for cylinder radius and shape rotations + f32 headDistHorizontal; - if (this->unk_1EE != 0) { - this->unk_1EE--; + if (this->timer != 0) { + this->timer--; } SkelAnime_Update(&this->skelAnime); @@ -347,66 +350,66 @@ void func_808F1A58(EnKarebaba* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIZUBABA1_MOUTH); } - phi_v0 = 20 - this->unk_1EE; - phi_v0 = 20 - ABS_ALT(phi_v0); - if (phi_v0 > 10) { - phi_v0 = 10; + temp = 20 - this->timer; + temp = 20 - ABS_ALT(temp); + if (temp > 10) { + temp = 10; } - this->collider1.dim.radius = sCylinderInit2.dim.radius + (phi_v0 * 2); - this->actor.shape.rot.x = 0xC000 - (phi_v0 << 8); - this->actor.shape.rot.y += phi_v0 * 0x2C0; + this->attackCollider.dim.radius = sAttackCylinderInit.dim.radius + (temp * 2); + this->actor.shape.rot.x = 0xC000 - temp * 0x100; + this->actor.shape.rot.y += temp * 0x2C0; this->actor.world.pos.y = (Math_SinS(this->actor.shape.rot.x) * -60.0f) + this->actor.home.pos.y; - sp28 = Math_CosS(this->actor.shape.rot.x) * 60.0f; - this->actor.world.pos.x = (Math_SinS(this->actor.shape.rot.y) * sp28) + this->actor.home.pos.x; - this->actor.world.pos.z = (Math_CosS(this->actor.shape.rot.y) * sp28) + this->actor.home.pos.z; + headDistHorizontal = Math_CosS(this->actor.shape.rot.x) * 60.0f; + this->actor.world.pos.x = (Math_SinS(this->actor.shape.rot.y) * headDistHorizontal) + this->actor.home.pos.x; + this->actor.world.pos.z = (Math_CosS(this->actor.shape.rot.y) * headDistHorizontal) + this->actor.home.pos.z; - if (this->collider2.base.acFlags & AC_HIT) { - func_808F13FC(this, play); - func_808F1BF8(this); + if (this->hurtCollider.base.acFlags & AC_HIT) { + EnKarebaba_SetDamageEffects(this, play); + EnKarebaba_SetupDying(this); Enemy_StartFinishingBlow(play, &this->actor); - } else if (this->unk_1EE == 0) { - func_808F1878(this); + } else if (this->timer == 0) { + EnKarebaba_SetupUpright(this); } } -void func_808F1BF8(EnKarebaba* this) { +void EnKarebaba_SetupDying(EnKarebaba* this) { if (this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { - this->unk_1EE = 0; + this->timer = 0; this->actor.gravity = -0.8f; this->actor.velocity.y = 4.0f; this->actor.world.rot.y = BINANG_ROT180(this->actor.shape.rot.y); this->actor.speedXZ = 3.0f; } else { - this->unk_1EE = 3; + this->timer = 3; } Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_JR_DEAD); this->actor.flags |= (ACTOR_FLAG_10 | ACTOR_FLAG_20); - this->actionFunc = func_808F1C84; + this->actionFunc = EnKarebaba_Dying; } -void func_808F1C84(EnKarebaba* this, PlayState* play) { +void EnKarebaba_Dying(EnKarebaba* this, PlayState* play) { s32 i; - Vec3f sp78; - f32 temp_f20; - f32 temp_f22; - f32 temp_f24; + Vec3f dustPos; + f32 xIncr; + f32 zIncr; + f32 yIncr; if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { - this->unk_1EE--; - if (this->unk_1EE == 0) { + this->timer--; + if (this->timer == 0) { this->actor.gravity = -0.8f; this->actor.speedXZ = 3.0f; this->actor.velocity.y = 4.0f; this->actor.world.rot.y = BINANG_ROT180(this->actor.shape.rot.y); - func_808F1374(this, play); + EnKarebaba_SpawnIceEffects(this, play); } } else { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.1f); - if (this->unk_1EE == 0) { + if (this->timer == 0) { Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C); EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); @@ -422,156 +425,155 @@ void func_808F1C84(EnKarebaba* this, PlayState* play) { if (this->actor.bgCheckFlags & 2) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); - this->unk_1EE = 1; + this->timer = 1; } - } else if (this->unk_1EE == 1) { - Math_Vec3f_Copy(&sp78, &this->actor.world.pos); + } else if (this->timer == 1) { + Math_Vec3f_Copy(&dustPos, &this->actor.world.pos); - temp_f24 = Math_SinS(this->actor.shape.rot.x) * 20.0f; - temp_f20 = (-20.0f * Math_CosS(this->actor.shape.rot.x)) * Math_SinS(this->actor.shape.rot.y); - temp_f22 = (-20.0f * Math_CosS(this->actor.shape.rot.x)) * Math_CosS(this->actor.shape.rot.y); + yIncr = Math_SinS(this->actor.shape.rot.x) * 20.0f; + xIncr = -20.0f * Math_CosS(this->actor.shape.rot.x) * Math_SinS(this->actor.shape.rot.y); + zIncr = -20.0f * Math_CosS(this->actor.shape.rot.x) * Math_CosS(this->actor.shape.rot.y); for (i = 0; i < 4; i++) { - func_800B1210(play, &sp78, &gZeroVec3f, &gZeroVec3f, 500, 50); - sp78.x += temp_f20; - sp78.y += temp_f24; - sp78.z += temp_f22; + func_800B1210(play, &dustPos, &gZeroVec3f, &gZeroVec3f, 500, 50); + dustPos.x += xIncr; + dustPos.y += yIncr; + dustPos.z += zIncr; } func_800B1210(play, &this->actor.home.pos, &gZeroVec3f, &gZeroVec3f, 500, 100); - func_808F20FC(this, play); + EnKarebaba_SetupDeadItemDrop(this, play); } } } -void func_808F1FAC(EnKarebaba* this) { +void EnKarebaba_SetupShrinkDie(EnKarebaba* this) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_JR_DEAD); this->actor.flags |= (ACTOR_FLAG_10 | ACTOR_FLAG_20); this->actor.flags &= ~ACTOR_FLAG_1; if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { - this->unk_1EE = 3; + this->timer = 3; } - this->actionFunc = func_808F200C; + this->actionFunc = EnKarebaba_ShrinkDie; } -void func_808F200C(EnKarebaba* this, PlayState* play) { +void EnKarebaba_ShrinkDie(EnKarebaba* this, PlayState* play) { if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { - this->unk_1EE--; - if (this->unk_1EE == 0) { - func_808F1374(this, play); + this->timer--; + if (this->timer == 0) { + EnKarebaba_SpawnIceEffects(this, play); } } else { if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.0005f)) { Item_DropCollectible(play, &this->actor.world.pos, ITEM00_NUTS_1); - func_808F238C(this); + EnKarebaba_SetupDead(this); } else { EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 1.0f); } - this->actor.scale.y = this->actor.scale.x; - this->actor.scale.z = this->actor.scale.x; + + this->actor.scale.z = this->actor.scale.y = this->actor.scale.x; } } -void func_808F20FC(EnKarebaba* this, PlayState* play) { +void EnKarebaba_SetupDeadItemDrop(EnKarebaba* this, PlayState* play) { Actor_SetScale(&this->actor, 0.03f); this->actor.shape.rot.x -= 0x4000; this->actor.shape.yOffset = 1000.0f; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; this->actor.shape.shadowScale = 3.0f; - func_800BC154(play, &play->actorCtx, &this->actor, 8); - this->unk_1EE = 200; + func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_MISC); + this->timer = 200; this->actor.flags &= ~ACTOR_FLAG_20; this->drawDmgEffAlpha = 0.0f; - this->actionFunc = func_808F21A4; + this->actionFunc = EnKarebaba_DeadItemDrop; } -void func_808F21A4(EnKarebaba* this, PlayState* play) { - if (this->unk_1EE != 0) { - this->unk_1EE--; +void EnKarebaba_DeadItemDrop(EnKarebaba* this, PlayState* play) { + if (this->timer != 0) { + this->timer--; } - if (Actor_HasParent(&this->actor, play) || (this->unk_1EE == 0)) { - func_808F238C(this); + if (Actor_HasParent(&this->actor, play) || (this->timer == 0)) { + EnKarebaba_SetupDead(this); } else { Actor_PickUpNearby(&this->actor, play, GI_STICKS_1); } } -void func_808F220C(EnKarebaba* this) { - Animation_Change(&this->skelAnime, &object_dekubaba_Anim_0002B8, -3.0f, - Animation_GetLastFrame(&object_dekubaba_Anim_0002B8), 0.0f, ANIMMODE_ONCE, -3.0f); - func_808F152C(this); - this->actionFunc = func_808F228C; +void EnKarebaba_SetupRetract(EnKarebaba* this) { + Animation_Change(&this->skelAnime, &gDekuBabaFastChompAnim, -3.0f, Animation_GetLastFrame(&gDekuBabaFastChompAnim), + 0.0f, ANIMMODE_ONCE, -3.0f); + EnKarebaba_ResetColliders(this); + this->actionFunc = EnKarebaba_Retract; } -void func_808F228C(EnKarebaba* this, PlayState* play) { +void EnKarebaba_Retract(EnKarebaba* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (Math_StepToF(&this->actor.scale.x, 0.005f, 0.0005f) && (this->actor.params == ENKAREBABA_2)) { - func_808F1648(this); + if (Math_StepToF(&this->actor.scale.x, 0.005f, 0.0005f) && (this->actor.params == KAREBABA_MINI)) { + EnKarebaba_SetupIdle(this); } - this->actor.scale.z = this->actor.scale.x; - this->actor.scale.y = this->actor.scale.x; + this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; if ((this->actor.params == ENKAREBABA_1) && Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 14.0f, 5.0f)) { - func_808F1648(this); + EnKarebaba_SetupIdle(this); } - this->actor.shape.rot.y += 0x1999; + this->actor.shape.rot.y += 0x10000 / 10; EffectSsHahen_SpawnBurst(play, &this->actor.home.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); } -void func_808F238C(EnKarebaba* this) { - Animation_Change(&this->skelAnime, &object_dekubaba_Anim_0002B8, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f); - func_808F152C(this); +void EnKarebaba_SetupDead(EnKarebaba* this) { + Animation_Change(&this->skelAnime, &gDekuBabaFastChompAnim, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f); + EnKarebaba_ResetColliders(this); this->actor.shape.rot.x = -0x4000; - this->unk_1EE = 200; + this->timer = 200; this->actor.parent = NULL; this->actor.shape.shadowScale = 0.0f; this->drawDmgEffAlpha = 0.0f; Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos); - this->actionFunc = func_808F254C; + this->actionFunc = EnKarebaba_Dead; } -void func_808F241C(EnKarebaba* this, PlayState* play) { - f32 sp1C; +void EnKarebaba_Regrow(EnKarebaba* this, PlayState* play) { + f32 scale; - this->unk_1EE++; - sp1C = this->unk_1EE * 0.05f; - Actor_SetScale(&this->actor, 0.005f * sp1C); - this->actor.world.pos.y = this->actor.home.pos.y + (14.0f * sp1C); + this->timer++; + scale = this->timer * 0.05f; + Actor_SetScale(&this->actor, 0.005f * scale); + this->actor.world.pos.y = this->actor.home.pos.y + (14.0f * scale); - if (this->unk_1EE == 20) { + if (this->timer == 20) { this->actor.flags &= ~ACTOR_FLAG_10; this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_4); if (this->actor.params == ENKAREBABA_1) { - func_800BC154(play, &play->actorCtx, &this->actor, 5); + func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY); } - func_808F1648(this); + EnKarebaba_SetupIdle(this); } } -void func_808F24F8(EnKarebaba* this) { +void EnKarebaba_SetupRegrow(EnKarebaba* this) { this->actor.shape.yOffset = 0.0f; this->actor.shape.shadowScale = 22.0f; - this->collider1.dim.radius = sCylinderInit2.dim.radius; + this->attackCollider.dim.radius = sAttackCylinderInit.dim.radius; Actor_SetScale(&this->actor, 0.0f); - this->actionFunc = func_808F241C; + this->actionFunc = EnKarebaba_Regrow; } -void func_808F254C(EnKarebaba* this, PlayState* play) { +void EnKarebaba_Dead(EnKarebaba* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (this->unk_1EE != 0) { - this->unk_1EE--; + if (this->timer != 0) { + this->timer--; } - if (this->unk_1EE == 0) { - func_808F24F8(this); + if (this->timer == 0) { + EnKarebaba_SetupRegrow(this); } } @@ -591,30 +593,30 @@ void EnKarebaba_Update(Actor* thisx, PlayState* play2) { } else { this->drawDmgEffScale = this->drawDmgEffScale; } - } else if (!Math_StepToF(&this->drawDmgEffFrozenSteamScale, 0.75f, 0.01875f)) { + } else if (!Math_StepToF(&this->drawDmgEffFrozenSteamScale, 0.75f, 0.75f / 40)) { func_800B9010(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); } } - if (this->actionFunc != func_808F254C) { - if (this->actionFunc == func_808F1C84) { + if (this->actionFunc != EnKarebaba_Dead) { + if (this->actionFunc == EnKarebaba_Dying) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 15.0f, 10.0f, 5); } else { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 4); - if (this->unk_22C == 0) { - this->unk_22C = this->actor.floorPoly; + if (this->boundFloor == 0) { + this->boundFloor = this->actor.floorPoly; } } - if ((this->actionFunc != func_808F1C84) && (this->actionFunc != func_808F200C) && - (this->actionFunc != func_808F21A4)) { - if ((this->actionFunc != func_808F241C) && (this->actionFunc != func_808F15B0)) { - CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider1.base); - CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider2.base); + if ((this->actionFunc != EnKarebaba_Dying) && (this->actionFunc != EnKarebaba_ShrinkDie) && + (this->actionFunc != EnKarebaba_DeadItemDrop)) { + if ((this->actionFunc != EnKarebaba_Regrow) && (this->actionFunc != EnKarebaba_Grow)) { + CollisionCheck_SetAT(play, &play->colChkCtx, &this->attackCollider.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->hurtCollider.base); } - CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider1.base); + CollisionCheck_SetOC(play, &play->colChkCtx, &this->attackCollider.base); Actor_SetFocus(&this->actor, (this->actor.scale.x * 10.0f) / 0.01f); max = this->actor.home.pos.y + 40.0f; @@ -625,8 +627,8 @@ void EnKarebaba_Update(Actor* thisx, PlayState* play2) { } } -void func_808F280C(EnKarebaba* this, PlayState* play) { - MtxF sp40; +void EnKarebaba_DrawShadow(EnKarebaba* this, PlayState* play) { + MtxF mf; OPEN_DISPS(play->state.gfxCtx); @@ -634,10 +636,9 @@ void func_808F280C(EnKarebaba* this, PlayState* play) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 255); - func_800C0094(this->unk_22C, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, &sp40); - Matrix_Mult(&sp40, MTXMODE_NEW); + func_800C0094(this->boundFloor, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, &mf); + Matrix_Mult(&mf, MTXMODE_NEW); Matrix_Scale(0.15f, 1.0f, 0.15f, MTXMODE_APPLY); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gCircleShadowDL); @@ -645,53 +646,53 @@ void func_808F280C(EnKarebaba* this, PlayState* play) { } void EnKarebaba_Draw(Actor* thisx, PlayState* play) { + static Color_RGBA8 sFogColor = { 0, 0, 0, 0 }; + static Gfx* sStemDLists[] = { gDekuBabaStemTopDL, gDekuBabaStemMiddleDL, gDekuBabaStemBaseDL }; EnKarebaba* this = THIS; s32 i; - s32 sp94; + s32 stemSections; s16 limbCount; - f32 sp8C = 0.01f; + f32 scale = 0.01f; OPEN_DISPS(play->state.gfxCtx); func_8012C28C(play->state.gfxCtx); - Math_Vec3f_Copy(this->limbPos, &this->actor.world.pos); + Math_Vec3f_Copy(this->bodyPartsPos, &this->actor.world.pos); - if (this->actionFunc == func_808F21A4) { - if ((this->unk_1EE > 40) || (this->unk_1EE & 1)) { + if (this->actionFunc == EnKarebaba_DeadItemDrop) { + if ((this->timer > 40) || (this->timer & 1)) { Matrix_Translate(0.0f, 0.0f, 200.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_dekubaba_DL_003070); + gSPDisplayList(POLY_OPA_DISP++, gDekuBabaStickDropDL); } - } else if (this->actionFunc != func_808F254C) { - func_800AE2A0(play, &D_808F2E28, 1, 2); + } else if (this->actionFunc != EnKarebaba_Dead) { + func_800AE2A0(play, &sFogColor, 1, 2); SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, NULL); Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); - if ((this->actionFunc == func_808F241C) || (this->actionFunc == func_808F200C) || - (this->actionFunc == func_808F15B0)) { - sp8C = this->unk_1EE * 0.0005f; + if ((this->actionFunc == EnKarebaba_Regrow) || (this->actionFunc == EnKarebaba_ShrinkDie) || + (this->actionFunc == EnKarebaba_Grow)) { + scale = this->timer * 0.0005f; } - Matrix_Scale(sp8C, sp8C, sp8C, MTXMODE_APPLY); + Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); Matrix_RotateZYX(this->actor.shape.rot.x, this->actor.shape.rot.y, 0, MTXMODE_APPLY); - if (this->actor.params == ENKAREBABA_2) { - sp94 = 1; - } else if (this->actionFunc == func_808F1C84) { - sp94 = 2; + if (this->actor.params == KAREBABA_MINI) { + stemSections = 1; + } else if (this->actionFunc == EnKarebaba_Dying) { + stemSections = 2; } else { - sp94 = 3; + stemSections = 3; } - for (i = 0; i < sp94; i++) { + for (i = 0; i < stemSections; i++) { Matrix_Translate(0.0f, 0.0f, -2000.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++, D_808F2E2C[i]); + gSPDisplayList(POLY_OPA_DISP++, sStemDLists[i]); - Matrix_MultZero(&this->limbPos[1 + i]); - if ((i == 0) && (this->actionFunc == func_808F1C84)) { + Matrix_MultZero(&this->bodyPartsPos[1 + i]); + if ((i == 0) && (this->actionFunc == EnKarebaba_Dying)) { Matrix_MultZero(&this->actor.focus.pos); } } @@ -699,41 +700,39 @@ void EnKarebaba_Draw(Actor* thisx, PlayState* play) { func_800AE5A0(play); } - func_800AE2A0(play, &D_808F2E28, 1, 2); + func_800AE2A0(play, &sFogColor, 1, 2); Matrix_Translate(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, MTXMODE_NEW); - if (this->actionFunc != func_808F15B0) { - sp8C = 0.01f; + if (this->actionFunc != EnKarebaba_Grow) { + scale = 0.01f; } - Matrix_Scale(sp8C, sp8C, sp8C, MTXMODE_APPLY); + Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); Matrix_RotateYS(this->actor.home.rot.y, 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_dekubaba_DL_0010F0); + gSPDisplayList(POLY_OPA_DISP++, gDekuBabaBaseLeavesDL); - if (this->actionFunc == func_808F1C84) { + if (this->actionFunc == EnKarebaba_Dying) { Matrix_RotateZYX(-0x4000, this->actor.shape.rot.y - this->actor.home.rot.y, 0, 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_dekubaba_DL_001828); + gSPDisplayList(POLY_OPA_DISP++, gDekuBabaStemBaseDL); - Matrix_MultZero(&this->limbPos[3]); + Matrix_MultZero(&this->bodyPartsPos[3]); } func_800AE5A0(play); - if (this->actor.params == ENKAREBABA_2) { + if (this->actor.params == KAREBABA_MINI) { limbCount = 1; } else { - limbCount = ARRAY_COUNT(this->limbPos); + limbCount = ARRAY_COUNT(this->bodyPartsPos); } - Actor_DrawDamageEffects(play, &this->actor, this->limbPos, limbCount, this->drawDmgEffScale, + Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, limbCount, this->drawDmgEffScale, this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha, this->drawDmgEffType); - if (this->unk_22C != 0) { - func_808F280C(this, play); + if (this->boundFloor != 0) { + EnKarebaba_DrawShadow(this, play); } CLOSE_DISPS(play->state.gfxCtx); 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 5063a8dbe6..aa05aec0a1 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h @@ -2,32 +2,33 @@ #define Z_EN_KAREBABA_H #include "global.h" +#include "objects/object_dekubaba/object_dekubaba.h" struct EnKarebaba; typedef void (*EnKarebabaActionFunc)(struct EnKarebaba*, PlayState*); -enum { - /* 0 */ ENKAREBABA_0, - /* 1 */ ENKAREBABA_1, - /* 2 */ ENKAREBABA_2, -}; +typedef enum { + /* 0 */ ENKAREBABA_0, // Unused, always shrinks and drops a Deku Nut + /* 1 */ ENKAREBABA_1, // Drops sticks (Only type OoT has) + /* 2 */ KAREBABA_MINI, +} KarebabaType; typedef struct EnKarebaba { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; /* 0x188 */ EnKarebabaActionFunc actionFunc; - /* 0x18C */ Vec3s jointTable[8]; - /* 0x1BC */ Vec3s morphTable[8]; + /* 0x18C */ Vec3s jointTable[DEKUBABA_LIMB_MAX]; + /* 0x1BC */ Vec3s morphTable[DEKUBABA_LIMB_MAX]; /* 0x1EC */ u8 drawDmgEffType; - /* 0x1EE */ s16 unk_1EE; + /* 0x1EE */ s16 timer; /* 0x1F0 */ f32 drawDmgEffAlpha; /* 0x1F4 */ f32 drawDmgEffScale; /* 0x1F8 */ f32 drawDmgEffFrozenSteamScale; - /* 0x1FC */ Vec3f limbPos[4]; - /* 0x22C */ CollisionPoly* unk_22C; - /* 0x230 */ ColliderCylinder collider1; - /* 0x27C */ ColliderCylinder collider2; + /* 0x1FC */ Vec3f bodyPartsPos[4]; + /* 0x22C */ CollisionPoly* boundFloor; + /* 0x230 */ ColliderCylinder attackCollider; + /* 0x27C */ ColliderCylinder hurtCollider; } EnKarebaba; // size = 0x2C8 #endif // Z_EN_KAREBABA_H diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 7dfe176114..5447b0c0f0 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -5901,48 +5901,48 @@ 0x808B0F98:("EnAm_Draw",), 0x808B1330:("EnDekubaba_Init",), 0x808B1504:("EnDekubaba_Destroy",), - 0x808B1530:("func_808B1530",), - 0x808B15B8:("func_808B15B8",), - 0x808B16BC:("func_808B16BC",), - 0x808B1798:("func_808B1798",), - 0x808B1814:("func_808B1814",), - 0x808B18A8:("func_808B18A8",), - 0x808B1B14:("func_808B1B14",), - 0x808B1BC0:("func_808B1BC0",), - 0x808B1CF0:("func_808B1CF0",), - 0x808B2158:("func_808B2158",), - 0x808B2240:("func_808B2240",), - 0x808B2608:("func_808B2608",), - 0x808B2660:("func_808B2660",), - 0x808B2890:("func_808B2890",), - 0x808B28B4:("func_808B28B4",), - 0x808B2980:("func_808B2980",), - 0x808B29C4:("func_808B29C4",), - 0x808B2C40:("func_808B2C40",), - 0x808B2CB8:("func_808B2CB8",), - 0x808B3044:("func_808B3044",), - 0x808B3078:("func_808B3078",), - 0x808B3170:("func_808B3170",), - 0x808B3280:("func_808B3280",), - 0x808B3390:("func_808B3390",), - 0x808B3404:("func_808B3404",), - 0x808B3768:("func_808B3768",), - 0x808B37E8:("func_808B37E8",), - 0x808B39AC:("func_808B39AC",), - 0x808B3B48:("func_808B3B48",), - 0x808B3BE4:("func_808B3BE4",), - 0x808B3C50:("func_808B3C50",), - 0x808B3D74:("func_808B3D74",), - 0x808B3DA8:("func_808B3DA8",), - 0x808B3E40:("func_808B3E40",), - 0x808B3EE8:("func_808B3EE8",), - 0x808B3F50:("func_808B3F50",), + 0x808B1530:("EnDekubaba_DisableHitboxes",), + 0x808B15B8:("EnDekubaba_UpdateHeadPosition",), + 0x808B16BC:("EnDekubaba_SetFireLightEffects",), + 0x808B1798:("EnDekubaba_SetFrozenEffects",), + 0x808B1814:("EnDekubaba_SpawnIceEffects",), + 0x808B18A8:("EnDekubaba_SetupWait",), + 0x808B1B14:("EnDekubaba_Wait",), + 0x808B1BC0:("EnDekubaba_SetupGrow",), + 0x808B1CF0:("EnDekubaba_Grow",), + 0x808B2158:("EnDekubaba_SetupRetract",), + 0x808B2240:("EnDekubaba_Retract",), + 0x808B2608:("EnDekubaba_SetupDecideLunge",), + 0x808B2660:("EnDekubaba_DecideLunge",), + 0x808B2890:("EnDekubaba_SetupPrepareLunge",), + 0x808B28B4:("EnDekubaba_PrepareLunge",), + 0x808B2980:("EnDekubaba_SetupLunge",), + 0x808B29C4:("EnDekubaba_Lunge",), + 0x808B2C40:("EnDekubaba_SetupPullBack",), + 0x808B2CB8:("EnDekubaba_PullBack",), + 0x808B3044:("EnDekubaba_SetupRecover",), + 0x808B3078:("EnDekubaba_Recover",), + 0x808B3170:("EnDekubaba_SetupHit",), + 0x808B3280:("EnDekubaba_Hit",), + 0x808B3390:("EnDekubaba_SetupPrunedSomersaultDie",), + 0x808B3404:("EnDekubaba_PrunedSomersaultDie",), + 0x808B3768:("EnDekubaba_SetupShrinkDie",), + 0x808B37E8:("EnDekubaba_ShrinkDie",), + 0x808B39AC:("EnDekubaba_SetupStunnedVertical",), + 0x808B3B48:("EnDekubaba_StunnedVertical",), + 0x808B3BE4:("EnDekubaba_SetupSway",), + 0x808B3C50:("EnDekubaba_Sway",), + 0x808B3D74:("EnDekubaba_SetupFrozen",), + 0x808B3DA8:("EnDekubaba_Frozen",), + 0x808B3E40:("EnDekubaba_SetupDeadStickDrop",), + 0x808B3EE8:("EnDekubaba_DeadStickDrop",), + 0x808B3F50:("EnDekubaba_UpdateDamage",), 0x808B42FC:("EnDekubaba_Update",), - 0x808B4548:("func_808B4548",), - 0x808B465C:("func_808B465C",), - 0x808B48FC:("func_808B48FC",), - 0x808B49C8:("func_808B49C8",), - 0x808B4ABC:("func_808B4ABC",), + 0x808B4548:("EnDekubaba_DrawStemRetracted",), + 0x808B465C:("EnDekubaba_DrawStemExtended",), + 0x808B48FC:("EnDekubaba_DrawStemBasePruned",), + 0x808B49C8:("EnDekubaba_DrawShadow",), + 0x808B4ABC:("EnDekubaba_PostLimbDraw",), 0x808B4AF8:("EnDekubaba_Draw",), 0x808B5230:("EnMFire1_Init",), 0x808B5294:("EnMFire1_Destroy",), @@ -6675,33 +6675,33 @@ 0x808ED3F4:("func_808ED3F4",), 0x808F1200:("EnKarebaba_Init",), 0x808F1334:("EnKarebaba_Destroy",), - 0x808F1374:("func_808F1374",), - 0x808F13FC:("func_808F13FC",), - 0x808F152C:("func_808F152C",), - 0x808F155C:("func_808F155C",), - 0x808F15B0:("func_808F15B0",), - 0x808F1648:("func_808F1648",), - 0x808F169C:("func_808F169C",), - 0x808F16FC:("func_808F16FC",), - 0x808F1778:("func_808F1778",), - 0x808F1878:("func_808F1878",), - 0x808F190C:("func_808F190C",), - 0x808F1A3C:("func_808F1A3C",), - 0x808F1A58:("func_808F1A58",), - 0x808F1BF8:("func_808F1BF8",), - 0x808F1C84:("func_808F1C84",), - 0x808F1FAC:("func_808F1FAC",), - 0x808F200C:("func_808F200C",), - 0x808F20FC:("func_808F20FC",), - 0x808F21A4:("func_808F21A4",), - 0x808F220C:("func_808F220C",), - 0x808F228C:("func_808F228C",), - 0x808F238C:("func_808F238C",), - 0x808F241C:("func_808F241C",), - 0x808F24F8:("func_808F24F8",), - 0x808F254C:("func_808F254C",), + 0x808F1374:("EnKarebaba_SpawnIceEffects",), + 0x808F13FC:("EnKarebaba_SetDamageEffects",), + 0x808F152C:("EnKarebaba_ResetColliders",), + 0x808F155C:("EnKarebaba_SetupGrow",), + 0x808F15B0:("EnKarebaba_Grow",), + 0x808F1648:("EnKarebaba_SetupIdle",), + 0x808F169C:("EnKarebaba_Idle",), + 0x808F16FC:("EnKarebaba_SetupAwaken",), + 0x808F1778:("EnKarebaba_Awaken",), + 0x808F1878:("EnKarebaba_SetupUpright",), + 0x808F190C:("EnKarebaba_Upright",), + 0x808F1A3C:("EnKarebaba_SetupSpin",), + 0x808F1A58:("EnKarebaba_Spin",), + 0x808F1BF8:("EnKarebaba_SetupDying",), + 0x808F1C84:("EnKarebaba_Dying",), + 0x808F1FAC:("EnKarebaba_SetupShrinkDie",), + 0x808F200C:("EnKarebaba_ShrinkDie",), + 0x808F20FC:("EnKarebaba_SetupDeadItemDrop",), + 0x808F21A4:("EnKarebaba_DeadItemDrop",), + 0x808F220C:("EnKarebaba_SetupRetract",), + 0x808F228C:("EnKarebaba_Retract",), + 0x808F238C:("EnKarebaba_SetupDead",), + 0x808F241C:("EnKarebaba_Regrow",), + 0x808F24F8:("EnKarebaba_SetupRegrow",), + 0x808F254C:("EnKarebaba_Dead",), 0x808F25A4:("EnKarebaba_Update",), - 0x808F280C:("func_808F280C",), + 0x808F280C:("EnKarebaba_DrawShadow",), 0x808F28F8:("EnKarebaba_Draw",), 0x808F30B0:("EnIn_ChangeAnim",), 0x808F3178:("func_808F3178",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index f88af903e3..071fce9db1 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -6431,15 +6431,15 @@ 0x808B11B0:("D_808B11B0","f32","",0x4), 0x808B11B4:("D_808B11B4","f32","",0x4), 0x808B11B8:("D_808B11B8","f32","",0x4), - 0x808B4D40:("En_Dekubaba_InitVars","UNK_TYPE1","",0x1), - 0x808B4D60:("D_808B4D60","UNK_TYPE1","",0x1), - 0x808B4E5C:("D_808B4E5C","UNK_TYPE1","",0x1), - 0x808B4E6C:("D_808B4E6C","UNK_TYPE1","",0x1), - 0x808B4E74:("D_808B4E74","UNK_TYPE1","",0x1), - 0x808B4E94:("D_808B4E94","UNK_TYPE1","",0x1), - 0x808B4E98:("D_808B4E98","UNK_TYPE1","",0x1), - 0x808B4E9C:("D_808B4E9C","UNK_TYPE1","",0x1), - 0x808B4EA0:("D_808B4EA0","UNK_PTR","",0x4), + 0x808B4D40:("En_Dekubaba_InitVars","ActorInit","",0x20), + 0x808B4D60:("sJntSphElementsInit","ColliderJntSphElementInit","[7]",0xFC), + 0x808B4E5C:("sJntSphInit","ColliderJntSphInit","",0x10), + 0x808B4E6C:("sColChkInfoInit","CollisionCheckInfoInit","",0x4), + 0x808B4E74:("sDamageTable","DamageTable","",0x20), + 0x808B4E94:("sInitChain","InitChainEntry","[1]",0x4), + 0x808B4E98:("sDustPrimColor","Color_RGBA8","",0x4), + 0x808B4E9C:("sDustEnvColor","Color_RGBA8","",0x4), + 0x808B4EA0:("sStemDLists","Gfx*","[3]",0xC), 0x808B4EB0:("D_808B4EB0","f32","",0x4), 0x808B4EB4:("D_808B4EB4","f32","",0x4), 0x808B4EB8:("D_808B4EB8","f32","",0x4), @@ -7197,8 +7197,8 @@ 0x808F2DF8:("D_808F2DF8","UNK_TYPE1","",0x1), 0x808F2E00:("D_808F2E00","UNK_TYPE1","",0x1), 0x808F2E20:("D_808F2E20","UNK_TYPE1","",0x1), - 0x808F2E28:("D_808F2E28","UNK_TYPE1","",0x1), - 0x808F2E2C:("D_808F2E2C","UNK_PTR","",0x4), + 0x808F2E28:("sFogColor","Color_RGBA8","",0x4), + 0x808F2E2C:("sStemDLists","Gfx*","[3]",0xC), 0x808F2E40:("D_808F2E40","f32","",0x4), 0x808F2E44:("D_808F2E44","f32","",0x4), 0x808F2E48:("D_808F2E48","f32","",0x4), diff --git a/undefined_syms.txt b/undefined_syms.txt index 649b781ced..f6436d5430 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -780,16 +780,6 @@ D_0600CB2C = 0x0600CB2C; D_0600CB84 = 0x0600CB84; D_0600CBC0 = 0x0600CBC0; -// ovl_En_Dekubaba - -D_06000208 = 0x06000208; -D_060002B8 = 0x060002B8; -D_060010F0 = 0x060010F0; -D_06001330 = 0x06001330; -D_06001828 = 0x06001828; -D_06002A40 = 0x06002A40; -D_06003070 = 0x06003070; - // ovl_En_Dnh D_06002950 = 0x06002950; From 6f60872ddbce56d7cb0299a53610519e349c383d Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Tue, 21 Feb 2023 13:06:22 -0500 Subject: [PATCH 03/29] Lens docs (#1123) * match MirRay_ReflectedBeam * match Actor_DrawLensActors * match func_80B9E8D4 * lens docs * more lens docs * fix * cleanup * move define down * Actor_AddToLensActors * small comment adj * add one more comment * fix bss --- include/functions.h | 2 +- include/z64.h | 2 +- include/z64actor.h | 15 +- include/z64scene.h | 2 +- src/boot_O2_g3/CIC6105.c | 1 + src/code/z_actor.c | 135 +++++++++--------- src/code/z_player_call.c | 1 + src/code/z_scene.c | 2 +- src/code/z_scene_proc.c | 1 + src/code/z_skin.c | 1 + src/overlays/actors/ovl_Boss_06/z_boss_06.c | 1 + src/overlays/actors/ovl_En_Box/z_en_box.c | 6 +- src/overlays/actors/ovl_En_Dai/z_en_dai.c | 2 +- src/overlays/actors/ovl_En_Dnb/z_en_dnb.c | 2 +- .../actors/ovl_En_Firefly/z_en_firefly.c | 2 +- .../actors/ovl_En_Floormas/z_en_floormas.c | 4 +- src/overlays/actors/ovl_En_Gg/z_en_gg.c | 20 +-- src/overlays/actors/ovl_En_Gg2/z_en_gg2.c | 18 +-- src/overlays/actors/ovl_En_Ot/z_en_ot.c | 1 - src/overlays/actors/ovl_En_Rd/z_en_rd.c | 2 +- src/overlays/actors/ovl_En_St/z_en_st.c | 6 +- .../ovl_En_Stone_heishi/z_en_stone_heishi.c | 4 +- src/overlays/actors/ovl_En_Test2/z_en_test2.c | 10 +- .../ovl_Obj_Visiblock/z_obj_visiblock.c | 2 +- tools/disasm/functions.txt | 4 +- tools/sizes/code_functions.csv | 4 +- 26 files changed, 132 insertions(+), 118 deletions(-) diff --git a/include/functions.h b/include/functions.h index 5ce1ce872a..f058547d93 100644 --- a/include/functions.h +++ b/include/functions.h @@ -721,7 +721,7 @@ void Actor_DeactivateLens(PlayState* play); void func_800B9120(ActorContext* actorCtx); void Actor_InitContext(PlayState* play, ActorContext* actorCtx, ActorEntry* actorEntry); void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx); -s32 Actor_RecordUndrawnActor(PlayState* play, Actor* actor); +s32 Actor_AddToLensActors(PlayState* play, Actor* actor); void Actor_DrawAll(PlayState* play, ActorContext* actorCtx); void func_800BA6FC(PlayState* play, ActorContext* actorCtx); void func_800BA798(PlayState* play, ActorContext* actorCtx); diff --git a/include/z64.h b/include/z64.h index 1a6fcd1d3e..fca4478add 100644 --- a/include/z64.h +++ b/include/z64.h @@ -930,7 +930,7 @@ typedef struct PlayState { /* 0x18E5C */ TexturePtr pictoPhotoI8; /* 0x18E60 */ void* unk_18E60; /* 0x18E64 */ void* unk_18E64; - /* 0x18E68 */ void* unk_18E68; + /* 0x18E68 */ void* unk_18E68; // framebuffer related to Lens of Truth /* 0x18E6C */ char unk_18E6C[0x3EC]; } PlayState; // size = 0x19258 diff --git a/include/z64actor.h b/include/z64actor.h index 370b49e753..04c8fd02a3 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -385,6 +385,13 @@ typedef struct ActorListEntry { /* 0x8 */ s32 unk_08; } ActorListEntry; // size = 0xC +typedef enum { + /* 0 */ LENS_MODE_HIDE_ACTORS, // lens actors are visible by default, and hidden by using lens (for example, fake walls) + /* 1 */ LENS_MODE_SHOW_ACTORS // lens actors are invisible by default, and shown by using lens (for example, invisible enemies) +} LensMode; + +#define LENS_ACTOR_MAX 32 + // Target size when activated #define LENS_MASK_ACTIVE_SIZE 100 @@ -399,9 +406,9 @@ typedef struct ActorContext { /* 0x00B */ s8 lensActorsDrawn; /* 0x00C */ s16 unkC; /* 0x00E */ u8 totalLoadedActors; - /* 0x00F */ u8 undrawnActorCount; + /* 0x00F */ u8 numLensActors; /* 0x010 */ ActorListEntry actorLists[ACTORCAT_MAX]; - /* 0x0A0 */ Actor* undrawnActors[32]; // Records the first 32 actors drawn each frame + /* 0x0A0 */ Actor* lensActors[LENS_ACTOR_MAX]; // Draws up to LENS_ACTOR_MAX number of invisible actors /* 0x120 */ TargetContext targetContext; /* 0x1B8 */ ActorContextSceneFlags sceneFlags; /* 0x1E4 */ TitleCardContext titleCtxt; @@ -467,8 +474,8 @@ typedef enum { #define ACTOR_FLAG_20 (1 << 5) // #define ACTOR_FLAG_40 (1 << 6) -// Invisible -#define ACTOR_FLAG_80 (1 << 7) +// hidden or revealed by Lens of Truth (depending on room lensMode) +#define ACTOR_FLAG_REACT_TO_LENS (1 << 7) // Related to talk #define ACTOR_FLAG_100 (1 << 8) // diff --git a/include/z64scene.h b/include/z64scene.h index 41198af718..66830d86d4 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -261,7 +261,7 @@ typedef struct { /* 0x02 */ u8 unk2; // 3: Room is hot /* 0x03 */ u8 unk3; /* 0x04 */ s8 echo; - /* 0x05 */ u8 unk5; + /* 0x05 */ u8 lensMode; /* 0x06 */ u8 enablePosLights; /* 0x07 */ UNK_TYPE1 pad7[0x1]; /* 0x08 */ RoomMesh* mesh; diff --git a/src/boot_O2_g3/CIC6105.c b/src/boot_O2_g3/CIC6105.c index 78eed1a775..4745ad5c89 100644 --- a/src/boot_O2_g3/CIC6105.c +++ b/src/boot_O2_g3/CIC6105.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" UNK_TYPE4 D_8009BE30; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index dcc5c0219a..a1b60fa695 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -2623,18 +2623,18 @@ void func_800B9D1C(Actor* actor) { } } -void Actor_DrawAllSetup(PlayState* play) { - play->actorCtx.undrawnActorCount = 0; +void Actor_ResetLensActors(PlayState* play) { + play->actorCtx.numLensActors = 0; play->actorCtx.lensActorsDrawn = false; } -s32 Actor_RecordUndrawnActor(PlayState* play, Actor* actor) { - if (play->actorCtx.undrawnActorCount >= 32) { +s32 Actor_AddToLensActors(PlayState* play, Actor* actor) { + if (play->actorCtx.numLensActors >= LENS_ACTOR_MAX) { return false; } - play->actorCtx.undrawnActors[play->actorCtx.undrawnActorCount] = actor; - play->actorCtx.undrawnActorCount++; + play->actorCtx.lensActors[play->actorCtx.numLensActors] = actor; + play->actorCtx.numLensActors++; return true; } @@ -2643,125 +2643,126 @@ void Actor_DrawLensOverlay(Gfx** gfxP, s32 lensMaskSize) { ((LENS_MASK_ACTIVE_SIZE - lensMaskSize) * 0.003f) + 1.0f); } -void Actor_DrawLensActors(PlayState* play, s32 numInvisibleActors, Actor** invisibleActors) { +void Actor_DrawLensActors(PlayState* play, s32 numLensActors, Actor** lensActors) { + GraphicsContext* gfxCtx = play->state.gfxCtx; + Actor** lensActor; + s32 i; + Gfx* gfx; + Gfx* gfxTemp; + void* zbuffer; + void* spA4; s32 dbgVar1; s32 dbgVar2; - s32 spB4; - Actor** invisibleActor; - Gfx* spAC; - void* spA8; - void* spA4; - GraphicsContext* gfxCtx = play->state.gfxCtx; - Gfx* tmp; s32 pad[2]; + // Remnant of debug dbgVar1 = true; dbgVar2 = true; if (dbgVar1) { - dbgVar1 = numInvisibleActors > 0; + dbgVar1 = (numLensActors > 0); } OPEN_DISPS(gfxCtx); if (dbgVar1) { - tmp = POLY_XLU_DISP; - spA8 = gfxCtx->zbuffer; + gfx = POLY_XLU_DISP; + zbuffer = gfxCtx->zbuffer; spA4 = play->unk_18E68; if (dbgVar2) { - PreRender_SetValues(&play->pauseBgPreRender, D_801FBBCC, D_801FBBCE, gfxCtx->curFrameBuffer, spA8); + PreRender_SetValues(&play->pauseBgPreRender, D_801FBBCC, D_801FBBCE, gfxCtx->curFrameBuffer, zbuffer); - spAC = tmp; - func_80170200(&play->pauseBgPreRender, &spAC, spA8, spA4); - tmp = spAC; + gfxTemp = gfx; + func_80170200(&play->pauseBgPreRender, &gfxTemp, zbuffer, spA4); + gfx = gfxTemp; } - gDPPipeSync(tmp++); - gDPSetPrimDepth(tmp++, 0, 0); + gDPPipeSync(gfx++); + gDPSetPrimDepth(gfx++, 0, 0); - gDPSetOtherMode(tmp++, + gDPSetOtherMode(gfx++, 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)); - gDPSetPrimColor(tmp++, 0, 0, 0, 0, 0, 255); + gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, 255); - if (play->roomCtx.curRoom.unk5 == 0) { - gDPSetCombineLERP(tmp++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, + if (play->roomCtx.curRoom.lensMode == LENS_MODE_HIDE_ACTORS) { + gDPSetCombineLERP(gfx++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0); } else { - gDPSetCombineMode(tmp++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + gDPSetCombineMode(gfx++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); } - spAC = tmp; - Actor_DrawLensOverlay(&spAC, play->actorCtx.lensMaskSize); - tmp = Play_SetFog(play, spAC); + gfxTemp = gfx; + Actor_DrawLensOverlay(&gfxTemp, play->actorCtx.lensMaskSize); + gfx = Play_SetFog(play, gfxTemp); - for (spB4 = 0, invisibleActor = invisibleActors; spB4 < numInvisibleActors; spB4++, invisibleActor++) { - POLY_XLU_DISP = tmp; - Actor_Draw(play, *invisibleActor); - tmp = POLY_XLU_DISP; + for (i = 0, lensActor = lensActors; i < numLensActors; i++, lensActor++) { + POLY_XLU_DISP = gfx; + Actor_Draw(play, *lensActor); + gfx = POLY_XLU_DISP; } if (dbgVar2) { - gDPPipeSync(tmp++); + gDPPipeSync(gfx++); - gDPSetOtherMode(tmp++, + gDPSetOtherMode(gfx++, 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); + gDPSetBlendColor(gfx++, 255, 255, 255, 0); + gDPSetPrimColor(gfx++, 0, 0xFF, 0, 0, 0, 32); - if (play->roomCtx.curRoom.unk5 == 0) { - gDPSetCombineMode(tmp++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + if (play->roomCtx.curRoom.lensMode == LENS_MODE_HIDE_ACTORS) { + gDPSetCombineMode(gfx++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); } else { - gDPSetCombineLERP(tmp++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, + gDPSetCombineLERP(gfx++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0); } - gDPSetColorImage(tmp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, play->pauseBgPreRender.width, spA4); + gDPSetColorImage(gfx++, G_IM_FMT_RGBA, G_IM_SIZ_16b, play->pauseBgPreRender.width, spA4); - spAC = tmp; - Actor_DrawLensOverlay(&spAC, play->actorCtx.lensMaskSize); - tmp = spAC; + gfxTemp = gfx; + Actor_DrawLensOverlay(&gfxTemp, play->actorCtx.lensMaskSize); + gfx = gfxTemp; - gDPPipeSync(tmp++); - gDPSetBlendColor(tmp++, 255, 255, 255, 8); + gDPPipeSync(gfx++); + gDPSetBlendColor(gfx++, 255, 255, 255, 8); - gDPSetColorImage(tmp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, play->pauseBgPreRender.width, + gDPSetColorImage(gfx++, 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; + gfxTemp = gfx; + func_8016FDB8(&play->pauseBgPreRender, &gfxTemp, spA4, zbuffer, 1); + gfx = gfxTemp; } - POLY_XLU_DISP = tmp; + POLY_XLU_DISP = gfx; } - tmp = OVERLAY_DISP; + gfx = OVERLAY_DISP; - gDPPipeSync(tmp++); + gDPPipeSync(gfx++); - gDPSetOtherMode(tmp++, + gDPSetOtherMode(gfx++, 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); - gDPSetCombineLERP(tmp++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, + gDPSetCombineLERP(gfx++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0); - gDPSetPrimColor(tmp++, 0, 0, 74, 0, 0, 74); + gDPSetPrimColor(gfx++, 0, 0, 74, 0, 0, 74); - spAC = tmp; - Actor_DrawLensOverlay(&spAC, play->actorCtx.lensMaskSize); - OVERLAY_DISP = spAC; + gfxTemp = gfx; + Actor_DrawLensOverlay(&gfxTemp, play->actorCtx.lensMaskSize); + OVERLAY_DISP = gfxTemp; CLOSE_DISPS(gfxCtx); } @@ -2817,7 +2818,7 @@ void Actor_DrawAll(PlayState* play, ActorContext* actorCtx) { OPEN_DISPS(play->state.gfxCtx); - Actor_DrawAllSetup(play); + Actor_ResetLensActors(play); sp58 = POLY_XLU_DISP; POLY_XLU_DISP = &sp58[1]; @@ -2841,10 +2842,11 @@ void Actor_DrawAll(PlayState* play, ActorContext* actorCtx) { actor->isDrawn = false; if ((actor->init == NULL) && (actor->draw != NULL) && (actor->flags & actorFlags)) { - if ((actor->flags & ACTOR_FLAG_80) && - ((play->roomCtx.curRoom.unk5 == 0) || (play->actorCtx.lensMaskSize == LENS_MASK_ACTIVE_SIZE) || + if ((actor->flags & ACTOR_FLAG_REACT_TO_LENS) && + ((play->roomCtx.curRoom.lensMode == LENS_MODE_HIDE_ACTORS) || + (play->actorCtx.lensMaskSize == LENS_MASK_ACTIVE_SIZE) || (actor->room != play->roomCtx.curRoom.num))) { - if (Actor_RecordUndrawnActor(play, actor)) {} + if (Actor_AddToLensActors(play, actor)) {} } else { Actor_Draw(play, actor); } @@ -2870,9 +2872,10 @@ void Actor_DrawAll(PlayState* play, ActorContext* actorCtx) { } else { Math_StepToC(&play->actorCtx.lensMaskSize, 0, 10); } + if (play->actorCtx.lensMaskSize != 0) { play->actorCtx.lensActorsDrawn = true; - Actor_DrawLensActors(play, play->actorCtx.undrawnActorCount, play->actorCtx.undrawnActors); + Actor_DrawLensActors(play, play->actorCtx.numLensActors, play->actorCtx.lensActors); } tmp2 = POLY_XLU_DISP; diff --git a/src/code/z_player_call.c b/src/code/z_player_call.c index a4ceeba955..bdc1247089 100644 --- a/src/code/z_player_call.c +++ b/src/code/z_player_call.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" #define FLAGS \ diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 48c3601074..5be9dca417 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -239,7 +239,7 @@ void Scene_HeaderCmdSpecialFiles(PlayState* play, SceneCmd* cmd) { void Scene_HeaderCmdRoomBehavior(PlayState* play, SceneCmd* cmd) { play->roomCtx.curRoom.unk3 = cmd->roomBehavior.gpFlag1; play->roomCtx.curRoom.unk2 = cmd->roomBehavior.gpFlag2 & 0xFF; - play->roomCtx.curRoom.unk5 = (cmd->roomBehavior.gpFlag2 >> 8) & 1; + play->roomCtx.curRoom.lensMode = (cmd->roomBehavior.gpFlag2 >> 8) & 1; play->msgCtx.unk12044 = (cmd->roomBehavior.gpFlag2 >> 0xA) & 1; play->roomCtx.curRoom.enablePosLights = (cmd->roomBehavior.gpFlag2 >> 0xB) & 1; play->envCtx.unk_E2 = (cmd->roomBehavior.gpFlag2 >> 0xC) & 1; diff --git a/src/code/z_scene_proc.c b/src/code/z_scene_proc.c index c899b4d83d..6ec3f2b803 100644 --- a/src/code/z_scene_proc.c +++ b/src/code/z_scene_proc.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" s32 sMatAnimStep; diff --git a/src/code/z_skin.c b/src/code/z_skin.c index 0d3e0bf85d..9bfd8d5661 100644 --- a/src/code/z_skin.c +++ b/src/code/z_skin.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" #include "z64skin.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 83a920b509..13908ec4d3 100644 --- a/src/overlays/actors/ovl_Boss_06/z_boss_06.c +++ b/src/overlays/actors/ovl_Boss_06/z_boss_06.c @@ -4,6 +4,7 @@ * 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" 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 33dd4f69fd..9529b5fdf9 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -265,7 +265,7 @@ void EnBox_Init(Actor* thisx, PlayState* play) { this->dyna.actor.flags |= ACTOR_FLAG_10; } else { if ((this->type == ENBOX_TYPE_BIG_INVISIBLE) || (this->type == ENBOX_TYPE_SMALL_INVISIBLE)) { - this->dyna.actor.flags |= ACTOR_FLAG_80; + this->dyna.actor.flags |= ACTOR_FLAG_REACT_TO_LENS; } EnBox_SetupAction(this, EnBox_WaitOpen); this->movementFlags |= ENBOX_MOVE_IMMOBILE; @@ -519,7 +519,7 @@ void EnBox_WaitOpen(EnBox* this, PlayState* play) { void EnBox_Open(EnBox* this, PlayState* play) { s32 pad; - this->dyna.actor.flags &= ~ACTOR_FLAG_80; + this->dyna.actor.flags &= ~ACTOR_FLAG_REACT_TO_LENS; if (SkelAnime_Update(&this->skelAnime)) { if (this->unk_1EC > 0) { @@ -698,7 +698,7 @@ void EnBox_Draw(Actor* thisx, PlayState* play) { } if (((this->alpha == 255) && (this->type != ENBOX_TYPE_BIG_INVISIBLE) && (this->type != ENBOX_TYPE_SMALL_INVISIBLE)) || - (!CHECK_FLAG_ALL(this->dyna.actor.flags, ACTOR_FLAG_80) && + (!CHECK_FLAG_ALL(this->dyna.actor.flags, ACTOR_FLAG_REACT_TO_LENS) && ((this->type == ENBOX_TYPE_BIG_INVISIBLE) || (this->type == ENBOX_TYPE_SMALL_INVISIBLE)))) { gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); 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 2f2496f576..2101797744 100644 --- a/src/overlays/actors/ovl_En_Dai/z_en_dai.c +++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.c @@ -642,7 +642,7 @@ void func_80B3F78C(EnDai* this, PlayState* play) { if (play->actorCtx.lensActorsDrawn) { this->unk_1CE |= 0x40; } else { - Actor_RecordUndrawnActor(play, &this->actor); + Actor_AddToLensActors(play, &this->actor); this->unk_1CE &= ~0x40; } 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 615383a27a..e967851336 100644 --- a/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c +++ b/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c @@ -8,7 +8,7 @@ #include "objects/object_hanareyama_obj/object_hanareyama_obj.h" #include "objects/gameplay_keep/gameplay_keep.h" -#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_80) +#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_REACT_TO_LENS) #define THIS ((EnDnb*)thisx) 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 5cdcd99feb..c41e6fd769 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -140,7 +140,7 @@ void EnFirefly_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); if (this->actor.params & KEESE_INVISIBLE) { - this->actor.flags |= ACTOR_FLAG_80; + this->actor.flags |= ACTOR_FLAG_REACT_TO_LENS; this->actor.params = KEESE_GET_MAIN_TYPE(thisx); this->isInvisible = true; } 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 3ad6809dcc..c66ce4b168 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -163,7 +163,7 @@ void EnFloormas_Init(Actor* thisx, PlayState* play2) { this->actor.params = ENFLOORMAS_GET_7FFF(&this->actor); if (params != 0) { - this->actor.flags |= ACTOR_FLAG_80; + this->actor.flags |= ACTOR_FLAG_REACT_TO_LENS; this->actor.draw = func_808D3754; } @@ -558,7 +558,7 @@ void func_808D19D4(EnFloormas* this) { this->drawDmgEffAlpha = 0.0f; Actor_SetScale(&this->actor, 0.004f); this->actor.flags |= ACTOR_FLAG_10; - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80)) { + if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { this->actor.draw = func_808D3754; } else { this->actor.draw = EnFloormas_Draw; 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 a6c2a31ec3..bb14b0dd07 100644 --- a/src/overlays/actors/ovl_En_Gg/z_en_gg.c +++ b/src/overlays/actors/ovl_En_Gg/z_en_gg.c @@ -8,7 +8,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_gg/object_gg.h" -#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_80) +#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_REACT_TO_LENS) #define THIS ((EnGg*)thisx) @@ -129,7 +129,7 @@ s32 func_80B34FB4(EnGg* this, PlayState* play) { pitch = Math_Vec3f_Pitch(&sp34, &sp40); if ((this->actor.xzDistToPlayer < 250.0f) && (this->actor.xzDistToPlayer > 50.0f) && - (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80) || CHECK_WEEKEVENTREG(WEEKEVENTREG_19_80))) { + (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS) || CHECK_WEEKEVENTREG(WEEKEVENTREG_19_80))) { Math_SmoothStepToS(&this->unk_2E8, pitch, 4, 0x2AA8, 1); } else { Math_SmoothStepToS(&this->unk_2E8, 0, 4, 0x2AA8, 1); @@ -230,7 +230,7 @@ void func_80B35450(EnGg* this, PlayState* play) { } if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80)) { + if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { Actor_DeactivateLens(play); } this->unk_308 = 1; @@ -239,7 +239,7 @@ void func_80B35450(EnGg* this, PlayState* play) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_19_80)) { func_800B863C(&this->actor, play); this->actor.textId = 0xCEE; - } else if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80)) { + } else if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { func_800B863C(&this->actor, play); this->actor.textId = 0xCE5; } @@ -252,7 +252,7 @@ void func_80B3556C(EnGg* this, PlayState* play) { play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; this->unk_308 = 0; - this->actor.flags &= ~ACTOR_FLAG_80; + this->actor.flags &= ~ACTOR_FLAG_REACT_TO_LENS; func_80B35250(this); } else { this->actor.textId = func_80B357F0(this); @@ -663,7 +663,7 @@ void EnGg_Init(Actor* thisx, PlayState* play) { CLEAR_WEEKEVENTREG(WEEKEVENTREG_20_04); CLEAR_WEEKEVENTREG(WEEKEVENTREG_20_08); CLEAR_WEEKEVENTREG(WEEKEVENTREG_20_10); - this->actor.flags &= ~ACTOR_FLAG_80; + this->actor.flags &= ~ACTOR_FLAG_REACT_TO_LENS; this->unk_310 = this->actor.home.pos.y; this->unk_2DC = this->actor.cutscene; this->actor.flags |= ACTOR_FLAG_2000000; @@ -683,10 +683,10 @@ void EnGg_Update(Actor* thisx, PlayState* play) { EnGg* this = THIS; if (play->actorCtx.lensMaskSize == LENS_MASK_ACTIVE_SIZE) { - this->actor.flags |= ACTOR_FLAG_80; + this->actor.flags |= ACTOR_FLAG_REACT_TO_LENS; this->actor.flags |= ACTOR_FLAG_1; } else { - this->actor.flags &= ~ACTOR_FLAG_80; + this->actor.flags &= ~ACTOR_FLAG_REACT_TO_LENS; this->actor.flags &= ~ACTOR_FLAG_1; } @@ -709,7 +709,7 @@ void EnGg_Update(Actor* thisx, PlayState* play) { } if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_91_10) && - (CHECK_WEEKEVENTREG(WEEKEVENTREG_19_80) || CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80) || + (CHECK_WEEKEVENTREG(WEEKEVENTREG_19_80) || CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS) || (this->unk_308 == 1))) { SET_WEEKEVENTREG(WEEKEVENTREG_91_10); } @@ -797,7 +797,7 @@ void EnGg_Draw(Actor* thisx, PlayState* play) { POLY_OPA_DISP = SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnGg_OverrideLimbDraw, EnGg_PostLimbDraw, &this->actor, POLY_OPA_DISP); - } else if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80) || (this->unk_308 == 1)) { + } else if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS) || (this->unk_308 == 1)) { func_8012C2DC(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B36DFC[this->unk_2E2])); 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 6da3b1378a..b2f35c49e9 100644 --- a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c +++ b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c @@ -7,7 +7,7 @@ #include "z_en_gg2.h" #include "objects/object_gg/object_gg.h" -#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_80) +#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_REACT_TO_LENS) #define THIS ((EnGg2*)thisx) @@ -89,7 +89,7 @@ s32 func_80B3AC94(EnGg2* this, PlayState* play) { pitch = Math_Vec3f_Pitch(&sp34, &sp40); if ((this->actor.xzDistToPlayer < 250.0f) && (this->actor.xzDistToPlayer > 50.0f) && - CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80)) { + CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { Math_SmoothStepToS(&this->unk_2F4, pitch, 4, 0x2AA8, 1); } else { Math_SmoothStepToS(&this->unk_2F4, 0, 4, 0x2AA8, 1); @@ -159,14 +159,14 @@ void func_80B3AFB0(EnGg2* this, PlayState* play) { this->unk_2F0 = 1; this->actionFunc = func_80B3AE60; } else if ((this->actor.xzDistToPlayer < 100.0f) && (this->actor.xzDistToPlayer > 50.0f) && - CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80)) { + CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { func_800B863C(&this->actor, play); this->actor.textId = 0xCE4; } } void func_80B3B05C(EnGg2* this, PlayState* play) { - if ((this->actor.xzDistToPlayer < 100.0f) && CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80)) { + if ((this->actor.xzDistToPlayer < 100.0f) && CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { this->actionFunc = func_80B3B5D4; } } @@ -203,7 +203,7 @@ void func_80B3B120(EnGg2* this, PlayState* play) { void func_80B3B21C(EnGg2* this, PlayState* play) { this->actor.speedXZ = 0.0f; - if ((this->actor.xzDistToPlayer < 100.0f) && CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80)) { + if ((this->actor.xzDistToPlayer < 100.0f) && CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { this->unk_2E4 = ActorCutscene_GetAdditionalCutscene(this->unk_2E4); this->actionFunc = func_80B3B5D4; } @@ -370,7 +370,7 @@ void EnGg2_Init(Actor* thisx, PlayState* play2) { SkelAnime_InitFlex(play, &this->skelAnime, &object_gg_Skel_00F6C0, &object_gg_Anim_00F578, this->jointTable, this->morphTable, 20); this->unk_1D8 = SubS_GetPathByIndex(play, ENGG2_GET_FC00(&this->actor), 0x3F); - this->actor.flags &= ~ACTOR_FLAG_80; + this->actor.flags &= ~ACTOR_FLAG_REACT_TO_LENS; this->unk_2F0 = 0; this->unk_2F1 = 0; this->unk_2F2 = 0; @@ -422,13 +422,13 @@ void EnGg2_Update(Actor* thisx, PlayState* play) { EnGg2* this = THIS; if (play->actorCtx.lensMaskSize == LENS_MASK_ACTIVE_SIZE) { - this->actor.flags |= ACTOR_FLAG_80; + this->actor.flags |= ACTOR_FLAG_REACT_TO_LENS; this->actor.flags |= ACTOR_FLAG_1; if ((this->unk_2EE == 5) && (this->unk_2EE == 7)) { this->actor.flags &= ~ACTOR_FLAG_1; } } else { - this->actor.flags &= ~ACTOR_FLAG_80; + this->actor.flags &= ~ACTOR_FLAG_REACT_TO_LENS; this->actor.flags &= ~ACTOR_FLAG_1; } @@ -481,7 +481,7 @@ void EnGg2_Draw(Actor* thisx, PlayState* play) { func_8012C2DC(play->state.gfxCtx); - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80) || (this->unk_2F0 == 1)) { + if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS) || (this->unk_2F0 == 1)) { gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B3C0AC[this->unk_2EA])); POLY_XLU_DISP = 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 5fa27e0263..fef1ebe6bb 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -5,7 +5,6 @@ */ #include "z_en_ot.h" -#include "prevent_bss_reordering.h" #include "objects/object_ot/object_ot.h" #include "objects/gameplay_keep/gameplay_keep.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 3e46c9f04a..9a51c664f8 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -266,7 +266,7 @@ void EnRd_Init(Actor* thisx, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (EN_RD_GET_TYPE(&this->actor) == EN_RD_TYPE_INVISIBLE) { - this->actor.flags |= ACTOR_FLAG_80; + this->actor.flags |= ACTOR_FLAG_REACT_TO_LENS; } if (EN_RD_GET_TYPE(&this->actor) == EN_RD_TYPE_FROZEN) { 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 14e0c1cb52..c5cc3232c6 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -699,7 +699,7 @@ void func_808A6A78(EnSt* this, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); if (ENST_GET_1C0(&this->actor) == ENST_1C0_1) { - this->actor.flags |= ACTOR_FLAG_80; + this->actor.flags |= ACTOR_FLAG_REACT_TO_LENS; } Actor_SetScale(&this->actor, 0.04f); @@ -864,8 +864,8 @@ void EnSt_Update(Actor* thisx, PlayState* play) { return; } - if (!(this->actor.flags & ACTOR_FLAG_80) && func_808A6A3C(this)) { - this->actor.flags |= ACTOR_FLAG_80; + if (!(this->actor.flags & ACTOR_FLAG_REACT_TO_LENS) && func_808A6A3C(this)) { + this->actor.flags |= ACTOR_FLAG_REACT_TO_LENS; } if (func_808A6580(this, play)) { 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 36dd9398e0..69efb56761 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 @@ -6,7 +6,7 @@ #include "z_en_stone_heishi.h" -#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_80) +#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_REACT_TO_LENS) #define THIS ((EnStoneheishi*)thisx) @@ -164,7 +164,7 @@ void func_80BC94B0(EnStoneheishi* this) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_41_40)) { // After drinking bottle EnStoneheishi_ChangeAnim(this, EN_STONE_HEISHI_ANIM_CHEER_WITH_SPEAR); this->textIdIndex = 8; - this->actor.flags &= ~ACTOR_FLAG_80; + this->actor.flags &= ~ACTOR_FLAG_REACT_TO_LENS; } else { // Initial configuration EnStoneheishi_ChangeAnim(this, EN_STONE_HEISHI_ANIM_WAVE); if (CHECK_WEEKEVENTREG(WEEKEVENTREG_41_80)) { 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 257aea2838..fd1710264b 100644 --- a/src/overlays/actors/ovl_En_Test2/z_en_test2.c +++ b/src/overlays/actors/ovl_En_Test2/z_en_test2.c @@ -12,7 +12,7 @@ #include "objects/object_meganeana_obj/object_meganeana_obj.h" #include "objects/object_haka_obj/object_haka_obj.h" -#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_80) +#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_REACT_TO_LENS) #define THIS ((EnTest2*)thisx) @@ -96,7 +96,7 @@ void EnTest2_Update(Actor* thisx, PlayState* play) { Actor_SetObjectDependency(play, &this->actor); this->animMat = Lib_SegmentedToVirtual(modelInfo->animMat); } - if (play->roomCtx.curRoom.unk5) { + if (play->roomCtx.curRoom.lensMode != LENS_MODE_HIDE_ACTORS) { this->actor.update = EnTest2_UpdateForLens; } else { this->actor.update = Actor_Noop; @@ -108,9 +108,9 @@ void EnTest2_UpdateForLens(Actor* thisx, PlayState* play) { EnTest2* this = THIS; if (play->actorCtx.lensMaskSize == LENS_MASK_ACTIVE_SIZE) { - this->actor.flags |= ACTOR_FLAG_80; + this->actor.flags |= ACTOR_FLAG_REACT_TO_LENS; } else { - this->actor.flags &= ~ACTOR_FLAG_80; + this->actor.flags &= ~ACTOR_FLAG_REACT_TO_LENS; } } @@ -122,7 +122,7 @@ void EnTest2_Draw(Actor* thisx, PlayState* play) { if (this->animMat != NULL) { AnimatedMat_Draw(play, this->animMat); } - if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80)) { + if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { OPEN_DISPS(play->state.gfxCtx); func_8012C2DC(play->state.gfxCtx); 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 4b0a797f6e..9859d9c0f5 100644 --- a/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c +++ b/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c @@ -7,7 +7,7 @@ #include "z_obj_visiblock.h" #include "objects/object_visiblock/object_visiblock.h" -#define FLAGS (ACTOR_FLAG_80) +#define FLAGS (ACTOR_FLAG_REACT_TO_LENS) #define THIS ((ObjVisiblock*)thisx) diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 5447b0c0f0..9d371e8ba3 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -819,8 +819,8 @@ 0x800B9780:("Actor_UpdateAll",), 0x800B9A04:("Actor_Draw",), 0x800B9D1C:("func_800B9D1C",), - 0x800B9E3C:("Actor_DrawAllSetup",), - 0x800B9E4C:("Actor_RecordUndrawnActor",), + 0x800B9E3C:("Actor_ResetLensActors",), + 0x800B9E4C:("Actor_AddToLensActors",), 0x800B9E84:("Actor_DrawLensOverlay",), 0x800B9EF4:("Actor_DrawLensActors",), 0x800BA2D8:("func_800BA2D8",), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 3e1befd914..a43e421075 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -333,8 +333,8 @@ asm/non_matchings/code/z_actor/Actor_UpdateActor.s,Actor_UpdateActor,0x800B948C, asm/non_matchings/code/z_actor/Actor_UpdateAll.s,Actor_UpdateAll,0x800B9780,0xA1 asm/non_matchings/code/z_actor/Actor_Draw.s,Actor_Draw,0x800B9A04,0xC6 asm/non_matchings/code/z_actor/func_800B9D1C.s,func_800B9D1C,0x800B9D1C,0x48 -asm/non_matchings/code/z_actor/Actor_DrawAllSetup.s,Actor_DrawAllSetup,0x800B9E3C,0x4 -asm/non_matchings/code/z_actor/Actor_RecordUndrawnActor.s,Actor_RecordUndrawnActor,0x800B9E4C,0xE +asm/non_matchings/code/z_actor/Actor_ResetLensActors.s,Actor_ResetLensActors,0x800B9E3C,0x4 +asm/non_matchings/code/z_actor/Actor_AddToLensActors.s,Actor_AddToLensActors,0x800B9E4C,0xE asm/non_matchings/code/z_actor/Actor_DrawLensOverlay.s,Actor_DrawLensOverlay,0x800B9E84,0x1C asm/non_matchings/code/z_actor/Actor_DrawLensActors.s,Actor_DrawLensActors,0x800B9EF4,0xF9 asm/non_matchings/code/z_actor/func_800BA2D8.s,func_800BA2D8,0x800BA2D8,0x9 From 5941e09b220c255cd0b1208d1040151e9ea09359 Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Tue, 21 Feb 2023 10:36:56 -0800 Subject: [PATCH 04/29] Fbdemo (TransitionTile) OK (#1163) * Fbdemo OK * Cleanup * sync and format * Fix functions.h * format * SQ --- include/PR/gbi.h | 8 +- include/functions.h | 17 ++- include/variables.h | 5 +- include/z64.h | 5 - include/z64transition.h | 32 ++++- spec | 2 +- src/code/z_fbdemo.c | 221 +++++++++++++++++++++++++++++++-- src/code/z_play.c | 63 +++++----- src/code/z_rcp.c | 2 +- tools/disasm/files.txt | 1 + tools/disasm/functions.txt | 16 +-- tools/disasm/variables.txt | 5 +- tools/sizes/code_functions.csv | 16 +-- 13 files changed, 308 insertions(+), 85 deletions(-) diff --git a/include/PR/gbi.h b/include/PR/gbi.h index 07fa0ac2c7..3ba8748b0b 100644 --- a/include/PR/gbi.h +++ b/include/PR/gbi.h @@ -4082,7 +4082,7 @@ _DW({ \ #define gDPLoadTextureTile(pkt, timg, fmt, siz, width, height, \ uls, ult, lrs, lrt, pal, \ cms, cmt, masks, maskt, shifts, shiftt) \ -{ \ +_DW({ \ gDPSetTextureImage(pkt, fmt, siz, width, timg); \ gDPSetTile(pkt, fmt, siz, \ (((((lrs)-(uls)+1) * siz##_TILE_BYTES)+7)>>3), 0, \ @@ -4104,7 +4104,7 @@ _DW({ \ (ult)<modelView); + guMtxIdent(&this->unk_98); + guOrtho(&this->projection, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT, 0.0f, -1000.0f, 1000.0f, 1.0f); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo/TransitionUnk_Init.s") + for (frame = 0; frame < 2; frame++) { + this->frame = frame; + vtx = (this->frame == 0) ? this->vtxFrame1 : this->vtxFrame2; + for (rowTex = 0, row = 0; row < (this->rows + 1); row++, rowTex += 0x20) { + for (colTex = 0, col = 0; col < (this->cols + 1); col++, colTex += 0x20) { + Vtx_tn* vtxn = &vtx->n; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo/func_80164438.s") + // clang-format off + vtx++; \ + vtxn->tc[0] = colTex << 6; \ + vtxn->ob[0] = col * 0x20; \ + vtxn->ob[1] = row * 0x20; \ + vtxn->ob[2] = -5; \ + vtxn->flag = 0; \ + vtxn->tc[1] = rowTex << 6; \ + vtxn->n[0] = 0; \ + vtxn->n[1] = 0; \ + vtxn->n[2] = 120; \ + vtxn->a = 255; + // clang-format on + } + } + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo/TransitionUnk_Draw.s") + gfx = this->gfx; + for (rowTex = 0, row = 0; row < this->rows; row++, rowTex += 0x20) { + gSPVertex(gfx++, SEGMENT_ADDR(0xA, (u32)row * (this->cols + 1) * sizeof(Vtx)), 2 * (this->cols + 1), 0); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo/func_80164678.s") + colTex = 0; + col2 = 0; + col = 0; + while (col < this->cols) { + gDPPipeSync(gfx++); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo/func_801647AC.s") + gDPLoadTextureTile(gfx++, SEGMENT_ADDR(0xB, 0), G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, SCREEN_HEIGHT, + colTex, rowTex, colTex + 0x20, rowTex + 0x20, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo/func_801647B8.s") + gSP1Quadrangle(gfx++, col, col + 1, col2 + this->cols + 2, this->cols + col2 + 1, 0); + + colTex += 0x20; + col2++; + col++; + } + } + + gDPPipeSync(gfx++); + gSPEndDisplayList(gfx++); +} + +void TransitionTile_InitVtxData(TransitionTile* this) { + s32 row; + s32 col; + + for (row = 0; row < this->rows + 1; row++) { + for (col = 0; col < this->cols + 1; col++) { + (this->vtxData + col + row * (this->cols + 1))->x = col * 0x20; + (this->vtxData + col + row * (this->cols + 1))->y = row * 0x20; + } + } +} + +void TransitionTile_Destroy(TransitionTile* this) { + Sleep_Msec(100); + + if (this->vtxData != NULL) { + SystemArena_Free(this->vtxData); + this->vtxData = NULL; + } + if (this->vtxFrame1 != NULL) { + SystemArena_Free(this->vtxFrame1); + this->vtxFrame1 = NULL; + } + if (this->vtxFrame2 != NULL) { + SystemArena_Free(this->vtxFrame2); + this->vtxFrame2 = NULL; + } + if (this->gfx != NULL) { + SystemArena_Free(this->gfx); + this->gfx = NULL; + } +} + +TransitionTile* TransitionTile_Init(TransitionTile* this, s32 cols, s32 rows) { + s32 gridSize; + + bzero(this, sizeof(TransitionTile)); + this->frame = 0; + this->cols = cols; + this->rows = rows; + gridSize = (cols + 1) * (rows + 1); + this->vtxData = SystemArena_Malloc(gridSize * sizeof(TransitionTileVtxData)); + this->vtxFrame1 = SystemArena_Malloc(gridSize * sizeof(Vtx)); + this->vtxFrame2 = SystemArena_Malloc(gridSize * sizeof(Vtx)); + this->gfx = SystemArena_Malloc(((cols * 9 + 1) * rows + 2) * sizeof(Gfx)); + + if ((this->vtxData == NULL) || (this->vtxFrame1 == NULL) || (this->vtxFrame2 == NULL) || (this->gfx == NULL)) { + if (this->vtxData != NULL) { + SystemArena_Free(this->vtxData); + this->vtxData = NULL; + } + if (this->vtxFrame1 != NULL) { + SystemArena_Free(this->vtxFrame1); + this->vtxFrame1 = NULL; + } + if (this->vtxFrame2 != NULL) { + SystemArena_Free(this->vtxFrame2); + this->vtxFrame2 = NULL; + } + if (this->gfx != NULL) { + SystemArena_Free(this->gfx); + this->gfx = NULL; + } + return NULL; + } + + TransitionTile_InitGraphics(this); + TransitionTile_InitVtxData(this); + this->frame = 0; + + return this; +} + +void TransitionTile_SetVtx(TransitionTile* this) { + s32 row; + s32 col; + Vtx* vtx; + + for (row = 0; row < this->rows + 1; row++) { + for (col = 0; col < this->cols + 1; col++) { + vtx = (this->frame == 0) ? this->vtxFrame1 : this->vtxFrame2; + (vtx + col + row * (this->cols + 1))->n.ob[0] = (this->vtxData + col + row * (this->cols + 1))->x; + + vtx = (this->frame == 0) ? this->vtxFrame1 : this->vtxFrame2; + (vtx + col + row * (this->cols + 1))->n.ob[1] = (this->vtxData + col + row * (this->cols + 1))->y; + } + } +} + +void TransitionTile_Draw(TransitionTile* this, Gfx** gfxP) { + Gfx* gfx = *gfxP; + + gSPDisplayList(gfx++, sTransTileSetupDL); + TransitionTile_SetVtx(this); + gSPMatrix(gfx++, &this->projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gfx++, &this->modelView, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPSegment(gfx++, 0xA, this->frame == 0 ? this->vtxFrame1 : this->vtxFrame2); + gSPSegment(gfx++, 0xB, this->zBuffer); + gSPDisplayList(gfx++, sTransTileSetupDL); + gSPDisplayList(gfx++, this->gfx); + gDPPipeSync(gfx++); + this->frame ^= 1; + *gfxP = gfx; +} + +void TransitionTile_Suck(TransitionTile* this) { + s32 row; + s32 col; + f32 diffX; + f32 diffY; + f32 scale; + + for (row = 0; row < this->rows + 1; row++) { + for (col = 0; col < this->cols + 1; col++) { + diffX = (this->vtxData + col + row * (this->cols + 1))->x - (this->vtxData + 5 + 4 * (this->cols + 1))->x; + diffY = (this->vtxData + col + row * (this->cols + 1))->y - (this->vtxData + 5 + 4 * (this->cols + 1))->y; + scale = (SQ(diffX) + SQ(diffY)) / SQ(10.0f); + if (scale != 0.0f) { + if (scale < 1.0f) { + scale = 1.0f; + } + (this->vtxData + col + row * (this->cols + 1))->x -= diffX / scale; + (this->vtxData + col + row * (this->cols + 1))->y -= diffY / scale; + } + } + } +} + +void TransitionTile_Update(TransitionTile* this) { +} + +s32 func_801647B8(TransitionTile* this) { + return 0; +} diff --git a/src/code/z_play.c b/src/code/z_play.c index b33b449d28..740f79d9e1 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -13,9 +13,8 @@ u8 D_801D0D54 = false; s16 sTransitionFillTimer; Input D_801F6C18; -FbDemoStruct sTrnsnUnk; -u16* D_801F6D0C; -s32 gTrnsnUnkState; +TransitionTile sTransitionTile; +s32 gTransitionTileState; VisMono sVisMono; Color_RGBA8_u32 gVisMonoColor; Struct_80140E80 D_801F6D38; @@ -389,9 +388,9 @@ void Play_Destroy(GameState* thisx) { EffectSS_Clear(this); CollisionCheck_DestroyContext(this, &this->colChkCtx); - if (gTrnsnUnkState == 3) { - TransitionUnk_Destroy(&sTrnsnUnk); - gTrnsnUnkState = 0; + if (gTransitionTileState == TRANS_TILE_READY) { + TransitionTile_Destroy(&sTransitionTile); + gTransitionTileState = TRANS_TILE_OFF; } if ((this->transitionMode == TRANS_MODE_INSTANCE_RUNNING) || D_801D0D54) { @@ -710,9 +709,9 @@ void Play_UpdateTransition(PlayState* this) { Play_ClearTransition(this); } this->transitionMode = TRANS_MODE_OFF; - if (gTrnsnUnkState == 3) { - TransitionUnk_Destroy(&sTrnsnUnk); - gTrnsnUnkState = 0; + if (gTransitionTileState == TRANS_TILE_READY) { + TransitionTile_Destroy(&sTransitionTile); + gTransitionTileState = TRANS_TILE_OFF; Game_SetFramerateDivisor(&this->state, 3); } } @@ -759,7 +758,7 @@ void Play_UpdateTransition(PlayState* this) { this->envCtx.screenFillColor[3] = (1.0f - (sTransitionFillTimer / 20.0f)) * 255.0f; if (sTransitionFillTimer >= 20) { - gTrnsnUnkState = 0; + gTransitionTileState = TRANS_TILE_OFF; Game_SetFramerateDivisor(&this->state, 3); this->transitionTrigger = TRANS_TRIGGER_OFF; this->transitionMode = TRANS_MODE_OFF; @@ -793,7 +792,7 @@ void Play_UpdateTransition(PlayState* this) { this->transitionTrigger = TRANS_TRIGGER_OFF; this->transitionMode = TRANS_MODE_OFF; } else { - gTrnsnUnkState = 0; + gTransitionTileState = TRANS_TILE_OFF; Game_SetFramerateDivisor(&this->state, 3); this->transitionTrigger = TRANS_TRIGGER_OFF; this->transitionMode = TRANS_MODE_OFF; @@ -822,7 +821,7 @@ void Play_UpdateTransition(PlayState* this) { func_8019F128(NA_SE_EV_SAND_STORM - SFX_FLAG); if (this->transitionTrigger == TRANS_TRIGGER_END) { if (this->envCtx.sandstormPrimA < 110) { - gTrnsnUnkState = 0; + gTransitionTileState = TRANS_TILE_OFF; Game_SetFramerateDivisor(&this->state, 3); this->transitionTrigger = TRANS_TRIGGER_OFF; this->transitionMode = TRANS_MODE_OFF; @@ -858,7 +857,7 @@ void Play_UpdateTransition(PlayState* this) { if (this->transitionTrigger == TRANS_TRIGGER_END) { if (this->envCtx.sandstormPrimA <= 0) { - gTrnsnUnkState = 0; + gTransitionTileState = TRANS_TILE_OFF; Game_SetFramerateDivisor(&this->state, 3); this->transitionTrigger = TRANS_TRIGGER_OFF; this->transitionMode = TRANS_MODE_OFF; @@ -881,7 +880,7 @@ void Play_UpdateTransition(PlayState* this) { this->envCtx.screenFillColor[3] = gSaveContext.cutsceneTransitionControl; if (gSaveContext.cutsceneTransitionControl <= 100) { - gTrnsnUnkState = 0; + gTransitionTileState = TRANS_TILE_OFF; Game_SetFramerateDivisor(&this->state, 3); this->transitionTrigger = TRANS_TRIGGER_OFF; this->transitionMode = TRANS_MODE_OFF; @@ -922,25 +921,28 @@ void Play_UpdateMain(PlayState* this) { this->transitionMode = TRANS_MODE_SETUP; } - if (gTrnsnUnkState != 0) { - switch (gTrnsnUnkState) { - case 2: - if (TransitionUnk_Init(&sTrnsnUnk, 10, 7) == NULL) { - gTrnsnUnkState = 0; + if (gTransitionTileState != TRANS_TILE_OFF) { + switch (gTransitionTileState) { + case TRANS_TILE_PROCESS: + if (TransitionTile_Init(&sTransitionTile, 10, 7) == NULL) { + gTransitionTileState = TRANS_TILE_OFF; } else { - D_801F6D0C = gZBufferPtr; - gTrnsnUnkState = 3; + sTransitionTile.zBuffer = gZBufferPtr; + gTransitionTileState = TRANS_TILE_READY; Game_SetFramerateDivisor(&this->state, 1); } break; - case 3: - func_801647AC(&sTrnsnUnk); + case TRANS_TILE_READY: + TransitionTile_Update(&sTransitionTile); + break; + + default: break; } } Play_UpdateTransition(this); - if (gTrnsnUnkState != 3) { + if (gTransitionTileState != TRANS_TILE_READY) { if ((gSaveContext.gameMode == 0) && (((this->msgCtx.msgMode == 0)) || ((this->msgCtx.currentTextId == 0xFF) && (this->msgCtx.msgMode == 0x42) && @@ -1121,7 +1123,7 @@ void Play_DrawMain(PlayState* this) { R_PAUSE_BG_PRERENDER_STATE = PAUSE_BG_PRERENDER_OFF; } - if ((R_PAUSE_BG_PRERENDER_STATE <= PAUSE_BG_PRERENDER_SETUP) && (gTrnsnUnkState < 2)) { + if ((R_PAUSE_BG_PRERENDER_STATE <= PAUSE_BG_PRERENDER_SETUP) && (gTransitionTileState <= TRANS_TILE_SETUP)) { if (this->skyboxCtx.skyboxShouldDraw || (this->roomCtx.curRoom.mesh->type0.type == 1)) { func_8012CF0C(gfxCtx, false, true, 0, 0, 0); } else { @@ -1226,10 +1228,10 @@ void Play_DrawMain(PlayState* this) { POLY_OPA_DISP = sp218; } - if (gTrnsnUnkState == 3) { + if (gTransitionTileState == TRANS_TILE_READY) { Gfx* sp90 = POLY_OPA_DISP; - TransitionUnk_Draw(&sTrnsnUnk, &sp90); + TransitionTile_Draw(&sTransitionTile, &sp90); POLY_OPA_DISP = sp90; sp25B = true; goto PostWorldDraw; @@ -1362,7 +1364,8 @@ void Play_DrawMain(PlayState* this) { Play_DrawMotionBlur(this); - if (((R_PAUSE_BG_PRERENDER_STATE == PAUSE_BG_PRERENDER_SETUP) || (gTrnsnUnkState == 1)) || + if (((R_PAUSE_BG_PRERENDER_STATE == PAUSE_BG_PRERENDER_SETUP) || + (gTransitionTileState == TRANS_TILE_SETUP)) || (R_PICTO_PHOTO_STATE == PICTO_PHOTO_STATE_SETUP)) { Gfx* sp74; Gfx* sp70 = POLY_OPA_DISP; @@ -1380,7 +1383,7 @@ void Play_DrawMain(PlayState* this) { this->pauseBgPreRender.fbufSave = gfxCtx->zbuffer; this->pauseBgPreRender.cvgSave = this->unk_18E58; } else { - gTrnsnUnkState = 2; + gTransitionTileState = TRANS_TILE_PROCESS; this->pauseBgPreRender.fbufSave = gfxCtx->zbuffer; this->pauseBgPreRender.cvgSave = NULL; } @@ -2241,7 +2244,7 @@ void Play_Init(GameState* thisx) { this->unk_18E68 = D_80784600; this->unk_18E58 = D_80784600; this->unk_18E60 = D_80784600; - gTrnsnUnkState = 0; + gTransitionTileState = TRANS_TILE_OFF; this->transitionMode = TRANS_MODE_OFF; D_801D0D54 = false; diff --git a/src/code/z_rcp.c b/src/code/z_rcp.c index 7e15a9bde1..b4bb6ea7da 100644 --- a/src/code/z_rcp.c +++ b/src/code/z_rcp.c @@ -1299,7 +1299,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_BG_PRERENDER_STATE <= PAUSE_BG_PRERENDER_SETUP) && (gTrnsnUnkState < 2)) { + if ((R_PAUSE_BG_PRERENDER_STATE <= PAUSE_BG_PRERENDER_SETUP) && (gTransitionTileState <= TRANS_TILE_SETUP)) { func_8012CF0C(gfxCtx, true, true, r, g, b); } else { func_8012CF0C(gfxCtx, false, false, r, g, b); diff --git a/tools/disasm/files.txt b/tools/disasm/files.txt index 2a79674bf6..9b97a8fc3d 100644 --- a/tools/disasm/files.txt +++ b/tools/disasm/files.txt @@ -570,6 +570,7 @@ 0x801D0B70 : "z_kaleido_manager", 0x801D0BB0 : "", 0x801D0C80 : "z_fbdemo", + 0x801D0CB0 : "z_fbdemo_fade", 0x801D0D00 : "z_fbdemo_circle", 0x801D0D50 : "z_play", 0x801D0D80 : "z_play_hireso", diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 9d371e8ba3..186d8a3ec1 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -2938,14 +2938,14 @@ 0x80163C0C:("KaleidoScopeCall_Draw",), 0x80163C90:("Transition_Init",), 0x80163D80:("Transition_Destroy",), - 0x80163DC0:("func_80163DC0",), - 0x8016418C:("func_8016418C",), - 0x8016424C:("TransitionUnk_Destroy",), - 0x801642D8:("TransitionUnk_Init",), - 0x80164438:("func_80164438",), - 0x8016454C:("TransitionUnk_Draw",), - 0x80164678:("func_80164678",), - 0x801647AC:("func_801647AC",), + 0x80163DC0:("TransitionTile_InitGraphics",), + 0x8016418C:("TransitionTile_InitVtxData",), + 0x8016424C:("TransitionTile_Destroy",), + 0x801642D8:("TransitionTile_Init",), + 0x80164438:("TransitionTile_SetVtx",), + 0x8016454C:("TransitionTile_Draw",), + 0x80164678:("TransitionTile_Suck",), + 0x801647AC:("TransitionTile_Update",), 0x801647B8:("func_801647B8",), 0x801647D0:("TransitionFade_Start",), 0x8016482C:("TransitionFade_Init",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 071fce9db1..c723f48d49 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -4053,9 +4053,8 @@ 0x801F6C04:("sKaleidoScopeDrawFunc","void*","",0x4), 0x801F6C10:("sTransitionFillTimer","UNK_TYPE1","",0x1), 0x801F6C18:("D_801F6C18","Input","",0x18), - 0x801F6C30:("sTrnsnUnk","UNK_TYPE1","",0x1), - 0x801F6D0C:("D_801F6D0C","UNK_TYPE1","",0x1), - 0x801F6D10:("gTrnsnUnkState","UNK_TYPE4","",0x4), + 0x801F6C30:("sTransitionTile","TransitionTile","",0xE0), + 0x801F6D10:("gTransitionTileState","UNK_TYPE4","",0x4), 0x801F6D18:("sVisMono","UNK_TYPE1","",0x1), 0x801F6D30:("gVisMonoColor","Color_RGBA8","",0x4), 0x801F6D38:("D_801F6D38","UNK_TYPE1","",0x1), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index a43e421075..7b7e4b1b4a 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -2452,14 +2452,14 @@ asm/non_matchings/code/z_kaleido_scope_call/func_80163A58.s,func_80163A58,0x8016 asm/non_matchings/code/z_kaleido_scope_call/func_80163C0C.s,func_80163C0C,0x80163C0C,0x21 asm/non_matchings/code/z_fbdemo_dlftbls/Transition_Init.s,Transition_Init,0x80163C90,0x3C asm/non_matchings/code/z_fbdemo_dlftbls/Transition_Destroy.s,Transition_Destroy,0x80163D80,0x10 -asm/non_matchings/code/z_fbdemo/func_80163DC0.s,func_80163DC0,0x80163DC0,0xF3 -asm/non_matchings/code/z_fbdemo/func_8016418C.s,func_8016418C,0x8016418C,0x30 -asm/non_matchings/code/z_fbdemo/TransitionUnk_Destroy.s,TransitionUnk_Destroy,0x8016424C,0x23 -asm/non_matchings/code/z_fbdemo/TransitionUnk_Init.s,TransitionUnk_Init,0x801642D8,0x58 -asm/non_matchings/code/z_fbdemo/func_80164438.s,func_80164438,0x80164438,0x45 -asm/non_matchings/code/z_fbdemo/TransitionUnk_Draw.s,TransitionUnk_Draw,0x8016454C,0x4B -asm/non_matchings/code/z_fbdemo/func_80164678.s,func_80164678,0x80164678,0x4D -asm/non_matchings/code/z_fbdemo/func_801647AC.s,func_801647AC,0x801647AC,0x3 +asm/non_matchings/code/z_fbdemo/TransitionTile_InitGraphics.s,TransitionTile_InitGraphics,0x80163DC0,0xF3 +asm/non_matchings/code/z_fbdemo/TransitionTile_InitVtxData.s,TransitionTile_InitVtxData,0x8016418C,0x30 +asm/non_matchings/code/z_fbdemo/TransitionTile_Destroy.s,TransitionTile_Destroy,0x8016424C,0x23 +asm/non_matchings/code/z_fbdemo/TransitionTile_Init.s,TransitionTile_Init,0x801642D8,0x58 +asm/non_matchings/code/z_fbdemo/TransitionTile_SetVtx.s,TransitionTile_SetVtx,0x80164438,0x45 +asm/non_matchings/code/z_fbdemo/TransitionTile_Draw.s,TransitionTile_Draw,0x8016454C,0x4B +asm/non_matchings/code/z_fbdemo/TransitionTile_Suck.s,TransitionTile_Suck,0x80164678,0x4D +asm/non_matchings/code/z_fbdemo/TransitionTile_Update.s,TransitionTile_Update,0x801647AC,0x3 asm/non_matchings/code/z_fbdemo/func_801647B8.s,func_801647B8,0x801647B8,0x6 asm/non_matchings/code/z_fbdemo_fade/TransitionFade_Start.s,TransitionFade_Start,0x801647D0,0x17 asm/non_matchings/code/z_fbdemo_fade/TransitionFade_Init.s,TransitionFade_Init,0x8016482C,0xB From 5bc388b9a9ca77457b5378619e79f64e8e762314 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Tue, 21 Feb 2023 16:05:12 -0300 Subject: [PATCH 05/29] Introduce `object_table.h` (#1136) * object_table * segmentsymbols * format * review Co-authored-by: Derek Hensley * bss * add more descriptions to the object_table * DEFINE_OBJECT_SIZE_ZERO * Update include/tables/object_table.h Co-authored-by: EllipticEllipsis * Rename `z_scene_dlftbls.c` to `object_table.c` * bss * bss * bss * bss --------- Co-authored-by: Derek Hensley Co-authored-by: EllipticEllipsis --- include/segment_symbols.h | 474 +------------ include/tables/object_table.h | 659 ++++++++++++++++++ include/variables.h | 7 +- include/z64object.h | 656 +---------------- spec | 2 +- src/code/object_table.c | 24 + .../actors/ovl_En_Fishing/z_en_fishing.c | 1 + tools/disasm/files.txt | 2 +- tools/disasm/variables.txt | 3 +- 9 files changed, 714 insertions(+), 1114 deletions(-) create mode 100644 include/tables/object_table.h create mode 100644 src/code/object_table.c diff --git a/include/segment_symbols.h b/include/segment_symbols.h index ccb5488d13..d8be247773 100644 --- a/include/segment_symbols.h +++ b/include/segment_symbols.h @@ -126,470 +126,15 @@ DECLARE_OVERLAY_SEGMENT(fbdemo_wipe4) DECLARE_OVERLAY_SEGMENT(fbdemo_wipe5) DECLARE_OVERLAY_SEGMENT(Effect_Ss_Sbn) -DECLARE_ROM_SEGMENT(gameplay_keep) -DECLARE_ROM_SEGMENT(gameplay_field_keep) -DECLARE_ROM_SEGMENT(gameplay_dangeon_keep) -DECLARE_ROM_SEGMENT(object_link_boy) -DECLARE_ROM_SEGMENT(object_link_child) -DECLARE_ROM_SEGMENT(object_link_goron) -DECLARE_ROM_SEGMENT(object_link_zora) -DECLARE_ROM_SEGMENT(object_link_nuts) -DECLARE_ROM_SEGMENT(object_mask_ki_tan) -DECLARE_ROM_SEGMENT(object_mask_rabit) -DECLARE_ROM_SEGMENT(object_mask_skj) -DECLARE_ROM_SEGMENT(object_mask_truth) -DECLARE_ROM_SEGMENT(object_mask_gibudo) -DECLARE_ROM_SEGMENT(object_mask_json) -DECLARE_ROM_SEGMENT(object_mask_kerfay) -DECLARE_ROM_SEGMENT(object_mask_bigelf) -DECLARE_ROM_SEGMENT(object_mask_kyojin) -DECLARE_ROM_SEGMENT(object_mask_romerny) -DECLARE_ROM_SEGMENT(object_mask_posthat) -DECLARE_ROM_SEGMENT(object_mask_zacho) -DECLARE_ROM_SEGMENT(object_mask_stone) -DECLARE_ROM_SEGMENT(object_mask_bree) -DECLARE_ROM_SEGMENT(object_mask_gero) -DECLARE_ROM_SEGMENT(object_mask_yofukasi) -DECLARE_ROM_SEGMENT(object_mask_meoto) -DECLARE_ROM_SEGMENT(object_mask_dancer) -DECLARE_ROM_SEGMENT(object_mask_bakuretu) -DECLARE_ROM_SEGMENT(object_mask_bu_san) -DECLARE_ROM_SEGMENT(object_mask_goron) -DECLARE_ROM_SEGMENT(object_mask_zora) -DECLARE_ROM_SEGMENT(object_mask_nuts) -DECLARE_ROM_SEGMENT(object_mask_boy) -DECLARE_ROM_SEGMENT(object_box) -DECLARE_ROM_SEGMENT(object_okuta) -DECLARE_ROM_SEGMENT(object_wallmaster) -DECLARE_ROM_SEGMENT(object_dy_obj) -DECLARE_ROM_SEGMENT(object_firefly) -DECLARE_ROM_SEGMENT(object_dodongo) -DECLARE_ROM_SEGMENT(object_niw) -DECLARE_ROM_SEGMENT(object_tite) -DECLARE_ROM_SEGMENT(object_ph) -DECLARE_ROM_SEGMENT(object_dinofos) -DECLARE_ROM_SEGMENT(object_zl1) -DECLARE_ROM_SEGMENT(object_bubble) -DECLARE_ROM_SEGMENT(object_test3) -DECLARE_ROM_SEGMENT(object_famos) -DECLARE_ROM_SEGMENT(object_st) -DECLARE_ROM_SEGMENT(object_thiefbird) -DECLARE_ROM_SEGMENT(object_bombf) -DECLARE_ROM_SEGMENT(object_am) -DECLARE_ROM_SEGMENT(object_dekubaba) -DECLARE_ROM_SEGMENT(object_warp1) -DECLARE_ROM_SEGMENT(object_b_heart) -DECLARE_ROM_SEGMENT(object_dekunuts) -DECLARE_ROM_SEGMENT(object_bb) -DECLARE_ROM_SEGMENT(object_death) -DECLARE_ROM_SEGMENT(object_hata) -DECLARE_ROM_SEGMENT(object_wood02) -DECLARE_ROM_SEGMENT(object_trap) -DECLARE_ROM_SEGMENT(object_vm) -DECLARE_ROM_SEGMENT(object_efc_star_field) -DECLARE_ROM_SEGMENT(object_rd) -DECLARE_ROM_SEGMENT(object_yukimura_obj) -DECLARE_ROM_SEGMENT(object_horse_link_child) -DECLARE_ROM_SEGMENT(object_syokudai) -DECLARE_ROM_SEGMENT(object_efc_tw) -DECLARE_ROM_SEGMENT(object_gi_key) -DECLARE_ROM_SEGMENT(object_mir_ray) -DECLARE_ROM_SEGMENT(object_ctower_rot) -DECLARE_ROM_SEGMENT(object_bdoor) -DECLARE_ROM_SEGMENT(object_sb) -DECLARE_ROM_SEGMENT(object_gi_melody) -DECLARE_ROM_SEGMENT(object_gi_heart) -DECLARE_ROM_SEGMENT(object_gi_compass) -DECLARE_ROM_SEGMENT(object_gi_bosskey) -DECLARE_ROM_SEGMENT(object_gi_nuts) -DECLARE_ROM_SEGMENT(object_gi_hearts) -DECLARE_ROM_SEGMENT(object_gi_arrowcase) -DECLARE_ROM_SEGMENT(object_gi_bombpouch) -DECLARE_ROM_SEGMENT(object_in) -DECLARE_ROM_SEGMENT(object_os_anime) -DECLARE_ROM_SEGMENT(object_gi_bottle) -DECLARE_ROM_SEGMENT(object_gi_stick) -DECLARE_ROM_SEGMENT(object_gi_map) -DECLARE_ROM_SEGMENT(object_oF1d_map) -DECLARE_ROM_SEGMENT(object_ru2) -DECLARE_ROM_SEGMENT(object_gi_magicpot) -DECLARE_ROM_SEGMENT(object_gi_bomb_1) -DECLARE_ROM_SEGMENT(object_ma2) -DECLARE_ROM_SEGMENT(object_gi_purse) -DECLARE_ROM_SEGMENT(object_rr) -DECLARE_ROM_SEGMENT(object_gi_arrow) -DECLARE_ROM_SEGMENT(object_gi_bomb_2) -DECLARE_ROM_SEGMENT(object_gi_shield_2) -DECLARE_ROM_SEGMENT(object_gi_hookshot) -DECLARE_ROM_SEGMENT(object_gi_ocarina) -DECLARE_ROM_SEGMENT(object_gi_milk) -DECLARE_ROM_SEGMENT(object_ma1) -DECLARE_ROM_SEGMENT(object_ny) -DECLARE_ROM_SEGMENT(object_fr) -DECLARE_ROM_SEGMENT(object_gi_bow) -DECLARE_ROM_SEGMENT(object_gi_glasses) -DECLARE_ROM_SEGMENT(object_gi_liquid) -DECLARE_ROM_SEGMENT(object_ani) -DECLARE_ROM_SEGMENT(object_gi_shield_3) -DECLARE_ROM_SEGMENT(object_gi_bean) -DECLARE_ROM_SEGMENT(object_gi_fish) -DECLARE_ROM_SEGMENT(object_gi_longsword) -DECLARE_ROM_SEGMENT(object_zo) -DECLARE_ROM_SEGMENT(object_umajump) -DECLARE_ROM_SEGMENT(object_mastergolon) -DECLARE_ROM_SEGMENT(object_masterzoora) -DECLARE_ROM_SEGMENT(object_aob) -DECLARE_ROM_SEGMENT(object_ik) -DECLARE_ROM_SEGMENT(object_ahg) -DECLARE_ROM_SEGMENT(object_cne) -DECLARE_ROM_SEGMENT(object_bji) -DECLARE_ROM_SEGMENT(object_bba) -DECLARE_ROM_SEGMENT(object_an1) -DECLARE_ROM_SEGMENT(object_boj) -DECLARE_ROM_SEGMENT(object_fz) -DECLARE_ROM_SEGMENT(object_bob) -DECLARE_ROM_SEGMENT(object_ge1) -DECLARE_ROM_SEGMENT(object_yabusame_point) -DECLARE_ROM_SEGMENT(object_d_hsblock) -DECLARE_ROM_SEGMENT(object_d_lift) -DECLARE_ROM_SEGMENT(object_mamenoki) -DECLARE_ROM_SEGMENT(object_goroiwa) -DECLARE_ROM_SEGMENT(object_toryo) -DECLARE_ROM_SEGMENT(object_daiku) -DECLARE_ROM_SEGMENT(object_nwc) -DECLARE_ROM_SEGMENT(object_gm) -DECLARE_ROM_SEGMENT(object_ms) -DECLARE_ROM_SEGMENT(object_hs) -DECLARE_ROM_SEGMENT(object_lightswitch) -DECLARE_ROM_SEGMENT(object_kusa) -DECLARE_ROM_SEGMENT(object_tsubo) -DECLARE_ROM_SEGMENT(object_kanban) -DECLARE_ROM_SEGMENT(object_owl) -DECLARE_ROM_SEGMENT(object_mk) -DECLARE_ROM_SEGMENT(object_fu) -DECLARE_ROM_SEGMENT(object_gi_ki_tan_mask) -DECLARE_ROM_SEGMENT(object_gi_mask18) -DECLARE_ROM_SEGMENT(object_gi_rabit_mask) -DECLARE_ROM_SEGMENT(object_gi_truth_mask) -DECLARE_ROM_SEGMENT(object_stream) -DECLARE_ROM_SEGMENT(object_mm) -DECLARE_ROM_SEGMENT(object_js) -DECLARE_ROM_SEGMENT(object_cs) -DECLARE_ROM_SEGMENT(object_gi_soldout) -DECLARE_ROM_SEGMENT(object_mag) -DECLARE_ROM_SEGMENT(object_gi_golonmask) -DECLARE_ROM_SEGMENT(object_gi_zoramask) -DECLARE_ROM_SEGMENT(object_ka) -DECLARE_ROM_SEGMENT(object_zg) -DECLARE_ROM_SEGMENT(object_gi_m_arrow) -DECLARE_ROM_SEGMENT(object_ds2) -DECLARE_ROM_SEGMENT(object_fish) -DECLARE_ROM_SEGMENT(object_gi_sutaru) -DECLARE_ROM_SEGMENT(object_ssh) -DECLARE_ROM_SEGMENT(object_bigslime) -DECLARE_ROM_SEGMENT(object_bg) -DECLARE_ROM_SEGMENT(object_bombiwa) -DECLARE_ROM_SEGMENT(object_hintnuts) -DECLARE_ROM_SEGMENT(object_rs) -DECLARE_ROM_SEGMENT(object_gla) -DECLARE_ROM_SEGMENT(object_geldb) -DECLARE_ROM_SEGMENT(object_dog) -DECLARE_ROM_SEGMENT(object_kibako2) -DECLARE_ROM_SEGMENT(object_dns) -DECLARE_ROM_SEGMENT(object_dnk) -DECLARE_ROM_SEGMENT(object_gi_insect) -DECLARE_ROM_SEGMENT(object_gi_ghost) -DECLARE_ROM_SEGMENT(object_gi_soul) -DECLARE_ROM_SEGMENT(object_f40_obj) -DECLARE_ROM_SEGMENT(object_gi_rupy) -DECLARE_ROM_SEGMENT(object_po_composer) -DECLARE_ROM_SEGMENT(object_mu) -DECLARE_ROM_SEGMENT(object_wf) -DECLARE_ROM_SEGMENT(object_skb) -DECLARE_ROM_SEGMENT(object_gs) -DECLARE_ROM_SEGMENT(object_ps) -DECLARE_ROM_SEGMENT(object_omoya_obj) -DECLARE_ROM_SEGMENT(object_crow) -DECLARE_ROM_SEGMENT(object_cow) -DECLARE_ROM_SEGMENT(object_gi_sword_1) -DECLARE_ROM_SEGMENT(object_zl4) -DECLARE_ROM_SEGMENT(object_grasshopper) -DECLARE_ROM_SEGMENT(object_boyo) -DECLARE_ROM_SEGMENT(object_fwall) -DECLARE_ROM_SEGMENT(object_jso) -DECLARE_ROM_SEGMENT(object_knight) -DECLARE_ROM_SEGMENT(object_icicle) -DECLARE_ROM_SEGMENT(object_spdweb) -DECLARE_ROM_SEGMENT(object_boss01) -DECLARE_ROM_SEGMENT(object_boss02) -DECLARE_ROM_SEGMENT(object_boss03) -DECLARE_ROM_SEGMENT(object_boss04) -DECLARE_ROM_SEGMENT(object_boss05) -DECLARE_ROM_SEGMENT(object_boss07) -DECLARE_ROM_SEGMENT(object_raf) -DECLARE_ROM_SEGMENT(object_funen) -DECLARE_ROM_SEGMENT(object_raillift) -DECLARE_ROM_SEGMENT(object_numa_obj) -DECLARE_ROM_SEGMENT(object_flowerpot) -DECLARE_ROM_SEGMENT(object_spinyroll) -DECLARE_ROM_SEGMENT(object_ice_block) -DECLARE_ROM_SEGMENT(object_keikoku_demo) -DECLARE_ROM_SEGMENT(object_slime) -DECLARE_ROM_SEGMENT(object_pr) -DECLARE_ROM_SEGMENT(object_f52_obj) -DECLARE_ROM_SEGMENT(object_f53_obj) -DECLARE_ROM_SEGMENT(object_kibako) -DECLARE_ROM_SEGMENT(object_sek) -DECLARE_ROM_SEGMENT(object_gmo) -DECLARE_ROM_SEGMENT(object_bat) -DECLARE_ROM_SEGMENT(object_sekihil) -DECLARE_ROM_SEGMENT(object_sekihig) -DECLARE_ROM_SEGMENT(object_sekihin) -DECLARE_ROM_SEGMENT(object_sekihiz) -DECLARE_ROM_SEGMENT(object_wiz) -DECLARE_ROM_SEGMENT(object_ladder) -DECLARE_ROM_SEGMENT(object_mkk) -DECLARE_ROM_SEGMENT(object_keikoku_obj) -DECLARE_ROM_SEGMENT(object_sichitai_obj) -DECLARE_ROM_SEGMENT(object_dekucity_ana_obj) -DECLARE_ROM_SEGMENT(object_rat) -DECLARE_ROM_SEGMENT(object_water_effect) -DECLARE_ROM_SEGMENT(object_dblue_object) -DECLARE_ROM_SEGMENT(object_bal) -DECLARE_ROM_SEGMENT(object_warp_uzu) -DECLARE_ROM_SEGMENT(object_driftice) -DECLARE_ROM_SEGMENT(object_fall) -DECLARE_ROM_SEGMENT(object_hanareyama_obj) -DECLARE_ROM_SEGMENT(object_crace_object) -DECLARE_ROM_SEGMENT(object_dno) -DECLARE_ROM_SEGMENT(object_obj_tokeidai) -DECLARE_ROM_SEGMENT(object_eg) -DECLARE_ROM_SEGMENT(object_tru) -DECLARE_ROM_SEGMENT(object_trt) -DECLARE_ROM_SEGMENT(object_hakugin_obj) -DECLARE_ROM_SEGMENT(object_horse_game_check) -DECLARE_ROM_SEGMENT(object_stk) -DECLARE_ROM_SEGMENT(object_mnk) -DECLARE_ROM_SEGMENT(object_gi_bottle_red) -DECLARE_ROM_SEGMENT(object_tokei_tobira) -DECLARE_ROM_SEGMENT(object_az) -DECLARE_ROM_SEGMENT(object_twig) -DECLARE_ROM_SEGMENT(object_dekucity_obj) -DECLARE_ROM_SEGMENT(object_po_fusen) -DECLARE_ROM_SEGMENT(object_racetsubo) -DECLARE_ROM_SEGMENT(object_ha) -DECLARE_ROM_SEGMENT(object_bigokuta) -DECLARE_ROM_SEGMENT(object_open_obj) -DECLARE_ROM_SEGMENT(object_fu_kaiten) -DECLARE_ROM_SEGMENT(object_fu_mato) -DECLARE_ROM_SEGMENT(object_mtoride) -DECLARE_ROM_SEGMENT(object_osn) -DECLARE_ROM_SEGMENT(object_tokei_step) -DECLARE_ROM_SEGMENT(object_lotus) -DECLARE_ROM_SEGMENT(object_tl) -DECLARE_ROM_SEGMENT(object_dkjail_obj) -DECLARE_ROM_SEGMENT(object_visiblock) -DECLARE_ROM_SEGMENT(object_tsn) -DECLARE_ROM_SEGMENT(object_ds2n) -DECLARE_ROM_SEGMENT(object_fsn) -DECLARE_ROM_SEGMENT(object_shn) -DECLARE_ROM_SEGMENT(object_bigicicle) -DECLARE_ROM_SEGMENT(object_gi_bottle_15) -DECLARE_ROM_SEGMENT(object_tk) -DECLARE_ROM_SEGMENT(object_market_obj) -DECLARE_ROM_SEGMENT(object_gi_reserve00) -DECLARE_ROM_SEGMENT(object_gi_reserve01) -DECLARE_ROM_SEGMENT(object_lightblock) -DECLARE_ROM_SEGMENT(object_takaraya_objects) -DECLARE_ROM_SEGMENT(object_wdhand) -DECLARE_ROM_SEGMENT(object_sdn) -DECLARE_ROM_SEGMENT(object_snowwd) -DECLARE_ROM_SEGMENT(object_giant) -DECLARE_ROM_SEGMENT(object_comb) -DECLARE_ROM_SEGMENT(object_hana) -DECLARE_ROM_SEGMENT(object_boss_hakugin) -DECLARE_ROM_SEGMENT(object_meganeana_obj) -DECLARE_ROM_SEGMENT(object_gi_nutsmask) -DECLARE_ROM_SEGMENT(object_stk2) -DECLARE_ROM_SEGMENT(object_spot11_obj) -DECLARE_ROM_SEGMENT(object_danpei_object) -DECLARE_ROM_SEGMENT(object_dhouse) -DECLARE_ROM_SEGMENT(object_hakaisi) -DECLARE_ROM_SEGMENT(object_po) -DECLARE_ROM_SEGMENT(object_snowman) -DECLARE_ROM_SEGMENT(object_po_sisters) -DECLARE_ROM_SEGMENT(object_pp) -DECLARE_ROM_SEGMENT(object_goronswitch) -DECLARE_ROM_SEGMENT(object_delf) -DECLARE_ROM_SEGMENT(object_botihasira) -DECLARE_ROM_SEGMENT(object_gi_bigbomb) -DECLARE_ROM_SEGMENT(object_pst) -DECLARE_ROM_SEGMENT(object_bsmask) -DECLARE_ROM_SEGMENT(object_spidertent) -DECLARE_ROM_SEGMENT(object_zoraegg) -DECLARE_ROM_SEGMENT(object_kbt) -DECLARE_ROM_SEGMENT(object_gg) -DECLARE_ROM_SEGMENT(object_maruta) -DECLARE_ROM_SEGMENT(object_ghaka) -DECLARE_ROM_SEGMENT(object_oyu) -DECLARE_ROM_SEGMENT(object_dnq) -DECLARE_ROM_SEGMENT(object_dai) -DECLARE_ROM_SEGMENT(object_kgy) -DECLARE_ROM_SEGMENT(object_fb) -DECLARE_ROM_SEGMENT(object_taisou) -DECLARE_ROM_SEGMENT(object_gk) -DECLARE_ROM_SEGMENT(object_haka_obj) -DECLARE_ROM_SEGMENT(object_dnt) -DECLARE_ROM_SEGMENT(object_yukiyama) -DECLARE_ROM_SEGMENT(object_icefloe) -DECLARE_ROM_SEGMENT(object_gi_gold_dust) -DECLARE_ROM_SEGMENT(object_gi_bottle_16) -DECLARE_ROM_SEGMENT(object_gi_bottle_22) -DECLARE_ROM_SEGMENT(object_bee) -DECLARE_ROM_SEGMENT(object_ot) -DECLARE_ROM_SEGMENT(object_utubo) -DECLARE_ROM_SEGMENT(object_dora) -DECLARE_ROM_SEGMENT(object_gi_loach) -DECLARE_ROM_SEGMENT(object_gi_seahorse) -DECLARE_ROM_SEGMENT(object_bigpo) -DECLARE_ROM_SEGMENT(object_hariko) -DECLARE_ROM_SEGMENT(object_dnj) -DECLARE_ROM_SEGMENT(object_sinkai_kabe) -DECLARE_ROM_SEGMENT(object_kin2_obj) -DECLARE_ROM_SEGMENT(object_ishi) -DECLARE_ROM_SEGMENT(object_hakugin_demo) -DECLARE_ROM_SEGMENT(object_jg) -DECLARE_ROM_SEGMENT(object_gi_sword_2) -DECLARE_ROM_SEGMENT(object_gi_sword_3) -DECLARE_ROM_SEGMENT(object_gi_sword_4) -DECLARE_ROM_SEGMENT(object_um) -DECLARE_ROM_SEGMENT(object_rb) -DECLARE_ROM_SEGMENT(object_mbar_obj) -DECLARE_ROM_SEGMENT(object_ikana_obj) -DECLARE_ROM_SEGMENT(object_kz) -DECLARE_ROM_SEGMENT(object_tokei_turret) -DECLARE_ROM_SEGMENT(object_zog) -DECLARE_ROM_SEGMENT(object_rotlift) -DECLARE_ROM_SEGMENT(object_posthouse_obj) -DECLARE_ROM_SEGMENT(object_gi_mask09) -DECLARE_ROM_SEGMENT(object_gi_mask14) -DECLARE_ROM_SEGMENT(object_gi_mask15) -DECLARE_ROM_SEGMENT(object_inibs_object) -DECLARE_ROM_SEGMENT(object_tree) -DECLARE_ROM_SEGMENT(object_kaizoku_obj) -DECLARE_ROM_SEGMENT(object_gi_reserve_b_00) -DECLARE_ROM_SEGMENT(object_gi_reserve_c_00) -DECLARE_ROM_SEGMENT(object_zob) -DECLARE_ROM_SEGMENT(object_milkbar) -DECLARE_ROM_SEGMENT(object_dmask) -DECLARE_ROM_SEGMENT(object_gi_reserve_c_01) -DECLARE_ROM_SEGMENT(object_zod) -DECLARE_ROM_SEGMENT(object_kumo30) -DECLARE_ROM_SEGMENT(object_obj_yasi) -DECLARE_ROM_SEGMENT(object_tanron1) -DECLARE_ROM_SEGMENT(object_tanron2) -DECLARE_ROM_SEGMENT(object_tanron3) -DECLARE_ROM_SEGMENT(object_gi_magicmushroom) -DECLARE_ROM_SEGMENT(object_obj_chan) -DECLARE_ROM_SEGMENT(object_gi_mask10) -DECLARE_ROM_SEGMENT(object_zos) -DECLARE_ROM_SEGMENT(object_an2) -DECLARE_ROM_SEGMENT(object_an3) -DECLARE_ROM_SEGMENT(object_f40_switch) -DECLARE_ROM_SEGMENT(object_lodmoon) -DECLARE_ROM_SEGMENT(object_tro) -DECLARE_ROM_SEGMENT(object_gi_mask12) -DECLARE_ROM_SEGMENT(object_gi_mask23) -DECLARE_ROM_SEGMENT(object_gi_bottle_21) -DECLARE_ROM_SEGMENT(object_gi_camera) -DECLARE_ROM_SEGMENT(object_kamejima) -DECLARE_ROM_SEGMENT(object_nb) -DECLARE_ROM_SEGMENT(object_harfgibud) -DECLARE_ROM_SEGMENT(object_zov) -DECLARE_ROM_SEGMENT(object_ah) -DECLARE_ROM_SEGMENT(object_hgdoor) -DECLARE_ROM_SEGMENT(object_dor01) -DECLARE_ROM_SEGMENT(object_dor02) -DECLARE_ROM_SEGMENT(object_dor03) -DECLARE_ROM_SEGMENT(object_dor04) -DECLARE_ROM_SEGMENT(object_last_obj) -DECLARE_ROM_SEGMENT(object_redead_obj) -DECLARE_ROM_SEGMENT(object_ikninside_obj) -DECLARE_ROM_SEGMENT(object_iknv_obj) -DECLARE_ROM_SEGMENT(object_pamera) -DECLARE_ROM_SEGMENT(object_hsstump) -DECLARE_ROM_SEGMENT(object_zm) -DECLARE_ROM_SEGMENT(object_al) -DECLARE_ROM_SEGMENT(object_tab) -DECLARE_ROM_SEGMENT(object_secom_obj) -DECLARE_ROM_SEGMENT(object_dt) -DECLARE_ROM_SEGMENT(object_gi_mask03) -DECLARE_ROM_SEGMENT(object_cha) -DECLARE_ROM_SEGMENT(object_obj_dinner) -DECLARE_ROM_SEGMENT(object_gi_reserve_b_01) -DECLARE_ROM_SEGMENT(object_lastday) -DECLARE_ROM_SEGMENT(object_bai) -DECLARE_ROM_SEGMENT(object_ikn_demo) -DECLARE_ROM_SEGMENT(object_gi_fieldmap) -DECLARE_ROM_SEGMENT(object_big_fwall) -DECLARE_ROM_SEGMENT(object_hunsui) -DECLARE_ROM_SEGMENT(object_uch) -DECLARE_ROM_SEGMENT(object_tanron4) -DECLARE_ROM_SEGMENT(object_tanron5) -DECLARE_ROM_SEGMENT(object_in2) -DECLARE_ROM_SEGMENT(object_yb) -DECLARE_ROM_SEGMENT(object_rz) -DECLARE_ROM_SEGMENT(object_bjt) -DECLARE_ROM_SEGMENT(object_taru) -DECLARE_ROM_SEGMENT(object_moonston) -DECLARE_ROM_SEGMENT(object_gi_schedule) -DECLARE_ROM_SEGMENT(object_gi_stonemask) -DECLARE_ROM_SEGMENT(object_zoraband) -DECLARE_ROM_SEGMENT(object_kepn_koya) -DECLARE_ROM_SEGMENT(object_obj_usiyane) -DECLARE_ROM_SEGMENT(object_gi_mask05) -DECLARE_ROM_SEGMENT(object_gi_mask11) -DECLARE_ROM_SEGMENT(object_gi_mask20) -DECLARE_ROM_SEGMENT(object_nnh) -DECLARE_ROM_SEGMENT(object_kzsaku) -DECLARE_ROM_SEGMENT(object_obj_milk_bin) -DECLARE_ROM_SEGMENT(object_random_obj) -DECLARE_ROM_SEGMENT(object_kujiya) -DECLARE_ROM_SEGMENT(object_kitan) -DECLARE_ROM_SEGMENT(object_gi_mask06) -DECLARE_ROM_SEGMENT(object_gi_mask16) -DECLARE_ROM_SEGMENT(object_astr_obj) -DECLARE_ROM_SEGMENT(object_bsb) -DECLARE_ROM_SEGMENT(object_fall2) -DECLARE_ROM_SEGMENT(object_sth) -DECLARE_ROM_SEGMENT(object_gi_mssa) -DECLARE_ROM_SEGMENT(object_smtower) -DECLARE_ROM_SEGMENT(object_gi_mask21) -DECLARE_ROM_SEGMENT(object_yado_obj) -DECLARE_ROM_SEGMENT(object_syoten) -DECLARE_ROM_SEGMENT(object_moonend) -DECLARE_ROM_SEGMENT(object_ob) -DECLARE_ROM_SEGMENT(object_gi_bottle_04) -DECLARE_ROM_SEGMENT(object_and) -DECLARE_ROM_SEGMENT(object_obj_danpeilift) -DECLARE_ROM_SEGMENT(object_drs) -DECLARE_ROM_SEGMENT(object_msmo) -DECLARE_ROM_SEGMENT(object_an4) -DECLARE_ROM_SEGMENT(object_wdor01) -DECLARE_ROM_SEGMENT(object_wdor02) -DECLARE_ROM_SEGMENT(object_wdor03) -DECLARE_ROM_SEGMENT(object_wdor04) -DECLARE_ROM_SEGMENT(object_wdor05) -DECLARE_ROM_SEGMENT(object_stk3) -DECLARE_ROM_SEGMENT(object_kinsta1_obj) -DECLARE_ROM_SEGMENT(object_kinsta2_obj) -DECLARE_ROM_SEGMENT(object_bh) -DECLARE_ROM_SEGMENT(object_gi_mask17) -DECLARE_ROM_SEGMENT(object_gi_mask22) -DECLARE_ROM_SEGMENT(object_lbfshot) -DECLARE_ROM_SEGMENT(object_fusen) -DECLARE_ROM_SEGMENT(object_ending_obj) -DECLARE_ROM_SEGMENT(object_gi_mask13) +#define DEFINE_OBJECT(name, _enumValue) DECLARE_ROM_SEGMENT(name) +#define DEFINE_OBJECT_UNSET(_enumValue) +#define DEFINE_OBJECT_SIZE_ZERO(_name, _enumValue) + +#include "tables/object_table.h" + +#undef DEFINE_OBJECT +#undef DEFINE_OBJECT_UNSET +#undef DEFINE_OBJECT_SIZE_ZERO DECLARE_ROM_SEGMENT(scene_texture_01) DECLARE_ROM_SEGMENT(scene_texture_02) @@ -1121,4 +666,5 @@ DECLARE_ROM_SEGMENT(KAKUSIANA_room_13) DECLARE_ROM_SEGMENT(KAKUSIANA_room_14) DECLARE_ROM_SEGMENT(bump_texture_static) + #endif diff --git a/include/tables/object_table.h b/include/tables/object_table.h new file mode 100644 index 0000000000..61175c1183 --- /dev/null +++ b/include/tables/object_table.h @@ -0,0 +1,659 @@ +/** + * Object Table + * + * DEFINE_OBJECT should be used for normal objects + * - Argument 0: Name of the object segment in spec + * - Argument 1: Enum value for this object + * + * DEFINE_OBJECT_UNSET and DEFINE_OBJECT_SIZE_ZERO are needed to define empty entries from the original game + * + * DEFINE_OBJECT_UNSET is used to declare a placeholder enum value which maps to an entry with zeroes in `gObjectTable` + * - Argument 0: Enum value for this object + * + * DEFINE_OBJECT_SIZE_ZERO is used to declare a placeholder enum value which maps to a zero-size entry in `gObjectTable`, with no corresponding segment in the rom. + * - Argument 0: Name of the object segment in spec + * - Argument 1: Enum value for this object + */ +/* 0x000 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_0) +/* 0x001 */ DEFINE_OBJECT(gameplay_keep, GAMEPLAY_KEEP) +/* 0x002 */ DEFINE_OBJECT(gameplay_field_keep, GAMEPLAY_FIELD_KEEP) +/* 0x003 */ DEFINE_OBJECT(gameplay_dangeon_keep, GAMEPLAY_DANGEON_KEEP) +/* 0x004 */ DEFINE_OBJECT(object_nb, OBJECT_NB) +/* 0x005 */ DEFINE_OBJECT(object_okuta, OBJECT_OKUTA) +/* 0x006 */ DEFINE_OBJECT(object_crow, OBJECT_CROW) +/* 0x007 */ DEFINE_OBJECT(object_ah, OBJECT_AH) +/* 0x008 */ DEFINE_OBJECT(object_dy_obj, OBJECT_DY_OBJ) +/* 0x009 */ DEFINE_OBJECT(object_wallmaster, OBJECT_WALLMASTER) +/* 0x00A */ DEFINE_OBJECT(object_dodongo, OBJECT_DODONGO) +/* 0x00B */ DEFINE_OBJECT(object_firefly, OBJECT_FIREFLY) +/* 0x00C */ DEFINE_OBJECT(object_box, OBJECT_BOX) +/* 0x00D */ DEFINE_OBJECT(object_al, OBJECT_AL) +/* 0x00E */ DEFINE_OBJECT(object_bubble, OBJECT_BUBBLE) +/* 0x00F */ DEFINE_OBJECT(object_niw, OBJECT_NIW) +/* 0x010 */ DEFINE_OBJECT(object_link_boy, OBJECT_LINK_BOY) +/* 0x011 */ DEFINE_OBJECT(object_link_child, OBJECT_LINK_CHILD) +/* 0x012 */ DEFINE_OBJECT(object_tite, OBJECT_TITE) +/* 0x013 */ DEFINE_OBJECT(object_tab, OBJECT_TAB) +/* 0x014 */ DEFINE_OBJECT(object_ph, OBJECT_PH) +/* 0x015 */ DEFINE_OBJECT(object_and, OBJECT_AND) +/* 0x016 */ DEFINE_OBJECT(object_msmo, OBJECT_MSMO) +/* 0x017 */ DEFINE_OBJECT(object_dinofos, OBJECT_DINOFOS) +/* 0x018 */ DEFINE_OBJECT(object_drs, OBJECT_DRS) +/* 0x019 */ DEFINE_OBJECT(object_zl1, OBJECT_ZL1) +/* 0x01A */ DEFINE_OBJECT(object_an4, OBJECT_AN4) +/* 0x01B */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_1B) +/* 0x01C */ DEFINE_OBJECT(object_test3, OBJECT_TEST3) +/* 0x01D */ DEFINE_OBJECT(object_famos, OBJECT_FAMOS) +/* 0x01E */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_1E) +/* 0x01F */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_1F) +/* 0x020 */ DEFINE_OBJECT(object_st, OBJECT_ST) +/* 0x021 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_21) +/* 0x022 */ DEFINE_OBJECT(object_thiefbird, OBJECT_THIEFBIRD) +/* 0x023 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_23) +/* 0x024 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_24) +/* 0x025 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_25) +/* 0x026 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_26) +/* 0x027 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_27) +/* 0x028 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_28) +/* 0x029 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_29) +/* 0x02A */ DEFINE_OBJECT(object_bombf, OBJECT_BOMBF) +/* 0x02B */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_2B) +/* 0x02C */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_2C) +/* 0x02D */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_2D) +/* 0x02E */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_2E) +/* 0x02F */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_2F) +/* 0x030 */ DEFINE_OBJECT(object_am, OBJECT_AM) +/* 0x031 */ DEFINE_OBJECT(object_dekubaba, OBJECT_DEKUBABA) +/* 0x032 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_32) +/* 0x033 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_33) +/* 0x034 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_34) +/* 0x035 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_35) +/* 0x036 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_36) +/* 0x037 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_37) +/* 0x038 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_38) +/* 0x039 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_39) +/* 0x03A */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_3A) +/* 0x03B */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_3B) +/* 0x03C */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_3C) +/* 0x03D */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_3D) +/* 0x03E */ DEFINE_OBJECT(object_warp1, OBJECT_WARP1) +/* 0x03F */ DEFINE_OBJECT(object_b_heart, OBJECT_B_HEART) +/* 0x040 */ DEFINE_OBJECT(object_dekunuts, OBJECT_DEKUNUTS) +/* 0x041 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_41) +/* 0x042 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_42) +/* 0x043 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_43) +/* 0x044 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_44) +/* 0x045 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_45) +/* 0x046 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_46) +/* 0x047 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_47) +/* 0x048 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_48) +/* 0x049 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_49) +/* 0x04A */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_4A) +/* 0x04B */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_4B) +/* 0x04C */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_4C) +/* 0x04D */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_4D) +/* 0x04E */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_4E) +/* 0x04F */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_4F) +/* 0x050 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_50) +/* 0x051 */ DEFINE_OBJECT(object_bb, OBJECT_BB) +/* 0x052 */ DEFINE_OBJECT(object_death, OBJECT_DEATH) +/* 0x053 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_53) +/* 0x054 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_54) +/* 0x055 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_55) +/* 0x056 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_56) +/* 0x057 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_57) +/* 0x058 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_58) +/* 0x059 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_59) +/* 0x05A */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_5A) +/* 0x05B */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_5B) +/* 0x05C */ DEFINE_OBJECT(object_f40_obj, OBJECT_F40_OBJ) +/* 0x05D */ DEFINE_OBJECT(object_po_composer, OBJECT_PO_COMPOSER) +/* 0x05E */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_5E) +/* 0x05F */ DEFINE_OBJECT(object_hata, OBJECT_HATA) +/* 0x060 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_60) +/* 0x061 */ DEFINE_OBJECT(object_wood02, OBJECT_WOOD02) +/* 0x062 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_62) +/* 0x063 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_63) +/* 0x064 */ DEFINE_OBJECT(object_trap, OBJECT_TRAP) +/* 0x065 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_65) +/* 0x066 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_66) +/* 0x067 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_67) +/* 0x068 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_68) +/* 0x069 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_69) +/* 0x06A */ DEFINE_OBJECT(object_vm, OBJECT_VM) +/* 0x06B */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_6B) +/* 0x06C */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_6C) +/* 0x06D */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_6D) +/* 0x06E */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_6E) +/* 0x06F */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_6F) +/* 0x070 */ DEFINE_OBJECT(object_efc_star_field, OBJECT_EFC_STAR_FIELD) +/* 0x071 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_71) +/* 0x072 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_72) +/* 0x073 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_73) +/* 0x074 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_74) +/* 0x075 */ DEFINE_OBJECT(object_rd, OBJECT_RD) +/* 0x076 */ DEFINE_OBJECT(object_yukimura_obj, OBJECT_YUKIMURA_OBJ) +/* 0x077 */ DEFINE_OBJECT_UNSET(OBJECT_HEAVY_OBJECT) +/* 0x078 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_78) +/* 0x079 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_79) +/* 0x07A */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_7A) +/* 0x07B */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_7B) +/* 0x07C */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_7C) +/* 0x07D */ DEFINE_OBJECT(object_horse_link_child, OBJECT_HORSE_LINK_CHILD) +/* 0x07E */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_7E) +/* 0x07F */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_7F) +/* 0x080 */ DEFINE_OBJECT(object_syokudai, OBJECT_SYOKUDAI) +/* 0x081 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_81) +/* 0x082 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_82) +/* 0x083 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_83) +/* 0x084 */ DEFINE_OBJECT(object_efc_tw, OBJECT_EFC_TW) +/* 0x085 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_85) +/* 0x086 */ DEFINE_OBJECT(object_gi_key, OBJECT_GI_KEY) +/* 0x087 */ DEFINE_OBJECT(object_mir_ray, OBJECT_MIR_RAY) +/* 0x088 */ DEFINE_OBJECT(object_ctower_rot, OBJECT_CTOWER_ROT) +/* 0x089 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_89) +/* 0x08A */ DEFINE_OBJECT(object_bdoor, OBJECT_BDOOR) +/* 0x08B */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_8B) +/* 0x08C */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_8C) +/* 0x08D */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_8D) +/* 0x08E */ DEFINE_OBJECT(object_sb, OBJECT_SB) +/* 0x08F */ DEFINE_OBJECT(object_gi_melody, OBJECT_GI_MELODY) +/* 0x090 */ DEFINE_OBJECT(object_gi_heart, OBJECT_GI_HEART) +/* 0x091 */ DEFINE_OBJECT(object_gi_compass, OBJECT_GI_COMPASS) +/* 0x092 */ DEFINE_OBJECT(object_gi_bosskey, OBJECT_GI_BOSSKEY) +/* 0x093 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_93) +/* 0x094 */ DEFINE_OBJECT(object_gi_nuts, OBJECT_GI_NUTS) +/* 0x095 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_95) +/* 0x096 */ DEFINE_OBJECT(object_gi_hearts, OBJECT_GI_HEARTS) +/* 0x097 */ DEFINE_OBJECT(object_gi_arrowcase, OBJECT_GI_ARROWCASE) +/* 0x098 */ DEFINE_OBJECT(object_gi_bombpouch, OBJECT_GI_BOMBPOUCH) +/* 0x099 */ DEFINE_OBJECT(object_in, OBJECT_IN) +/* 0x09A */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_9A) +/* 0x09B */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_9B) +/* 0x09C */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_9C) +/* 0x09D */ DEFINE_OBJECT(object_os_anime, OBJECT_OS_ANIME) +/* 0x09E */ DEFINE_OBJECT(object_gi_bottle, OBJECT_GI_BOTTLE) +/* 0x09F */ DEFINE_OBJECT(object_gi_stick, OBJECT_GI_STICK) +/* 0x0A0 */ DEFINE_OBJECT(object_gi_map, OBJECT_GI_MAP) +/* 0x0A1 */ DEFINE_OBJECT(object_oF1d_map, OBJECT_OF1D_MAP) +/* 0x0A2 */ DEFINE_OBJECT(object_ru2, OBJECT_RU2) +/* 0x0A3 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_A3) +/* 0x0A4 */ DEFINE_OBJECT(object_gi_magicpot, OBJECT_GI_MAGICPOT) +/* 0x0A5 */ DEFINE_OBJECT(object_gi_bomb_1, OBJECT_GI_BOMB_1) +/* 0x0A6 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_A6) +/* 0x0A7 */ DEFINE_OBJECT(object_ma2, OBJECT_MA2) +/* 0x0A8 */ DEFINE_OBJECT(object_gi_purse, OBJECT_GI_PURSE) +/* 0x0A9 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_A9) +/* 0x0AA */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_AA) +/* 0x0AB */ DEFINE_OBJECT(object_rr, OBJECT_RR) +/* 0x0AC */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_AC) +/* 0x0AD */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_AD) +/* 0x0AE */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_AE) +/* 0x0AF */ DEFINE_OBJECT(object_gi_arrow, OBJECT_GI_ARROW) +/* 0x0B0 */ DEFINE_OBJECT(object_gi_bomb_2, OBJECT_GI_BOMB_2) +/* 0x0B1 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_B1) +/* 0x0B2 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_B2) +/* 0x0B3 */ DEFINE_OBJECT(object_gi_shield_2, OBJECT_GI_SHIELD_2) +/* 0x0B4 */ DEFINE_OBJECT(object_gi_hookshot, OBJECT_GI_HOOKSHOT) +/* 0x0B5 */ DEFINE_OBJECT(object_gi_ocarina, OBJECT_GI_OCARINA) +/* 0x0B6 */ DEFINE_OBJECT(object_gi_milk, OBJECT_GI_MILK) +/* 0x0B7 */ DEFINE_OBJECT(object_ma1, OBJECT_MA1) +/* 0x0B8 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_B8) +/* 0x0B9 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_B9) +/* 0x0BA */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_BA) +/* 0x0BB */ DEFINE_OBJECT(object_ny, OBJECT_NY) +/* 0x0BC */ DEFINE_OBJECT(object_fr, OBJECT_FR) +/* 0x0BD */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_BD) +/* 0x0BE */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_BE) +/* 0x0BF */ DEFINE_OBJECT(object_gi_bow, OBJECT_GI_BOW) +/* 0x0C0 */ DEFINE_OBJECT(object_gi_glasses, OBJECT_GI_GLASSES) +/* 0x0C1 */ DEFINE_OBJECT(object_gi_liquid, OBJECT_GI_LIQUID) +/* 0x0C2 */ DEFINE_OBJECT(object_ani, OBJECT_ANI) +/* 0x0C3 */ DEFINE_OBJECT(object_gi_shield_3, OBJECT_GI_SHIELD_3) +/* 0x0C4 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_C4) +/* 0x0C5 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_C5) +/* 0x0C6 */ DEFINE_OBJECT(object_gi_bean, OBJECT_GI_BEAN) +/* 0x0C7 */ DEFINE_OBJECT(object_gi_fish, OBJECT_GI_FISH) +/* 0x0C8 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_C8) +/* 0x0C9 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_C9) +/* 0x0CA */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_CA) +/* 0x0CB */ DEFINE_OBJECT(object_gi_longsword, OBJECT_GI_LONGSWORD) +/* 0x0CC */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_CC) +/* 0x0CD */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_CD) +/* 0x0CE */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_CE) +/* 0x0CF */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_CF) +/* 0x0D0 */ DEFINE_OBJECT(object_zo, OBJECT_ZO) +/* 0x0D1 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_D1) +/* 0x0D2 */ DEFINE_OBJECT(object_umajump, OBJECT_UMAJUMP) +/* 0x0D3 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_D3) +/* 0x0D4 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_D4) +/* 0x0D5 */ DEFINE_OBJECT(object_mastergolon, OBJECT_MASTERGOLON) +/* 0x0D6 */ DEFINE_OBJECT(object_masterzoora, OBJECT_MASTERZOORA) +/* 0x0D7 */ DEFINE_OBJECT(object_aob, OBJECT_AOB) +/* 0x0D8 */ DEFINE_OBJECT(object_ik, OBJECT_IK) +/* 0x0D9 */ DEFINE_OBJECT(object_ahg, OBJECT_AHG) +/* 0x0DA */ DEFINE_OBJECT(object_cne, OBJECT_CNE) +/* 0x0DB */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_DB) +/* 0x0DC */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_DC) +/* 0x0DD */ DEFINE_OBJECT(object_an3, OBJECT_AN3) +/* 0x0DE */ DEFINE_OBJECT(object_bji, OBJECT_BJI) +/* 0x0DF */ DEFINE_OBJECT(object_bba, OBJECT_BBA) +/* 0x0E0 */ DEFINE_OBJECT(object_an2, OBJECT_AN2) +/* 0x0E1 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_E1) +/* 0x0E2 */ DEFINE_OBJECT(object_an1, OBJECT_AN1) +/* 0x0E3 */ DEFINE_OBJECT(object_boj, OBJECT_BOJ) +/* 0x0E4 */ DEFINE_OBJECT(object_fz, OBJECT_FZ) +/* 0x0E5 */ DEFINE_OBJECT(object_bob, OBJECT_BOB) +/* 0x0E6 */ DEFINE_OBJECT(object_ge1, OBJECT_GE1) +/* 0x0E7 */ DEFINE_OBJECT(object_yabusame_point, OBJECT_YABUSAME_POINT) +/* 0x0E8 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_E8) +/* 0x0E9 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_E9) +/* 0x0EA */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_EA) +/* 0x0EB */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_EB) +/* 0x0EC */ DEFINE_OBJECT(object_d_hsblock, OBJECT_D_HSBLOCK) +/* 0x0ED */ DEFINE_OBJECT(object_d_lift, OBJECT_D_LIFT) +/* 0x0EE */ DEFINE_OBJECT(object_mamenoki, OBJECT_MAMENOKI) +/* 0x0EF */ DEFINE_OBJECT(object_goroiwa, OBJECT_GOROIWA) +/* 0x0F0 */ DEFINE_OBJECT(object_toryo, OBJECT_TORYO) +/* 0x0F1 */ DEFINE_OBJECT(object_daiku, OBJECT_DAIKU) +/* 0x0F2 */ DEFINE_OBJECT(object_nwc, OBJECT_NWC) +/* 0x0F3 */ DEFINE_OBJECT(object_gm, OBJECT_GM) +/* 0x0F4 */ DEFINE_OBJECT(object_ms, OBJECT_MS) +/* 0x0F5 */ DEFINE_OBJECT(object_hs, OBJECT_HS) +/* 0x0F6 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_F6) +/* 0x0F7 */ DEFINE_OBJECT(object_lightswitch, OBJECT_LIGHTSWITCH) +/* 0x0F8 */ DEFINE_OBJECT(object_kusa, OBJECT_KUSA) +/* 0x0F9 */ DEFINE_OBJECT(object_tsubo, OBJECT_TSUBO) +/* 0x0FA */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_FA) +/* 0x0FB */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_FB) +/* 0x0FC */ DEFINE_OBJECT(object_kanban, OBJECT_KANBAN) +/* 0x0FD */ DEFINE_OBJECT(object_owl, OBJECT_OWL) +/* 0x0FE */ DEFINE_OBJECT(object_mk, OBJECT_MK) +/* 0x0FF */ DEFINE_OBJECT(object_fu, OBJECT_FU) +/* 0x100 */ DEFINE_OBJECT(object_gi_ki_tan_mask, OBJECT_GI_KI_TAN_MASK) +/* 0x101 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_101) +/* 0x102 */ DEFINE_OBJECT(object_gi_mask18, OBJECT_GI_MASK18) +/* 0x103 */ DEFINE_OBJECT(object_gi_rabit_mask, OBJECT_GI_RABIT_MASK) +/* 0x104 */ DEFINE_OBJECT(object_gi_truth_mask, OBJECT_GI_TRUTH_MASK) +/* 0x105 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_105) +/* 0x106 */ DEFINE_OBJECT(object_stream, OBJECT_STREAM) +/* 0x107 */ DEFINE_OBJECT(object_mm, OBJECT_MM) +/* 0x108 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_108) +/* 0x109 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_109) +/* 0x10A */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_10A) +/* 0x10B */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_10B) +/* 0x10C */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_10C) +/* 0x10D */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_10D) +/* 0x10E */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_10E) +/* 0x10F */ DEFINE_OBJECT(object_js, OBJECT_JS) +/* 0x110 */ DEFINE_OBJECT(object_cs, OBJECT_CS) +/* 0x111 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_111) +/* 0x112 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_112) +/* 0x113 */ DEFINE_OBJECT(object_gi_soldout, OBJECT_GI_SOLDOUT) +/* 0x114 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_114) +/* 0x115 */ DEFINE_OBJECT(object_mag, OBJECT_MAG) +/* 0x116 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_116) +/* 0x117 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_117) +/* 0x118 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_118) +/* 0x119 */ DEFINE_OBJECT(object_gi_golonmask, OBJECT_GI_GOLONMASK) +/* 0x11A */ DEFINE_OBJECT(object_gi_zoramask, OBJECT_GI_ZORAMASK) +/* 0x11B */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_11B) +/* 0x11C */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_11C) +/* 0x11D */ DEFINE_OBJECT(object_ka, OBJECT_KA) +/* 0x11E */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_11E) +/* 0x11F */ DEFINE_OBJECT(object_zg, OBJECT_ZG) +/* 0x120 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_120) +/* 0x121 */ DEFINE_OBJECT(object_gi_m_arrow, OBJECT_GI_M_ARROW) +/* 0x122 */ DEFINE_OBJECT(object_ds2, OBJECT_DS2) +/* 0x123 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_123) +/* 0x124 */ DEFINE_OBJECT(object_fish, OBJECT_FISH) +/* 0x125 */ DEFINE_OBJECT(object_gi_sutaru, OBJECT_GI_SUTARU) +/* 0x126 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_126) +/* 0x127 */ DEFINE_OBJECT(object_ssh, OBJECT_SSH) +/* 0x128 */ DEFINE_OBJECT(object_bigslime, OBJECT_BIGSLIME) +/* 0x129 */ DEFINE_OBJECT(object_bg, OBJECT_BG) +/* 0x12A */ DEFINE_OBJECT(object_bombiwa, OBJECT_BOMBIWA) +/* 0x12B */ DEFINE_OBJECT(object_hintnuts, OBJECT_HINTNUTS) +/* 0x12C */ DEFINE_OBJECT(object_rs, OBJECT_RS) +/* 0x12D */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_12D) +/* 0x12E */ DEFINE_OBJECT(object_gla, OBJECT_GLA) +/* 0x12F */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_12F) +/* 0x130 */ DEFINE_OBJECT(object_geldb, OBJECT_GELDB) +/* 0x131 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_131) +/* 0x132 */ DEFINE_OBJECT(object_dog, OBJECT_DOG) +/* 0x133 */ DEFINE_OBJECT(object_kibako2, OBJECT_KIBAKO2) +/* 0x134 */ DEFINE_OBJECT(object_dns, OBJECT_DNS) +/* 0x135 */ DEFINE_OBJECT(object_dnk, OBJECT_DNK) +/* 0x136 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_136) +/* 0x137 */ DEFINE_OBJECT(object_gi_insect, OBJECT_GI_INSECT) +/* 0x138 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_138) +/* 0x139 */ DEFINE_OBJECT(object_gi_ghost, OBJECT_GI_GHOST) +/* 0x13A */ DEFINE_OBJECT(object_gi_soul, OBJECT_GI_SOUL) +/* 0x13B */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_13B) +/* 0x13C */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_13C) +/* 0x13D */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_13D) +/* 0x13E */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_13E) +/* 0x13F */ DEFINE_OBJECT(object_gi_rupy, OBJECT_GI_RUPY) +/* 0x140 */ DEFINE_OBJECT(object_mu, OBJECT_MU) +/* 0x141 */ DEFINE_OBJECT(object_wf, OBJECT_WF) +/* 0x142 */ DEFINE_OBJECT(object_skb, OBJECT_SKB) +/* 0x143 */ DEFINE_OBJECT(object_gs, OBJECT_GS) +/* 0x144 */ DEFINE_OBJECT(object_ps, OBJECT_PS) +/* 0x145 */ DEFINE_OBJECT(object_omoya_obj, OBJECT_OMOYA_OBJ) +/* 0x146 */ DEFINE_OBJECT(object_cow, OBJECT_COW) +/* 0x147 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_147) +/* 0x148 */ DEFINE_OBJECT(object_gi_sword_1, OBJECT_GI_SWORD_1) +/* 0x149 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_149) +/* 0x14A */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_14A) +/* 0x14B */ DEFINE_OBJECT(object_zl4, OBJECT_ZL4) +/* 0x14C */ DEFINE_OBJECT(object_link_goron, OBJECT_LINK_GORON) +/* 0x14D */ DEFINE_OBJECT(object_link_zora, OBJECT_LINK_ZORA) +/* 0x14E */ DEFINE_OBJECT(object_grasshopper, OBJECT_GRASSHOPPER) +/* 0x14F */ DEFINE_OBJECT(object_boyo, OBJECT_BOYO) +/* 0x150 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_150) +/* 0x151 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_151) +/* 0x152 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_152) +/* 0x153 */ DEFINE_OBJECT(object_fwall, OBJECT_FWALL) +/* 0x154 */ DEFINE_OBJECT(object_link_nuts, OBJECT_LINK_NUTS) +/* 0x155 */ DEFINE_OBJECT(object_jso, OBJECT_JSO) +/* 0x156 */ DEFINE_OBJECT(object_knight, OBJECT_KNIGHT) +/* 0x157 */ DEFINE_OBJECT(object_icicle, OBJECT_ICICLE) +/* 0x158 */ DEFINE_OBJECT(object_spdweb, OBJECT_SPDWEB) +/* 0x159 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_159) +/* 0x15A */ DEFINE_OBJECT(object_boss01, OBJECT_BOSS01) +/* 0x15B */ DEFINE_OBJECT(object_boss02, OBJECT_BOSS02) +/* 0x15C */ DEFINE_OBJECT(object_boss03, OBJECT_BOSS03) +/* 0x15D */ DEFINE_OBJECT(object_boss04, OBJECT_BOSS04) +/* 0x15E */ DEFINE_OBJECT(object_boss05, OBJECT_BOSS05) +/* 0x15F */ DEFINE_OBJECT_SIZE_ZERO(object_boss07, OBJECT_UNSET_15F) // unused duplicate with size 0 +/* 0x160 */ DEFINE_OBJECT(object_boss07, OBJECT_BOSS07) +/* 0x161 */ DEFINE_OBJECT(object_raf, OBJECT_RAF) +/* 0x162 */ DEFINE_OBJECT(object_funen, OBJECT_FUNEN) +/* 0x163 */ DEFINE_OBJECT(object_raillift, OBJECT_RAILLIFT) +/* 0x164 */ DEFINE_OBJECT(object_numa_obj, OBJECT_NUMA_OBJ) +/* 0x165 */ DEFINE_OBJECT(object_flowerpot, OBJECT_FLOWERPOT) +/* 0x166 */ DEFINE_OBJECT(object_spinyroll, OBJECT_SPINYROLL) +/* 0x167 */ DEFINE_OBJECT(object_ice_block, OBJECT_ICE_BLOCK) +/* 0x168 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_168) +/* 0x169 */ DEFINE_OBJECT(object_keikoku_demo, OBJECT_KEIKOKU_DEMO) +/* 0x16A */ DEFINE_OBJECT(object_slime, OBJECT_SLIME) +/* 0x16B */ DEFINE_OBJECT(object_pr, OBJECT_PR) +/* 0x16C */ DEFINE_OBJECT(object_f52_obj, OBJECT_F52_OBJ) +/* 0x16D */ DEFINE_OBJECT(object_f53_obj, OBJECT_F53_OBJ) +/* 0x16E */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_16E) +/* 0x16F */ DEFINE_OBJECT(object_kibako, OBJECT_KIBAKO) +/* 0x170 */ DEFINE_OBJECT(object_sek, OBJECT_SEK) +/* 0x171 */ DEFINE_OBJECT(object_gmo, OBJECT_GMO) +/* 0x172 */ DEFINE_OBJECT(object_bat, OBJECT_BAT) +/* 0x173 */ DEFINE_OBJECT(object_sekihil, OBJECT_SEKIHIL) +/* 0x174 */ DEFINE_OBJECT(object_sekihig, OBJECT_SEKIHIG) +/* 0x175 */ DEFINE_OBJECT(object_sekihin, OBJECT_SEKIHIN) +/* 0x176 */ DEFINE_OBJECT(object_sekihiz, OBJECT_SEKIHIZ) +/* 0x177 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_177) +/* 0x178 */ DEFINE_OBJECT(object_wiz, OBJECT_WIZ) +/* 0x179 */ DEFINE_OBJECT(object_ladder, OBJECT_LADDER) +/* 0x17A */ DEFINE_OBJECT(object_mkk, OBJECT_MKK) +/* 0x17B */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_17B) +/* 0x17C */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_17C) +/* 0x17D */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_17D) +/* 0x17E */ DEFINE_OBJECT(object_keikoku_obj, OBJECT_KEIKOKU_OBJ) +/* 0x17F */ DEFINE_OBJECT(object_sichitai_obj, OBJECT_SICHITAI_OBJ) +/* 0x180 */ DEFINE_OBJECT(object_dekucity_ana_obj, OBJECT_DEKUCITY_ANA_OBJ) +/* 0x181 */ DEFINE_OBJECT(object_rat, OBJECT_RAT) +/* 0x182 */ DEFINE_OBJECT(object_water_effect, OBJECT_WATER_EFFECT) +/* 0x183 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_183) +/* 0x184 */ DEFINE_OBJECT(object_dblue_object, OBJECT_DBLUE_OBJECT) +/* 0x185 */ DEFINE_OBJECT(object_bal, OBJECT_BAL) +/* 0x186 */ DEFINE_OBJECT(object_warp_uzu, OBJECT_WARP_UZU) +/* 0x187 */ DEFINE_OBJECT(object_driftice, OBJECT_DRIFTICE) +/* 0x188 */ DEFINE_OBJECT(object_fall, OBJECT_FALL) +/* 0x189 */ DEFINE_OBJECT(object_hanareyama_obj, OBJECT_HANAREYAMA_OBJ) +/* 0x18A */ DEFINE_OBJECT(object_crace_object, OBJECT_CRACE_OBJECT) +/* 0x18B */ DEFINE_OBJECT(object_dno, OBJECT_DNO) +/* 0x18C */ DEFINE_OBJECT(object_obj_tokeidai, OBJECT_OBJ_TOKEIDAI) +/* 0x18D */ DEFINE_OBJECT(object_eg, OBJECT_EG) +/* 0x18E */ DEFINE_OBJECT(object_tru, OBJECT_TRU) +/* 0x18F */ DEFINE_OBJECT(object_trt, OBJECT_TRT) +/* 0x190 */ DEFINE_OBJECT(object_hakugin_obj, OBJECT_HAKUGIN_OBJ) +/* 0x191 */ DEFINE_OBJECT(object_horse_game_check, OBJECT_HORSE_GAME_CHECK) +/* 0x192 */ DEFINE_OBJECT(object_stk, OBJECT_STK) +/* 0x193 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_193) +/* 0x194 */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_194) +/* 0x195 */ DEFINE_OBJECT(object_mnk, OBJECT_MNK) +/* 0x196 */ DEFINE_OBJECT(object_gi_bottle_red, OBJECT_GI_BOTTLE_RED) +/* 0x197 */ DEFINE_OBJECT(object_tokei_tobira, OBJECT_TOKEI_TOBIRA) +/* 0x198 */ DEFINE_OBJECT(object_az, OBJECT_AZ) +/* 0x199 */ DEFINE_OBJECT(object_twig, OBJECT_TWIG) +/* 0x19A */ DEFINE_OBJECT(object_dekucity_obj, OBJECT_DEKUCITY_OBJ) +/* 0x19B */ DEFINE_OBJECT(object_po_fusen, OBJECT_PO_FUSEN) +/* 0x19C */ DEFINE_OBJECT(object_racetsubo, OBJECT_RACETSUBO) +/* 0x19D */ DEFINE_OBJECT(object_ha, OBJECT_HA) +/* 0x19E */ DEFINE_OBJECT(object_bigokuta, OBJECT_BIGOKUTA) +/* 0x19F */ DEFINE_OBJECT(object_open_obj, OBJECT_OPEN_OBJ) +/* 0x1A0 */ DEFINE_OBJECT(object_fu_kaiten, OBJECT_FU_KAITEN) +/* 0x1A1 */ DEFINE_OBJECT(object_fu_mato, OBJECT_FU_MATO) +/* 0x1A2 */ DEFINE_OBJECT(object_mtoride, OBJECT_MTORIDE) +/* 0x1A3 */ DEFINE_OBJECT(object_osn, OBJECT_OSN) +/* 0x1A4 */ DEFINE_OBJECT(object_tokei_step, OBJECT_TOKEI_STEP) +/* 0x1A5 */ DEFINE_OBJECT(object_lotus, OBJECT_LOTUS) +/* 0x1A6 */ DEFINE_OBJECT(object_tl, OBJECT_TL) +/* 0x1A7 */ DEFINE_OBJECT(object_dkjail_obj, OBJECT_DKJAIL_OBJ) +/* 0x1A8 */ DEFINE_OBJECT(object_visiblock, OBJECT_VISIBLOCK) +/* 0x1A9 */ DEFINE_OBJECT(object_tsn, OBJECT_TSN) +/* 0x1AA */ DEFINE_OBJECT(object_ds2n, OBJECT_DS2N) +/* 0x1AB */ DEFINE_OBJECT(object_fsn, OBJECT_FSN) +/* 0x1AC */ DEFINE_OBJECT(object_shn, OBJECT_SHN) +/* 0x1AD */ DEFINE_OBJECT(object_bigicicle, OBJECT_BIGICICLE) +/* 0x1AE */ DEFINE_OBJECT(object_gi_bottle_15, OBJECT_GI_BOTTLE_15) +/* 0x1AF */ DEFINE_OBJECT(object_tk, OBJECT_TK) +/* 0x1B0 */ DEFINE_OBJECT(object_market_obj, OBJECT_MARKET_OBJ) +/* 0x1B1 */ DEFINE_OBJECT(object_gi_reserve00, OBJECT_GI_RESERVE00) +/* 0x1B2 */ DEFINE_OBJECT(object_gi_reserve01, OBJECT_GI_RESERVE01) +/* 0x1B3 */ DEFINE_OBJECT(object_lightblock, OBJECT_LIGHTBLOCK) +/* 0x1B4 */ DEFINE_OBJECT(object_takaraya_objects, OBJECT_TAKARAYA_OBJECTS) +/* 0x1B5 */ DEFINE_OBJECT(object_wdhand, OBJECT_WDHAND) +/* 0x1B6 */ DEFINE_OBJECT(object_sdn, OBJECT_SDN) +/* 0x1B7 */ DEFINE_OBJECT(object_snowwd, OBJECT_SNOWWD) +/* 0x1B8 */ DEFINE_OBJECT(object_giant, OBJECT_GIANT) +/* 0x1B9 */ DEFINE_OBJECT(object_comb, OBJECT_COMB) +/* 0x1BA */ DEFINE_OBJECT(object_hana, OBJECT_HANA) +/* 0x1BB */ DEFINE_OBJECT(object_boss_hakugin, OBJECT_BOSS_HAKUGIN) +/* 0x1BC */ DEFINE_OBJECT(object_meganeana_obj, OBJECT_MEGANEANA_OBJ) +/* 0x1BD */ DEFINE_OBJECT(object_gi_nutsmask, OBJECT_GI_NUTSMASK) +/* 0x1BE */ DEFINE_OBJECT(object_stk2, OBJECT_STK2) +/* 0x1BF */ DEFINE_OBJECT(object_spot11_obj, OBJECT_SPOT11_OBJ) +/* 0x1C0 */ DEFINE_OBJECT(object_danpei_object, OBJECT_DANPEI_OBJECT) +/* 0x1C1 */ DEFINE_OBJECT(object_dhouse, OBJECT_DHOUSE) +/* 0x1C2 */ DEFINE_OBJECT(object_hakaisi, OBJECT_HAKAISI) +/* 0x1C3 */ DEFINE_OBJECT(object_po, OBJECT_PO) +/* 0x1C4 */ DEFINE_OBJECT(object_snowman, OBJECT_SNOWMAN) +/* 0x1C5 */ DEFINE_OBJECT(object_po_sisters, OBJECT_PO_SISTERS) +/* 0x1C6 */ DEFINE_OBJECT(object_pp, OBJECT_PP) +/* 0x1C7 */ DEFINE_OBJECT(object_goronswitch, OBJECT_GORONSWITCH) +/* 0x1C8 */ DEFINE_OBJECT(object_delf, OBJECT_DELF) +/* 0x1C9 */ DEFINE_OBJECT(object_botihasira, OBJECT_BOTIHASIRA) +/* 0x1CA */ DEFINE_OBJECT(object_gi_bigbomb, OBJECT_GI_BIGBOMB) +/* 0x1CB */ DEFINE_OBJECT(object_pst, OBJECT_PST) +/* 0x1CC */ DEFINE_OBJECT(object_bsmask, OBJECT_BSMASK) +/* 0x1CD */ DEFINE_OBJECT(object_spidertent, OBJECT_SPIDERTENT) +/* 0x1CE */ DEFINE_OBJECT(object_zoraegg, OBJECT_ZORAEGG) +/* 0x1CF */ DEFINE_OBJECT(object_kbt, OBJECT_KBT) +/* 0x1D0 */ DEFINE_OBJECT(object_gg, OBJECT_GG) +/* 0x1D1 */ DEFINE_OBJECT(object_maruta, OBJECT_MARUTA) +/* 0x1D2 */ DEFINE_OBJECT(object_ghaka, OBJECT_GHAKA) +/* 0x1D3 */ DEFINE_OBJECT(object_oyu, OBJECT_OYU) +/* 0x1D4 */ DEFINE_OBJECT(object_dnq, OBJECT_DNQ) +/* 0x1D5 */ DEFINE_OBJECT(object_dai, OBJECT_DAI) +/* 0x1D6 */ DEFINE_OBJECT(object_kgy, OBJECT_KGY) +/* 0x1D7 */ DEFINE_OBJECT(object_fb, OBJECT_FB) +/* 0x1D8 */ DEFINE_OBJECT(object_taisou, OBJECT_TAISOU) +/* 0x1D9 */ DEFINE_OBJECT(object_mask_bu_san, OBJECT_MASK_BU_SAN) +/* 0x1DA */ DEFINE_OBJECT(object_mask_ki_tan, OBJECT_MASK_KI_TAN) +/* 0x1DB */ DEFINE_OBJECT(object_mask_rabit, OBJECT_MASK_RABIT) +/* 0x1DC */ DEFINE_OBJECT(object_mask_skj, OBJECT_MASK_SKJ) +/* 0x1DD */ DEFINE_OBJECT(object_mask_bakuretu, OBJECT_MASK_BAKURETU) +/* 0x1DE */ DEFINE_OBJECT(object_mask_truth, OBJECT_MASK_TRUTH) +/* 0x1DF */ DEFINE_OBJECT(object_gk, OBJECT_GK) +/* 0x1E0 */ DEFINE_OBJECT(object_haka_obj, OBJECT_HAKA_OBJ) +/* 0x1E1 */ DEFINE_OBJECT(object_mask_goron, OBJECT_MASK_GORON) +/* 0x1E2 */ DEFINE_OBJECT(object_mask_zora, OBJECT_MASK_ZORA) +/* 0x1E3 */ DEFINE_OBJECT(object_mask_nuts, OBJECT_MASK_NUTS) +/* 0x1E4 */ DEFINE_OBJECT(object_mask_boy, OBJECT_MASK_BOY) +/* 0x1E5 */ DEFINE_OBJECT(object_dnt, OBJECT_DNT) +/* 0x1E6 */ DEFINE_OBJECT(object_yukiyama, OBJECT_YUKIYAMA) +/* 0x1E7 */ DEFINE_OBJECT(object_icefloe, OBJECT_ICEFLOE) +/* 0x1E8 */ DEFINE_OBJECT(object_gi_gold_dust, OBJECT_GI_GOLD_DUST) +/* 0x1E9 */ DEFINE_OBJECT(object_gi_bottle_16, OBJECT_GI_BOTTLE_16) +/* 0x1EA */ DEFINE_OBJECT(object_gi_bottle_22, OBJECT_GI_BOTTLE_22) +/* 0x1EB */ DEFINE_OBJECT(object_bee, OBJECT_BEE) +/* 0x1EC */ DEFINE_OBJECT(object_ot, OBJECT_OT) +/* 0x1ED */ DEFINE_OBJECT(object_utubo, OBJECT_UTUBO) +/* 0x1EE */ DEFINE_OBJECT(object_dora, OBJECT_DORA) +/* 0x1EF */ DEFINE_OBJECT(object_gi_loach, OBJECT_GI_LOACH) +/* 0x1F0 */ DEFINE_OBJECT(object_gi_seahorse, OBJECT_GI_SEAHORSE) +/* 0x1F1 */ DEFINE_OBJECT(object_bigpo, OBJECT_BIGPO) +/* 0x1F2 */ DEFINE_OBJECT(object_hariko, OBJECT_HARIKO) +/* 0x1F3 */ DEFINE_OBJECT(object_dnj, OBJECT_DNJ) +/* 0x1F4 */ DEFINE_OBJECT(object_sinkai_kabe, OBJECT_SINKAI_KABE) +/* 0x1F5 */ DEFINE_OBJECT(object_kin2_obj, OBJECT_KIN2_OBJ) +/* 0x1F6 */ DEFINE_OBJECT(object_ishi, OBJECT_ISHI) +/* 0x1F7 */ DEFINE_OBJECT(object_hakugin_demo, OBJECT_HAKUGIN_DEMO) +/* 0x1F8 */ DEFINE_OBJECT(object_jg, OBJECT_JG) +/* 0x1F9 */ DEFINE_OBJECT(object_gi_sword_2, OBJECT_GI_SWORD_2) +/* 0x1FA */ DEFINE_OBJECT(object_gi_sword_3, OBJECT_GI_SWORD_3) +/* 0x1FB */ DEFINE_OBJECT(object_gi_sword_4, OBJECT_GI_SWORD_4) +/* 0x1FC */ DEFINE_OBJECT(object_um, OBJECT_UM) +/* 0x1FD */ DEFINE_OBJECT(object_mask_gibudo, OBJECT_MASK_GIBUDO) +/* 0x1FE */ DEFINE_OBJECT(object_mask_json, OBJECT_MASK_JSON) +/* 0x1FF */ DEFINE_OBJECT(object_mask_kerfay, OBJECT_MASK_KERFAY) +/* 0x200 */ DEFINE_OBJECT(object_mask_bigelf, OBJECT_MASK_BIGELF) +/* 0x201 */ DEFINE_OBJECT(object_rb, OBJECT_RB) +/* 0x202 */ DEFINE_OBJECT(object_mbar_obj, OBJECT_MBAR_OBJ) +/* 0x203 */ DEFINE_OBJECT(object_ikana_obj, OBJECT_IKANA_OBJ) +/* 0x204 */ DEFINE_OBJECT(object_kz, OBJECT_KZ) +/* 0x205 */ DEFINE_OBJECT(object_tokei_turret, OBJECT_TOKEI_TURRET) +/* 0x206 */ DEFINE_OBJECT(object_zog, OBJECT_ZOG) +/* 0x207 */ DEFINE_OBJECT(object_rotlift, OBJECT_ROTLIFT) +/* 0x208 */ DEFINE_OBJECT(object_posthouse_obj, OBJECT_POSTHOUSE_OBJ) +/* 0x209 */ DEFINE_OBJECT(object_gi_mask09, OBJECT_GI_MASK09) +/* 0x20A */ DEFINE_OBJECT(object_gi_mask14, OBJECT_GI_MASK14) +/* 0x20B */ DEFINE_OBJECT(object_gi_mask15, OBJECT_GI_MASK15) +/* 0x20C */ DEFINE_OBJECT(object_inibs_object, OBJECT_INIBS_OBJECT) +/* 0x20D */ DEFINE_OBJECT(object_tree, OBJECT_TREE) +/* 0x20E */ DEFINE_OBJECT(object_kaizoku_obj, OBJECT_KAIZOKU_OBJ) +/* 0x20F */ DEFINE_OBJECT(object_gi_reserve_b_00, OBJECT_GI_RESERVE_B_00) +/* 0x210 */ DEFINE_OBJECT(object_gi_reserve_c_00, OBJECT_GI_RESERVE_C_00) +/* 0x211 */ DEFINE_OBJECT(object_zob, OBJECT_ZOB) +/* 0x212 */ DEFINE_OBJECT(object_milkbar, OBJECT_MILKBAR) +/* 0x213 */ DEFINE_OBJECT(object_dmask, OBJECT_DMASK) +/* 0x214 */ DEFINE_OBJECT(object_mask_kyojin, OBJECT_MASK_KYOJIN) +/* 0x215 */ DEFINE_OBJECT(object_gi_reserve_c_01, OBJECT_GI_RESERVE_C_01) +/* 0x216 */ DEFINE_OBJECT(object_zod, OBJECT_ZOD) +/* 0x217 */ DEFINE_OBJECT(object_kumo30, OBJECT_KUMO30) +/* 0x218 */ DEFINE_OBJECT(object_obj_yasi, OBJECT_OBJ_YASI) +/* 0x219 */ DEFINE_OBJECT(object_mask_romerny, OBJECT_MASK_ROMERNY) +/* 0x21A */ DEFINE_OBJECT(object_tanron1, OBJECT_TANRON1) +/* 0x21B */ DEFINE_OBJECT(object_tanron2, OBJECT_TANRON2) +/* 0x21C */ DEFINE_OBJECT(object_tanron3, OBJECT_TANRON3) +/* 0x21D */ DEFINE_OBJECT(object_gi_magicmushroom, OBJECT_GI_MAGICMUSHROOM) +/* 0x21E */ DEFINE_OBJECT(object_obj_chan, OBJECT_OBJ_CHAN) +/* 0x21F */ DEFINE_OBJECT(object_gi_mask10, OBJECT_GI_MASK10) +/* 0x220 */ DEFINE_OBJECT(object_zos, OBJECT_ZOS) +/* 0x221 */ DEFINE_OBJECT(object_mask_posthat, OBJECT_MASK_POSTHAT) +/* 0x222 */ DEFINE_OBJECT(object_f40_switch, OBJECT_F40_SWITCH) +/* 0x223 */ DEFINE_OBJECT(object_lodmoon, OBJECT_LODMOON) +/* 0x224 */ DEFINE_OBJECT(object_tro, OBJECT_TRO) +/* 0x225 */ DEFINE_OBJECT(object_gi_mask12, OBJECT_GI_MASK12) +/* 0x226 */ DEFINE_OBJECT(object_gi_mask23, OBJECT_GI_MASK23) +/* 0x227 */ DEFINE_OBJECT(object_gi_bottle_21, OBJECT_GI_BOTTLE_21) +/* 0x228 */ DEFINE_OBJECT(object_gi_camera, OBJECT_GI_CAMERA) +/* 0x229 */ DEFINE_OBJECT(object_kamejima, OBJECT_KAMEJIMA) +/* 0x22A */ DEFINE_OBJECT(object_harfgibud, OBJECT_HARFGIBUD) +/* 0x22B */ DEFINE_OBJECT(object_zov, OBJECT_ZOV) +/* 0x22C */ DEFINE_OBJECT(object_hgdoor, OBJECT_HGDOOR) +/* 0x22D */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_22D) +/* 0x22E */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_22E) +/* 0x22F */ DEFINE_OBJECT_UNSET(OBJECT_UNSET_22F) +/* 0x230 */ DEFINE_OBJECT(object_dor01, OBJECT_DOR01) +/* 0x231 */ DEFINE_OBJECT(object_dor02, OBJECT_DOR02) +/* 0x232 */ DEFINE_OBJECT(object_dor03, OBJECT_DOR03) +/* 0x233 */ DEFINE_OBJECT(object_dor04, OBJECT_DOR04) +/* 0x234 */ DEFINE_OBJECT(object_last_obj, OBJECT_LAST_OBJ) +/* 0x235 */ DEFINE_OBJECT(object_redead_obj, OBJECT_REDEAD_OBJ) +/* 0x236 */ DEFINE_OBJECT(object_ikninside_obj, OBJECT_IKNINSIDE_OBJ) +/* 0x237 */ DEFINE_OBJECT(object_iknv_obj, OBJECT_IKNV_OBJ) +/* 0x238 */ DEFINE_OBJECT(object_pamera, OBJECT_PAMERA) +/* 0x239 */ DEFINE_OBJECT(object_hsstump, OBJECT_HSSTUMP) +/* 0x23A */ DEFINE_OBJECT(object_zm, OBJECT_ZM) +/* 0x23B */ DEFINE_OBJECT(object_big_fwall, OBJECT_BIG_FWALL) +/* 0x23C */ DEFINE_OBJECT(object_secom_obj, OBJECT_SECOM_OBJ) +/* 0x23D */ DEFINE_OBJECT(object_hunsui, OBJECT_HUNSUI) +/* 0x23E */ DEFINE_OBJECT(object_uch, OBJECT_UCH) +/* 0x23F */ DEFINE_OBJECT(object_tanron4, OBJECT_TANRON4) +/* 0x240 */ DEFINE_OBJECT(object_tanron5, OBJECT_TANRON5) +/* 0x241 */ DEFINE_OBJECT(object_dt, OBJECT_DT) +/* 0x242 */ DEFINE_OBJECT(object_gi_mask03, OBJECT_GI_MASK03) +/* 0x243 */ DEFINE_OBJECT(object_cha, OBJECT_CHA) +/* 0x244 */ DEFINE_OBJECT(object_obj_dinner, OBJECT_OBJ_DINNER) +/* 0x245 */ DEFINE_OBJECT(object_gi_reserve_b_01, OBJECT_GI_RESERVE_B_01) +/* 0x246 */ DEFINE_OBJECT(object_lastday, OBJECT_LASTDAY) +/* 0x247 */ DEFINE_OBJECT(object_bai, OBJECT_BAI) +/* 0x248 */ DEFINE_OBJECT(object_in2, OBJECT_IN2) +/* 0x249 */ DEFINE_OBJECT(object_ikn_demo, OBJECT_IKN_DEMO) +/* 0x24A */ DEFINE_OBJECT(object_yb, OBJECT_YB) +/* 0x24B */ DEFINE_OBJECT(object_rz, OBJECT_RZ) +/* 0x24C */ DEFINE_OBJECT(object_mask_zacho, OBJECT_MASK_ZACHO) +/* 0x24D */ DEFINE_OBJECT(object_gi_fieldmap, OBJECT_GI_FIELDMAP) +/* 0x24E */ DEFINE_OBJECT(object_mask_stone, OBJECT_MASK_STONE) +/* 0x24F */ DEFINE_OBJECT(object_bjt, OBJECT_BJT) +/* 0x250 */ DEFINE_OBJECT(object_taru, OBJECT_TARU) +/* 0x251 */ DEFINE_OBJECT(object_moonston, OBJECT_MOONSTON) +/* 0x252 */ DEFINE_OBJECT(object_mask_bree, OBJECT_MASK_BREE) +/* 0x253 */ DEFINE_OBJECT(object_gi_schedule, OBJECT_GI_SCHEDULE) +/* 0x254 */ DEFINE_OBJECT(object_gi_stonemask, OBJECT_GI_STONEMASK) +/* 0x255 */ DEFINE_OBJECT(object_zoraband, OBJECT_ZORABAND) +/* 0x256 */ DEFINE_OBJECT(object_kepn_koya, OBJECT_KEPN_KOYA) +/* 0x257 */ DEFINE_OBJECT(object_obj_usiyane, OBJECT_OBJ_USIYANE) +/* 0x258 */ DEFINE_OBJECT(object_gi_mask05, OBJECT_GI_MASK05) +/* 0x259 */ DEFINE_OBJECT(object_gi_mask11, OBJECT_GI_MASK11) +/* 0x25A */ DEFINE_OBJECT(object_gi_mask20, OBJECT_GI_MASK20) +/* 0x25B */ DEFINE_OBJECT(object_nnh, OBJECT_NNH) +/* 0x25C */ DEFINE_OBJECT(object_mask_gero, OBJECT_MASK_GERO) +/* 0x25D */ DEFINE_OBJECT(object_mask_yofukasi, OBJECT_MASK_YOFUKASI) +/* 0x25E */ DEFINE_OBJECT(object_mask_meoto, OBJECT_MASK_MEOTO) +/* 0x25F */ DEFINE_OBJECT(object_mask_dancer, OBJECT_MASK_DANCER) +/* 0x260 */ DEFINE_OBJECT(object_kzsaku, OBJECT_KZSAKU) +/* 0x261 */ DEFINE_OBJECT(object_obj_milk_bin, OBJECT_OBJ_MILK_BIN) +/* 0x262 */ DEFINE_OBJECT(object_random_obj, OBJECT_RANDOM_OBJ) +/* 0x263 */ DEFINE_OBJECT(object_kujiya, OBJECT_KUJIYA) +/* 0x264 */ DEFINE_OBJECT(object_kitan, OBJECT_KITAN) +/* 0x265 */ DEFINE_OBJECT(object_gi_mask06, OBJECT_GI_MASK06) +/* 0x266 */ DEFINE_OBJECT(object_gi_mask16, OBJECT_GI_MASK16) +/* 0x267 */ DEFINE_OBJECT(object_astr_obj, OBJECT_ASTR_OBJ) +/* 0x268 */ DEFINE_OBJECT(object_bsb, OBJECT_BSB) +/* 0x269 */ DEFINE_OBJECT(object_fall2, OBJECT_FALL2) +/* 0x26A */ DEFINE_OBJECT(object_sth, OBJECT_STH) +/* 0x26B */ DEFINE_OBJECT(object_gi_mssa, OBJECT_GI_MSSA) +/* 0x26C */ DEFINE_OBJECT(object_smtower, OBJECT_SMTOWER) +/* 0x26D */ DEFINE_OBJECT(object_gi_mask21, OBJECT_GI_MASK21) +/* 0x26E */ DEFINE_OBJECT(object_yado_obj, OBJECT_YADO_OBJ) +/* 0x26F */ DEFINE_OBJECT(object_syoten, OBJECT_SYOTEN) +/* 0x270 */ DEFINE_OBJECT(object_moonend, OBJECT_MOONEND) +/* 0x271 */ DEFINE_OBJECT(object_ob, OBJECT_OB) +/* 0x272 */ DEFINE_OBJECT(object_gi_bottle_04, OBJECT_GI_BOTTLE_04) +/* 0x273 */ DEFINE_OBJECT(object_obj_danpeilift, OBJECT_OBJ_DANPEILIFT) +/* 0x274 */ DEFINE_OBJECT(object_wdor01, OBJECT_WDOR01) +/* 0x275 */ DEFINE_OBJECT(object_wdor02, OBJECT_WDOR02) +/* 0x276 */ DEFINE_OBJECT(object_wdor03, OBJECT_WDOR03) +/* 0x277 */ DEFINE_OBJECT(object_stk3, OBJECT_STK3) +/* 0x278 */ DEFINE_OBJECT(object_kinsta1_obj, OBJECT_KINSTA1_OBJ) +/* 0x279 */ DEFINE_OBJECT(object_kinsta2_obj, OBJECT_KINSTA2_OBJ) +/* 0x27A */ DEFINE_OBJECT(object_bh, OBJECT_BH) +/* 0x27B */ DEFINE_OBJECT(object_wdor04, OBJECT_WDOR04) +/* 0x27C */ DEFINE_OBJECT(object_wdor05, OBJECT_WDOR05) +/* 0x27D */ DEFINE_OBJECT(object_gi_mask17, OBJECT_GI_MASK17) +/* 0x27E */ DEFINE_OBJECT(object_gi_mask22, OBJECT_GI_MASK22) +/* 0x27F */ DEFINE_OBJECT(object_lbfshot, OBJECT_LBFSHOT) +/* 0x280 */ DEFINE_OBJECT(object_fusen, OBJECT_FUSEN) +/* 0x281 */ DEFINE_OBJECT(object_ending_obj, OBJECT_ENDING_OBJ) +/* 0x282 */ DEFINE_OBJECT(object_gi_mask13, OBJECT_GI_MASK13) diff --git a/include/variables.h b/include/variables.h index 201cbdc6a8..f12329143e 100644 --- a/include/variables.h +++ b/include/variables.h @@ -657,8 +657,11 @@ extern u8 gItemSlots[]; extern s16 gItemPrices[]; extern u16 gSceneIdsPerRegion[11][27]; extern u8 gPlayerFormItemRestrictions[PLAYER_FORM_MAX][114]; -extern s16 gPlayerFormObjectIndices[8]; -extern RomFile gObjectTable[643]; + +extern s16 gPlayerFormObjectIndices[PLAYER_FORM_MAX]; +extern ObjectId gObjectTableSize; +extern RomFile gObjectTable[OBJECT_ID_MAX]; + extern SceneTableEntry gSceneTable[]; extern UNK_PTR D_801C5C50; // extern UNK_TYPE1 D_801C5C9C; diff --git a/include/z64object.h b/include/z64object.h index e800e91389..7128268156 100644 --- a/include/z64object.h +++ b/include/z64object.h @@ -8,651 +8,17 @@ #define OBJECT_EXCHANGE_BANK_MAX 35 -typedef enum { - /* 0x000 */ OBJECT_UNSET_0, - /* 0x001 */ GAMEPLAY_KEEP, - /* 0x002 */ GAMEPLAY_FIELD_KEEP, - /* 0x003 */ GAMEPLAY_DANGEON_KEEP, - /* 0x004 */ OBJECT_NB, - /* 0x005 */ OBJECT_OKUTA, - /* 0x006 */ OBJECT_CROW, - /* 0x007 */ OBJECT_AH, - /* 0x008 */ OBJECT_DY_OBJ, - /* 0x009 */ OBJECT_WALLMASTER, - /* 0x00A */ OBJECT_DODONGO, - /* 0x00B */ OBJECT_FIREFLY, - /* 0x00C */ OBJECT_BOX, - /* 0x00D */ OBJECT_AL, - /* 0x00E */ OBJECT_BUBBLE, - /* 0x00F */ OBJECT_NIW, - /* 0x010 */ OBJECT_LINK_BOY, - /* 0x011 */ OBJECT_LINK_CHILD, - /* 0x012 */ OBJECT_TITE, - /* 0x013 */ OBJECT_TAB, - /* 0x014 */ OBJECT_PH, - /* 0x015 */ OBJECT_AND, - /* 0x016 */ OBJECT_MSMO, - /* 0x017 */ OBJECT_DINOFOS, - /* 0x018 */ OBJECT_DRS, - /* 0x019 */ OBJECT_ZL1, - /* 0x01A */ OBJECT_AN4, - /* 0x01B */ OBJECT_UNSET_1B, - /* 0x01C */ OBJECT_TEST3, - /* 0x01D */ OBJECT_FAMOS, - /* 0x01E */ OBJECT_UNSET_1E, - /* 0x01F */ OBJECT_UNSET_1F, - /* 0x020 */ OBJECT_ST, - /* 0x021 */ OBJECT_UNSET_21, - /* 0x022 */ OBJECT_THIEFBIRD, - /* 0x023 */ OBJECT_UNSET_23, - /* 0x024 */ OBJECT_UNSET_24, - /* 0x025 */ OBJECT_UNSET_25, - /* 0x026 */ OBJECT_UNSET_26, - /* 0x027 */ OBJECT_UNSET_27, - /* 0x028 */ OBJECT_UNSET_28, - /* 0x029 */ OBJECT_UNSET_29, - /* 0x02A */ OBJECT_BOMBF, - /* 0x02B */ OBJECT_UNSET_2B, - /* 0x02C */ OBJECT_UNSET_2C, - /* 0x02D */ OBJECT_UNSET_2D, - /* 0x02E */ OBJECT_UNSET_2E, - /* 0x02F */ OBJECT_UNSET_2F, - /* 0x030 */ OBJECT_AM, - /* 0x031 */ OBJECT_DEKUBABA, - /* 0x032 */ OBJECT_UNSET_32, - /* 0x033 */ OBJECT_UNSET_33, - /* 0x034 */ OBJECT_UNSET_34, - /* 0x035 */ OBJECT_UNSET_35, - /* 0x036 */ OBJECT_UNSET_36, - /* 0x037 */ OBJECT_UNSET_37, - /* 0x038 */ OBJECT_UNSET_38, - /* 0x039 */ OBJECT_UNSET_39, - /* 0x03A */ OBJECT_UNSET_3A, - /* 0x03B */ OBJECT_UNSET_3B, - /* 0x03C */ OBJECT_UNSET_3C, - /* 0x03D */ OBJECT_UNSET_3D, - /* 0x03E */ OBJECT_WARP1, - /* 0x03F */ OBJECT_B_HEART, - /* 0x040 */ OBJECT_DEKUNUTS, - /* 0x041 */ OBJECT_UNSET_41, - /* 0x042 */ OBJECT_UNSET_42, - /* 0x043 */ OBJECT_UNSET_43, - /* 0x044 */ OBJECT_UNSET_44, - /* 0x045 */ OBJECT_UNSET_45, - /* 0x046 */ OBJECT_UNSET_46, - /* 0x047 */ OBJECT_UNSET_47, - /* 0x048 */ OBJECT_UNSET_48, - /* 0x049 */ OBJECT_UNSET_49, - /* 0x04A */ OBJECT_UNSET_4A, - /* 0x04B */ OBJECT_UNSET_4B, - /* 0x04C */ OBJECT_UNSET_4C, - /* 0x04D */ OBJECT_UNSET_4D, - /* 0x04E */ OBJECT_UNSET_4E, - /* 0x04F */ OBJECT_UNSET_4F, - /* 0x050 */ OBJECT_UNSET_50, - /* 0x051 */ OBJECT_BB, - /* 0x052 */ OBJECT_DEATH, - /* 0x053 */ OBJECT_UNSET_53, - /* 0x054 */ OBJECT_UNSET_54, - /* 0x055 */ OBJECT_UNSET_55, - /* 0x056 */ OBJECT_UNSET_56, - /* 0x057 */ OBJECT_UNSET_57, - /* 0x058 */ OBJECT_UNSET_58, - /* 0x059 */ OBJECT_UNSET_59, - /* 0x05A */ OBJECT_UNSET_5A, - /* 0x05B */ OBJECT_UNSET_5B, - /* 0x05C */ OBJECT_F40_OBJ, - /* 0x05D */ OBJECT_PO_COMPOSER, - /* 0x05E */ OBJECT_UNSET_5E, - /* 0x05F */ OBJECT_HATA, - /* 0x060 */ OBJECT_UNSET_60, - /* 0x061 */ OBJECT_WOOD02, - /* 0x062 */ OBJECT_UNSET_62, - /* 0x063 */ OBJECT_UNSET_63, - /* 0x064 */ OBJECT_TRAP, - /* 0x065 */ OBJECT_UNSET_65, - /* 0x066 */ OBJECT_UNSET_66, - /* 0x067 */ OBJECT_UNSET_67, - /* 0x068 */ OBJECT_UNSET_68, - /* 0x069 */ OBJECT_UNSET_69, - /* 0x06A */ OBJECT_VM, - /* 0x06B */ OBJECT_UNSET_6B, - /* 0x06C */ OBJECT_UNSET_6C, - /* 0x06D */ OBJECT_UNSET_6D, - /* 0x06E */ OBJECT_UNSET_6E, - /* 0x06F */ OBJECT_UNSET_6F, - /* 0x070 */ OBJECT_EFC_STAR_FIELD, - /* 0x071 */ OBJECT_UNSET_71, - /* 0x072 */ OBJECT_UNSET_72, - /* 0x073 */ OBJECT_UNSET_73, - /* 0x074 */ OBJECT_UNSET_74, - /* 0x075 */ OBJECT_RD, - /* 0x076 */ OBJECT_YUKIMURA_OBJ, - /* 0x077 */ OBJECT_HEAVY_OBJECT, - /* 0x078 */ OBJECT_UNSET_78, - /* 0x079 */ OBJECT_UNSET_79, - /* 0x07A */ OBJECT_UNSET_7A, - /* 0x07B */ OBJECT_UNSET_7B, - /* 0x07C */ OBJECT_UNSET_7C, - /* 0x07D */ OBJECT_HORSE_LINK_CHILD, - /* 0x07E */ OBJECT_UNSET_7E, - /* 0x07F */ OBJECT_UNSET_7F, - /* 0x080 */ OBJECT_SYOKUDAI, - /* 0x081 */ OBJECT_UNSET_81, - /* 0x082 */ OBJECT_UNSET_82, - /* 0x083 */ OBJECT_UNSET_83, - /* 0x084 */ OBJECT_EFC_TW, - /* 0x085 */ OBJECT_UNSET_85, - /* 0x086 */ OBJECT_GI_KEY, - /* 0x087 */ OBJECT_MIR_RAY, - /* 0x088 */ OBJECT_CTOWER_ROT, - /* 0x089 */ OBJECT_UNSET_89, - /* 0x08A */ OBJECT_BDOOR, - /* 0x08B */ OBJECT_UNSET_8B, - /* 0x08C */ OBJECT_UNSET_8C, - /* 0x08D */ OBJECT_UNSET_8D, - /* 0x08E */ OBJECT_SB, - /* 0x08F */ OBJECT_GI_MELODY, - /* 0x090 */ OBJECT_GI_HEART, - /* 0x091 */ OBJECT_GI_COMPASS, - /* 0x092 */ OBJECT_GI_BOSSKEY, - /* 0x093 */ OBJECT_UNSET_93, - /* 0x094 */ OBJECT_GI_NUTS, - /* 0x095 */ OBJECT_UNSET_95, - /* 0x096 */ OBJECT_GI_HEARTS, - /* 0x097 */ OBJECT_GI_ARROWCASE, - /* 0x098 */ OBJECT_GI_BOMBPOUCH, - /* 0x099 */ OBJECT_IN, - /* 0x09A */ OBJECT_UNSET_9A, - /* 0x09B */ OBJECT_UNSET_9B, - /* 0x09C */ OBJECT_UNSET_9C, - /* 0x09D */ OBJECT_OS_ANIME, - /* 0x09E */ OBJECT_GI_BOTTLE, - /* 0x09F */ OBJECT_GI_STICK, - /* 0x0A0 */ OBJECT_GI_MAP, - /* 0x0A1 */ OBJECT_OF1D_MAP, - /* 0x0A2 */ OBJECT_RU2, - /* 0x0A3 */ OBJECT_UNSET_A3, - /* 0x0A4 */ OBJECT_GI_MAGICPOT, - /* 0x0A5 */ OBJECT_GI_BOMB_1, - /* 0x0A6 */ OBJECT_UNSET_A6, - /* 0x0A7 */ OBJECT_MA2, - /* 0x0A8 */ OBJECT_GI_PURSE, - /* 0x0A9 */ OBJECT_UNSET_A9, - /* 0x0AA */ OBJECT_UNSET_AA, - /* 0x0AB */ OBJECT_RR, - /* 0x0AC */ OBJECT_UNSET_AC, - /* 0x0AD */ OBJECT_UNSET_AD, - /* 0x0AE */ OBJECT_UNSET_AE, - /* 0x0AF */ OBJECT_GI_ARROW, - /* 0x0B0 */ OBJECT_GI_BOMB_2, - /* 0x0B1 */ OBJECT_UNSET_B1, - /* 0x0B2 */ OBJECT_UNSET_B2, - /* 0x0B3 */ OBJECT_GI_SHIELD_2, - /* 0x0B4 */ OBJECT_GI_HOOKSHOT, - /* 0x0B5 */ OBJECT_GI_OCARINA, - /* 0x0B6 */ OBJECT_GI_MILK, - /* 0x0B7 */ OBJECT_MA1, - /* 0x0B8 */ OBJECT_UNSET_B8, - /* 0x0B9 */ OBJECT_UNSET_B9, - /* 0x0BA */ OBJECT_UNSET_BA, - /* 0x0BB */ OBJECT_NY, - /* 0x0BC */ OBJECT_FR, - /* 0x0BD */ OBJECT_UNSET_BD, - /* 0x0BE */ OBJECT_UNSET_BE, - /* 0x0BF */ OBJECT_GI_BOW, - /* 0x0C0 */ OBJECT_GI_GLASSES, - /* 0x0C1 */ OBJECT_GI_LIQUID, - /* 0x0C2 */ OBJECT_ANI, - /* 0x0C3 */ OBJECT_GI_SHIELD_3, - /* 0x0C4 */ OBJECT_UNSET_C4, - /* 0x0C5 */ OBJECT_UNSET_C5, - /* 0x0C6 */ OBJECT_GI_BEAN, - /* 0x0C7 */ OBJECT_GI_FISH, - /* 0x0C8 */ OBJECT_UNSET_C8, - /* 0x0C9 */ OBJECT_UNSET_C9, - /* 0x0CA */ OBJECT_UNSET_CA, - /* 0x0CB */ OBJECT_GI_LONGSWORD, - /* 0x0CC */ OBJECT_UNSET_CC, - /* 0x0CD */ OBJECT_UNSET_CD, - /* 0x0CE */ OBJECT_UNSET_CE, - /* 0x0CF */ OBJECT_UNSET_CF, - /* 0x0D0 */ OBJECT_ZO, - /* 0x0D1 */ OBJECT_UNSET_D1, - /* 0x0D2 */ OBJECT_UMAJUMP, - /* 0x0D3 */ OBJECT_UNSET_D3, - /* 0x0D4 */ OBJECT_UNSET_D4, - /* 0x0D5 */ OBJECT_MASTERGOLON, - /* 0x0D6 */ OBJECT_MASTERZOORA, - /* 0x0D7 */ OBJECT_AOB, - /* 0x0D8 */ OBJECT_IK, - /* 0x0D9 */ OBJECT_AHG, - /* 0x0DA */ OBJECT_CNE, - /* 0x0DB */ OBJECT_UNSET_DB, - /* 0x0DC */ OBJECT_UNSET_DC, - /* 0x0DD */ OBJECT_AN3, - /* 0x0DE */ OBJECT_BJI, - /* 0x0DF */ OBJECT_BBA, - /* 0x0E0 */ OBJECT_AN2, - /* 0x0E1 */ OBJECT_UNSET_E1, - /* 0x0E2 */ OBJECT_AN1, - /* 0x0E3 */ OBJECT_BOJ, - /* 0x0E4 */ OBJECT_FZ, - /* 0x0E5 */ OBJECT_BOB, - /* 0x0E6 */ OBJECT_GE1, - /* 0x0E7 */ OBJECT_YABUSAME_POINT, - /* 0x0E8 */ OBJECT_UNSET_E8, - /* 0x0E9 */ OBJECT_UNSET_E9, - /* 0x0EA */ OBJECT_UNSET_EA, - /* 0x0EB */ OBJECT_UNSET_EB, - /* 0x0EC */ OBJECT_D_HSBLOCK, - /* 0x0ED */ OBJECT_D_LIFT, - /* 0x0EE */ OBJECT_MAMENOKI, - /* 0x0EF */ OBJECT_GOROIWA, - /* 0x0F0 */ OBJECT_TORYO, - /* 0x0F1 */ OBJECT_DAIKU, - /* 0x0F2 */ OBJECT_NWC, - /* 0x0F3 */ OBJECT_GM, - /* 0x0F4 */ OBJECT_MS, - /* 0x0F5 */ OBJECT_HS, - /* 0x0F6 */ OBJECT_UNSET_F6, - /* 0x0F7 */ OBJECT_LIGHTSWITCH, - /* 0x0F8 */ OBJECT_KUSA, - /* 0x0F9 */ OBJECT_TSUBO, - /* 0x0FA */ OBJECT_UNSET_FA, - /* 0x0FB */ OBJECT_UNSET_FB, - /* 0x0FC */ OBJECT_KANBAN, - /* 0x0FD */ OBJECT_OWL, - /* 0x0FE */ OBJECT_MK, - /* 0x0FF */ OBJECT_FU, - /* 0x100 */ OBJECT_GI_KI_TAN_MASK, - /* 0x101 */ OBJECT_UNSET_101, - /* 0x102 */ OBJECT_GI_MASK18, - /* 0x103 */ OBJECT_GI_RABIT_MASK, - /* 0x104 */ OBJECT_GI_TRUTH_MASK, - /* 0x105 */ OBJECT_UNSET_105, - /* 0x106 */ OBJECT_STREAM, - /* 0x107 */ OBJECT_MM, - /* 0x108 */ OBJECT_UNSET_108, - /* 0x109 */ OBJECT_UNSET_109, - /* 0x10A */ OBJECT_UNSET_10A, - /* 0x10B */ OBJECT_UNSET_10B, - /* 0x10C */ OBJECT_UNSET_10C, - /* 0x10D */ OBJECT_UNSET_10D, - /* 0x10E */ OBJECT_UNSET_10E, - /* 0x10F */ OBJECT_JS, - /* 0x110 */ OBJECT_CS, - /* 0x111 */ OBJECT_UNSET_111, - /* 0x112 */ OBJECT_UNSET_112, - /* 0x113 */ OBJECT_GI_SOLDOUT, - /* 0x114 */ OBJECT_UNSET_114, - /* 0x115 */ OBJECT_MAG, - /* 0x116 */ OBJECT_UNSET_116, - /* 0x117 */ OBJECT_UNSET_117, - /* 0x118 */ OBJECT_UNSET_118, - /* 0x119 */ OBJECT_GI_GOLONMASK, - /* 0x11A */ OBJECT_GI_ZORAMASK, - /* 0x11B */ OBJECT_UNSET_11B, - /* 0x11C */ OBJECT_UNSET_11C, - /* 0x11D */ OBJECT_KA, - /* 0x11E */ OBJECT_UNSET_11E, - /* 0x11F */ OBJECT_ZG, - /* 0x120 */ OBJECT_UNSET_120, - /* 0x121 */ OBJECT_GI_M_ARROW, - /* 0x122 */ OBJECT_DS2, - /* 0x123 */ OBJECT_UNSET_123, - /* 0x124 */ OBJECT_FISH, - /* 0x125 */ OBJECT_GI_SUTARU, - /* 0x126 */ OBJECT_UNSET_126, - /* 0x127 */ OBJECT_SSH, - /* 0x128 */ OBJECT_BIGSLIME, - /* 0x129 */ OBJECT_BG, - /* 0x12A */ OBJECT_BOMBIWA, - /* 0x12B */ OBJECT_HINTNUTS, - /* 0x12C */ OBJECT_RS, - /* 0x12D */ OBJECT_UNSET_12D, - /* 0x12E */ OBJECT_GLA, - /* 0x12F */ OBJECT_UNSET_12F, - /* 0x130 */ OBJECT_GELDB, - /* 0x131 */ OBJECT_UNSET_131, - /* 0x132 */ OBJECT_DOG, - /* 0x133 */ OBJECT_KIBAKO2, - /* 0x134 */ OBJECT_DNS, - /* 0x135 */ OBJECT_DNK, - /* 0x136 */ OBJECT_UNSET_136, - /* 0x137 */ OBJECT_GI_INSECT, - /* 0x138 */ OBJECT_UNSET_138, - /* 0x139 */ OBJECT_GI_GHOST, - /* 0x13A */ OBJECT_GI_SOUL, - /* 0x13B */ OBJECT_UNSET_13B, - /* 0x13C */ OBJECT_UNSET_13C, - /* 0x13D */ OBJECT_UNSET_13D, - /* 0x13E */ OBJECT_UNSET_13E, - /* 0x13F */ OBJECT_GI_RUPY, - /* 0x140 */ OBJECT_MU, - /* 0x141 */ OBJECT_WF, - /* 0x142 */ OBJECT_SKB, - /* 0x143 */ OBJECT_GS, - /* 0x144 */ OBJECT_PS, - /* 0x145 */ OBJECT_OMOYA_OBJ, - /* 0x146 */ OBJECT_COW, - /* 0x147 */ OBJECT_UNSET_147, - /* 0x148 */ OBJECT_GI_SWORD_1, - /* 0x149 */ OBJECT_UNSET_149, - /* 0x14A */ OBJECT_UNSET_14A, - /* 0x14B */ OBJECT_ZL4, - /* 0x14C */ OBJECT_LINK_GORON, - /* 0x14D */ OBJECT_LINK_ZORA, - /* 0x14E */ OBJECT_GRASSHOPPER, - /* 0x14F */ OBJECT_BOYO, - /* 0x150 */ OBJECT_UNSET_150, - /* 0x151 */ OBJECT_UNSET_151, - /* 0x152 */ OBJECT_UNSET_152, - /* 0x153 */ OBJECT_FWALL, - /* 0x154 */ OBJECT_LINK_NUTS, - /* 0x155 */ OBJECT_JSO, - /* 0x156 */ OBJECT_KNIGHT, - /* 0x157 */ OBJECT_ICICLE, - /* 0x158 */ OBJECT_SPDWEB, - /* 0x159 */ OBJECT_UNSET_159, - /* 0x15A */ OBJECT_BOSS01, - /* 0x15B */ OBJECT_BOSS02, - /* 0x15C */ OBJECT_BOSS03, - /* 0x15D */ OBJECT_BOSS04, - /* 0x15E */ OBJECT_BOSS05, - /* 0x15F */ OBJECT_BOSS06, - /* 0x160 */ OBJECT_BOSS07, - /* 0x161 */ OBJECT_RAF, - /* 0x162 */ OBJECT_FUNEN, - /* 0x163 */ OBJECT_RAILLIFT, - /* 0x164 */ OBJECT_NUMA_OBJ, - /* 0x165 */ OBJECT_FLOWERPOT, - /* 0x166 */ OBJECT_SPINYROLL, - /* 0x167 */ OBJECT_ICE_BLOCK, - /* 0x168 */ OBJECT_UNSET_168, - /* 0x169 */ OBJECT_KEIKOKU_DEMO, - /* 0x16A */ OBJECT_SLIME, - /* 0x16B */ OBJECT_PR, - /* 0x16C */ OBJECT_F52_OBJ, - /* 0x16D */ OBJECT_F53_OBJ, - /* 0x16E */ OBJECT_UNSET_16E, - /* 0x16F */ OBJECT_KIBAKO, - /* 0x170 */ OBJECT_SEK, - /* 0x171 */ OBJECT_GMO, - /* 0x172 */ OBJECT_BAT, - /* 0x173 */ OBJECT_SEKIHIL, - /* 0x174 */ OBJECT_SEKIHIG, - /* 0x175 */ OBJECT_SEKIHIN, - /* 0x176 */ OBJECT_SEKIHIZ, - /* 0x177 */ OBJECT_UNSET_177, - /* 0x178 */ OBJECT_WIZ, - /* 0x179 */ OBJECT_LADDER, - /* 0x17A */ OBJECT_MKK, - /* 0x17B */ OBJECT_UNSET_17B, - /* 0x17C */ OBJECT_UNSET_17C, - /* 0x17D */ OBJECT_UNSET_17D, - /* 0x17E */ OBJECT_KEIKOKU_OBJ, - /* 0x17F */ OBJECT_SICHITAI_OBJ, - /* 0x180 */ OBJECT_DEKUCITY_ANA_OBJ, - /* 0x181 */ OBJECT_RAT, - /* 0x182 */ OBJECT_WATER_EFFECT, - /* 0x183 */ OBJECT_UNSET_183, - /* 0x184 */ OBJECT_DBLUE_OBJECT, - /* 0x185 */ OBJECT_BAL, - /* 0x186 */ OBJECT_WARP_UZU, - /* 0x187 */ OBJECT_DRIFTICE, - /* 0x188 */ OBJECT_FALL, - /* 0x189 */ OBJECT_HANAREYAMA_OBJ, - /* 0x18A */ OBJECT_CRACE_OBJECT, - /* 0x18B */ OBJECT_DNO, - /* 0x18C */ OBJECT_OBJ_TOKEIDAI, - /* 0x18D */ OBJECT_EG, - /* 0x18E */ OBJECT_TRU, - /* 0x18F */ OBJECT_TRT, - /* 0x190 */ OBJECT_HAKUGIN_OBJ, - /* 0x191 */ OBJECT_HORSE_GAME_CHECK, - /* 0x192 */ OBJECT_STK, - /* 0x193 */ OBJECT_UNSET_193, - /* 0x194 */ OBJECT_UNSET_194, - /* 0x195 */ OBJECT_MNK, - /* 0x196 */ OBJECT_GI_BOTTLE_RED, - /* 0x197 */ OBJECT_TOKEI_TOBIRA, - /* 0x198 */ OBJECT_AZ, - /* 0x199 */ OBJECT_TWIG, - /* 0x19A */ OBJECT_DEKUCITY_OBJ, - /* 0x19B */ OBJECT_PO_FUSEN, - /* 0x19C */ OBJECT_RACETSUBO, - /* 0x19D */ OBJECT_HA, - /* 0x19E */ OBJECT_BIGOKUTA, - /* 0x19F */ OBJECT_OPEN_OBJ, - /* 0x1A0 */ OBJECT_FU_KAITEN, - /* 0x1A1 */ OBJECT_FU_MATO, - /* 0x1A2 */ OBJECT_MTORIDE, - /* 0x1A3 */ OBJECT_OSN, - /* 0x1A4 */ OBJECT_TOKEI_STEP, - /* 0x1A5 */ OBJECT_LOTUS, - /* 0x1A6 */ OBJECT_TL, - /* 0x1A7 */ OBJECT_DKJAIL_OBJ, - /* 0x1A8 */ OBJECT_VISIBLOCK, - /* 0x1A9 */ OBJECT_TSN, - /* 0x1AA */ OBJECT_DS2N, - /* 0x1AB */ OBJECT_FSN, - /* 0x1AC */ OBJECT_SHN, - /* 0x1AD */ OBJECT_BIGICICLE, - /* 0x1AE */ OBJECT_GI_BOTTLE_15, - /* 0x1AF */ OBJECT_TK, - /* 0x1B0 */ OBJECT_MARKET_OBJ, - /* 0x1B1 */ OBJECT_GI_RESERVE00, - /* 0x1B2 */ OBJECT_GI_RESERVE01, - /* 0x1B3 */ OBJECT_LIGHTBLOCK, - /* 0x1B4 */ OBJECT_TAKARAYA_OBJECTS, - /* 0x1B5 */ OBJECT_WDHAND, - /* 0x1B6 */ OBJECT_SDN, - /* 0x1B7 */ OBJECT_SNOWWD, - /* 0x1B8 */ OBJECT_GIANT, - /* 0x1B9 */ OBJECT_COMB, - /* 0x1BA */ OBJECT_HANA, - /* 0x1BB */ OBJECT_BOSS_HAKUGIN, - /* 0x1BC */ OBJECT_MEGANEANA_OBJ, - /* 0x1BD */ OBJECT_GI_NUTSMASK, - /* 0x1BE */ OBJECT_STK2, - /* 0x1BF */ OBJECT_SPOT11_OBJ, - /* 0x1C0 */ OBJECT_DANPEI_OBJECT, - /* 0x1C1 */ OBJECT_DHOUSE, - /* 0x1C2 */ OBJECT_HAKAISI, - /* 0x1C3 */ OBJECT_PO, - /* 0x1C4 */ OBJECT_SNOWMAN, - /* 0x1C5 */ OBJECT_PO_SISTERS, - /* 0x1C6 */ OBJECT_PP, - /* 0x1C7 */ OBJECT_GORONSWITCH, - /* 0x1C8 */ OBJECT_DELF, - /* 0x1C9 */ OBJECT_BOTIHASIRA, - /* 0x1CA */ OBJECT_GI_BIGBOMB, - /* 0x1CB */ OBJECT_PST, - /* 0x1CC */ OBJECT_BSMASK, - /* 0x1CD */ OBJECT_SPIDERTENT, - /* 0x1CE */ OBJECT_ZORAEGG, - /* 0x1CF */ OBJECT_KBT, - /* 0x1D0 */ OBJECT_GG, - /* 0x1D1 */ OBJECT_MARUTA, - /* 0x1D2 */ OBJECT_GHAKA, - /* 0x1D3 */ OBJECT_OYU, - /* 0x1D4 */ OBJECT_DNQ, - /* 0x1D5 */ OBJECT_DAI, - /* 0x1D6 */ OBJECT_KGY, - /* 0x1D7 */ OBJECT_FB, - /* 0x1D8 */ OBJECT_TAISOU, - /* 0x1D9 */ OBJECT_MASK_BU_SAN, - /* 0x1DA */ OBJECT_MASK_KI_TAN, - /* 0x1DB */ OBJECT_MASK_RABIT, - /* 0x1DC */ OBJECT_MASK_SKJ, - /* 0x1DD */ OBJECT_MASK_BAKURETU, - /* 0x1DE */ OBJECT_MASK_TRUTH, - /* 0x1DF */ OBJECT_GK, - /* 0x1E0 */ OBJECT_HAKA_OBJ, - /* 0x1E1 */ OBJECT_MASK_GORON, - /* 0x1E2 */ OBJECT_MASK_ZORA, - /* 0x1E3 */ OBJECT_MASK_NUTS, - /* 0x1E4 */ OBJECT_MASK_BOY, - /* 0x1E5 */ OBJECT_DNT, - /* 0x1E6 */ OBJECT_YUKIYAMA, - /* 0x1E7 */ OBJECT_ICEFLOE, - /* 0x1E8 */ OBJECT_GI_GOLD_DUST, - /* 0x1E9 */ OBJECT_GI_BOTTLE_16, - /* 0x1EA */ OBJECT_GI_BOTTLE_22, - /* 0x1EB */ OBJECT_BEE, - /* 0x1EC */ OBJECT_OT, - /* 0x1ED */ OBJECT_UTUBO, - /* 0x1EE */ OBJECT_DORA, - /* 0x1EF */ OBJECT_GI_LOACH, - /* 0x1F0 */ OBJECT_GI_SEAHORSE, - /* 0x1F1 */ OBJECT_BIGPO, - /* 0x1F2 */ OBJECT_HARIKO, - /* 0x1F3 */ OBJECT_DNJ, - /* 0x1F4 */ OBJECT_SINKAI_KABE, - /* 0x1F5 */ OBJECT_KIN2_OBJ, - /* 0x1F6 */ OBJECT_ISHI, - /* 0x1F7 */ OBJECT_HAKUGIN_DEMO, - /* 0x1F8 */ OBJECT_JG, - /* 0x1F9 */ OBJECT_GI_SWORD_2, - /* 0x1FA */ OBJECT_GI_SWORD_3, - /* 0x1FB */ OBJECT_GI_SWORD_4, - /* 0x1FC */ OBJECT_UM, - /* 0x1FD */ OBJECT_MASK_GIBUDO, - /* 0x1FE */ OBJECT_MASK_JSON, - /* 0x1FF */ OBJECT_MASK_KERFAY, - /* 0x200 */ OBJECT_MASK_BIGELF, - /* 0x201 */ OBJECT_RB, - /* 0x202 */ OBJECT_MBAR_OBJ, - /* 0x203 */ OBJECT_IKANA_OBJ, - /* 0x204 */ OBJECT_KZ, - /* 0x205 */ OBJECT_TOKEI_TURRET, - /* 0x206 */ OBJECT_ZOG, - /* 0x207 */ OBJECT_ROTLIFT, - /* 0x208 */ OBJECT_POSTHOUSE_OBJ, - /* 0x209 */ OBJECT_GI_MASK09, - /* 0x20A */ OBJECT_GI_MASK14, - /* 0x20B */ OBJECT_GI_MASK15, - /* 0x20C */ OBJECT_INIBS_OBJECT, - /* 0x20D */ OBJECT_TREE, - /* 0x20E */ OBJECT_KAIZOKU_OBJ, - /* 0x20F */ OBJECT_GI_RESERVE_B_00, - /* 0x210 */ OBJECT_GI_RESERVE_C_00, - /* 0x211 */ OBJECT_ZOB, - /* 0x212 */ OBJECT_MILKBAR, - /* 0x213 */ OBJECT_DMASK, - /* 0x214 */ OBJECT_MASK_KYOJIN, - /* 0x215 */ OBJECT_GI_RESERVE_C_01, - /* 0x216 */ OBJECT_ZOD, - /* 0x217 */ OBJECT_KUMO30, - /* 0x218 */ OBJECT_OBJ_YASI, - /* 0x219 */ OBJECT_MASK_ROMERNY, - /* 0x21A */ OBJECT_TANRON1, - /* 0x21B */ OBJECT_TANRON2, - /* 0x21C */ OBJECT_TANRON3, - /* 0x21D */ OBJECT_GI_MAGICMUSHROOM, - /* 0x21E */ OBJECT_OBJ_CHAN, - /* 0x21F */ OBJECT_GI_MASK10, - /* 0x220 */ OBJECT_ZOS, - /* 0x221 */ OBJECT_MASK_POSTHAT, - /* 0x222 */ OBJECT_F40_SWITCH, - /* 0x223 */ OBJECT_LODMOON, - /* 0x224 */ OBJECT_TRO, - /* 0x225 */ OBJECT_GI_MASK12, - /* 0x226 */ OBJECT_GI_MASK23, - /* 0x227 */ OBJECT_GI_BOTTLE_21, - /* 0x228 */ OBJECT_GI_CAMERA, - /* 0x229 */ OBJECT_KAMEJIMA, - /* 0x22A */ OBJECT_HARFGIBUD, - /* 0x22B */ OBJECT_ZOV, - /* 0x22C */ OBJECT_HGDOOR, - /* 0x22D */ OBJECT_UNSET_22D, - /* 0x22E */ OBJECT_UNSET_22E, - /* 0x22F */ OBJECT_UNSET_22F, - /* 0x230 */ OBJECT_DOR01, - /* 0x231 */ OBJECT_DOR02, - /* 0x232 */ OBJECT_DOR03, - /* 0x233 */ OBJECT_DOR04, - /* 0x234 */ OBJECT_LAST_OBJ, - /* 0x235 */ OBJECT_REDEAD_OBJ, - /* 0x236 */ OBJECT_IKNINSIDE_OBJ, - /* 0x237 */ OBJECT_IKNV_OBJ, - /* 0x238 */ OBJECT_PAMERA, - /* 0x239 */ OBJECT_HSSTUMP, - /* 0x23A */ OBJECT_ZM, - /* 0x23B */ OBJECT_BIG_FWALL, - /* 0x23C */ OBJECT_SECOM_OBJ, - /* 0x23D */ OBJECT_HUNSUI, - /* 0x23E */ OBJECT_UCH, - /* 0x23F */ OBJECT_TANRON4, - /* 0x240 */ OBJECT_TANRON5, - /* 0x241 */ OBJECT_DT, - /* 0x242 */ OBJECT_GI_MASK03, - /* 0x243 */ OBJECT_CHA, - /* 0x244 */ OBJECT_OBJ_DINNER, - /* 0x245 */ OBJECT_GI_RESERVE_B_01, - /* 0x246 */ OBJECT_LASTDAY, - /* 0x247 */ OBJECT_BAI, - /* 0x248 */ OBJECT_IN2, - /* 0x249 */ OBJECT_IKN_DEMO, - /* 0x24A */ OBJECT_YB, - /* 0x24B */ OBJECT_RZ, - /* 0x24C */ OBJECT_MASK_ZACHO, - /* 0x24D */ OBJECT_GI_FIELDMAP, - /* 0x24E */ OBJECT_MASK_STONE, - /* 0x24F */ OBJECT_BJT, - /* 0x250 */ OBJECT_TARU, - /* 0x251 */ OBJECT_MOONSTON, - /* 0x252 */ OBJECT_MASK_BREE, - /* 0x253 */ OBJECT_GI_SCHEDULE, - /* 0x254 */ OBJECT_GI_STONEMASK, - /* 0x255 */ OBJECT_ZORABAND, - /* 0x256 */ OBJECT_KEPN_KOYA, - /* 0x257 */ OBJECT_OBJ_USIYANE, - /* 0x258 */ OBJECT_GI_MASK05, - /* 0x259 */ OBJECT_GI_MASK11, - /* 0x25A */ OBJECT_GI_MASK20, - /* 0x25B */ OBJECT_NNH, - /* 0x25C */ OBJECT_MASK_GERO, - /* 0x25D */ OBJECT_MASK_YOFUKASI, - /* 0x25E */ OBJECT_MASK_MEOTO, - /* 0x25F */ OBJECT_MASK_DANCER, - /* 0x260 */ OBJECT_KZSAKU, - /* 0x261 */ OBJECT_OBJ_MILK_BIN, - /* 0x262 */ OBJECT_RANDOM_OBJ, - /* 0x263 */ OBJECT_KUJIYA, - /* 0x264 */ OBJECT_KITAN, - /* 0x265 */ OBJECT_GI_MASK06, - /* 0x266 */ OBJECT_GI_MASK16, - /* 0x267 */ OBJECT_ASTR_OBJ, - /* 0x268 */ OBJECT_BSB, - /* 0x269 */ OBJECT_FALL2, - /* 0x26A */ OBJECT_STH, - /* 0x26B */ OBJECT_GI_MSSA, - /* 0x26C */ OBJECT_SMTOWER, - /* 0x26D */ OBJECT_GI_MASK21, - /* 0x26E */ OBJECT_YADO_OBJ, - /* 0x26F */ OBJECT_SYOTEN, - /* 0x270 */ OBJECT_MOONEND, - /* 0x271 */ OBJECT_OB, - /* 0x272 */ OBJECT_GI_BOTTLE_04, - /* 0x273 */ OBJECT_OBJ_DANPEILIFT, - /* 0x274 */ OBJECT_WDOR01, - /* 0x275 */ OBJECT_WDOR02, - /* 0x276 */ OBJECT_WDOR03, - /* 0x277 */ OBJECT_STK3, - /* 0x278 */ OBJECT_KINSTA1_OBJ, - /* 0x279 */ OBJECT_KINSTA2_OBJ, - /* 0x27A */ OBJECT_BH, - /* 0x27B */ OBJECT_WDOR04, - /* 0x27C */ OBJECT_WDOR05, - /* 0x27D */ OBJECT_GI_MASK17, - /* 0x27E */ OBJECT_GI_MASK22, - /* 0x27F */ OBJECT_LBFSHOT, - /* 0x280 */ OBJECT_FUSEN, - /* 0x281 */ OBJECT_ENDING_OBJ, - /* 0x282 */ OBJECT_GI_MASK13, +#define DEFINE_OBJECT(_name, enumValue) enumValue, +#define DEFINE_OBJECT_UNSET(enumValue) enumValue, +#define DEFINE_OBJECT_SIZE_ZERO(_name, enumValue) enumValue, + +typedef enum ObjectId { + #include "tables/object_table.h" /* 0x283 */ OBJECT_ID_MAX -} ObjectID; +} ObjectId; + +#undef DEFINE_OBJECT +#undef DEFINE_OBJECT_UNSET +#undef DEFINE_OBJECT_SIZE_ZERO #endif diff --git a/spec b/spec index d662369614..754baa265c 100644 --- a/spec +++ b/spec @@ -513,7 +513,7 @@ beginseg pad_text include "build/data/code/code_801C2410.data.o" include "build/src/code/z_scene.o" - include "build/data/code/code_801C2730.data.o" + include "build/src/code/object_table.o" include "build/src/code/z_scene_proc.o" include "build/src/code/z_scene_table.o" include "build/src/code/z_schedule.o" diff --git a/src/code/object_table.c b/src/code/object_table.c new file mode 100644 index 0000000000..aa73199b82 --- /dev/null +++ b/src/code/object_table.c @@ -0,0 +1,24 @@ +#include "global.h" + +s16 gPlayerFormObjectIndices[PLAYER_FORM_MAX] = { + OBJECT_LINK_BOY, // PLAYER_FORM_FIERCE_DEITY + OBJECT_LINK_GORON, // PLAYER_FORM_GORON + OBJECT_LINK_ZORA, // PLAYER_FORM_ZORA + OBJECT_LINK_NUTS, // PLAYER_FORM_DEKU + OBJECT_LINK_CHILD, // PLAYER_FORM_HUMAN +}; + +ObjectId gObjectTableSize = OBJECT_ID_MAX; + +// Object Table definition +#define DEFINE_OBJECT(name, _enumValue) { SEGMENT_ROM_START(name), SEGMENT_ROM_END(name) }, +#define DEFINE_OBJECT_UNSET(_enumValue) { 0, 0 }, +#define DEFINE_OBJECT_SIZE_ZERO(name, _enumValue) { SEGMENT_ROM_START(name), SEGMENT_ROM_START(name) }, + +RomFile gObjectTable[] = { +#include "tables/object_table.h" +}; + +#undef DEFINE_OBJECT +#undef DEFINE_OBJECT_UNSET +#undef DEFINE_OBJECT_SIZE_ZERO 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 a64e8a9471..aac1cb6374 100644 --- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c +++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c @@ -3,6 +3,7 @@ * Overlay: ovl_En_Fishing * Description: Fishing Pond Elements (Owner, Fish, Props, Effects...) */ + #include "prevent_bss_reordering.h" #include "z_en_fishing.h" #include "z64rumble.h" diff --git a/tools/disasm/files.txt b/tools/disasm/files.txt index 9b97a8fc3d..0b15fa8345 100644 --- a/tools/disasm/files.txt +++ b/tools/disasm/files.txt @@ -554,7 +554,7 @@ 0x801C1D30 : "code_8012EC80", 0x801C2410 : "code_801C2410", 0x801C2650 : "z_scene", - 0x801C2730 : "", + 0x801C2730 : "object_table", 0x801C3B60 : "z_scene_proc", 0x801C3CA0 : "z_scene_table", 0x801C5C50 : "z_schedule", diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index c723f48d49..f74ea0a5f6 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -1360,7 +1360,8 @@ 0x801C2650:("tatlMessageFiles","RomFile","[2]",0x10), 0x801C2660:("sceneTextureFiles","RomFile","[9]",0x48), 0x801C26A8:("sceneHeaderFuncTable","scene_header_func","[31]",0x7c), - 0x801C2730:("gPlayerFormObjectIndices","s16","[8]",0x10), + 0x801C2730:("gPlayerFormObjectIndices","s16","[5]",0xA), + 0x801C273C:("gObjectTableSize","ObjectId","",0x4), 0x801C2740:("gObjectTable","RomFile","[643]",0x1418), 0x801C3B60:("sSceneDrawDefaultDl","Gfx","[11]",0x58), 0x801C3BB8:("gSceneProcSceneDrawFuncs","SceneDrawConfigFunc","[8]",0x20), From a7fd595136a97448822eced0f8d14666554c32b5 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Tue, 21 Feb 2023 16:31:11 -0300 Subject: [PATCH 06/29] Debloating `z64.h` 1: Introducing `z64skybox.h` (#1150) * z64skybox.h * Add a few placeholder values on the enum * Remove unused structs on z64.h * Update include/z64skybox.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * move skybox functions * format * Revert ARRAY_COUNT(msg) * bss * whoops * Update include/z64.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * SkyboxDraw -> Skybox_ * use enum in z_play * format --------- Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> --- include/functions.h | 10 --- include/z64.h | 81 +------------------ include/z64skybox.h | 67 +++++++++++++++ src/boot_O2_g3/irqmgr.c | 2 +- src/code/z_play.c | 22 ++--- src/code/z_vr_box.c | 10 +-- src/code/z_vr_box_draw.c | 8 +- src/overlays/actors/ovl_Boss_02/z_boss_02.c | 6 +- src/overlays/actors/ovl_En_Bom/z_en_bom.c | 2 +- .../ovl_En_Weather_Tag/z_en_weather_tag.c | 6 +- tools/disasm/functions.txt | 8 +- 11 files changed, 102 insertions(+), 120 deletions(-) create mode 100644 include/z64skybox.h diff --git a/include/functions.h b/include/functions.h index 5d23991a51..110bb867a5 100644 --- a/include/functions.h +++ b/include/functions.h @@ -2164,16 +2164,6 @@ void func_801420C0(void* arg0); void func_801420F4(void* arg0); void func_80142100(void* arg0, Gfx** gfx, u32 arg2); -s32 func_80142440(SkyboxContext* skyboxCtx, Vtx* roomVtx, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8); -void func_80143148(SkyboxContext* skyboxCtx, s32 arg1); -void Skybox_Setup(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyboxId); -void func_80143324(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId); -void Skybox_Init(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyboxId); -Mtx* SkyboxDraw_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z); -void SkyboxDraw_SetColors(SkyboxContext* skyboxCtx, u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB); -void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z); -void SkyboxDraw_Update(SkyboxContext* skyboxCtx); - // void func_80147520(void); void func_80147564(PlayState* play); s32 Message_ShouldAdvance(PlayState* play); diff --git a/include/z64.h b/include/z64.h index e996f4a5a7..e168bedbc8 100644 --- a/include/z64.h +++ b/include/z64.h @@ -48,6 +48,7 @@ #include "z64scene.h" #include "z64schedule.h" #include "z64skin.h" +#include "z64skybox.h" #include "z64subs.h" #include "z64transition.h" #include "z64view.h" @@ -276,8 +277,6 @@ typedef struct { /* 0x10 */ OSTime resetTime; } NmiBuff; // size >= 0x18 -typedef void(*osCreateThread_func)(void*); - typedef enum { SLOWLY_CALLBACK_NO_ARGS, SLOWLY_CALLBACK_ONE_ARG, @@ -306,36 +305,6 @@ typedef struct { /* 0x14 */ OSMesgQueue unk14; } s80185D40; // size = 0x2C -typedef struct { - /* 0x00 */ u32 unk0; - /* 0x04 */ u8 unk4; - /* 0x05 */ u8 unk5; - /* 0x06 */ u8 unk6; - /* 0x07 */ UNK_TYPE1 pad7[0x2]; - /* 0x09 */ u8 unk9; - /* 0x0A */ UNK_TYPE1 padA[0x2]; - /* 0x0C */ u32 unkC; - /* 0x10 */ u16 unk10; - /* 0x12 */ u16 unk12; - /* 0x14 */ u16 unk14; - /* 0x16 */ UNK_TYPE1 pad16[0x2]; - /* 0x18 */ u32 unk18; - /* 0x1C */ u32 unk1C; - /* 0x20 */ u32 unk20; - /* 0x24 */ u32 unk24; - /* 0x28 */ u32 unk28; - /* 0x2C */ u32 unk2C; - /* 0x30 */ u32 unk30; - /* 0x34 */ u32 unk34; -} s8018CFAC; // size = 0x38 - -typedef struct { - /* 0x00 */ Vec3f unk0; - /* 0x0C */ Vec3f unkC; - /* 0x18 */ s16 unk18; - /* 0x1A */ s16 unk1A; -} s80874650; // size = 0x1C - typedef union { F3DVertexColor color; F3DVertexNormal normal; @@ -542,36 +511,6 @@ typedef struct { /* 0xFA */ u8 unk_FA[4]; } EnvironmentContext; // size = 0x100 -typedef struct { - /* 0x000 */ View view; - /* 0x168 */ void* staticSegments[4]; - /* 0x178 */ void* paletteStaticSegment; - /* 0x17C */ Gfx (*dListBuf)[150]; - /* 0x180 */ Gfx* roomDL; - /* 0x184 */ Vtx* roomVtx; - /* 0x188 */ DmaRequest unk188; - /* 0x1A8 */ DmaRequest unk1A8; - /* 0x1C8 */ DmaRequest unk1C8; - /* 0x1E8 */ OSMesgQueue loadQueue; - /* 0x200 */ OSMesg loadMsg; - /* 0x204 */ s16 skyboxShouldDraw; - /* 0x208 */ f32 rotX; - /* 0x20C */ f32 rotY; - /* 0x210 */ f32 rotZ; - /* 0x214 */ Vec3f eye; - /* 0x220 */ s16 angle; - /* 0x222 */ u8 primR; - /* 0x223 */ u8 primG; - /* 0x224 */ u8 primB; - /* 0x225 */ u8 envR; - /* 0x226 */ u8 envG; - /* 0x227 */ u8 envB; -} SkyboxContext; // size = 0x228 - -typedef enum { - /* 0x05 */ SKYBOX_CUTSCENE_MAP = 5 -} SkyboxId; - typedef struct ListAlloc { /* 0x0 */ struct ListAlloc* prev; /* 0x4 */ struct ListAlloc* next; @@ -698,13 +637,7 @@ typedef struct GameState { /* 0xA3 */ u8 unk_A3; } GameState; // size = 0xA4 -typedef struct { - /* 0x00 */ u32 resetting; - /* 0x04 */ u32 resetCount; - /* 0x08 */ OSTime duration; - /* 0x10 */ OSTime resetTime; -} PreNmiBuff; // size = 0x18 (actually osAppNmiBuffer is 0x40 bytes large but the rest is unused) - +struct PlayState; typedef s32 (*ColChkResetFunc)(struct PlayState*, Collider*); typedef void (*ColChkBloodFunc)(struct PlayState*, Collider*, Vec3f*); @@ -906,7 +839,7 @@ typedef struct PlayState { /* 0x18868 */ void* naviQuestHints; // leftover from OoT, system which processes this is removed /* 0x1886C */ AnimatedMaterial* sceneMaterialAnims; /* 0x18870 */ void* specialEffects; - /* 0x18874 */ u8 skyboxId; + /* 0x18874 */ u8 skyboxId; // @see SkyboxId enum /* 0x18875 */ s8 transitionTrigger; // "fade_direction" /* 0x18876 */ s16 worldCoverAlpha; /* 0x18878 */ s16 bgCoverAlpha; @@ -969,14 +902,6 @@ typedef struct { /* 0x10 */ Color_RGBA8_u32 envColor; } Struct_80140E80; // size = 0x14 -typedef struct { - /* 0x00 */ s32 unk0; - /* 0x04 */ s32 unk4; - /* 0x08 */ s32 unk8; - /* 0x0C */ s32 unkC; - /* 0x10 */ s32 unk10; -} struct_801C5F44; // size = 0x14 - // From OoT's struct_80034A14_arg1 typedef struct { /* 0x00 */ s16 unk_00; diff --git a/include/z64skybox.h b/include/z64skybox.h new file mode 100644 index 0000000000..1664b94b13 --- /dev/null +++ b/include/z64skybox.h @@ -0,0 +1,67 @@ +#ifndef Z64_SKYBOX_H +#define Z64_SKYBOX_H + +#include "PR/ultratypes.h" +#include "PR/gbi.h" + +#include "z64dma.h" +#include "z64math.h" +#include "z64view.h" + +struct GraphicsContext; +struct GameState; +struct PlayState; + +typedef enum SkyboxId { + /* 0 */ SKYBOX_NONE, + /* 1 */ SKYBOX_NORMAL_SKY, + /* 2 */ SKYBOX_2, + /* 3 */ SKYBOX_3, + /* 5 */ SKYBOX_CUTSCENE_MAP = 5 +} SkyboxId; + +typedef struct SkyboxContext { + /* 0x000 */ View view; + /* 0x168 */ void* staticSegments[4]; + /* 0x178 */ void* paletteStaticSegment; + /* 0x17C */ Gfx (*dListBuf)[150]; + /* 0x180 */ Gfx* roomDL; + /* 0x184 */ Vtx* roomVtx; + /* 0x188 */ DmaRequest unk188; + /* 0x1A8 */ DmaRequest unk1A8; + /* 0x1C8 */ DmaRequest unk1C8; + /* 0x1E8 */ OSMesgQueue loadQueue; + /* 0x200 */ OSMesg loadMsg; + /* 0x204 */ s16 skyboxShouldDraw; + /* 0x208 */ f32 rotX; + /* 0x20C */ f32 rotY; + /* 0x210 */ f32 rotZ; + /* 0x214 */ Vec3f eye; + /* 0x220 */ s16 angle; + /* 0x222 */ u8 primR; + /* 0x223 */ u8 primG; + /* 0x224 */ u8 primB; + /* 0x225 */ u8 envR; + /* 0x226 */ u8 envG; + /* 0x227 */ u8 envB; +} SkyboxContext; // size = 0x228 + +typedef struct struct_801C5F44 { + /* 0x00 */ s32 unk0; + /* 0x04 */ s32 unk4; + /* 0x08 */ s32 unk8; + /* 0x0C */ s32 unkC; + /* 0x10 */ s32 unk10; +} struct_801C5F44; // size = 0x14 + +s32 func_80142440(SkyboxContext* skyboxCtx, Vtx* roomVtx, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8); +void func_80143148(SkyboxContext* skyboxCtx, s32 arg1); +void Skybox_Setup(struct GameState* gameState, SkyboxContext* skyboxCtx, s16 skyboxId); +void func_80143324(struct PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId); +void Skybox_Init(struct GameState* gameState, SkyboxContext* skyboxCtx, s16 skyboxId); +Mtx* Skybox_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z); +void Skybox_SetColors(SkyboxContext* skyboxCtx, u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB); +void Skybox_Draw(SkyboxContext* skyboxCtx, struct GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z); +void Skybox_Update(SkyboxContext* skyboxCtx); + +#endif diff --git a/src/boot_O2_g3/irqmgr.c b/src/boot_O2_g3/irqmgr.c index b100f209d5..152c69b89a 100644 --- a/src/boot_O2_g3/irqmgr.c +++ b/src/boot_O2_g3/irqmgr.c @@ -163,6 +163,6 @@ void IrqMgr_Init(IrqMgr* irqmgr, void* stack, OSPri pri, u8 retraceCount) { osSetEventMesg(0xE, &irqmgr->irqQueue, (OSMesg)0x29D); osViSetEvent(&irqmgr->irqQueue, (OSMesg)0x29A, retraceCount); - osCreateThread(&irqmgr->thread, Z_THREAD_ID_IRQMGR, (osCreateThread_func)IrqMgr_ThreadEntry, irqmgr, stack, pri); + osCreateThread(&irqmgr->thread, Z_THREAD_ID_IRQMGR, IrqMgr_ThreadEntry, irqmgr, stack, pri); osStartThread(&irqmgr->thread); } diff --git a/src/code/z_play.c b/src/code/z_play.c index 740f79d9e1..c6c3cc2735 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -991,7 +991,7 @@ void Play_UpdateMain(PlayState* this) { Room_nop8012D510(this, &this->roomCtx.curRoom, &input[1], 0); Room_nop8012D510(this, &this->roomCtx.prevRoom, &input[1], 1); - SkyboxDraw_Update(&this->skyboxCtx); + Skybox_Update(&this->skyboxCtx); if ((this->pauseCtx.state != 0) || (this->pauseCtx.debugEditor != DEBUG_EDITOR_NONE)) { KaleidoScopeCall_Update(this); @@ -1264,14 +1264,14 @@ void Play_DrawMain(PlayState* this) { if (this->unk_18844 == 0) { if (1) { - if (this->skyboxId && !this->envCtx.skyboxDisabled) { - if ((this->skyboxId == 1) || (this->skyboxId == 3)) { + if ((this->skyboxId != SKYBOX_NONE) && !this->envCtx.skyboxDisabled) { + if ((this->skyboxId == SKYBOX_NORMAL_SKY) || (this->skyboxId == SKYBOX_3)) { Environment_UpdateSkybox(this->skyboxId, &this->envCtx, &this->skyboxCtx); - SkyboxDraw_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, this->envCtx.unk_13, - this->view.eye.x, this->view.eye.y, this->view.eye.z); + Skybox_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, this->envCtx.unk_13, this->view.eye.x, + this->view.eye.y, this->view.eye.z); } else if (!this->skyboxCtx.skyboxShouldDraw) { - SkyboxDraw_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, 0, this->view.eye.x, - this->view.eye.y, this->view.eye.z); + Skybox_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, 0, this->view.eye.x, this->view.eye.y, + this->view.eye.z); } } @@ -1302,8 +1302,8 @@ void Play_DrawMain(PlayState* this) { if (1) {} Camera_GetQuakeOffset(&sp78, GET_ACTIVE_CAM(this)); - SkyboxDraw_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, 0, this->view.eye.x + sp78.x, - this->view.eye.y + sp78.y, this->view.eye.z + sp78.z); + Skybox_Draw(&this->skyboxCtx, gfxCtx, this->skyboxId, 0, this->view.eye.x + sp78.x, + this->view.eye.y + sp78.y, this->view.eye.z + sp78.z); } // envCtx.precipitation[PRECIP_RAIN_CUR] @@ -1414,8 +1414,8 @@ void Play_DrawMain(PlayState* this) { Camera_Update(&sp4C, GET_ACTIVE_CAM(this)); View_UpdateViewingMatrix(&this->view); this->view.unk164 = 0; - if ((this->skyboxId != 0) && !this->envCtx.skyboxDisabled) { - SkyboxDraw_UpdateMatrix(&this->skyboxCtx, this->view.eye.x, this->view.eye.y, this->view.eye.z); + if ((this->skyboxId != SKYBOX_NONE) && !this->envCtx.skyboxDisabled) { + Skybox_UpdateMatrix(&this->skyboxCtx, this->view.eye.x, this->view.eye.y, this->view.eye.z); } } diff --git a/src/code/z_vr_box.c b/src/code/z_vr_box.c index f42e66a252..2797fee3cb 100644 --- a/src/code/z_vr_box.c +++ b/src/code/z_vr_box.c @@ -191,7 +191,7 @@ void Skybox_Setup(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyboxId) skyboxCtx->rotZ = 0.0f; switch (skyboxId) { - case 1: + case SKYBOX_NORMAL_SKY: // Send a DMA request for the cloudy sky texture skyboxCtx->staticSegments[0] = &D_80025D00; size = SEGMENT_ROM_SIZE(d2_cloud_static); @@ -224,7 +224,7 @@ void Skybox_Setup(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyboxId) } break; - case 2: + case SKYBOX_2: break; default: @@ -236,7 +236,7 @@ void func_80143324(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) { size_t size; switch (skyboxId) { - case 1: + case SKYBOX_NORMAL_SKY: osCreateMesgQueue(&skyboxCtx->loadQueue, &skyboxCtx->loadMsg, 1); if (play->envCtx.unk_10 == 0) { @@ -293,10 +293,10 @@ void Skybox_Init(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyboxId) { Skybox_Setup(gameState, skyboxCtx, skyboxId); - if (skyboxId != 0) { + if (skyboxId != SKYBOX_NONE) { skyboxCtx->dListBuf = THA_AllocEndAlign16(&gameState->heap, 0x3840); - if (skyboxId == 5) { + if (skyboxId == SKYBOX_CUTSCENE_MAP) { // Allocate enough space for the vertices for a 6 sided skybox (cube) skyboxCtx->roomVtx = THA_AllocEndAlign16(&gameState->heap, sizeof(Vtx) * 32 * 6); func_80143148(skyboxCtx, 6); diff --git a/src/code/z_vr_box_draw.c b/src/code/z_vr_box_draw.c index e0884e2707..2569f81fad 100644 --- a/src/code/z_vr_box_draw.c +++ b/src/code/z_vr_box_draw.c @@ -2,7 +2,7 @@ Mtx* sSkyboxDrawMatrix; -Mtx* SkyboxDraw_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z) { +Mtx* Skybox_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z) { Matrix_Translate(x, y, z, MTXMODE_NEW); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); Matrix_RotateXFApply(skyboxCtx->rotX); @@ -11,7 +11,7 @@ Mtx* SkyboxDraw_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z) { return Matrix_ToMtx(sSkyboxDrawMatrix); } -void SkyboxDraw_SetColors(SkyboxContext* skyboxCtx, u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB) { +void Skybox_SetColors(SkyboxContext* skyboxCtx, u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB) { skyboxCtx->primR = primR; skyboxCtx->primG = primG; skyboxCtx->primB = primB; @@ -20,7 +20,7 @@ void SkyboxDraw_SetColors(SkyboxContext* skyboxCtx, u8 primR, u8 primG, u8 primB skyboxCtx->envB = envB; } -void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z) { +void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z) { OPEN_DISPS(gfxCtx); func_8012C6AC(gfxCtx); @@ -63,5 +63,5 @@ void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyb CLOSE_DISPS(gfxCtx); } -void SkyboxDraw_Update(SkyboxContext* skyboxCtx) { +void Skybox_Update(SkyboxContext* skyboxCtx) { } 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 e5505e92a3..805d79170f 100644 --- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c +++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c @@ -1288,17 +1288,17 @@ void Boss02_Static_Update(Actor* thisx, PlayState* play) { this->unk_1D74 = KREG(23) + -15.0f; D_801F4E30 = 0; play->envCtx.lightSettingOverride = 1; - play->skyboxId = 1; + play->skyboxId = SKYBOX_NORMAL_SKY; } else if (!sIsInGiantMode) { this->unk_1D74 = 0.0f; D_801F4E30 = this->unk_1D7C; play->envCtx.lightSettingOverride = 0; - play->skyboxId = 2; + play->skyboxId = SKYBOX_2; } else { this->unk_1D74 = KREG(23) + -15.0f; D_801F4E30 = ((KREG(24) * 0.1f) + 1.0f) * this->unk_1D7C; play->envCtx.lightSettingOverride = 1; - play->skyboxId = 1; + play->skyboxId = SKYBOX_NORMAL_SKY; } Math_ApproachS(&this->unk_1D7C, this->unk_1D7E, 1, 3); 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 a25a339042..9e49ca0b17 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -30,7 +30,7 @@ typedef struct { /* 0x1A */ s16 rotX; } PowderKegFuseSegment; // size = 0x1C -static PowderKegFuseSegment sPowderKegFuseSegments[16]; +PowderKegFuseSegment sPowderKegFuseSegments[16]; ActorInit En_Bom_InitVars = { ACTOR_EN_BOM, 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 7ddd539e79..b4f63eb88c 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 @@ -94,7 +94,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { break; case WEATHERTAG_TYPE_UNK5: func_800BC154(play, &play->actorCtx, &this->actor, 7); - play->skyboxId = 3; + play->skyboxId = SKYBOX_3; play->envCtx.unk_1F = 5; play->envCtx.unk_20 = 5; D_801F4E74 = 1.0f; @@ -231,10 +231,10 @@ void EnWeatherTag_Die(EnWeatherTag* this, PlayState* play) { // this tag stops spawning after STT cleared? void func_80966B08(EnWeatherTag* this, PlayState* play) { if (func_80966608(this, play, 0, 0, play->envCtx.unk_1F, 5, 100, 2) || (gWeatherMode == 2)) { - play->skyboxId = 3; + play->skyboxId = SKYBOX_3; EnWeatherTag_SetupAction(this, func_80966D20); } else if (D_801F4E74 <= 0.01f) { - play->skyboxId = 1; + play->skyboxId = SKYBOX_NORMAL_SKY; } else { Math_SmoothStepToF(&D_801F4E74, 0.0f, 0.2f, 0.02f, 0.001f); } diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 186d8a3ec1..822b19131e 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -2783,10 +2783,10 @@ 0x801431E8:("Skybox_Setup",), 0x80143324:("func_80143324",), 0x801434E4:("Skybox_Init",), - 0x801435A0:("SkyboxDraw_UpdateMatrix",), - 0x80143624:("SkyboxDraw_SetColors",), - 0x80143668:("SkyboxDraw_Draw",), - 0x80143A04:("SkyboxDraw_Update",), + 0x801435A0:("Skybox_UpdateMatrix",), + 0x80143624:("Skybox_SetColors",), + 0x80143668:("Skybox_Draw",), + 0x80143A04:("Skybox_Update",), 0x80143A10:("Sram_ActivateOwl",), 0x80143A54:("Sram_ClearHighscores",), 0x80143AC4:("Sram_ClearFlagsAtDawnOfTheFirstDay",), From 50bd6056e2b1a5ce7902435de5f2d73bfa7d83d5 Mon Sep 17 00:00:00 2001 From: Tom Overton Date: Tue, 21 Feb 2023 11:42:20 -0800 Subject: [PATCH 07/29] Document EnSyatekiWf and do some slight cleanup on object_wf and other Syateki actors (#1168) --- assets/xml/objects/object_wf.xml | 14 +- .../ovl_En_Syateki_Crow/z_en_syateki_crow.c | 24 +- .../z_en_syateki_dekunuts.c | 34 +- .../ovl_En_Syateki_Wf/z_en_syateki_wf.c | 343 ++++++++++-------- .../ovl_En_Syateki_Wf/z_en_syateki_wf.h | 28 +- src/overlays/actors/ovl_En_Wf/z_en_wf.c | 42 +-- tools/disasm/functions.txt | 42 +-- tools/disasm/variables.txt | 8 +- 8 files changed, 286 insertions(+), 249 deletions(-) diff --git a/assets/xml/objects/object_wf.xml b/assets/xml/objects/object_wf.xml index b6c5b640d8..0d8fdb68c7 100644 --- a/assets/xml/objects/object_wf.xml +++ b/assets/xml/objects/object_wf.xml @@ -65,11 +65,11 @@ - - - - - + + + + + @@ -135,8 +135,8 @@ - + - + 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 1a2f8b685a..6f533b3a3a 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 @@ -16,8 +16,8 @@ void EnSyatekiCrow_Destroy(Actor* thisx, PlayState* play); void EnSyatekiCrow_Update(Actor* thisx, PlayState* play); void EnSyatekiCrow_Draw(Actor* thisx, PlayState* play); -void EnSyatekiCrow_SetupWaitForSpawn(EnSyatekiCrow* this); -void EnSyatekiCrow_WaitForSpawn(EnSyatekiCrow* this, PlayState* play); +void EnSyatekiCrow_SetupWaitForSignal(EnSyatekiCrow* this); +void EnSyatekiCrow_WaitForSignal(EnSyatekiCrow* this, PlayState* play); void EnSyatekiCrow_SetupWaitToMove(EnSyatekiCrow* this); void EnSyatekiCrow_WaitToMove(EnSyatekiCrow* this, PlayState* play); void EnSyatekiCrow_Fly(EnSyatekiCrow* this, PlayState* play); @@ -105,7 +105,7 @@ void EnSyatekiCrow_Init(Actor* thisx, PlayState* play2) { this->maxPointIndex = path->count; this->deathTimer = 20; this->waitTimer = 0; - EnSyatekiCrow_SetupWaitForSpawn(this); + EnSyatekiCrow_SetupWaitForSignal(this); } void EnSyatekiCrow_Destroy(Actor* thisx, PlayState* play) { @@ -114,7 +114,7 @@ void EnSyatekiCrow_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyJntSph(play, &this->collider); } -void EnSyatekiCrow_SetupWaitForSpawn(EnSyatekiCrow* this) { +void EnSyatekiCrow_SetupWaitForSignal(EnSyatekiCrow* this) { Actor_SetScale(&this->actor, 0.03f); this->actor.speedXZ = 0.0f; this->actor.gravity = 0.0f; @@ -123,13 +123,13 @@ void EnSyatekiCrow_SetupWaitForSpawn(EnSyatekiCrow* this) { this->actor.shape.rot = this->actor.world.rot; this->currentPointIndex = 1; this->actor.draw = NULL; - this->actionFunc = EnSyatekiCrow_WaitForSpawn; + this->actionFunc = EnSyatekiCrow_WaitForSignal; } /** - * Waits until the shooting gallery man sets the appropriate Guay flag to spawn. + * Waits until the shooting gallery man sets the appropriate Guay flag. */ -void EnSyatekiCrow_WaitForSpawn(EnSyatekiCrow* this, PlayState* play) { +void EnSyatekiCrow_WaitForSignal(EnSyatekiCrow* this, PlayState* play) { EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent; if ((syatekiMan->shootingGameState == SG_GAME_STATE_RUNNING) && (this->isActive == true) && @@ -144,6 +144,10 @@ void EnSyatekiCrow_WaitForSpawn(EnSyatekiCrow* this, PlayState* play) { } } +/** + * Positions the Guay at the start of its assigned path and rotates it to face the + * next point on the path, then sets it up to start waiting. + */ void EnSyatekiCrow_SetupWaitToMove(EnSyatekiCrow* this) { Vec3f targetPos; @@ -181,7 +185,7 @@ void EnSyatekiCrow_Fly(EnSyatekiCrow* this, PlayState* play) { EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent; if (syatekiMan->shootingGameState != SG_GAME_STATE_RUNNING) { - EnSyatekiCrow_SetupWaitForSpawn(this); + EnSyatekiCrow_SetupWaitForSignal(this); return; } @@ -203,7 +207,7 @@ void EnSyatekiCrow_Fly(EnSyatekiCrow* this, PlayState* play) { } else { this->isActive = false; syatekiMan->guayFlags &= ~(1 << EN_SYATEKI_CROW_GET_INDEX(&this->actor)); - EnSyatekiCrow_SetupWaitForSpawn(this); + EnSyatekiCrow_SetupWaitForSignal(this); } SkelAnime_Update(&this->skelAnime); @@ -242,7 +246,7 @@ void EnSyatekiCrow_Dead(EnSyatekiCrow* this, PlayState* play) { func_800B3030(play, &this->actor.world.pos, &sZeroVec, &sZeroVec, this->actor.scale.x * 10000.0f, 0, 0); syatekiMan->guayHitCounter++; syatekiMan->guayFlags &= ~(1 << EN_SYATEKI_CROW_GET_INDEX(&this->actor)); - EnSyatekiCrow_SetupWaitForSpawn(this); + EnSyatekiCrow_SetupWaitForSignal(this); } this->deathTimer++; 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 601095cfd7..c21eb61157 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 @@ -17,10 +17,10 @@ void EnSyatekiDekunuts_Destroy(Actor* thisx, PlayState* play); void EnSyatekiDekunuts_Update(Actor* thisx, PlayState* play); void EnSyatekiDekunuts_Draw(Actor* thisx, PlayState* play); -void EnSyatekiDekunuts_SetupWaitForSpawn(EnSyatekiDekunuts* this); -void EnSyatekiDekunuts_WaitForSpawn(EnSyatekiDekunuts* this, PlayState* play); -void EnSyatekiDekunuts_SetupSpawn(EnSyatekiDekunuts* this); -void EnSyatekiDekunuts_Spawn(EnSyatekiDekunuts* this, PlayState* play); +void EnSyatekiDekunuts_SetupWaitForSignal(EnSyatekiDekunuts* this); +void EnSyatekiDekunuts_WaitForSignal(EnSyatekiDekunuts* this, PlayState* play); +void EnSyatekiDekunuts_SetupWaitToStart(EnSyatekiDekunuts* this); +void EnSyatekiDekunuts_WaitToStart(EnSyatekiDekunuts* this, PlayState* play); void EnSyatekiDekunuts_SetupWaitToEmerge(EnSyatekiDekunuts* this); void EnSyatekiDekunuts_WaitToEmerge(EnSyatekiDekunuts* this, PlayState* play); void EnSyatekiDekunuts_SetupEmerge(EnSyatekiDekunuts* this); @@ -152,7 +152,7 @@ void EnSyatekiDekunuts_Init(Actor* thisx, PlayState* play2) { this->timer = 0; this->unk_1DC = 0; this->waitTimer = 0; - EnSyatekiDekunuts_SetupWaitForSpawn(this); + EnSyatekiDekunuts_SetupWaitForSignal(this); } void EnSyatekiDekunuts_Destroy(Actor* thisx, PlayState* play) { @@ -161,7 +161,7 @@ void EnSyatekiDekunuts_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->collider); } -void EnSyatekiDekunuts_SetupWaitForSpawn(EnSyatekiDekunuts* this) { +void EnSyatekiDekunuts_SetupWaitForSignal(EnSyatekiDekunuts* this) { Animation_PlayOnceSetSpeed(&this->skelAnime, &gDekuScrubUpAnim, 0.0f); this->actor.speedXZ = 0.0f; @@ -176,18 +176,18 @@ void EnSyatekiDekunuts_SetupWaitForSpawn(EnSyatekiDekunuts* this) { this->isAlive = true; } - this->actionFunc = EnSyatekiDekunuts_WaitForSpawn; + this->actionFunc = EnSyatekiDekunuts_WaitForSignal; } /** - * Waits until the shooting gallery man sets the appropriate Deku Scrub flag to spawn. + * Waits until the shooting gallery man sets the appropriate Deku Scrub flag. */ -void EnSyatekiDekunuts_WaitForSpawn(EnSyatekiDekunuts* this, PlayState* play) { +void EnSyatekiDekunuts_WaitForSignal(EnSyatekiDekunuts* this, PlayState* play) { EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent; if ((syatekiMan->shootingGameState == SG_GAME_STATE_RUNNING) && (this->isAlive == true) && (syatekiMan->dekuScrubFlags & (1 << this->index))) { - EnSyatekiDekunuts_SetupSpawn(this); + EnSyatekiDekunuts_SetupWaitToStart(this); } else if (syatekiMan->shootingGameState != SG_GAME_STATE_RUNNING) { this->isAlive = true; } @@ -201,7 +201,7 @@ void EnSyatekiDekunuts_WaitForSpawn(EnSyatekiDekunuts* this, PlayState* play) { /** * Positions the Deku Scrub to match up with its flower, then sets it up to start waiting. */ -void EnSyatekiDekunuts_SetupSpawn(EnSyatekiDekunuts* this) { +void EnSyatekiDekunuts_SetupWaitToStart(EnSyatekiDekunuts* this) { Vec3f pos; EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent; @@ -221,13 +221,13 @@ void EnSyatekiDekunuts_SetupSpawn(EnSyatekiDekunuts* this) { this->headdressType = EN_SYATEKI_DEKUNUTS_HEADDRESS_TYPE_NORMAL; } - this->actionFunc = EnSyatekiDekunuts_Spawn; + this->actionFunc = EnSyatekiDekunuts_WaitToStart; } /** * Waits 20 frames, then plays a sound and starts the process of making the Deku Scrubs emerge. */ -void EnSyatekiDekunuts_Spawn(EnSyatekiDekunuts* this, PlayState* play) { +void EnSyatekiDekunuts_WaitToStart(EnSyatekiDekunuts* this, PlayState* play) { EnSyatekiMan* syatekiMan; if (this->waitTimer > 20) { @@ -357,7 +357,7 @@ void EnSyatekiDekunuts_SetupGameEnd(EnSyatekiDekunuts* this) { */ void EnSyatekiDekunuts_GameEnd(EnSyatekiDekunuts* this, PlayState* play) { if (this->waitTimer > 20) { - EnSyatekiDekunuts_SetupWaitForSpawn(this); + EnSyatekiDekunuts_SetupWaitForSignal(this); this->waitTimer = 0; } else { this->waitTimer++; @@ -411,7 +411,7 @@ void EnSyatekiDekunuts_Dead(EnSyatekiDekunuts* this, PlayState* play) { syatekiMan->dekuScrubFlags &= ~(1 << this->index); } - EnSyatekiDekunuts_SetupWaitForSpawn(this); + EnSyatekiDekunuts_SetupWaitForSignal(this); } } else if (this->timer < 160) { this->timer--; @@ -424,7 +424,7 @@ void EnSyatekiDekunuts_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - if ((this->actionFunc != EnSyatekiDekunuts_WaitForSpawn) && (this->timer < this->timeToBurrow) && + if ((this->actionFunc != EnSyatekiDekunuts_WaitForSignal) && (this->timer < this->timeToBurrow) && (this->timer > 10)) { if ((this->collider.base.acFlags & AC_HIT) && (this->isAlive == true)) { if (EN_SYATEKI_DEKUNUTS_GET_TYPE(&this->actor) == EN_SYATEKI_DEKUNUTS_TYPE_BONUS) { @@ -463,7 +463,7 @@ void EnSyatekiDekunuts_Draw(Actor* thisx, PlayState* play) { Vec3f flowerPos; s32 i; - if (this->actionFunc != EnSyatekiDekunuts_WaitForSpawn) { + if (this->actionFunc != EnSyatekiDekunuts_WaitForSignal) { SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, EnSyatekiDekunuts_OverrideLimbDraw, NULL, &this->actor); } 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 20871efb29..9f35d8bc72 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 @@ -16,19 +16,19 @@ void EnSyatekiWf_Destroy(Actor* thisx, PlayState* play); void EnSyatekiWf_Update(Actor* thisx, PlayState* play2); void EnSyatekiWf_Draw(Actor* thisx, PlayState* play); -void func_80A201CC(EnSyatekiWf* this); -void func_80A20284(EnSyatekiWf* this, PlayState* play); -void func_80A2030C(EnSyatekiWf* this); -void func_80A20320(EnSyatekiWf* this, PlayState* play); -void func_80A20378(EnSyatekiWf* this); -void func_80A203DC(EnSyatekiWf* this, PlayState* play); -void func_80A20670(EnSyatekiWf* this); -void func_80A206DC(EnSyatekiWf* this, PlayState* play); -void func_80A20710(EnSyatekiWf* this); -void func_80A2075C(EnSyatekiWf* this, PlayState* play); -void func_80A2079C(EnSyatekiWf* this); -void func_80A20800(EnSyatekiWf* this, PlayState* play); -void func_80A208F8(EnSyatekiWf* this, PlayState* play); +void EnSyatekiWf_SetupWaitForSignal(EnSyatekiWf* this); +void EnSyatekiWf_WaitForSignal(EnSyatekiWf* this, PlayState* play); +void EnSyatekiWf_SetupWaitToMove(EnSyatekiWf* this); +void EnSyatekiWf_WaitToMove(EnSyatekiWf* this, PlayState* play); +void EnSyatekiWf_SetupRun(EnSyatekiWf* this); +void EnSyatekiWf_Run(EnSyatekiWf* this, PlayState* play); +void EnSyatekiWf_SetupJump(EnSyatekiWf* this); +void EnSyatekiWf_Jump(EnSyatekiWf* this, PlayState* play); +void EnSyatekiWf_SetupLand(EnSyatekiWf* this); +void EnSyatekiWf_Land(EnSyatekiWf* this, PlayState* play); +void EnSyatekiWf_SetupHowl(EnSyatekiWf* this); +void EnSyatekiWf_Howl(EnSyatekiWf* this, PlayState* play); +void EnSyatekiWf_Dead(EnSyatekiWf* this, PlayState* play); static ColliderJntSphElementInit sJntSphElementsInit[1] = { { @@ -40,11 +40,11 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = { BUMP_ON, OCELEM_ON, }, - { 17, { { 800, 0, 0 }, 25 }, 100 }, + { WOLFOS_NORMAL_LIMB_HEAD, { { 800, 0, 0 }, 25 }, 100 }, }, }; -static ColliderCylinderInit sCylinderInit1 = { +static ColliderCylinderInit sBodyCylinderInit = { { COLTYPE_HIT5, AT_NONE, @@ -77,7 +77,7 @@ static ColliderJntSphInit sJntSphInit = { sJntSphElementsInit, }; -static ColliderCylinderInit sCylinderInit2 = { +static ColliderCylinderInit sTailCylinderInit = { { COLTYPE_HIT5, AT_NONE, @@ -97,9 +97,9 @@ static ColliderCylinderInit sCylinderInit2 = { { 15, 20, -15, { 0, 0, 0 } }, }; -static Vec3f D_80A20EDC = { 0.0f, 20.0f, 0.0f }; +static Vec3f sVelocity = { 0.0f, 20.0f, 0.0f }; -static Vec3f D_80A20EE8 = { 0.0f, 0.0f, 0.0f }; +static Vec3f sAccel = { 0.0f, 0.0f, 0.0f }; ActorInit En_Syateki_Wf_InitVars = { ACTOR_EN_SYATEKI_WF, @@ -113,14 +113,24 @@ ActorInit En_Syateki_Wf_InitVars = { (ActorFunc)EnSyatekiWf_Draw, }; +typedef enum { + /* 0 */ EN_SYATEKI_WF_ANIM_WAIT, // unused + /* 1 */ EN_SYATEKI_WF_ANIM_RUN, + /* 2 */ EN_SYATEKI_WF_ANIM_JUMP, + /* 3 */ EN_SYATEKI_WF_ANIM_LAND, + /* 4 */ EN_SYATEKI_WF_ANIM_BACKFLIP, // unused + /* 5 */ EN_SYATEKI_WF_ANIM_DAMAGED, + /* 6 */ EN_SYATEKI_WF_ANIM_REAR_UP_FALL_OVER, +} EnSyatekiWfAnimation; + static AnimationInfo sAnimationInfo[] = { - { &gWolfosWaitingAnim, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -1.0f }, - { &gWolfosRunningAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, - { &gWolfosRunningAnim, 1.0f, 0.0f, 4.0f, ANIMMODE_ONCE, 1.0f }, - { &gWolfosRunningAnim, 1.0f, 4.0f, 8.0f, ANIMMODE_ONCE, 1.0f }, - { &gWolfosBackflippingAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, + { &gWolfosWaitAnim, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -1.0f }, + { &gWolfosRunAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, + { &gWolfosRunAnim, 1.0f, 0.0f, 4.0f, ANIMMODE_ONCE, 1.0f }, + { &gWolfosRunAnim, 1.0f, 4.0f, 8.0f, ANIMMODE_ONCE, 1.0f }, + { &gWolfosBackflipAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, { &gWolfosDamagedAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 8.0f }, - { &gWolfosRearingUpFallingOverAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, + { &gWolfosRearUpFallOverAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, }; static InitChainEntry sInitChain[] = { @@ -128,17 +138,6 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_STOP), }; -static Vec3f D_80A20FC4 = { 0.0f, 0.5f, 0.0f }; - -static Vec3f D_80A20FD0 = { 1200.0f, 0.0f, 0.0f }; - -static TexturePtr sEyeTextures[] = { - gWolfosNormalEyeOpenTex, - gWolfosNormalEyeHalfTex, - gWolfosNormalEyeNarrowTex, - gWolfosNormalEyeHalfTex, -}; - void EnSyatekiWf_Init(Actor* thisx, PlayState* play) { s32 pad; EnSyatekiWf* this = THIS; @@ -160,12 +159,12 @@ void EnSyatekiWf_Init(Actor* thisx, PlayState* play) { return; } - this->unk_2A0 = Lib_SegmentedToVirtual(path->points); - this->unk_2A4 = 1; - this->unk_2A6 = path->count; + this->pathPoints = Lib_SegmentedToVirtual(path->points); + this->currentPointIndex = 1; + this->maxPointIndex = path->count; Actor_ProcessInitChain(&this->actor, sInitChain); - this->unk_29C = 0; + this->waitTimer = 0; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); this->actor.focus.pos = this->actor.world.pos; this->actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -175,45 +174,46 @@ void EnSyatekiWf_Init(Actor* thisx, PlayState* play) { this->eyeIndex = 0; this->unk_2AC = 10.0f; - Collider_InitCylinder(play, &this->unk_2B4); - Collider_SetCylinder(play, &this->unk_2B4, &this->actor, &sCylinderInit1); - Collider_InitCylinder(play, &this->unk_300); - Collider_SetCylinder(play, &this->unk_300, &this->actor, &sCylinderInit2); - Collider_InitJntSph(play, &this->unk_34C); - Collider_SetJntSph(play, &this->unk_34C, &this->actor, &sJntSphInit, this->unk_36C); - this->unk_34C.elements->dim.worldSphere.radius = sJntSphInit.elements[0].dim.modelSphere.radius; + Collider_InitCylinder(play, &this->bodyCollider); + Collider_SetCylinder(play, &this->bodyCollider, &this->actor, &sBodyCylinderInit); + Collider_InitCylinder(play, &this->tailCollider); + Collider_SetCylinder(play, &this->tailCollider, &this->actor, &sTailCylinderInit); + Collider_InitJntSph(play, &this->headCollider); + Collider_SetJntSph(play, &this->headCollider, &this->actor, &sJntSphInit, this->headColliderElements); + this->headCollider.elements->dim.worldSphere.radius = sJntSphInit.elements[0].dim.modelSphere.radius; - SkelAnime_InitFlex(play, &this->skelAnime, &gWolfosNormalSkel, &gWolfosWaitingAnim, this->jointTable, - this->morphTable, WOLFOS_NORMAL_LIMB_MAX); + SkelAnime_InitFlex(play, &this->skelAnime, &gWolfosNormalSkel, &gWolfosWaitAnim, this->jointTable, this->morphTable, + WOLFOS_NORMAL_LIMB_MAX); Actor_SetScale(&this->actor, 0.01f); this->actor.hintId = TATL_HINT_ID_WOLFOS; - func_80A201CC(this); + EnSyatekiWf_SetupWaitForSignal(this); } void EnSyatekiWf_Destroy(Actor* thisx, PlayState* play) { EnSyatekiWf* this = THIS; - Collider_DestroyCylinder(play, &this->unk_2B4); - Collider_DestroyCylinder(play, &this->unk_300); + Collider_DestroyCylinder(play, &this->bodyCollider); + Collider_DestroyCylinder(play, &this->tailCollider); } -void func_80A200E0(EnSyatekiWf* this) { - Vec3f sp24; - s16 temp; +/** + * Positions the Wolfos at the start of its assigned path and rotates it to face + * the next point on the path. + */ +void EnSyatekiWf_InitPathStart(EnSyatekiWf* this) { + Vec3f targetPos; - this->actor.world.pos.x = this->unk_2A0[0].x; - this->actor.world.pos.y = this->unk_2A0[0].y; - this->actor.world.pos.z = this->unk_2A0[0].z; - sp24.x = this->unk_2A0[this->unk_2A4].x; - sp24.y = this->unk_2A0[this->unk_2A4].y; - sp24.z = this->unk_2A0[this->unk_2A4].z; - temp = Math_Vec3f_Yaw(&this->actor.world.pos, &sp24); - this->actor.shape.rot.y = temp; - this->actor.world.rot.y = temp; + this->actor.world.pos.x = this->pathPoints[0].x; + this->actor.world.pos.y = this->pathPoints[0].y; + this->actor.world.pos.z = this->pathPoints[0].z; + targetPos.x = this->pathPoints[this->currentPointIndex].x; + targetPos.y = this->pathPoints[this->currentPointIndex].y; + targetPos.z = this->pathPoints[this->currentPointIndex].z; + this->actor.world.rot.y = this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &targetPos); } -void func_80A201CC(EnSyatekiWf* this) { +void EnSyatekiWf_SetupWaitForSignal(EnSyatekiWf* this) { EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent; this->actor.speedXZ = 0.0f; @@ -222,67 +222,79 @@ void func_80A201CC(EnSyatekiWf* this) { this->actor.shape.rot = this->actor.world.rot; this->actor.colChkInfo.health = 2; this->actor.draw = NULL; - this->unk_2A4 = 1; - this->unk_298 = 0; + this->currentPointIndex = 1; + this->isActive = false; syatekiMan->wolfosFlags &= ~(1 << EN_SYATEKI_WF_GET_INDEX(&this->actor)); - this->actionFunc = func_80A20284; + this->actionFunc = EnSyatekiWf_WaitForSignal; } -void func_80A20284(EnSyatekiWf* this, PlayState* play) { +/** + * Waits until the shooting gallery man sets the appropriate Wolfos flag. + */ +void EnSyatekiWf_WaitForSignal(EnSyatekiWf* this, PlayState* play) { EnSyatekiMan* syatekiMan; if (this->actor.parent != NULL) { syatekiMan = (EnSyatekiMan*)this->actor.parent; - if ((syatekiMan->shootingGameState == SG_GAME_STATE_RUNNING) && (this->unk_298 == 1)) { - func_80A200E0(this); - func_80A2030C(this); + if ((syatekiMan->shootingGameState == SG_GAME_STATE_RUNNING) && (this->isActive == true)) { + EnSyatekiWf_InitPathStart(this); + EnSyatekiWf_SetupWaitToMove(this); } else if (syatekiMan->wolfosFlags & (1 << EN_SYATEKI_WF_GET_INDEX(&this->actor))) { - this->unk_298 = 1; + this->isActive = true; } } } -void func_80A2030C(EnSyatekiWf* this) { - this->actionFunc = func_80A20320; +void EnSyatekiWf_SetupWaitToMove(EnSyatekiWf* this) { + this->actionFunc = EnSyatekiWf_WaitToMove; } -void func_80A20320(EnSyatekiWf* this, PlayState* play) { - if (this->unk_29C >= 11) { +/** + * Waits 11 frames, then makes the Wolfos start running forward. + */ +void EnSyatekiWf_WaitToMove(EnSyatekiWf* this, PlayState* play) { + if (this->waitTimer >= 11) { Actor_PlaySfxAtPos(this->actor.parent, NA_SE_EN_WOLFOS_APPEAR); - this->unk_29C = 0; - func_80A20378(this); + this->waitTimer = 0; + EnSyatekiWf_SetupRun(this); } else { - this->unk_29C++; + this->waitTimer++; } } -void func_80A20378(EnSyatekiWf* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); +void EnSyatekiWf_SetupRun(EnSyatekiWf* this) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_WF_ANIM_RUN); this->actor.speedXZ = 10.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.draw = EnSyatekiWf_Draw; - this->actionFunc = func_80A203DC; + this->actionFunc = EnSyatekiWf_Run; } -void func_80A203DC(EnSyatekiWf* this, PlayState* play) { - Vec3f sp54; - f32 sp50; - s16 temp_v0; +/** + * Runs forward along its assigned path. If the Wolfos encounters a wall directly + * in front of it, this function will make it jump. If the Wolfos reaches a certain + * point along the path (which is specified via its params), this function will make + * it stop running and howl in place. + */ +void EnSyatekiWf_Run(EnSyatekiWf* this, PlayState* play) { + Vec3f targetPoint; + f32 distToTarget; + s16 wallYawDiff; EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent; if (syatekiMan->shootingGameState != SG_GAME_STATE_RUNNING) { - func_80A201CC(this); + EnSyatekiWf_SetupWaitForSignal(this); } - sp54.x = this->unk_2A0[this->unk_2A4].x; - sp54.y = this->unk_2A0[this->unk_2A4].y; - sp54.z = this->unk_2A0[this->unk_2A4].z; - temp_v0 = (this->actor.wallYaw - this->actor.world.rot.y) + 0x8000; + targetPoint.x = this->pathPoints[this->currentPointIndex].x; + targetPoint.y = this->pathPoints[this->currentPointIndex].y; + targetPoint.z = this->pathPoints[this->currentPointIndex].z; + wallYawDiff = (this->actor.wallYaw - this->actor.world.rot.y) + 0x8000; if (this->actor.bgCheckFlags & 1) { if (this->actor.bgCheckFlags & 8) { - if ((ABS(temp_v0) < 0x1555) && (this->actor.wallPoly != this->actor.floorPoly)) { - func_80A20670(this); + if ((ABS(wallYawDiff) < 0x1555) && (this->actor.wallPoly != this->actor.floorPoly)) { + EnSyatekiWf_SetupJump(this); return; } } @@ -291,13 +303,13 @@ void func_80A203DC(EnSyatekiWf* this, PlayState* play) { this->actor.velocity.y = 2.0f; } - sp50 = Math_Vec3f_DistXZ(&this->actor.world.pos, &sp54); - this->unk_2A8 = Math_Vec3f_Yaw(&this->actor.world.pos, &sp54); + distToTarget = Math_Vec3f_DistXZ(&this->actor.world.pos, &targetPoint); + this->yawTarget = Math_Vec3f_Yaw(&this->actor.world.pos, &targetPoint); - if (sp50 > 15.0f) { - Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2A8, 5, 0x3000, 0x100); + if (distToTarget > 15.0f) { + Math_SmoothStepToS(&this->actor.world.rot.y, this->yawTarget, 5, 0x3000, 0x100); this->actor.shape.rot.y = this->actor.world.rot.y; - if (sp50 < 50.0f) { + if (distToTarget < 50.0f) { if (this->actor.speedXZ > 3.0f) { this->actor.speedXZ = this->actor.speedXZ - 0.5f; } else { @@ -305,16 +317,16 @@ void func_80A203DC(EnSyatekiWf* this, PlayState* play) { } } } else { - if (this->unk_2A4 < (this->unk_2A6 - 1)) { - if (this->unk_2A4 == EN_SYATEKI_WF_GET_PARAM_F0(&this->actor)) { - func_80A2079C(this); + if (this->currentPointIndex < (this->maxPointIndex - 1)) { + if (this->currentPointIndex == EN_SYATEKI_WF_GET_POINT_TO_HOWL(&this->actor)) { + EnSyatekiWf_SetupHowl(this); } - this->unk_2A4++; + this->currentPointIndex++; } else { - this->unk_298 = 0; - this->unk_2A4 = 1; - func_80A201CC(this); + this->isActive = false; + this->currentPointIndex = 1; + EnSyatekiWf_SetupWaitForSignal(this); } } @@ -324,76 +336,82 @@ void func_80A203DC(EnSyatekiWf* this, PlayState* play) { } } -void func_80A20670(EnSyatekiWf* this) { +void EnSyatekiWf_SetupJump(EnSyatekiWf* this) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP); this->actor.velocity.y = 20.0f; this->actor.speedXZ = 5.0f; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); - this->actionFunc = func_80A206DC; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_WF_ANIM_JUMP); + this->actionFunc = EnSyatekiWf_Jump; } -void func_80A206DC(EnSyatekiWf* this, PlayState* play) { +void EnSyatekiWf_Jump(EnSyatekiWf* this, PlayState* play) { if (this->actor.bgCheckFlags & 2) { - func_80A20710(this); + EnSyatekiWf_SetupLand(this); } } -void func_80A20710(EnSyatekiWf* this) { +void EnSyatekiWf_SetupLand(EnSyatekiWf* this) { this->actor.speedXZ = 0.0f; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); - this->actionFunc = func_80A2075C; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_WF_ANIM_LAND); + this->actionFunc = EnSyatekiWf_Land; } -void func_80A2075C(EnSyatekiWf* this, PlayState* play) { +/** + * Freezes the Wolfos in place until its landing animation is complete, then makes it start running. + */ +void EnSyatekiWf_Land(EnSyatekiWf* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - func_80A20378(this); + EnSyatekiWf_SetupRun(this); } } -void func_80A2079C(EnSyatekiWf* this) { - this->unk_29A = 40; +void EnSyatekiWf_SetupHowl(EnSyatekiWf* this) { + this->timer = 40; this->actor.speedXZ = 0.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_APPEAR); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); - this->actionFunc = func_80A20800; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_WF_ANIM_DAMAGED); + this->actionFunc = EnSyatekiWf_Howl; } -void func_80A20800(EnSyatekiWf* this, PlayState* play) { +/** + * Makes the Wolfos stand completely still until 40 frames after its damaged animation is complete. + */ +void EnSyatekiWf_Howl(EnSyatekiWf* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - this->unk_29A--; - if (this->unk_29A == 0) { - func_80A20378(this); + this->timer--; + if (this->timer == 0) { + EnSyatekiWf_SetupRun(this); } } } -void func_80A20858(EnSyatekiWf* this, PlayState* play) { +void EnSyatekiWf_SetupDead(EnSyatekiWf* this, PlayState* play) { EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent; - this->unk_298 = 0; + this->isActive = false; this->actor.speedXZ = 0.0f; - EffectSsExtra_Spawn(play, &this->actor.world.pos, &D_80A20EDC, &D_80A20EE8, 5, 2); + EffectSsExtra_Spawn(play, &this->actor.world.pos, &sVelocity, &sAccel, 5, 2); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_DEAD); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_WF_ANIM_REAR_UP_FALL_OVER); syatekiMan->score += 100; - this->actionFunc = func_80A208F8; + this->actionFunc = EnSyatekiWf_Dead; } -void func_80A208F8(EnSyatekiWf* this, PlayState* play) { +void EnSyatekiWf_Dead(EnSyatekiWf* this, PlayState* play) { s32 pad; if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - func_80A201CC(this); + EnSyatekiWf_SetupWaitForSignal(this); } else { - Vec3f sp68; - Vec3f sp5C = D_80A20FC4; + Vec3f firePos; + Vec3f sFireVelocityAndAccel = { 0.0f, 0.5f, 0.0f }; s32 i; for (i = (s32)this->skelAnime.animLength - (s32)this->skelAnime.curFrame; i >= 0; i--) { - sp68.x = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.x; - sp68.z = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.z; - sp68.y = randPlusMinusPoint5Scaled(50.0f) + (this->actor.world.pos.y + 20.0f); - func_800B3030(play, &sp68, &sp5C, &sp5C, 0x64, 0, 2); + firePos.x = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.x; + firePos.z = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.z; + firePos.y = randPlusMinusPoint5Scaled(50.0f) + (this->actor.world.pos.y + 20.0f); + func_800B3030(play, &firePos, &sFireVelocityAndAccel, &sFireVelocityAndAccel, 100, 0, 2); } } } @@ -402,7 +420,7 @@ void EnSyatekiWf_Update(Actor* thisx, PlayState* play2) { PlayState* play = play2; EnSyatekiWf* this = THIS; - if (this->actionFunc != func_80A20284) { + if (this->actionFunc != EnSyatekiWf_WaitForSignal) { SkelAnime_Update(&this->skelAnime); } @@ -417,26 +435,34 @@ void EnSyatekiWf_Update(Actor* thisx, PlayState* play2) { Math_SmoothStepToS(&this->actor.shape.rot.z, 0, 1, 0x3E8, 0); } - if ((this->unk_2B4.base.acFlags & AC_HIT) || (this->unk_300.base.acFlags & AC_HIT) || - (this->unk_34C.base.acFlags & AC_HIT)) { - this->unk_2B4.base.acFlags &= ~AC_HIT; - this->unk_300.base.acFlags &= ~AC_HIT; - this->unk_34C.base.acFlags &= ~AC_HIT; + if ((this->bodyCollider.base.acFlags & AC_HIT) || (this->tailCollider.base.acFlags & AC_HIT) || + (this->headCollider.base.acFlags & AC_HIT)) { + this->bodyCollider.base.acFlags &= ~AC_HIT; + this->tailCollider.base.acFlags &= ~AC_HIT; + this->headCollider.base.acFlags &= ~AC_HIT; + + // The Wolfos always starts with 2 health, so the subtraction below is guaranteed to kill it; + // the else-block is never reached in practice. If you *could* damage the Wolfos without killing + // it, then the number "30" would appear every time you hit it, and the player's displayed score + // would increase by 30. However, the else-block doesn't increase the shooting gallery man's + // "score" variable, so it would become desynchronized from the displayed score. This could cause + // weird behavior, like not getting a free replay after finishing a game with 2000 or more points. this->actor.colChkInfo.health -= 2; if (this->actor.colChkInfo.health == 0) { Audio_PlayFanfare(NA_BGM_GET_ITEM | 0x900); - func_80A20858(this, play); + EnSyatekiWf_SetupDead(this, play); } else { play_sound(NA_SE_SY_TRE_BOX_APPEAR); - EffectSsExtra_Spawn(play, &this->actor.world.pos, &D_80A20EDC, &D_80A20EE8, 3, 0); + EffectSsExtra_Spawn(play, &this->actor.world.pos, &sVelocity, &sAccel, 3, 0); } } - Collider_UpdateCylinder(&this->actor, &this->unk_2B4); - if ((this->actionFunc != func_80A20284) && (this->actionFunc != func_80A208F8) && (this->actor.draw != NULL)) { - CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk_300.base); - CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk_2B4.base); - CollisionCheck_SetAC(play, &play->colChkCtx, &this->unk_34C.base); + Collider_UpdateCylinder(&this->actor, &this->bodyCollider); + if ((this->actionFunc != EnSyatekiWf_WaitForSignal) && (this->actionFunc != EnSyatekiWf_Dead) && + (this->actor.draw != NULL)) { + CollisionCheck_SetAC(play, &play->colChkCtx, &this->tailCollider.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->bodyCollider.base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->headCollider.base); this->actor.focus.pos = this->actor.world.pos; this->actor.focus.pos.y += 25.0f; } @@ -455,19 +481,26 @@ s32 EnSyatekiWf_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Ve } void EnSyatekiWf_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + static Vec3f sTailColliderOffset = { 1200.0f, 0.0f, 0.0f }; EnSyatekiWf* this = THIS; - Vec3f sp18; + Vec3f tailColliderPos; - Collider_UpdateSpheres(limbIndex, &this->unk_34C); + Collider_UpdateSpheres(limbIndex, &this->headCollider); if (limbIndex == WOLFOS_NORMAL_LIMB_TAIL) { - Matrix_MultVec3f(&D_80A20FD0, &sp18); - this->unk_300.dim.pos.x = sp18.x; - this->unk_300.dim.pos.y = sp18.y; - this->unk_300.dim.pos.z = sp18.z; + Matrix_MultVec3f(&sTailColliderOffset, &tailColliderPos); + this->tailCollider.dim.pos.x = tailColliderPos.x; + this->tailCollider.dim.pos.y = tailColliderPos.y; + this->tailCollider.dim.pos.z = tailColliderPos.z; } } void EnSyatekiWf_Draw(Actor* thisx, PlayState* play) { + static TexturePtr sEyeTextures[] = { + gWolfosNormalEyeOpenTex, + gWolfosNormalEyeHalfTex, + gWolfosNormalEyeNarrowTex, + gWolfosNormalEyeHalfTex, + }; EnSyatekiWf* this = THIS; OPEN_DISPS(play->state.gfxCtx); 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 56770952f7..4a1fb2f72b 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 @@ -4,9 +4,9 @@ #include "global.h" #include "objects/object_wf/object_wf.h" -#define EN_SYATEKI_WF_GET_PARAM_F0(thisx) (((thisx)->params & 0xF0) >> 4) +#define EN_SYATEKI_WF_GET_POINT_TO_HOWL(thisx) (((thisx)->params & 0xF0) >> 4) #define EN_SYATEKI_WF_GET_INDEX(thisx) (((thisx)->params & 0xFF00) >> 8) -#define EN_SYATEKI_WF_PARAMS(index, unkF0, unused) (((index << 8) & 0xFF00) | ((unkF0 << 4) & 0xF0) | (unused & 0xF)) +#define EN_SYATEKI_WF_PARAMS(index, pointToHowl, unused) (((index << 8) & 0xFF00) | ((pointToHowl << 4) & 0xF0) | (unused & 0xF)) struct EnSyatekiWf; @@ -19,19 +19,19 @@ typedef struct EnSyatekiWf { /* 0x20C */ Vec3s morphTable[WOLFOS_NORMAL_LIMB_MAX]; /* 0x290 */ UNK_TYPE1 unk_290[0x4]; /* 0x294 */ EnSyatekiWfActionFunc actionFunc; - /* 0x298 */ s16 unk_298; - /* 0x29A */ s16 unk_29A; - /* 0x29C */ s16 unk_29C; - /* 0x2A0 */ Vec3s* unk_2A0; - /* 0x2A4 */ s16 unk_2A4; - /* 0x2A6 */ s16 unk_2A6; - /* 0x2A8 */ s16 unk_2A8; - /* 0x2AC */ f32 unk_2AC; + /* 0x298 */ s16 isActive; + /* 0x29A */ s16 timer; + /* 0x29C */ s16 waitTimer; + /* 0x2A0 */ Vec3s* pathPoints; + /* 0x2A4 */ s16 currentPointIndex; + /* 0x2A6 */ s16 maxPointIndex; + /* 0x2A8 */ s16 yawTarget; + /* 0x2AC */ f32 unk_2AC; // set to 10.0f, but never used /* 0x2B0 */ u8 eyeIndex; - /* 0x2B4 */ ColliderCylinder unk_2B4; - /* 0x300 */ ColliderCylinder unk_300; - /* 0x34C */ ColliderJntSph unk_34C; - /* 0x36C */ ColliderJntSphElement unk_36C[1]; + /* 0x2B4 */ ColliderCylinder bodyCollider; + /* 0x300 */ ColliderCylinder tailCollider; + /* 0x34C */ ColliderJntSph headCollider; + /* 0x36C */ ColliderJntSphElement headColliderElements[1]; /* 0x3AC */ UNK_TYPE1 unk_3AC[0x20]; } EnSyatekiWf; // size = 0x3CC 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 bc505ee530..8d6daa3c2c 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -317,7 +317,7 @@ void EnWf_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.0075f); if (this->actor.params == 0) { - SkelAnime_InitFlex(play, &this->skelAnime, &gWolfosNormalSkel, &gWolfosWaitingAnim, this->jointTable, + SkelAnime_InitFlex(play, &this->skelAnime, &gWolfosNormalSkel, &gWolfosWaitAnim, this->jointTable, this->morphTable, WOLFOS_NORMAL_LIMB_MAX); this->actor.hintId = TATL_HINT_ID_WOLFOS; CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable2, &sColChkInfoInit); @@ -325,7 +325,7 @@ void EnWf_Init(Actor* thisx, PlayState* play) { this->collider1.elements[1].info.toucher.damage = 8; this->actor.colChkInfo.health = 6; } else { - SkelAnime_InitFlex(play, &this->skelAnime, &gWolfosWhiteSkel, &gWolfosWaitingAnim, this->jointTable, + SkelAnime_InitFlex(play, &this->skelAnime, &gWolfosWhiteSkel, &gWolfosWaitAnim, this->jointTable, this->morphTable, WOLFOS_WHITE_LIMB_MAX); this->actor.hintId = TATL_HINT_ID_WHITE_WOLFOS; CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable1, &sColChkInfoInit); @@ -549,7 +549,7 @@ void func_80990F50(EnWf* this, PlayState* play) { } void func_80990FC8(EnWf* this) { - Animation_Change(&this->skelAnime, &gWolfosRearingUpFallingOverAnim, 0.5f, 0.0f, 7.0f, ANIMMODE_ONCE_INTERP, 0.0f); + Animation_Change(&this->skelAnime, &gWolfosRearUpFallOverAnim, 0.5f, 0.0f, 7.0f, ANIMMODE_ONCE_INTERP, 0.0f); this->unk_2A0 = 5; this->actor.flags |= ACTOR_FLAG_1; this->actionFunc = func_80991040; @@ -572,7 +572,7 @@ void func_80991040(EnWf* this, PlayState* play) { void func_809910F0(EnWf* this) { this->collider2.base.acFlags &= ~AC_ON; this->actor.speedXZ = 0.0f; - Animation_Change(&this->skelAnime, &gWolfosRearingUpFallingOverAnim, 0.5f, 0.0f, 7.0f, ANIMMODE_ONCE_INTERP, -5.0f); + Animation_Change(&this->skelAnime, &gWolfosRearUpFallOverAnim, 0.5f, 0.0f, 7.0f, ANIMMODE_ONCE_INTERP, -5.0f); this->unk_2A0 = 5; this->actionFunc = func_80991174; } @@ -591,7 +591,7 @@ void func_80991174(EnWf* this, PlayState* play) { void func_80991200(EnWf* this) { this->collider2.base.acFlags |= AC_ON; - Animation_MorphToLoop(&this->skelAnime, &gWolfosWaitingAnim, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &gWolfosWaitAnim, -4.0f); this->unk_2A0 = (s32)Rand_ZeroFloat(10.0f) + 2; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = func_80991280; @@ -642,7 +642,7 @@ void func_80991280(EnWf* this, PlayState* play) { void func_80991438(EnWf* this) { this->collider2.base.acFlags |= AC_ON; - Animation_MorphToLoop(&this->skelAnime, &gWolfosRunningAnim, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &gWolfosRunAnim, -4.0f); this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.speedXZ = 8.0f; this->actionFunc = func_8099149C; @@ -703,7 +703,7 @@ void func_8099149C(EnWf* this, PlayState* play) { } void func_80991738(EnWf* this) { - Animation_MorphToLoop(&this->skelAnime, &gWolfosSidesteppingAnim, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &gWolfosSidestepAnim, -4.0f); this->actionFunc = func_8099177C; } @@ -755,7 +755,7 @@ void func_8099177C(EnWf* this, PlayState* play) { void func_80991948(EnWf* this) { this->collider2.base.acFlags |= AC_ON; - Animation_MorphToLoop(&this->skelAnime, &gWolfosRunningAnim, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &gWolfosRunAnim, -4.0f); if (Rand_ZeroOne() > 0.5f) { this->unk_29A = 16000; } else { @@ -809,7 +809,7 @@ void func_809919F4(EnWf* this, PlayState* play) { void func_80991C04(EnWf* this) { this->collider2.base.acFlags |= AC_ON; - Animation_PlayOnce(&this->skelAnime, &gWolfosSlashingAnim); + Animation_PlayOnce(&this->skelAnime, &gWolfosSlashAnim); this->collider1.base.atFlags &= ~AT_BOUNCED; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->unk_2A0 = 7; @@ -879,7 +879,7 @@ void func_80991FD8(EnWf* this) { if (this->skelAnime.curFrame > 15.0f) { phi_f0 = 15.0f; } - Animation_Change(&this->skelAnime, &gWolfosSlashingAnim, -0.5f, this->skelAnime.curFrame - 1.0f, phi_f0, + Animation_Change(&this->skelAnime, &gWolfosSlashAnim, -0.5f, this->skelAnime.curFrame - 1.0f, phi_f0, ANIMMODE_ONCE_INTERP, 0.0f); this->collider1.base.atFlags &= ~AT_ON; this->actionFunc = func_80992068; @@ -923,7 +923,7 @@ void func_80992068(EnWf* this, PlayState* play) { void func_8099223C(EnWf* this) { this->collider2.base.acFlags &= ~AC_ON; - Animation_MorphToPlayOnce(&this->skelAnime, &gWolfosBackflippingAnim, -3.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &gWolfosBackflipAnim, -3.0f); this->unk_2A0 = 0; this->actor.speedXZ = -6.0f; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; @@ -1021,8 +1021,8 @@ void func_809924EC(EnWf* this, PlayState* play) { void func_809926D0(EnWf* this) { this->collider2.base.acFlags &= ~AC_ON; - Animation_Change(&this->skelAnime, &gWolfosBackflippingAnim, -1.0f, - Animation_GetLastFrame(&gWolfosBackflippingAnim.common), 0.0f, ANIMMODE_ONCE, -3.0f); + Animation_Change(&this->skelAnime, &gWolfosBackflipAnim, -1.0f, Animation_GetLastFrame(&gWolfosBackflipAnim.common), + 0.0f, ANIMMODE_ONCE, -3.0f); this->unk_2A0 = 0; this->actor.speedXZ = 6.5f; this->actor.velocity.y = 15.0f; @@ -1053,8 +1053,8 @@ void func_8099282C(EnWf* this) { this->collider1.base.atFlags &= ~AT_ON; this->unk_2A0 = 10; this->actor.speedXZ = 0.0f; - Animation_Change(&this->skelAnime, &gWolfosBlockingAnim, -1.0f, Animation_GetLastFrame(&gWolfosBlockingAnim.common), - 0.0f, ANIMMODE_ONCE, -2.0f); + Animation_Change(&this->skelAnime, &gWolfosBlockAnim, -1.0f, Animation_GetLastFrame(&gWolfosBlockAnim.common), 0.0f, + ANIMMODE_ONCE, -2.0f); this->actionFunc = func_809928CC; } @@ -1091,7 +1091,7 @@ void func_80992A74(EnWf* this, PlayState* play) { f32 temp_f0; this->collider2.base.acFlags |= AC_ON; - Animation_MorphToLoop(&this->skelAnime, &gWolfosRunningAnim, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &gWolfosRunAnim, -4.0f); player = GET_PLAYER(play); temp_f0 = Math_SinS((player->actor.shape.rot.y + this->unk_29A) - this->actor.yawTowardsPlayer); if (temp_f0 > 0.0f) { @@ -1153,7 +1153,7 @@ void func_80992B8C(EnWf* this, PlayState* play) { void func_80992D6C(EnWf* this) { this->collider2.base.acFlags &= ~AC_ON; - Animation_MorphToPlayOnce(&this->skelAnime, &gWolfosRearingUpFallingOverAnim, -4.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &gWolfosRearUpFallOverAnim, -4.0f); this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = -6.0f; @@ -1205,7 +1205,7 @@ void func_80992E0C(EnWf* this, PlayState* play) { } void func_80992FD4(EnWf* this) { - Animation_MorphToLoop(&this->skelAnime, &gWolfosWaitingAnim, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &gWolfosWaitAnim, -4.0f); this->actionFunc = func_80993018; } @@ -1232,7 +1232,7 @@ void func_80993018(EnWf* this, PlayState* play) { } void func_80993148(EnWf* this) { - Animation_MorphToLoop(&this->skelAnime, &gWolfosRunningAnim, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &gWolfosRunAnim, -4.0f); this->actor.speedXZ = 0.0f; this->actionFunc = func_80993194; } @@ -1277,7 +1277,7 @@ void func_80993194(EnWf* this, PlayState* play) { } void func_80993350(EnWf* this) { - Animation_MorphToLoop(&this->skelAnime, &gWolfosRunningAnim, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &gWolfosRunAnim, -4.0f); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_APPEAR); this->actionFunc = func_809933A0; } @@ -1317,7 +1317,7 @@ void func_809933A0(EnWf* this, PlayState* play) { } void func_80993524(EnWf* this) { - Animation_MorphToLoop(&this->skelAnime, &gWolfosRunningAnim, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &gWolfosRunAnim, -4.0f); this->actor.speedXZ = 6.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = func_8099357C; diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 822b19131e..c4fa65163c 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -9125,8 +9125,8 @@ 0x809CA27C:("BgIcicle_Draw",), 0x809CA3F0:("EnSyatekiCrow_Init",), 0x809CA5A8:("EnSyatekiCrow_Destroy",), - 0x809CA5D4:("EnSyatekiCrow_SetupWaitForSpawn",), - 0x809CA67C:("EnSyatekiCrow_WaitForSpawn",), + 0x809CA5D4:("EnSyatekiCrow_SetupWaitForSignal",), + 0x809CA67C:("EnSyatekiCrow_WaitForSignal",), 0x809CA71C:("EnSyatekiCrow_SetupWaitToMove",), 0x809CA840:("EnSyatekiCrow_WaitToMove",), 0x809CA8E4:("EnSyatekiCrow_Fly",), @@ -9876,21 +9876,21 @@ 0x80A1FC50:("DmHina_Draw",), 0x80A1FE50:("EnSyatekiWf_Init",), 0x80A200A0:("EnSyatekiWf_Destroy",), - 0x80A200E0:("func_80A200E0",), - 0x80A201CC:("func_80A201CC",), - 0x80A20284:("func_80A20284",), - 0x80A2030C:("func_80A2030C",), - 0x80A20320:("func_80A20320",), - 0x80A20378:("func_80A20378",), - 0x80A203DC:("func_80A203DC",), - 0x80A20670:("func_80A20670",), - 0x80A206DC:("func_80A206DC",), - 0x80A20710:("func_80A20710",), - 0x80A2075C:("func_80A2075C",), - 0x80A2079C:("func_80A2079C",), - 0x80A20800:("func_80A20800",), - 0x80A20858:("func_80A20858",), - 0x80A208F8:("func_80A208F8",), + 0x80A200E0:("EnSyatekiWf_InitPathStart",), + 0x80A201CC:("EnSyatekiWf_SetupWaitForSignal",), + 0x80A20284:("EnSyatekiWf_WaitForSignal",), + 0x80A2030C:("EnSyatekiWf_SetupWaitToMove",), + 0x80A20320:("EnSyatekiWf_WaitToMove",), + 0x80A20378:("EnSyatekiWf_SetupRun",), + 0x80A203DC:("EnSyatekiWf_Run",), + 0x80A20670:("EnSyatekiWf_SetupJump",), + 0x80A206DC:("EnSyatekiWf_Jump",), + 0x80A20710:("EnSyatekiWf_SetupLand",), + 0x80A2075C:("EnSyatekiWf_Land",), + 0x80A2079C:("EnSyatekiWf_SetupHowl",), + 0x80A20800:("EnSyatekiWf_Howl",), + 0x80A20858:("EnSyatekiWf_SetupDead",), + 0x80A208F8:("EnSyatekiWf_Dead",), 0x80A20A50:("EnSyatekiWf_Update",), 0x80A20CF4:("EnSyatekiWf_OverrideLimbDraw",), 0x80A20D10:("EnSyatekiWf_PostLimbDraw",), @@ -10063,10 +10063,10 @@ 0x80A2B390:("BgDblueMovebg_Draw",), 0x80A2BC00:("EnSyatekiDekunuts_Init",), 0x80A2BE28:("EnSyatekiDekunuts_Destroy",), - 0x80A2BE54:("EnSyatekiDekunuts_SetupWaitForSpawn",), - 0x80A2BF18:("EnSyatekiDekunuts_WaitForSpawn",), - 0x80A2BFC4:("EnSyatekiDekunuts_SetupSpawn",), - 0x80A2C0F8:("EnSyatekiDekunuts_Spawn",), + 0x80A2BE54:("EnSyatekiDekunuts_SetupWaitForSignal",), + 0x80A2BF18:("EnSyatekiDekunuts_WaitForSignal",), + 0x80A2BFC4:("EnSyatekiDekunuts_SetupWaitToStart",), + 0x80A2C0F8:("EnSyatekiDekunuts_WaitToStart",), 0x80A2C150:("EnSyatekiDekunuts_SetupWaitToEmerge",), 0x80A2C168:("EnSyatekiDekunuts_WaitToEmerge",), 0x80A2C1AC:("EnSyatekiDekunuts_SetupEmerge",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index f74ea0a5f6..16dcf55afc 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -10954,13 +10954,13 @@ 0x80A20EA0:("D_80A20EA0","UNK_TYPE1","",0x1), 0x80A20EAC:("D_80A20EAC","UNK_PTR","",0x4), 0x80A20EB0:("D_80A20EB0","UNK_TYPE1","",0x1), - 0x80A20EDC:("D_80A20EDC","UNK_TYPE1","",0x1), - 0x80A20EE8:("D_80A20EE8","UNK_TYPE1","",0x1), + 0x80A20EDC:("sVelocity","UNK_TYPE1","",0x1), + 0x80A20EE8:("sAccel","UNK_TYPE1","",0x1), 0x80A20EF4:("En_Syateki_Wf_InitVars","UNK_TYPE1","",0x1), 0x80A20F14:("D_80A20F14","UNK_PTR","",0x4), 0x80A20FBC:("D_80A20FBC","UNK_TYPE1","",0x1), - 0x80A20FC4:("D_80A20FC4","UNK_TYPE4","",0x4), - 0x80A20FD0:("D_80A20FD0","UNK_TYPE1","",0x1), + 0x80A20FC4:("sFireVelocityAndAccel","UNK_TYPE4","",0x4), + 0x80A20FD0:("sTailColliderOffset","UNK_TYPE1","",0x1), 0x80A20FDC:("D_80A20FDC","UNK_TYPE1","",0x1), 0x80A20FF0:("D_80A20FF0","f32","",0x4), 0x80A229F0:("Obj_Skateblock_InitVars","UNK_TYPE1","",0x1), From 4c4c0d730780b4846427ba26697a00830a0d948b Mon Sep 17 00:00:00 2001 From: Isghj <42048411+isghj5@users.noreply.github.com> Date: Tue, 21 Feb 2023 12:09:08 -0800 Subject: [PATCH 08/29] Document `object_po_fusen` (Poe Balloon from romani ranch) (#1167) * PoFusen: Documented object * PoFusen: Cleaning and docs * Apply suggestions from code review Co-authored-by: Tom Overton * PoFusen: fixes for requested changes, and additional changes * PoSisters: replace NONEFFECT with NONE * Fusen/Sisters: requested changes * Fusen: more requested changes * Fusen: removed documentation at request * Apply suggestions from code review Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Po Fusen/Sisters: fix dmgeff naming * Po Fuse/Sisters: more enum/define/limb name cohesive * Apply suggestions from code review Co-authored-by: EllipticEllipsis * PoSisters: comment caplitalization --------- Co-authored-by: Tom Overton Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> Co-authored-by: EllipticEllipsis --- assets/xml/objects/object_po_fusen.xml | 63 ++-- assets/xml/objects/object_po_sisters.xml | 92 ++--- .../actors/ovl_En_Po_Fusen/z_en_po_fusen.c | 175 ++++----- .../actors/ovl_En_Po_Fusen/z_en_po_fusen.h | 16 +- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 331 +++++++++--------- .../ovl_En_Po_Sisters/z_en_po_sisters.h | 28 +- 6 files changed, 361 insertions(+), 344 deletions(-) diff --git a/assets/xml/objects/object_po_fusen.xml b/assets/xml/objects/object_po_fusen.xml index a25c9d9607..23bfbe0755 100644 --- a/assets/xml/objects/object_po_fusen.xml +++ b/assets/xml/objects/object_po_fusen.xml @@ -1,32 +1,39 @@  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_po_sisters.xml b/assets/xml/objects/object_po_sisters.xml index e2e57a31aa..cc00b50a1f 100644 --- a/assets/xml/objects/object_po_sisters.xml +++ b/assets/xml/objects/object_po_sisters.xml @@ -3,68 +3,68 @@ - + - + - - - + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - + 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 a9fcf95e3f..e7a2ae6071 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 @@ -6,7 +6,6 @@ #include "z_en_po_fusen.h" #include "overlays/actors/ovl_En_Ma4/z_en_ma4.h" -#include "objects/object_po_fusen/object_po_fusen.h" #define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_100000 | ACTOR_FLAG_80000000) @@ -57,44 +56,49 @@ static ColliderSphereInit sSphereInit = { { 0, { { 0, 0, 0 }, 200 }, 100 }, }; +typedef enum { + /* 0x0 */ POE_BALLOON_DMGEFF_NONE, + /* 0xF */ POE_BALLOON_DMGEFF_POP = 0xF, +} PoeBalloonDamageEffect; + static DamageTable sDamageTable = { - /* Deku Nut */ DMG_ENTRY(0, 0x0), - /* Deku Stick */ DMG_ENTRY(0, 0x0), - /* Horse trample */ DMG_ENTRY(0, 0x0), - /* Explosives */ DMG_ENTRY(0, 0x0), - /* Zora boomerang */ DMG_ENTRY(0, 0x0), - /* Normal arrow */ DMG_ENTRY(1, 0xF), - /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), - /* Hookshot */ DMG_ENTRY(0, 0x0), - /* Goron punch */ DMG_ENTRY(0, 0x0), - /* Sword */ DMG_ENTRY(0, 0x0), - /* Goron pound */ DMG_ENTRY(0, 0x0), - /* Fire arrow */ DMG_ENTRY(1, 0xF), - /* Ice arrow */ DMG_ENTRY(1, 0xF), - /* Light arrow */ DMG_ENTRY(1, 0xF), - /* Goron spikes */ DMG_ENTRY(1, 0xF), - /* Deku spin */ DMG_ENTRY(0, 0x0), - /* Deku bubble */ DMG_ENTRY(0, 0x0), - /* Deku launch */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0), - /* Zora barrier */ DMG_ENTRY(0, 0x0), - /* Normal shield */ DMG_ENTRY(0, 0x0), - /* Light ray */ DMG_ENTRY(0, 0x0), - /* Thrown object */ DMG_ENTRY(0, 0x0), - /* Zora punch */ DMG_ENTRY(0, 0x0), - /* Spin attack */ DMG_ENTRY(0, 0x0), - /* Sword beam */ DMG_ENTRY(0, 0x0), - /* Normal Roll */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0x0), - /* Unblockable */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0x0), - /* Powder Keg */ DMG_ENTRY(0, 0x0), + /* Deku Nut */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Deku Stick */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Horse trample */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Explosives */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Zora boomerang */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Normal arrow */ DMG_ENTRY(1, POE_BALLOON_DMGEFF_POP), + /* UNK_DMG_0x06 */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Hookshot */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Goron punch */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Sword */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Goron pound */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Fire arrow */ DMG_ENTRY(1, POE_BALLOON_DMGEFF_POP), + /* Ice arrow */ DMG_ENTRY(1, POE_BALLOON_DMGEFF_POP), + /* Light arrow */ DMG_ENTRY(1, POE_BALLOON_DMGEFF_POP), + /* Goron spikes */ DMG_ENTRY(1, POE_BALLOON_DMGEFF_POP), + /* Deku spin */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Deku bubble */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Deku launch */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* UNK_DMG_0x12 */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Zora barrier */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Normal shield */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Light ray */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Thrown object */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Zora punch */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Spin attack */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Sword beam */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Normal Roll */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* UNK_DMG_0x1B */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* UNK_DMG_0x1C */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Unblockable */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* UNK_DMG_0x1E */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), + /* Powder Keg */ DMG_ENTRY(0, POE_BALLOON_DMGEFF_NONE), }; void EnPoFusen_Init(Actor* thisx, PlayState* play) { EnPoFusen* this = THIS; - f32 heightTemp; + f32 flyingHeightMin; this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = 0.007f; this->actor.targetMode = 6; @@ -103,10 +107,9 @@ void EnPoFusen_Init(Actor* thisx, PlayState* play) { Collider_InitSphere(play, &this->collider); Collider_SetSphere(play, &this->collider, &this->actor, &sSphereInit); - if (0) {} this->collider.dim.worldSphere.radius = 40; - SkelAnime_InitFlex(play, &this->anime, &object_po_fusen_Skel_0024F0, &object_po_fusen_Anim_000040, this->jointTable, - this->morphTable, 10); + SkelAnime_InitFlex(play, &this->anime, &gPoeBalloonSkel, &gPoeBalloonEmptyAnim, this->jointTable, this->morphTable, + POE_BALLOON_LIMB_MAX); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 0x4); @@ -114,27 +117,26 @@ void EnPoFusen_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->actor); } - heightTemp = this->actor.floorHeight + 90.0f; - if (this->actor.home.pos.y < heightTemp) { - this->actor.home.pos.y = heightTemp; + flyingHeightMin = this->actor.floorHeight + 90.0f; + if (this->actor.home.pos.y < flyingHeightMin) { + this->actor.home.pos.y = flyingHeightMin; } this->randScaleChange = (Rand_Next() % 0xFFFE) - 0x7FFF; this->randYRotChange = (Rand_Next() % 0x4B0) - 0x258; this->avgBaseRotation = 0x10000 / 12; - this->limb3Rot = 0; + this->limbRotYRightUpperArm = 0; this->limb46Rot = 0; this->limb57Rot = 0; - this->limb8Rot = 0; - this->limb9Rot = 0x71C; + this->limbRotLeftHand = 0; + this->limbRotChainAndLantern = 0x71C; this->randBaseRotChange = 0; - if (ENPOFUSEN_IS_FUSE_TYPE(&this->actor)) { + if (POE_BALLOON_IS_FUSE_TYPE(&this->actor)) { EnPoFusen_InitFuse(this); - return; + } else { + EnPoFusen_InitNoFuse(this); } - - EnPoFusen_InitNoFuse(this); } void EnPoFusen_Destroy(Actor* thisx, PlayState* play) { @@ -143,20 +145,22 @@ void EnPoFusen_Destroy(Actor* thisx, PlayState* play) { Collider_DestroySphere(play, &this->collider); } +/** + * Search for Romani's actor, beacuse it's PoFusen's job to update her actor on pop. + */ u16 EnPoFusen_CheckParent(EnPoFusen* this, PlayState* play) { - Actor* actorPtr; + Actor* actorIter = play->actorCtx.actorLists[ACTORCAT_NPC].first; - actorPtr = play->actorCtx.actorLists[ACTORCAT_NPC].first; - if (ENPOFUSEN_IS_FUSE_TYPE(&this->actor)) { + if (POE_BALLOON_IS_FUSE_TYPE(&this->actor)) { return true; } - while (actorPtr != NULL) { - if (actorPtr->id == ACTOR_EN_MA4) { - this->actor.parent = actorPtr; + while (actorIter != NULL) { + if (actorIter->id == ACTOR_EN_MA4) { + this->actor.parent = actorIter; return true; } - actorPtr = actorPtr->next; + actorIter = actorIter->next; } return false; @@ -171,7 +175,7 @@ u16 EnPoFusen_CheckCollision(EnPoFusen* this, PlayState* play) { this->collider.dim.worldSphere.center.y = this->actor.world.pos.y + 20.0f; this->collider.dim.worldSphere.center.z = this->actor.world.pos.z; - if ((this->collider.base.acFlags & AC_HIT) && (this->actor.colChkInfo.damageEffect == 0xF)) { + if ((this->collider.base.acFlags & AC_HIT) && (this->actor.colChkInfo.damageEffect == POE_BALLOON_DMGEFF_POP)) { this->collider.base.acFlags &= ~AC_HIT; return true; } @@ -204,16 +208,16 @@ void EnPoFusen_Idle(EnPoFusen* this, PlayState* play) { this->actor.shape.rot.z = (Math_SinS(this->randBaseRotChange) * 910.0f); if ((this->randScaleChange < 0x4000) && (this->randScaleChange >= -0x3FFF)) { - Math_SmoothStepToS(&this->limb9Rot, 0x38E, 0x14, 0xBB8, 0x64); + Math_SmoothStepToS(&this->limbRotChainAndLantern, 0x38E, 0x14, 0xBB8, 0x64); } else { - Math_SmoothStepToS(&this->limb9Rot, 0x71C, 0x8, 0xBB8, 0x64); + Math_SmoothStepToS(&this->limbRotChainAndLantern, 0x71C, 0x8, 0xBB8, 0x64); } - this->avgBaseRotation = this->limb9Rot * 3; - this->limb3Rot = (Math_SinS(this->randBaseRotChange + 0x38E3) * this->avgBaseRotation); + this->avgBaseRotation = this->limbRotChainAndLantern * 3; + this->limbRotYRightUpperArm = (Math_SinS(this->randBaseRotChange + 0x38E3) * this->avgBaseRotation); this->limb46Rot = (Math_SinS(this->randBaseRotChange) * this->avgBaseRotation); this->limb57Rot = (Math_SinS(this->randBaseRotChange - 0x38E3) * this->avgBaseRotation); - this->limb8Rot = (Math_SinS(this->randBaseRotChange - 0x71C6) * this->avgBaseRotation); + this->limbRotLeftHand = (Math_SinS(this->randBaseRotChange - 0x71C6) * this->avgBaseRotation); shadowScaleTmp = ((1.0f - Math_SinS(this->randScaleChange)) * 10.0f) + 50.0f; shadowAlphaTmp = ((1.0f - Math_SinS(this->randScaleChange)) * 75.0f) + 100.0f; @@ -223,10 +227,9 @@ void EnPoFusen_Idle(EnPoFusen* this, PlayState* play) { void EnPoFusen_IncrementRomaniPop(EnPoFusen* this) { Actor* parent = this->actor.parent; - EnMa4* romani; if ((parent != NULL) && (parent->id == ACTOR_EN_MA4)) { - romani = (EnMa4*)parent; + EnMa4* romani = (EnMa4*)parent; romani->poppedBalloonCounter++; } @@ -243,7 +246,8 @@ void EnPoFusen_Pop(EnPoFusen* this, PlayState* play) { void EnPoFusen_InitFuse(EnPoFusen* this) { s16 rotZ = this->actor.shape.rot.z; - this->fuse = ENPOFUSEN_GET_FUSE_LEN(&this->actor); + + this->fuse = POE_BALLOON_GET_FUSE_LEN(&this->actor); this->actor.shape.rot.z = 0; this->randScaleChange = rotZ & 0xFFFF; this->actionFunc = EnPoFusen_IdleFuse; @@ -258,6 +262,7 @@ void EnPoFusen_IdleFuse(EnPoFusen* this, PlayState* play) { void EnPoFusen_Update(Actor* thisx, PlayState* play) { EnPoFusen* this = THIS; + this->actionFunc(this, play); if (EnPoFusen_CheckCollision(this, play)) { EnPoFusen_IncrementRomaniPop(this); @@ -266,39 +271,38 @@ void EnPoFusen_Update(Actor* thisx, PlayState* play) { s32 EnPoFusen_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { EnPoFusen* this = THIS; - f32 zScale; - f32 yScale; - f32 xScale; - s16 pad; - s16 zRot; - s16 pad2; - s16 xRot; - if (limbIndex == 2) { - zScale = (Math_CosS(this->randScaleChange) * 0.08f) + 1.0f; - xScale = zScale; - if (!zScale) {} + if (limbIndex == POE_BALLOON_LIMB_BODY) { + f32 zScale = (Math_CosS(this->randScaleChange) * 0.08f) + 1.0f; + f32 yScale; + f32 xScale = zScale; + s16 pad; + s16 zRot; + s16 pad2; + s16 xRot; + yScale = (Math_SinS(this->randScaleChange) * 0.08f) + 1.0f; - yScale = yScale * yScale; + yScale = SQ(yScale); xRot = ((Math_SinS(this->randXZRotChange) * 2730.0f)); zRot = ((Math_CosS(this->randXZRotChange) * 2730.0f)); Matrix_RotateZYX(xRot, 0, zRot, MTXMODE_APPLY); Matrix_Scale(xScale, yScale, zScale, MTXMODE_APPLY); Matrix_RotateZS(-zRot, MTXMODE_APPLY); Matrix_RotateXS(-xRot, MTXMODE_APPLY); - } else if (limbIndex == 3) { - rot->y += this->limb3Rot; - } else if (limbIndex == 6) { + + } else if (limbIndex == POE_BALLOON_RIGHT_UPPER_ARM) { + rot->y += this->limbRotYRightUpperArm; + } else if (limbIndex == POE_BALLOON_LEFT_UPPER_ARM) { rot->y += this->limb46Rot; - } else if (limbIndex == 4) { + } else if (limbIndex == POE_BALLOON_RIGHT_FOREARM) { rot->z += this->limb46Rot; - } else if ((limbIndex == 5) || (limbIndex == 7)) { + } else if ((limbIndex == POE_BALLOON_RIGHT_HAND) || (limbIndex == POE_BALLOON_LEFT_FOREARM)) { rot->z += this->limb57Rot; - } else if (limbIndex == 8) { - rot->z += this->limb8Rot; - } else if (limbIndex == 9) { - rot->y += (s16)(this->limb9Rot * Math_SinS(this->randBaseRotChange)); - rot->z += (s16)(this->limb9Rot * Math_CosS(this->randBaseRotChange)); + } else if (limbIndex == POE_BALLOON_LEFT_HAND) { + rot->z += this->limbRotLeftHand; + } else if (limbIndex == POE_BALLOON_LIMB_CHAIN_AND_LANTERN) { + rot->y += (s16)(this->limbRotChainAndLantern * Math_SinS(this->randBaseRotChange)); + rot->z += (s16)(this->limbRotChainAndLantern * Math_CosS(this->randBaseRotChange)); } return false; } @@ -311,6 +315,7 @@ void EnPoFusen_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) { void EnPoFusen_Draw(Actor* thisx, PlayState* play) { EnPoFusen* this = THIS; + func_8012C28C(play->state.gfxCtx); SkelAnime_DrawTransformFlexOpa(play, this->anime.skeleton, this->anime.jointTable, this->anime.dListCount, EnPoFusen_OverrideLimbDraw, EnPoFusen_PostLimbDraw, EnPoFusen_TransformLimbDraw, 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 740d659683..506f046d01 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 @@ -2,11 +2,13 @@ #define Z_EN_PO_FUSEN_H #include "global.h" +#include "objects/object_po_fusen/object_po_fusen.h" struct EnPoFusen; -#define ENPOFUSEN_GET_FUSE_LEN(thisx) ((thisx)->params & 0x3FF) -#define ENPOFUSEN_IS_FUSE_TYPE(thisx) ((thisx)->params & 0x8000) +// The version used in the credits, where we see romani shoot three in a row, are on timer, this is the fuse length. +#define POE_BALLOON_GET_FUSE_LEN(thisx) ((thisx)->params & 0x3FF) +#define POE_BALLOON_IS_FUSE_TYPE(thisx) ((thisx)->params & 0x8000) typedef void (*EnPoFusenActionFunc)(struct EnPoFusen*, PlayState*); @@ -15,17 +17,17 @@ typedef struct EnPoFusen { /* 0x144 */ SkelAnime anime; /* 0x188 */ EnPoFusenActionFunc actionFunc; /* 0x18C */ ColliderSphere collider; - /* 0x1E4 */ Vec3s jointTable[0xA]; - /* 0x220 */ Vec3s morphTable[0xA]; + /* 0x1E4 */ Vec3s jointTable[POE_BALLOON_LIMB_MAX]; + /* 0x220 */ Vec3s morphTable[POE_BALLOON_LIMB_MAX]; /* 0x25C */ s16 randScaleChange; /* 0x25E */ s16 randXZRotChange; /* 0x260 */ s16 randYRotChange; /* 0x262 */ s16 avgBaseRotation; - /* 0x264 */ s16 limb3Rot; + /* 0x264 */ s16 limbRotYRightUpperArm; /* 0x266 */ s16 limb46Rot; /* 0x268 */ s16 limb57Rot; - /* 0x26A */ s16 limb8Rot; - /* 0x26C */ s16 limb9Rot; + /* 0x26A */ s16 limbRotLeftHand; + /* 0x26C */ s16 limbRotChainAndLantern; /* 0x26E */ s16 randBaseRotChange; /* 0x270 */ s16 fuse; } EnPoFusen; // size = 0x274 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 a89a55d9e9..2c1ad1e025 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 @@ -97,46 +97,46 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit sColChkInfoInit = { 6, 25, 60, 50 }; typedef enum { - /* 0x0 */ POSISTERS_DAMAGEEFFECT_NOEFFECT, - /* 0x1 */ POSISTERS_DAMAGEEFFECT_UNKDMG12, // set in DamageTable, but unused - /* 0x4 */ POSISTERS_DAMAGEEFFECT_LIGHTARROWS = 0x4, - /* 0xE */ POSISTERS_DAMAGEEFFECT_SPINATTACK = 0xE, - /* 0xF */ POSISTERS_DAMAGEEFFECT_DEKUNUT = 0xF, -} PoSisterDamageEffect; + /* 0x0 */ POE_SISTERS_DMGEFF_NONE, + /* 0x1 */ POE_SISTERS_DMGEFF_UNKDMG12, // set in DamageTable, but unused + /* 0x4 */ POE_SISTERS_DMGEFF_LIGHTARROWS = 0x4, + /* 0xE */ POE_SISTERS_DMGEFF_SPINATTACK = 0xE, + /* 0xF */ POE_SISTERS_DMGEFF_DEKUNUT = 0xF, +} PoeSisterDamageEffect; static DamageTable sDamageTable = { - /* Deku Nut */ DMG_ENTRY(0, POSISTERS_DAMAGEEFFECT_DEKUNUT), - /* Deku Stick */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Horse trample */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Explosives */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Zora boomerang */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Normal arrow */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* UNK_DMG_0x06 */ DMG_ENTRY(0, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Hookshot */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Goron punch */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Sword */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Goron pound */ DMG_ENTRY(0, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Fire arrow */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Ice arrow */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Light arrow */ DMG_ENTRY(2, POSISTERS_DAMAGEEFFECT_LIGHTARROWS), - /* Goron spikes */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Deku spin */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Deku bubble */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Deku launch */ DMG_ENTRY(2, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* UNK_DMG_0x12 */ DMG_ENTRY(0, POSISTERS_DAMAGEEFFECT_UNKDMG12), - /* Zora barrier */ DMG_ENTRY(0, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Normal shield */ DMG_ENTRY(0, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Light ray */ DMG_ENTRY(0, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Thrown object */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Zora punch */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Spin attack */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_SPINATTACK), - /* Sword beam */ DMG_ENTRY(0, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Normal Roll */ DMG_ENTRY(0, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* UNK_DMG_0x1B */ DMG_ENTRY(0, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* UNK_DMG_0x1C */ DMG_ENTRY(0, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Unblockable */ DMG_ENTRY(0, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* UNK_DMG_0x1E */ DMG_ENTRY(0, POSISTERS_DAMAGEEFFECT_NOEFFECT), - /* Powder Keg */ DMG_ENTRY(1, POSISTERS_DAMAGEEFFECT_NOEFFECT), + /* Deku Nut */ DMG_ENTRY(0, POE_SISTERS_DMGEFF_DEKUNUT), + /* Deku Stick */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_NONE), + /* Horse trample */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_NONE), + /* Explosives */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_NONE), + /* Zora boomerang */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_NONE), + /* Normal arrow */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_NONE), + /* UNK_DMG_0x06 */ DMG_ENTRY(0, POE_SISTERS_DMGEFF_NONE), + /* Hookshot */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_NONE), + /* Goron punch */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_NONE), + /* Sword */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_NONE), + /* Goron pound */ DMG_ENTRY(0, POE_SISTERS_DMGEFF_NONE), + /* Fire arrow */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_NONE), + /* Ice arrow */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_NONE), + /* Light arrow */ DMG_ENTRY(2, POE_SISTERS_DMGEFF_LIGHTARROWS), + /* Goron spikes */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_NONE), + /* Deku spin */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_NONE), + /* Deku bubble */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_NONE), + /* Deku launch */ DMG_ENTRY(2, POE_SISTERS_DMGEFF_NONE), + /* UNK_DMG_0x12 */ DMG_ENTRY(0, POE_SISTERS_DMGEFF_UNKDMG12), + /* Zora barrier */ DMG_ENTRY(0, POE_SISTERS_DMGEFF_NONE), + /* Normal shield */ DMG_ENTRY(0, POE_SISTERS_DMGEFF_NONE), + /* Light ray */ DMG_ENTRY(0, POE_SISTERS_DMGEFF_NONE), + /* Thrown object */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_NONE), + /* Zora punch */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_NONE), + /* Spin attack */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_SPINATTACK), + /* Sword beam */ DMG_ENTRY(0, POE_SISTERS_DMGEFF_NONE), + /* Normal Roll */ DMG_ENTRY(0, POE_SISTERS_DMGEFF_NONE), + /* UNK_DMG_0x1B */ DMG_ENTRY(0, POE_SISTERS_DMGEFF_NONE), + /* UNK_DMG_0x1C */ DMG_ENTRY(0, POE_SISTERS_DMGEFF_NONE), + /* Unblockable */ DMG_ENTRY(0, POE_SISTERS_DMGEFF_NONE), + /* UNK_DMG_0x1E */ DMG_ENTRY(0, POE_SISTERS_DMGEFF_NONE), + /* Powder Keg */ DMG_ENTRY(1, POE_SISTERS_DMGEFF_NONE), }; static InitChainEntry sInitChain[] = { @@ -146,15 +146,15 @@ static InitChainEntry sInitChain[] = { // clang-format off // PoSisters have their own flags variable for cross function behavior detection -#define POSISTERS_FLAG_CLEAR (0) -#define POSISTERS_FLAG_CHECK_AC (1 << 0) -#define POSISTERS_FLAG_UPDATE_SHAPE_ROT (1 << 1) -#define POSISTERS_FLAG_CHECK_Z_TARGET (1 << 2) // meg doesnt go invis if you ztarget her for too long -#define POSISTERS_FLAG_MATCH_PLAYER_HEIGHT (1 << 3) // the po is attempting to level with player's height -#define POSISTERS_FLAG_UPDATE_BGCHECK_INFO (1 << 4) -#define POSISTERS_FLAG_UPDATE_FIRES (1 << 5) // firePos updated to match limb in PostLimbDraw -#define POSISTERS_FLAG_REAL_MEG_ROTATION (1 << 6) // real meg rotates different than her clones for one cycle -#define POSISTERS_FLAG_DRAW_TORCH (1 << 7) +#define POE_SISTERS_FLAG_CLEAR (0) +#define POE_SISTERS_FLAG_CHECK_AC (1 << 0) +#define POE_SISTERS_FLAG_UPDATE_SHAPE_ROT (1 << 1) +#define POE_SISTERS_FLAG_CHECK_Z_TARGET (1 << 2) // Meg doesnt go invisible if you ztarget her for too long +#define POE_SISTERS_FLAG_MATCH_PLAYER_HEIGHT (1 << 3) // The Poe is attempting to level with player's height +#define POE_SISTERS_FLAG_UPDATE_BGCHECK_INFO (1 << 4) +#define POE_SISTERS_FLAG_UPDATE_FIRES (1 << 5) // firePos updated to match limb in PostLimbDraw +#define POE_SISTERS_FLAG_REAL_MEG_ROTATION (1 << 6) // Real Meg rotates different than her clones for one cycle +#define POE_SISTERS_FLAG_DRAW_TORCH (1 << 7) // clang-format on void EnPoSisters_Init(Actor* thisx, PlayState* play) { @@ -163,8 +163,8 @@ void EnPoSisters_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f); - SkelAnime_Init(play, &this->skelAnime, &gPoSistersSkel, &gPoeSistersSwayAnim, this->jointTable, this->morphTable, - POSISTERS_LIMB_MAX); + SkelAnime_Init(play, &this->skelAnime, &gPoeSistersSkel, &gPoeSistersSwayAnim, this->jointTable, this->morphTable, + POE_SISTERS_LIMB_MAX); this->color.r = 255; this->color.g = 255; @@ -176,21 +176,21 @@ void EnPoSisters_Init(Actor* thisx, PlayState* play) { Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); - this->type = ENPOSISTERS_GET_TYPE(thisx); + this->type = POE_SISTERS_GET_TYPE(thisx); this->actor.hintId = this->type + TATL_HINT_ID_POE_SISTER_MEG; - this->megCloneId = ENPOSISTERS_GET_MEG_CLONE_ID(thisx); + this->megCloneId = POE_SISTERS_GET_MEG_CLONE_ID(thisx); this->floatingBobbingTimer = 32; this->zTargetTimer = 20; this->fireCount = 1; - this->poSisterFlags = POSISTERS_FLAG_UPDATE_FIRES; + this->poSisterFlags = POE_SISTERS_FLAG_UPDATE_FIRES; this->megDistToPlayer = 110.0f; thisx->flags &= ~ACTOR_FLAG_1; - if (ENPOSISTERS_GET_OBSERVER_FLAG(&this->actor)) { - // if flagged observer, they are a floating prop spawned by EnGb2 (po hut proprieter) + if (POE_SISTERS_GET_OBSERVER_FLAG(&this->actor)) { + // "Flagged observer": non-enemy floating prop spawned by EnGb2 (Poe Hut Proprieter) for display EnPoSisters_SetupObserverIdle(this); - } else if (this->type == POSISTER_TYPE_MEG) { - if (this->megCloneId == POSISTER_MEG_REAL) { + } else if (this->type == POE_SISTERS_TYPE_MEG) { + if (this->megCloneId == POE_SISTERS_MEG_REAL) { this->actor.colChkInfo.health = 8; this->collider.info.toucher.damage = 16; this->collider.base.ocFlags1 = (OC1_TYPE_PLAYER | OC1_ON); @@ -242,7 +242,7 @@ void EnPoSisters_MatchPlayerXZ(EnPoSisters* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 dist; - if (this->megCloneId == POSISTER_MEG_REAL || this->actionFunc != EnPoSisters_DamageFlinch) { + if (this->megCloneId == POE_SISTERS_MEG_REAL || this->actionFunc != EnPoSisters_DamageFlinch) { if ((player->meleeWeaponState == 0 || player->meleeWeaponAnimation >= PLAYER_MWA_SPIN_ATTACK_1H) && ((player->actor.world.pos.y - player->actor.floorHeight) < 1.0f)) { Math_StepToF(&this->megDistToPlayer, 110.0f, 3.0f); @@ -250,7 +250,7 @@ void EnPoSisters_MatchPlayerXZ(EnPoSisters* this, PlayState* play) { Math_StepToF(&this->megDistToPlayer, 170.0f, 10.0f); } dist = this->megDistToPlayer; - } else if (this->megCloneId != POSISTER_MEG_REAL) { + } else if (this->megCloneId != POE_SISTERS_MEG_REAL) { dist = this->actor.parent->xzDistToPlayer; } @@ -353,7 +353,8 @@ void EnPoSisters_SetupAimlessIdleFlying(EnPoSisters* this) { Animation_MorphToLoop(&this->skelAnime, &gPoeSistersFloatAnim, -3.0f); } this->idleFlyingAnimationCounter = Rand_S16Offset(15, 3); - this->poSisterFlags |= (POSISTERS_FLAG_CHECK_Z_TARGET | POSISTERS_FLAG_UPDATE_SHAPE_ROT | POSISTERS_FLAG_CHECK_AC); + this->poSisterFlags |= + (POE_SISTERS_FLAG_CHECK_Z_TARGET | POE_SISTERS_FLAG_UPDATE_SHAPE_ROT | POE_SISTERS_FLAG_CHECK_AC); this->actionFunc = EnPoSisters_AimlessIdleFlying; } @@ -418,10 +419,10 @@ void EnPoSisters_SetupSpinUp(EnPoSisters* this) { this->collider.base.acFlags |= AC_HARD; } - Animation_MorphToLoop(&this->skelAnime, &gPoSistersAttackAnim, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &gPoeSistersAttackAnim, -5.0f); this->actor.speedXZ = 0.0f; - this->spinupTimer = Animation_GetLastFrame(&gPoSistersAttackAnim.common) * 3 + 3; - this->poSisterFlags &= ~POSISTERS_FLAG_UPDATE_SHAPE_ROT; + this->spinupTimer = Animation_GetLastFrame(&gPoeSistersAttackAnim.common) * 3 + 3; + this->poSisterFlags &= ~POE_SISTERS_FLAG_UPDATE_SHAPE_ROT; this->actionFunc = EnPoSisters_SpinUp; } @@ -438,15 +439,15 @@ void EnPoSisters_SpinUp(EnPoSisters* this, PlayState* play) { void EnPoSisters_SetupSpinAttack(EnPoSisters* this) { this->actor.speedXZ = 5.0f; - if (this->type == POSISTER_TYPE_MEG) { + if (this->type == POE_SISTERS_TYPE_MEG) { this->collider.base.colType = COLTYPE_METAL; this->collider.base.acFlags |= AC_HARD; - Animation_MorphToLoop(&this->skelAnime, &gPoSistersAttackAnim, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &gPoeSistersAttackAnim, -5.0f); } this->spinTimer = 5; this->actor.world.rot.y = this->actor.yawTowardsPlayer; - this->poSisterFlags |= POSISTERS_FLAG_MATCH_PLAYER_HEIGHT; + this->poSisterFlags |= POE_SISTERS_FLAG_MATCH_PLAYER_HEIGHT; this->actionFunc = EnPoSisters_SpinAttack; } @@ -462,7 +463,7 @@ void EnPoSisters_SpinAttack(EnPoSisters* this, PlayState* play) { s16 rotY = this->actor.shape.rot.y - this->actor.world.rot.y; if (ABS_ALT(rotY) < 0x1000) { - if (this->type != POSISTER_TYPE_MEG) { + if (this->type != POE_SISTERS_TYPE_MEG) { this->collider.base.colType = COLTYPE_HIT3; this->collider.base.acFlags &= ~AC_HARD; EnPoSisters_SetupAimlessIdleFlying(this); @@ -484,7 +485,7 @@ void EnPoSisters_SpinAttack(EnPoSisters* this, PlayState* play) { void EnPoSisters_SetupAttackConnect(EnPoSisters* this) { Animation_MorphToLoop(&this->skelAnime, &gPoeSistersFloatAnim, -3.0f); this->actor.world.rot.y = BINANG_ROT180(this->actor.yawTowardsPlayer); - if (this->type != POSISTER_TYPE_MEG) { + if (this->type != POE_SISTERS_TYPE_MEG) { this->collider.base.colType = COLTYPE_HIT3; this->collider.base.acFlags &= ~AC_HARD; } @@ -498,7 +499,7 @@ void EnPoSisters_AttackConnectDrift(EnPoSisters* this, PlayState* play) { if (Math_StepToF(&this->actor.speedXZ, 0.0f, 0.1f)) { // wait to stop moving this->actor.world.rot.y = this->actor.shape.rot.y; - if (this->type != POSISTER_TYPE_MEG) { + if (this->type != POE_SISTERS_TYPE_MEG) { EnPoSisters_SetupAimlessIdleFlying(this); } else { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH2); @@ -513,12 +514,12 @@ void EnPoSisters_SetupDamageFlinch(EnPoSisters* this) { func_800BE504(&this->actor, &this->collider); } - if (this->type != POSISTER_TYPE_MEG) { + if (this->type != POE_SISTERS_TYPE_MEG) { this->actor.speedXZ = 10.0f; } this->poSisterFlags &= - ~(POSISTERS_FLAG_MATCH_PLAYER_HEIGHT | POSISTERS_FLAG_UPDATE_SHAPE_ROT | POSISTERS_FLAG_CHECK_AC); + ~(POE_SISTERS_FLAG_MATCH_PLAYER_HEIGHT | POE_SISTERS_FLAG_UPDATE_SHAPE_ROT | POE_SISTERS_FLAG_CHECK_AC); Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 16); this->actionFunc = EnPoSisters_DamageFlinch; } @@ -526,9 +527,9 @@ void EnPoSisters_SetupDamageFlinch(EnPoSisters* this) { void EnPoSisters_DamageFlinch(EnPoSisters* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime) && !(this->actor.flags & ACTOR_FLAG_8000)) { if (this->actor.colChkInfo.health != 0) { - if (this->type != POSISTER_TYPE_MEG) { + if (this->type != POE_SISTERS_TYPE_MEG) { EnPoSisters_SetupFlee(this); - } else if (this->megCloneId != POSISTER_MEG_REAL) { + } else if (this->megCloneId != POE_SISTERS_MEG_REAL) { EnPoSisters_MegCloneVanish(this, NULL); } else { EnPoSisters_MegCloneVanish(this, play); @@ -538,27 +539,27 @@ void EnPoSisters_DamageFlinch(EnPoSisters* this, PlayState* play) { } } - if (this->megCloneId != POSISTER_MEG_REAL) { + if (this->megCloneId != POE_SISTERS_MEG_REAL) { s32 alpha; Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.parent->shape.rot.y, - (this->megCloneId == POSISTER_MEG_CLONE2) ? 0x800 : 0x400); + (this->megCloneId == POE_SISTERS_MEG_CLONE2) ? 0x800 : 0x400); alpha = ((this->skelAnime.endFrame - this->skelAnime.curFrame) * 255.0f) / this->skelAnime.endFrame; this->color.a = CLAMP(alpha, 0, 255); this->actor.world.pos.y = this->actor.parent->world.pos.y; EnPoSisters_MatchPlayerXZ(this, play); - } else if (this->type != POSISTER_TYPE_MEG) { + } else if (this->type != POE_SISTERS_TYPE_MEG) { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); } } void EnPoSisters_SetupFlee(EnPoSisters* this) { - Animation_MorphToLoop(&this->skelAnime, &gPoSistersFleeAnim, -3.0f); + Animation_MorphToLoop(&this->skelAnime, &gPoeSistersFleeAnim, -3.0f); this->actor.world.rot.y = BINANG_ROT180(this->actor.shape.rot.y); this->fleeTimer = 5; this->poSisterFlags |= - (POSISTERS_FLAG_MATCH_PLAYER_HEIGHT | POSISTERS_FLAG_UPDATE_SHAPE_ROT | POSISTERS_FLAG_CHECK_AC); + (POE_SISTERS_FLAG_MATCH_PLAYER_HEIGHT | POE_SISTERS_FLAG_UPDATE_SHAPE_ROT | POE_SISTERS_FLAG_CHECK_AC); this->actor.speedXZ = 5.0f; this->actionFunc = EnPoSisters_Flee; } @@ -572,7 +573,7 @@ void EnPoSisters_Flee(EnPoSisters* this, PlayState* play) { if (this->actor.bgCheckFlags & 8) { // touching a wall this->actor.world.rot.y = this->actor.shape.rot.y; - this->poSisterFlags |= POSISTERS_FLAG_UPDATE_SHAPE_ROT; + this->poSisterFlags |= POE_SISTERS_FLAG_UPDATE_SHAPE_ROT; EnPoSisters_SetupSpinToInvis(this); } else if (this->fleeTimer == 0 && this->actor.xzDistToPlayer > 480.0f) { this->actor.world.rot.y = this->actor.shape.rot.y; @@ -586,7 +587,7 @@ void EnPoSisters_SetupSpinToInvis(EnPoSisters* this) { this->invisibleTimer = 100; // 5 seconds this->actor.speedXZ = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; - this->poSisterFlags &= ~(POSISTERS_FLAG_CHECK_Z_TARGET | POSISTERS_FLAG_CHECK_AC); + this->poSisterFlags &= ~(POE_SISTERS_FLAG_CHECK_Z_TARGET | POE_SISTERS_FLAG_CHECK_AC); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DISAPPEAR); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH2); this->actionFunc = EnPoSisters_SpinToInvis; @@ -607,7 +608,7 @@ void EnPoSisters_SpinToInvis(EnPoSisters* this, PlayState* play) { void EnPoSisters_SetupSpinBackToVisible(EnPoSisters* this, PlayState* play) { Animation_Change(&this->skelAnime, &gPoeSistersAppearDisappearAnim, 1.5f, 0.0f, Animation_GetLastFrame(&gPoeSistersAppearDisappearAnim.common), ANIMMODE_ONCE, -3.0f); - if (this->type == POSISTER_TYPE_MEG) { + if (this->type == POE_SISTERS_TYPE_MEG) { this->megDistToPlayer = 110.0f; EnPoSisters_MatchPlayerXZ(this, play); this->color.a = 0; @@ -619,15 +620,15 @@ void EnPoSisters_SetupSpinBackToVisible(EnPoSisters* this, PlayState* play) { this->spinInvisibleTimer = 15; this->actor.speedXZ = 0.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); - this->poSisterFlags &= ~POSISTERS_FLAG_CHECK_AC; + this->poSisterFlags &= ~POE_SISTERS_FLAG_CHECK_AC; this->actionFunc = EnPoSisters_SpinBackToVisible; } void EnPoSisters_SpinBackToVisible(EnPoSisters* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { this->color.a = 255; // fully visible - if (this->type != POSISTER_TYPE_MEG) { - this->poSisterFlags |= POSISTERS_FLAG_CHECK_AC; + if (this->type != POE_SISTERS_TYPE_MEG) { + this->poSisterFlags |= POE_SISTERS_FLAG_CHECK_AC; this->collider.info.bumper.dmgFlags = ~(0x8000000 | 0x200000 | 0x100000 | 0x40000 | 0x1); DECR(this->spinInvisibleTimer); @@ -643,7 +644,7 @@ void EnPoSisters_SpinBackToVisible(EnPoSisters* this, PlayState* play) { s32 alpha = (this->skelAnime.curFrame * 255.0f) / this->skelAnime.endFrame; this->color.a = CLAMP(alpha, 0, 255); - if (this->type == POSISTER_TYPE_MEG) { + if (this->type == POE_SISTERS_TYPE_MEG) { EnPoSisters_MatchPlayerXZ(this, play); } } @@ -655,7 +656,7 @@ void EnPoSisters_SetupDeathStage1(EnPoSisters* this) { this->actor.world.pos.y += 42.0f; this->actor.shape.yOffset = -6000.0f; this->actor.flags &= ~ACTOR_FLAG_1; - this->poSisterFlags = POSISTERS_FLAG_CLEAR; + this->poSisterFlags = POE_SISTERS_FLAG_CLEAR; this->actionFunc = EnPoSisters_DeathStage1; } @@ -724,15 +725,15 @@ void EnPoSisters_DeathStage2(EnPoSisters* this, PlayState* play) { void EnPoSisters_SpawnMegClones(EnPoSisters* this, PlayState* play) { Actor* clone1 = Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_PO_SISTERS, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, - 0, ENPOSISTERS_PARAMS(false, POSISTER_MEG_CLONE1, POSISTER_TYPE_MEG)); + 0, POE_SISTERS_PARAMS(false, POE_SISTERS_MEG_CLONE1, POE_SISTERS_TYPE_MEG)); Actor* clone2 = Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_PO_SISTERS, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, - 0, ENPOSISTERS_PARAMS(false, POSISTER_MEG_CLONE2, POSISTER_TYPE_MEG)); + 0, POE_SISTERS_PARAMS(false, POE_SISTERS_MEG_CLONE2, POE_SISTERS_TYPE_MEG)); Actor* clone3 = Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_PO_SISTERS, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, - 0, ENPOSISTERS_PARAMS(false, POSISTER_MEG_CLONE3, POSISTER_TYPE_MEG)); + 0, POE_SISTERS_PARAMS(false, POE_SISTERS_MEG_CLONE3, POE_SISTERS_TYPE_MEG)); - // if we cannot spawn all clones: abort + // If we cannot spawn all clones: Abort if ((clone1 == NULL) || (clone2 == NULL) || (clone3 == NULL)) { if (clone1 != NULL) { Actor_Kill(clone1); @@ -759,7 +760,7 @@ void EnPoSisters_MegCloneVanish(EnPoSisters* this, PlayState* play) { this->actor.draw = NULL; this->actor.flags &= ~ACTOR_FLAG_1; this->invisibleTimer = 100; // 5 seconds - this->poSisterFlags = POSISTERS_FLAG_UPDATE_FIRES; + this->poSisterFlags = POE_SISTERS_FLAG_UPDATE_FIRES; this->collider.base.colType = COLTYPE_HIT3; this->collider.base.acFlags &= ~AC_HARD; @@ -767,10 +768,10 @@ void EnPoSisters_MegCloneVanish(EnPoSisters* this, PlayState* play) { pos.x = this->actor.world.pos.x; pos.y = this->actor.world.pos.y + 45.0f; pos.z = this->actor.world.pos.z; - func_800B3030(play, &pos, &gZeroVec3f, &gZeroVec3f, 150, 0, 3); // spawns EffectSsDeadDb + func_800B3030(play, &pos, &gZeroVec3f, &gZeroVec3f, 150, 0, 3); // Spawns EffectSsDeadDb (flame effects) } - Lights_PointSetColorAndRadius(&this->lightInfo, 0, 0, 0, 0); // light OFF + Lights_PointSetColorAndRadius(&this->lightInfo, 0, 0, 0, 0); // Light OFF this->actionFunc = EnPoSisters_MegCloneWaitForSpinBack; } @@ -778,7 +779,7 @@ void EnPoSisters_MegCloneWaitForSpinBack(EnPoSisters* this, PlayState* play) { Player* player = GET_PLAYER(play); EnPoSisters* parent = (EnPoSisters*)this->actor.parent; - if (this->megCloneId == POSISTER_MEG_REAL) { + if (this->megCloneId == POE_SISTERS_MEG_REAL) { DECR(this->invisibleTimer); if (this->invisibleTimer == 0) { s32 rand = Rand_ZeroFloat(4.0f); @@ -803,7 +804,7 @@ void EnPoSisters_SetupMegSurroundPlayer(EnPoSisters* this) { this->color.a = 255; this->megSurroundTimer = 300; // 15 seconds this->megClonesRemaining = 3; - this->poSisterFlags |= (POSISTERS_FLAG_MATCH_PLAYER_HEIGHT | POSISTERS_FLAG_CHECK_AC); + this->poSisterFlags |= (POE_SISTERS_FLAG_MATCH_PLAYER_HEIGHT | POE_SISTERS_FLAG_CHECK_AC); this->actor.flags |= ACTOR_FLAG_1; this->actionFunc = EnPoSisters_MegSurroundPlayer; } @@ -815,47 +816,48 @@ void EnPoSisters_MegSurroundPlayer(EnPoSisters* this, PlayState* play) { if (this->megClonesRemaining > 0 && this->megSurroundTimer >= 16) { SkelAnime_Update(&this->skelAnime); - if (this->megCloneId == POSISTER_MEG_REAL) { + if (this->megCloneId == POE_SISTERS_MEG_REAL) { if (ABS_ALT(16 - this->floatingBobbingTimer) < 14) { - // every x frames rotate around player, the fewer meg clones remaining the faster they spin + // Every N frames rotate around player. The fewer Meg clones remaining the faster they spin. this->actor.shape.rot.y += (s16)((0x580 - (this->megClonesRemaining * 0x180)) * fabsf(Math_SinS(this->floatingBobbingTimer * 0x800))); } - // twirl the real meg backwards for a bit for visual tell to player + // Twirl the real Meg backwards for a bit for a visual tell to player. if ((this->megSurroundTimer >= 284) || (this->megSurroundTimer <= 30)) { - this->poSisterFlags |= POSISTERS_FLAG_REAL_MEG_ROTATION; + this->poSisterFlags |= POE_SISTERS_FLAG_REAL_MEG_ROTATION; } else { - this->poSisterFlags &= ~POSISTERS_FLAG_REAL_MEG_ROTATION; + this->poSisterFlags &= ~POE_SISTERS_FLAG_REAL_MEG_ROTATION; } } else { this->actor.shape.rot.y = this->actor.parent->shape.rot.y + (this->megCloneId * 0x4000); } } - if (this->megCloneId == POSISTER_MEG_REAL) { + if (this->megCloneId == POE_SISTERS_MEG_REAL) { if ((this->megSurroundTimer >= 284) || ((this->megSurroundTimer <= 30) && (this->megSurroundTimer >= 16))) { - this->poSisterFlags |= POSISTERS_FLAG_REAL_MEG_ROTATION; + this->poSisterFlags |= POE_SISTERS_FLAG_REAL_MEG_ROTATION; } else { - this->poSisterFlags &= ~POSISTERS_FLAG_REAL_MEG_ROTATION; + this->poSisterFlags &= ~POE_SISTERS_FLAG_REAL_MEG_ROTATION; } } if (this->megSurroundTimer == 0) { - if (this->megCloneId == POSISTER_MEG_REAL) { + if (this->megCloneId == POE_SISTERS_MEG_REAL) { EnPoSisters_SetupSpinAttack(this); } else { EnPoSisters_MegCloneVanish(this, play); } - } else if (this->megCloneId != POSISTER_MEG_REAL) { + } else if (this->megCloneId != POE_SISTERS_MEG_REAL) { parent = (EnPoSisters*)this->actor.parent; if (parent->actionFunc == EnPoSisters_DamageFlinch) { - // flinch clones if you hit the real meg + // Clones flinch if you hit the real Meg EnPoSisters_SetupDamageFlinch(this); } } else if (this->megClonesRemaining == 0) { - // all meg clones have been killed, meg waits 15 frames then spin attacks - // timer is negative because megClonesRemaining and megAttackTimer are the same union'd variable + // All Meg clones have been killed: Real Meg waits 15 frames then spin attacks in retaliation + // Timer is negative (inrecrements to zero) + // because megClonesRemaining and megAttackTimer are the same union'd variable this->megAttackTimer = -15; } else if (this->megAttackTimer < 0) { this->megAttackTimer++; @@ -874,7 +876,7 @@ void EnPoSisters_SetupSpawnPo(EnPoSisters* this) { Animation_PlayOnce(&this->skelAnime, &gPoeSistersAppearDisappearAnim); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); this->color.a = 0; - this->poSisterFlags = POSISTERS_FLAG_UPDATE_FIRES; + this->poSisterFlags = POE_SISTERS_FLAG_UPDATE_FIRES; this->actionFunc = EnPoSisters_PoeSpawn; } @@ -882,8 +884,8 @@ void EnPoSisters_PoeSpawn(EnPoSisters* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { this->color.a = 255; this->actor.flags |= ACTOR_FLAG_1; - this->poSisterFlags |= (POSISTERS_FLAG_UPDATE_BGCHECK_INFO | POSISTERS_FLAG_MATCH_PLAYER_HEIGHT); - if (this->type == POSISTER_TYPE_MEG) { + this->poSisterFlags |= (POE_SISTERS_FLAG_UPDATE_BGCHECK_INFO | POE_SISTERS_FLAG_MATCH_PLAYER_HEIGHT); + if (this->type == POE_SISTERS_TYPE_MEG) { EnPoSisters_MegCloneVanish(this, play); } else { EnPoSisters_SetupAimlessIdleFlying(this); @@ -903,7 +905,7 @@ void EnPoSisters_CheckCollision(EnPoSisters* this, PlayState* play) { this->collider.base.acFlags &= ~AC_HIT; Actor_SetDropFlag(&this->actor, &this->collider.info); - if (this->megCloneId != POSISTER_MEG_REAL) { + if (this->megCloneId != POE_SISTERS_MEG_REAL) { ((EnPoSisters*)this->actor.parent)->megClonesRemaining--; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH2); EnPoSisters_MegCloneVanish(this, play); @@ -914,16 +916,16 @@ void EnPoSisters_CheckCollision(EnPoSisters* this, PlayState* play) { Item_DropCollectible(play, &pos, ITEM00_ARROWS_10); } } else if (this->collider.base.colType != 9) { - if (this->actor.colChkInfo.damageEffect == POSISTERS_DAMAGEEFFECT_DEKUNUT) { + if (this->actor.colChkInfo.damageEffect == POE_SISTERS_DMGEFF_DEKUNUT) { this->actor.world.rot.y = this->actor.shape.rot.y; - this->poSisterFlags |= POSISTERS_FLAG_UPDATE_SHAPE_ROT; + this->poSisterFlags |= POE_SISTERS_FLAG_UPDATE_SHAPE_ROT; EnPoSisters_SetupSpinBackToVisible(this, play); - } else if ((this->type == POSISTER_TYPE_MEG) && - (this->actor.colChkInfo.damageEffect == POSISTERS_DAMAGEEFFECT_SPINATTACK) && + } else if ((this->type == POE_SISTERS_TYPE_MEG) && + (this->actor.colChkInfo.damageEffect == POE_SISTERS_DMGEFF_SPINATTACK) && (this->actionFunc == EnPoSisters_MegSurroundPlayer)) { if (this->megClonesRemaining == 0) { - // all meg clones have been killed, meg waits 45 frames then spin attacks - // timer is negative because megClonesRemaining and megAttackTimer are the same union'd variable + // All Meg clones have been killed: Real Meg waits 45 frames then spin attacks + // Timer is negative because megClonesRemaining and megAttackTimer are the same union'd variable this->megAttackTimer = -45; } } else { @@ -934,7 +936,7 @@ void EnPoSisters_CheckCollision(EnPoSisters* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_SISTER_DEAD); } - if (this->actor.colChkInfo.damageEffect == POSISTERS_DAMAGEEFFECT_LIGHTARROWS) { + if (this->actor.colChkInfo.damageEffect == POE_SISTERS_DMGEFF_LIGHTARROWS) { this->drawDmgEffAlpha = 4.0f; this->drawDmgEffScale = 0.5f; Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->collider.info.bumper.hitPos.x, @@ -960,19 +962,19 @@ void EnPoSisters_Update(Actor* thisx, PlayState* play) { } EnPoSisters_CheckCollision(this, play); - if (this->poSisterFlags & POSISTERS_FLAG_CHECK_Z_TARGET) { + if (this->poSisterFlags & POE_SISTERS_FLAG_CHECK_Z_TARGET) { EnPoSisters_CheckZTarget(this, play); } this->actionFunc(this, play); - if (this->poSisterFlags & POSISTERS_FLAG_MATCH_PLAYER_HEIGHT) { + if (this->poSisterFlags & POE_SISTERS_FLAG_MATCH_PLAYER_HEIGHT) { EnPoSisters_MatchPlayerY(this, play); } Actor_MoveWithGravity(&this->actor); - if (this->poSisterFlags & POSISTERS_FLAG_UPDATE_BGCHECK_INFO) { + if (this->poSisterFlags & POE_SISTERS_FLAG_UPDATE_BGCHECK_INFO) { Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 0.0f, 5); } else { checkPos.x = this->actor.world.pos.x; @@ -999,8 +1001,8 @@ void EnPoSisters_Update(Actor* thisx, PlayState* play) { } if (this->poSisterFlags & - (POSISTERS_FLAG_UPDATE_BGCHECK_INFO | POSISTERS_FLAG_MATCH_PLAYER_HEIGHT | POSISTERS_FLAG_CHECK_Z_TARGET | - POSISTERS_FLAG_UPDATE_SHAPE_ROT | POSISTERS_FLAG_CHECK_AC)) { + (POE_SISTERS_FLAG_UPDATE_BGCHECK_INFO | POE_SISTERS_FLAG_MATCH_PLAYER_HEIGHT | POE_SISTERS_FLAG_CHECK_Z_TARGET | + POE_SISTERS_FLAG_UPDATE_SHAPE_ROT | POE_SISTERS_FLAG_CHECK_AC)) { Collider_UpdateCylinder(&this->actor, &this->collider); if ((this->actionFunc == EnPoSisters_SpinAttack) || (this->actionFunc == EnPoSisters_SpinUp)) { this->fireCount++; @@ -1014,7 +1016,7 @@ void EnPoSisters_Update(Actor* thisx, PlayState* play) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); } - if (this->poSisterFlags & POSISTERS_FLAG_CHECK_AC) { + if (this->poSisterFlags & POE_SISTERS_FLAG_CHECK_AC) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } @@ -1024,23 +1026,23 @@ void EnPoSisters_Update(Actor* thisx, PlayState* play) { if (this->actionFunc == EnPoSisters_Flee) { this->actor.shape.rot.y = BINANG_ROT180(this->actor.world.rot.y); - } else if (this->poSisterFlags & POSISTERS_FLAG_UPDATE_SHAPE_ROT) { + } else if (this->poSisterFlags & POE_SISTERS_FLAG_UPDATE_SHAPE_ROT) { this->actor.shape.rot.y = this->actor.world.rot.y; } } } void EnPoSisters_UpdateColors(EnPoSisters* this) { - if (this->skelAnime.animation == &gPoSistersAttackAnim) { + if (this->skelAnime.animation == &gPoeSistersAttackAnim) { this->color.r = CLAMP_MAX(this->color.r + 5, 255); this->color.g = CLAMP_MIN(this->color.g - 5, 50); this->color.b = CLAMP_MIN(this->color.b - 5, 0); - } else if (this->skelAnime.animation == &gPoSistersFleeAnim) { + } else if (this->skelAnime.animation == &gPoeSistersFleeAnim) { this->color.r = CLAMP_MAX(this->color.r + 5, 80); this->color.g = CLAMP_MAX(this->color.g + 5, 255); this->color.b = CLAMP_MAX(this->color.b + 5, 225); } else if (this->skelAnime.animation == &gPoeSistersDamagedAnim) { - // flash every other frame after taking damage + // Flash every other frame after taking damage if (this->actor.colorFilterTimer & 0x2) { this->color.r = 0; this->color.g = 0; @@ -1067,16 +1069,16 @@ void EnPoSisters_UpdateColors(EnPoSisters* this) { s32 EnPoSisters_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx, Gfx** gfx) { static Gfx* gPoSisterBodyDisplayLists[] = { - gPoSistersMegBodyDL, - gPoSistersJoelleBodyDL, - gPoSistersBethBodyDL, - gPoSistersAmyBodyDL, + gPoeSistersMegBodyDL, + gPoeSistersJoelleBodyDL, + gPoeSistersBethBodyDL, + gPoeSistersAmyBodyDL, }; static Gfx* gPoSisterFaceDisplayLists[] = { - gPoSistersMegFaceDL, - gPoSistersJoelleFaceDL, - gPoSistersBethFaceDL, - gPoSistersAmyFaceDL, + gPoeSistersMegFaceDL, + gPoeSistersJoelleFaceDL, + gPoeSistersBethFaceDL, + gPoeSistersAmyFaceDL, }; static Color_RGBA8 gPoSisterColors[] = { { 80, 0, 100, 0 }, @@ -1086,7 +1088,7 @@ s32 EnPoSisters_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Ve }; EnPoSisters* this = THIS; - if (limbIndex == POSISTERS_LIMB_ROOT && (this->poSisterFlags & POSISTERS_FLAG_REAL_MEG_ROTATION)) { + if (limbIndex == POE_SISTERS_LIMB_ROOT && (this->poSisterFlags & POE_SISTERS_FLAG_REAL_MEG_ROTATION)) { if (this->megSurroundTimer >= 284) { rot->x += (this->megSurroundTimer - 284) * 0x1000; } else { @@ -1094,17 +1096,17 @@ s32 EnPoSisters_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Ve } } - if ((this->color.a == 0) || (limbIndex == POSISTERS_LIMB_TORCH) || + if ((this->color.a == 0) || (limbIndex == POE_SISTERS_LIMB_TORCH) || ((this->actionFunc == EnPoSisters_DeathStage1) && (this->deathTimer >= 8))) { *dList = NULL; - } else if (limbIndex == POSISTERS_LIMB_MAIN_BODY) { + } else if (limbIndex == POE_SISTERS_LIMB_MAIN_BODY) { *dList = gPoSisterBodyDisplayLists[this->type]; - } else if (limbIndex == POSISTERS_LIMB_FACE) { + } else if (limbIndex == POE_SISTERS_LIMB_FACE) { *dList = gPoSisterFaceDisplayLists[this->type]; gDPPipeSync((*gfx)++); gDPSetEnvColor((*gfx)++, this->color.r, this->color.g, this->color.b, this->color.a); - } else if (limbIndex == POSISTERS_LIMB_LOWER_BODY) { + } else if (limbIndex == POE_SISTERS_LIMB_LOWER_BODY) { Color_RGBA8* color = &gPoSisterColors[this->type]; gDPPipeSync((*gfx)++); @@ -1114,46 +1116,47 @@ s32 EnPoSisters_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Ve return false; } -#define POSISTER_LIMBPOS_INVALID -1 +#define POE_SISTERS_LIMBPOS_INVALID -1 void EnPoSisters_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) { static Vec3f D_80B1DAFC = { 1000.0f, -1700.0f, 0.0f }; static s8 D_80B1DB08[] = { - POSISTER_LIMBPOS_INVALID, - POSISTER_LIMBPOS_INVALID, + POE_SISTERS_LIMBPOS_INVALID, + POE_SISTERS_LIMBPOS_INVALID, 0, 1, 2, - POSISTER_LIMBPOS_INVALID, + POE_SISTERS_LIMBPOS_INVALID, 3, - POSISTER_LIMBPOS_INVALID, - POSISTER_LIMBPOS_INVALID, - POSISTER_LIMBPOS_INVALID, - POSISTER_LIMBPOS_INVALID, - POSISTER_LIMBPOS_INVALID, + POE_SISTERS_LIMBPOS_INVALID, + POE_SISTERS_LIMBPOS_INVALID, + POE_SISTERS_LIMBPOS_INVALID, + POE_SISTERS_LIMBPOS_INVALID, + POE_SISTERS_LIMBPOS_INVALID, }; EnPoSisters* this = THIS; s32 end; f32 brightness; - if (D_80B1DB08[limbIndex] != POSISTER_LIMBPOS_INVALID) { + if (D_80B1DB08[limbIndex] != POE_SISTERS_LIMBPOS_INVALID) { Matrix_MultZero(&this->limbPos[D_80B1DB08[limbIndex]]); - } else if (limbIndex == POSISTERS_LIMB_MAIN_BODY) { + } else if (limbIndex == POE_SISTERS_LIMB_MAIN_BODY) { Matrix_MultVecY(-2500.0f, &this->limbPos[4]); Matrix_MultVecY(3000.0f, &this->limbPos[5]); - } else if (limbIndex == POSISTERS_LIMB_FACE) { + } else if (limbIndex == POE_SISTERS_LIMB_FACE) { Matrix_MultVecY(-4000.0f, &this->limbPos[6]); - } else if (limbIndex == POSISTERS_LIMB_LOWER_BODY) { + } else if (limbIndex == POE_SISTERS_LIMB_LOWER_BODY) { Matrix_MultVecX(3000.0f, &this->limbPos[7]); } - if (this->actionFunc == EnPoSisters_DeathStage1 && this->deathTimer >= 8 && limbIndex == POSISTERS_LIMB_MAIN_BODY) { + if (this->actionFunc == EnPoSisters_DeathStage1 && this->deathTimer >= 8 && + limbIndex == POE_SISTERS_LIMB_MAIN_BODY) { gSPMatrix((*gfx)++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList((*gfx)++, gPoSistersBurnBodyDL); + gSPDisplayList((*gfx)++, gPoeSistersBurnBodyDL); } - if (limbIndex == POSISTERS_LIMB_TORCH) { - if (this->poSisterFlags & POSISTERS_FLAG_UPDATE_FIRES) { + if (limbIndex == POE_SISTERS_LIMB_TORCH) { + if (this->poSisterFlags & POE_SISTERS_FLAG_UPDATE_FIRES) { for (end = this->fireCount - 1; end > 0; end--) { this->firePos[end] = this->firePos[end - 1]; } @@ -1164,7 +1167,7 @@ void EnPoSisters_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s if (this->fireCount > 0) { Color_RGBA8* flameColor = &sPoSisterFlameColors[this->type]; - brightness = Rand_ZeroFloat(0.3f) + 0.7f; // flickering torch light level + brightness = Rand_ZeroFloat(0.3f) + 0.7f; // Flickering torch light level if (this->actionFunc == EnPoSisters_DeathStage2) { Lights_PointNoGlowSetInfo(&this->lightInfo, this->firePos[0].x, this->firePos[0].y + 15.0f, @@ -1179,7 +1182,7 @@ void EnPoSisters_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s Lights_PointSetColorAndRadius(&this->lightInfo, 0, 0, 0, 0); } - if (!(this->poSisterFlags & POSISTERS_FLAG_DRAW_TORCH)) { + if (!(this->poSisterFlags & POE_SISTERS_FLAG_DRAW_TORCH)) { Matrix_Get(&this->mtxf); } } @@ -1203,23 +1206,23 @@ void EnPoSisters_Draw(Actor* thisx, PlayState* play) { if ((this->color.a == 255) || (this->color.a == 0)) { gDPSetEnvColor(POLY_OPA_DISP++, this->color.r, this->color.g, this->color.b, this->color.a); - gSPSegment(POLY_OPA_DISP++, 0x09, D_801AEFA0); // empty + gSPSegment(POLY_OPA_DISP++, 0x09, D_801AEFA0); // Empty DL POLY_OPA_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable, EnPoSisters_OverrideLimbDraw, EnPoSisters_PostLimbDraw, &this->actor, POLY_OPA_DISP); } else { gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, this->color.a); - gSPSegment(POLY_XLU_DISP++, 0x09, D_801AEF88); // xlu only DL + gSPSegment(POLY_XLU_DISP++, 0x09, D_801AEF88); // XLU only DL POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable, EnPoSisters_OverrideLimbDraw, EnPoSisters_PostLimbDraw, &this->actor, POLY_XLU_DISP); } - if (!(this->poSisterFlags & POSISTERS_FLAG_DRAW_TORCH)) { + if (!(this->poSisterFlags & POE_SISTERS_FLAG_DRAW_TORCH)) { Matrix_Put(&this->mtxf); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, gPoSistersDrawTorchDL); + gSPDisplayList(POLY_OPA_DISP++, gPoeSistersDrawTorchDL); } gSPSegment( 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 5e549c4d77..cfb8a1697e 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 @@ -8,24 +8,24 @@ struct EnPoSisters; typedef void (*EnPoSistersActionFunc)(struct EnPoSisters*, PlayState*); -#define ENPOSISTERS_GET_OBSERVER_FLAG(thisx) ((thisx)->params & 0x1000) -#define ENPOSISTERS_GET_MEG_CLONE_ID(thisx) (((thisx)->params >> 0xA) & 3) -#define ENPOSISTERS_GET_TYPE(thisx) (((thisx)->params >> 8) & 3) +#define POE_SISTERS_GET_OBSERVER_FLAG(thisx) ((thisx)->params & 0x1000) +#define POE_SISTERS_GET_MEG_CLONE_ID(thisx) (((thisx)->params >> 0xA) & 3) +#define POE_SISTERS_GET_TYPE(thisx) (((thisx)->params >> 8) & 3) -#define ENPOSISTERS_PARAMS(observerFlag, megClone, type) (((observerFlag) << 0xC) | ((megClone & 3) << 0xA) | ((type & 3) << 8)) +#define POE_SISTERS_PARAMS(observerFlag, megClone, type) (((observerFlag) << 0xC) | ((megClone & 3) << 0xA) | ((type & 3) << 8)) typedef enum { - /* 0 */ POSISTER_TYPE_MEG, // purple - /* 1 */ POSISTER_TYPE_JO, // red - /* 2 */ POSISTER_TYPE_BETH, // blue - /* 3 */ POSISTER_TYPE_AMY, // green + /* 0 */ POE_SISTERS_TYPE_MEG, // purple + /* 1 */ POE_SISTERS_TYPE_JO, // red + /* 2 */ POE_SISTERS_TYPE_BETH, // blue + /* 3 */ POE_SISTERS_TYPE_AMY, // green } EnPoSisterType; typedef enum { - /* 0 */ POSISTER_MEG_REAL, - /* 1 */ POSISTER_MEG_CLONE1, - /* 2 */ POSISTER_MEG_CLONE2, - /* 3 */ POSISTER_MEG_CLONE3, + /* 0 */ POE_SISTERS_MEG_REAL, + /* 1 */ POE_SISTERS_MEG_CLONE1, + /* 2 */ POE_SISTERS_MEG_CLONE2, + /* 3 */ POE_SISTERS_MEG_CLONE3, } EnPoSisterMegCloneID; typedef struct EnPoSisters { @@ -54,8 +54,8 @@ typedef struct EnPoSisters { s16 megAttackTimer; // delay until meg spin attacks player (negative frames counting up to 0) s16 megClonesRemaining; // positive count of meg clones remaining }; - /* 0x196 */ Vec3s jointTable[POSISTERS_LIMB_MAX]; - /* 0x1DE */ Vec3s morphTable[POSISTERS_LIMB_MAX]; + /* 0x196 */ Vec3s jointTable[POE_SISTERS_LIMB_MAX]; + /* 0x1DE */ Vec3s morphTable[POE_SISTERS_LIMB_MAX]; /* 0x226 */ Color_RGBA8 color; /* 0x22C */ Vec3f firePos[8]; /* 0x28C */ Vec3f limbPos[8]; // passed to Actor_DrawDamageEffects From 3e257354c1a5811c8f1a7578f30b24be8cb10c9b Mon Sep 17 00:00:00 2001 From: Tom Overton Date: Tue, 21 Feb 2023 12:43:34 -0800 Subject: [PATCH 09/29] Add original asset names for all object_d* files (#1162) --- assets/xml/objects/object_am.xml | 4 +- assets/xml/objects/object_astr_obj.xml | 2 +- assets/xml/objects/object_botihasira.xml | 2 +- assets/xml/objects/object_box.xml | 2 +- assets/xml/objects/object_crace_object.xml | 2 +- assets/xml/objects/object_ctower_rot.xml | 10 +- assets/xml/objects/object_d_hsblock.xml | 8 +- assets/xml/objects/object_d_lift.xml | 4 +- assets/xml/objects/object_dai.xml | 30 ++-- assets/xml/objects/object_daiku.xml | 28 ++-- assets/xml/objects/object_danpei_object.xml | 6 +- assets/xml/objects/object_dblue_object.xml | 20 +-- assets/xml/objects/object_death.xml | 26 +-- assets/xml/objects/object_dekubaba.xml | 12 +- assets/xml/objects/object_dekucity_obj.xml | 10 +- assets/xml/objects/object_delf.xml | 156 +++++++++--------- assets/xml/objects/object_dhouse.xml | 22 +-- assets/xml/objects/object_dinofos.xml | 26 +-- assets/xml/objects/object_dkjail_obj.xml | 4 +- assets/xml/objects/object_dmask.xml | 12 +- assets/xml/objects/object_dnk.xml | 14 +- assets/xml/objects/object_dnt.xml | 36 ++-- assets/xml/objects/object_dodongo.xml | 22 +-- assets/xml/objects/object_dor01.xml | 4 +- assets/xml/objects/object_dor02.xml | 4 +- assets/xml/objects/object_dor03.xml | 2 +- assets/xml/objects/object_dor04.xml | 4 +- assets/xml/objects/object_dora.xml | 14 +- assets/xml/objects/object_driftice.xml | 4 +- assets/xml/objects/object_drs.xml | 2 +- assets/xml/objects/object_ds2.xml | 2 +- assets/xml/objects/object_ds2n.xml | 2 +- assets/xml/objects/object_dt.xml | 12 +- assets/xml/objects/object_dy_obj.xml | 22 +-- src/overlays/actors/ovl_Obj_Dora/z_obj_dora.c | 6 +- 35 files changed, 268 insertions(+), 268 deletions(-) diff --git a/assets/xml/objects/object_am.xml b/assets/xml/objects/object_am.xml index 259700dc8c..bec26eb3a3 100644 --- a/assets/xml/objects/object_am.xml +++ b/assets/xml/objects/object_am.xml @@ -1,6 +1,6 @@  - + @@ -36,6 +36,6 @@ - + diff --git a/assets/xml/objects/object_astr_obj.xml b/assets/xml/objects/object_astr_obj.xml index 75a8e7ca2e..233de785b2 100644 --- a/assets/xml/objects/object_astr_obj.xml +++ b/assets/xml/objects/object_astr_obj.xml @@ -8,6 +8,6 @@ - + diff --git a/assets/xml/objects/object_botihasira.xml b/assets/xml/objects/object_botihasira.xml index f949abcc74..0a22127609 100644 --- a/assets/xml/objects/object_botihasira.xml +++ b/assets/xml/objects/object_botihasira.xml @@ -6,6 +6,6 @@ - + diff --git a/assets/xml/objects/object_box.xml b/assets/xml/objects/object_box.xml index be4f34b87f..c0603a6cf1 100644 --- a/assets/xml/objects/object_box.xml +++ b/assets/xml/objects/object_box.xml @@ -48,6 +48,6 @@ - + diff --git a/assets/xml/objects/object_crace_object.xml b/assets/xml/objects/object_crace_object.xml index af0cb89e0a..63dd9913d4 100644 --- a/assets/xml/objects/object_crace_object.xml +++ b/assets/xml/objects/object_crace_object.xml @@ -4,6 +4,6 @@ - + diff --git a/assets/xml/objects/object_ctower_rot.xml b/assets/xml/objects/object_ctower_rot.xml index ad23362578..044443c981 100644 --- a/assets/xml/objects/object_ctower_rot.xml +++ b/assets/xml/objects/object_ctower_rot.xml @@ -73,12 +73,12 @@ - + - + @@ -86,15 +86,15 @@ - + - + - + diff --git a/assets/xml/objects/object_d_hsblock.xml b/assets/xml/objects/object_d_hsblock.xml index b43647dc39..ee61d0a541 100644 --- a/assets/xml/objects/object_d_hsblock.xml +++ b/assets/xml/objects/object_d_hsblock.xml @@ -1,10 +1,10 @@  - - - - + + + + diff --git a/assets/xml/objects/object_d_lift.xml b/assets/xml/objects/object_d_lift.xml index 475f7fd3e6..868eccd858 100644 --- a/assets/xml/objects/object_d_lift.xml +++ b/assets/xml/objects/object_d_lift.xml @@ -3,8 +3,8 @@ - - + + diff --git a/assets/xml/objects/object_dai.xml b/assets/xml/objects/object_dai.xml index b547897f89..927e3f1e1a 100644 --- a/assets/xml/objects/object_dai.xml +++ b/assets/xml/objects/object_dai.xml @@ -2,21 +2,21 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_daiku.xml b/assets/xml/objects/object_daiku.xml index 17d8ddbf09..0152a6e7db 100644 --- a/assets/xml/objects/object_daiku.xml +++ b/assets/xml/objects/object_daiku.xml @@ -1,11 +1,11 @@  - - - - - - + + + + + + @@ -39,10 +39,10 @@ - + - + @@ -66,11 +66,11 @@ - - - - - - + + + + + + diff --git a/assets/xml/objects/object_danpei_object.xml b/assets/xml/objects/object_danpei_object.xml index 3f373a8ceb..8e86f2f791 100644 --- a/assets/xml/objects/object_danpei_object.xml +++ b/assets/xml/objects/object_danpei_object.xml @@ -3,9 +3,9 @@ - - - + + + diff --git a/assets/xml/objects/object_dblue_object.xml b/assets/xml/objects/object_dblue_object.xml index 8611c539be..08cb20ec34 100644 --- a/assets/xml/objects/object_dblue_object.xml +++ b/assets/xml/objects/object_dblue_object.xml @@ -4,17 +4,17 @@ - + - + - + @@ -25,22 +25,22 @@ - + - - + + - + @@ -50,17 +50,17 @@ - + - + - + diff --git a/assets/xml/objects/object_death.xml b/assets/xml/objects/object_death.xml index 77d4ccd4a1..7588c484a4 100644 --- a/assets/xml/objects/object_death.xml +++ b/assets/xml/objects/object_death.xml @@ -1,17 +1,17 @@  - - - - - - - + + + + + + + - - + + @@ -41,7 +41,7 @@ - + @@ -76,9 +76,9 @@ - - - + + + diff --git a/assets/xml/objects/object_dekubaba.xml b/assets/xml/objects/object_dekubaba.xml index 87634d654c..053b82f614 100644 --- a/assets/xml/objects/object_dekubaba.xml +++ b/assets/xml/objects/object_dekubaba.xml @@ -3,16 +3,16 @@ - - + + - - - - + + + + diff --git a/assets/xml/objects/object_dekucity_obj.xml b/assets/xml/objects/object_dekucity_obj.xml index 1d680965e4..2d1da14a0c 100644 --- a/assets/xml/objects/object_dekucity_obj.xml +++ b/assets/xml/objects/object_dekucity_obj.xml @@ -1,22 +1,22 @@  - - + + - + - + - + diff --git a/assets/xml/objects/object_delf.xml b/assets/xml/objects/object_delf.xml index 39996c0f09..85f3138e1d 100644 --- a/assets/xml/objects/object_delf.xml +++ b/assets/xml/objects/object_delf.xml @@ -1,82 +1,82 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_dhouse.xml b/assets/xml/objects/object_dhouse.xml index dd95b8b98f..a5894a4df5 100644 --- a/assets/xml/objects/object_dhouse.xml +++ b/assets/xml/objects/object_dhouse.xml @@ -9,25 +9,25 @@ - + - + - + - + - + - + - + - + - - + + - + diff --git a/assets/xml/objects/object_dinofos.xml b/assets/xml/objects/object_dinofos.xml index 8db9c7c4a7..435d60e959 100644 --- a/assets/xml/objects/object_dinofos.xml +++ b/assets/xml/objects/object_dinofos.xml @@ -1,13 +1,13 @@  - - - - - - - - + + + + + + + + @@ -62,10 +62,10 @@ - - - - - + + + + + diff --git a/assets/xml/objects/object_dkjail_obj.xml b/assets/xml/objects/object_dkjail_obj.xml index ada181475e..d0d2775c3a 100644 --- a/assets/xml/objects/object_dkjail_obj.xml +++ b/assets/xml/objects/object_dkjail_obj.xml @@ -1,9 +1,9 @@  - + - + diff --git a/assets/xml/objects/object_dmask.xml b/assets/xml/objects/object_dmask.xml index a7b3874ec7..29f245b1b8 100644 --- a/assets/xml/objects/object_dmask.xml +++ b/assets/xml/objects/object_dmask.xml @@ -1,17 +1,17 @@  - - + + - + - - + + @@ -21,7 +21,7 @@ - + diff --git a/assets/xml/objects/object_dnk.xml b/assets/xml/objects/object_dnk.xml index bec6ce45d0..b085eed285 100644 --- a/assets/xml/objects/object_dnk.xml +++ b/assets/xml/objects/object_dnk.xml @@ -1,11 +1,11 @@  - - - - - + + + + + @@ -45,7 +45,7 @@ - - + + diff --git a/assets/xml/objects/object_dnt.xml b/assets/xml/objects/object_dnt.xml index 96b793849b..9f3fcf9963 100644 --- a/assets/xml/objects/object_dnt.xml +++ b/assets/xml/objects/object_dnt.xml @@ -1,25 +1,25 @@  - - + + - - - - - - - - - + + + + + + + + + - - - - - - + + + + + + @@ -85,7 +85,7 @@ - + diff --git a/assets/xml/objects/object_dodongo.xml b/assets/xml/objects/object_dodongo.xml index 8de3f4653f..cc9b41e257 100644 --- a/assets/xml/objects/object_dodongo.xml +++ b/assets/xml/objects/object_dodongo.xml @@ -1,15 +1,15 @@  - + - - - - + + + + - - - + + + @@ -59,9 +59,9 @@ - - - + + + diff --git a/assets/xml/objects/object_dor01.xml b/assets/xml/objects/object_dor01.xml index 39c950680f..9708d97c68 100644 --- a/assets/xml/objects/object_dor01.xml +++ b/assets/xml/objects/object_dor01.xml @@ -1,7 +1,7 @@  - - + + diff --git a/assets/xml/objects/object_dor02.xml b/assets/xml/objects/object_dor02.xml index c60fa9ba98..3cc3d14115 100644 --- a/assets/xml/objects/object_dor02.xml +++ b/assets/xml/objects/object_dor02.xml @@ -1,7 +1,7 @@  - - + + diff --git a/assets/xml/objects/object_dor03.xml b/assets/xml/objects/object_dor03.xml index 941fa6fcc1..c7971db0c3 100644 --- a/assets/xml/objects/object_dor03.xml +++ b/assets/xml/objects/object_dor03.xml @@ -1,6 +1,6 @@  - + diff --git a/assets/xml/objects/object_dor04.xml b/assets/xml/objects/object_dor04.xml index 394f5a6fe0..4e78d9efe2 100644 --- a/assets/xml/objects/object_dor04.xml +++ b/assets/xml/objects/object_dor04.xml @@ -1,7 +1,7 @@  - - + + diff --git a/assets/xml/objects/object_dora.xml b/assets/xml/objects/object_dora.xml index ab4b09cf7f..09732ba0a2 100644 --- a/assets/xml/objects/object_dora.xml +++ b/assets/xml/objects/object_dora.xml @@ -1,17 +1,17 @@  - + - - - - + + + + - - + + diff --git a/assets/xml/objects/object_driftice.xml b/assets/xml/objects/object_driftice.xml index 0ddb6e2048..c380c09c19 100644 --- a/assets/xml/objects/object_driftice.xml +++ b/assets/xml/objects/object_driftice.xml @@ -5,7 +5,7 @@ - - + + diff --git a/assets/xml/objects/object_drs.xml b/assets/xml/objects/object_drs.xml index 1b6c295976..ef9788fd59 100644 --- a/assets/xml/objects/object_drs.xml +++ b/assets/xml/objects/object_drs.xml @@ -1,7 +1,7 @@  - + diff --git a/assets/xml/objects/object_ds2.xml b/assets/xml/objects/object_ds2.xml index 1794c4bf80..0eb35db79a 100644 --- a/assets/xml/objects/object_ds2.xml +++ b/assets/xml/objects/object_ds2.xml @@ -1,6 +1,6 @@  - + diff --git a/assets/xml/objects/object_ds2n.xml b/assets/xml/objects/object_ds2n.xml index 7e7d45f0c5..da6ce5e875 100644 --- a/assets/xml/objects/object_ds2n.xml +++ b/assets/xml/objects/object_ds2n.xml @@ -65,7 +65,7 @@ - + diff --git a/assets/xml/objects/object_dt.xml b/assets/xml/objects/object_dt.xml index 8b2a902176..f1e62d59a8 100644 --- a/assets/xml/objects/object_dt.xml +++ b/assets/xml/objects/object_dt.xml @@ -1,10 +1,10 @@  - - - - - + + + + + @@ -62,6 +62,6 @@ - + diff --git a/assets/xml/objects/object_dy_obj.xml b/assets/xml/objects/object_dy_obj.xml index a64bc975b4..91b9a55fbd 100644 --- a/assets/xml/objects/object_dy_obj.xml +++ b/assets/xml/objects/object_dy_obj.xml @@ -1,15 +1,15 @@  - - - - - - - - - - + + + + + + + + + + @@ -18,7 +18,7 @@ - + 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 9b6c812663..509f285fe7 100644 --- a/src/overlays/actors/ovl_Obj_Dora/z_obj_dora.c +++ b/src/overlays/actors/ovl_Obj_Dora/z_obj_dora.c @@ -332,20 +332,20 @@ void ObjDora_Draw(Actor* thisx, PlayState* play) { Matrix_Push(); Matrix_RotateXS(this->gongRotation.x, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, &gDoraGongDL); + gSPDisplayList(POLY_OPA_DISP++, &gDoraChainDL); Matrix_Translate(position.x, position.y + gongForceX, position.z + gongForceX, MTXMODE_APPLY); Matrix_RotateXS(this->gongRotation.z - this->gongRotation.x, MTXMODE_APPLY); Matrix_Translate(-position.x, -position.y, -position.z, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, &gDoraChainDL); + gSPDisplayList(POLY_OPA_DISP++, &gDoraGongDL); Matrix_Pop(); } else { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, &gDoraChainDL); gSPDisplayList(POLY_OPA_DISP++, &gDoraGongDL); + gSPDisplayList(POLY_OPA_DISP++, &gDoraChainDL); } CLOSE_DISPS(play->state.gfxCtx); From 69f7540e333aa5a88556dfece7126541aaa0a146 Mon Sep 17 00:00:00 2001 From: EllipticEllipsis Date: Fri, 24 Feb 2023 14:59:17 +0000 Subject: [PATCH 10/29] EnGe2 (Gerudo in Purple) OK and documented, object_gla documented (#1071) * OK, data imported * Permuter settings * Name data, a few functions and variables, cleanup * Small amount of cleanup on some related actors * Oops * Document object * Type and other macros * Some cutscene stuff and temporary function names * Proper path function names * Name a couple more functions * A couple more function names * Name PathStatus enum * Name rest of functions and formalise the documentation a bit * Apply suggestions from code review Co-authored-by: Derek Hensley * limbs * Format * Review * format * weekeventregconvert and format --------- Co-authored-by: Derek Hensley Co-authored-by: angie --- assets/xml/objects/object_gla.xml | 143 ++-- include/z64save.h | 6 + include/z64transition.h | 1 + spec | 3 +- src/overlays/actors/ovl_En_Arrow/z_en_arrow.c | 2 +- src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 50 +- src/overlays/actors/ovl_En_Ge1/z_en_ge1.h | 2 +- src/overlays/actors/ovl_En_Ge2/z_en_ge2.c | 761 ++++++++++++++++-- src/overlays/actors/ovl_En_Ge2/z_en_ge2.h | 48 +- src/overlays/actors/ovl_En_Kgy/z_en_kgy.c | 2 +- src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c | 134 +-- src/overlays/actors/ovl_Obj_Boat/z_obj_boat.h | 17 +- .../ovl_Obj_Lupygamelift/z_obj_lupygamelift.c | 8 +- tools/disasm/functions.txt | 56 +- tools/disasm/variables.txt | 14 +- 15 files changed, 993 insertions(+), 254 deletions(-) diff --git a/assets/xml/objects/object_gla.xml b/assets/xml/objects/object_gla.xml index 7463cd2e0c..757e652c97 100644 --- a/assets/xml/objects/object_gla.xml +++ b/assets/xml/objects/object_gla.xml @@ -1,73 +1,78 @@  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/z64save.h b/include/z64save.h index d3f5380290..acd2fe6f80 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -1218,7 +1218,10 @@ typedef enum SunsSongState { #define WEEKEVENTREG_80_01 PACK_WEEKEVENTREG_FLAG(80, 0x01) #define WEEKEVENTREG_80_02 PACK_WEEKEVENTREG_FLAG(80, 0x02) #define WEEKEVENTREG_80_04 PACK_WEEKEVENTREG_FLAG(80, 0x04) + +// Aveil has spotted Player #define WEEKEVENTREG_80_08 PACK_WEEKEVENTREG_FLAG(80, 0x08) + #define WEEKEVENTREG_80_10 PACK_WEEKEVENTREG_FLAG(80, 0x10) #define WEEKEVENTREG_80_20 PACK_WEEKEVENTREG_FLAG(80, 0x20) #define WEEKEVENTREG_80_40 PACK_WEEKEVENTREG_FLAG(80, 0x40) @@ -1243,7 +1246,10 @@ typedef enum SunsSongState { #define WEEKEVENTREG_82_40 PACK_WEEKEVENTREG_FLAG(82, 0x40) #define WEEKEVENTREG_82_80 PACK_WEEKEVENTREG_FLAG(82, 0x80) #define WEEKEVENTREG_83_01 PACK_WEEKEVENTREG_FLAG(83, 0x01) + +// Knocked the Gerudo beehive down #define WEEKEVENTREG_83_02 PACK_WEEKEVENTREG_FLAG(83, 0x02) + #define WEEKEVENTREG_83_04 PACK_WEEKEVENTREG_FLAG(83, 0x04) #define WEEKEVENTREG_83_08 PACK_WEEKEVENTREG_FLAG(83, 0x08) #define WEEKEVENTREG_83_10 PACK_WEEKEVENTREG_FLAG(83, 0x10) diff --git a/include/z64transition.h b/include/z64transition.h index b50a3df4e1..943dad2057 100644 --- a/include/z64transition.h +++ b/include/z64transition.h @@ -147,6 +147,7 @@ typedef enum { /* 22 */ TRANS_TYPE_WIPE5, // transition types 23 - 31 are unused // transition types 32 - 39 are Wipe4 TODO needs macro + /* 38 */ TRANS_TYPE_38 = 38, // transition types 40 - 63 are unused // transition types 64 - 127 are Wipe3 TODO needs macro /* 64 */ TRANS_TYPE_64 = 64, diff --git a/spec b/spec index 754baa265c..0a347c1a50 100644 --- a/spec +++ b/spec @@ -4023,8 +4023,7 @@ beginseg name "ovl_En_Ge2" compress include "build/src/overlays/actors/ovl_En_Ge2/z_en_ge2.o" - include "build/data/ovl_En_Ge2/ovl_En_Ge2.data.o" - include "build/data/ovl_En_Ge2/ovl_En_Ge2.reloc.o" + include "build/src/overlays/actors/ovl_En_Ge2/ovl_En_Ge2_reloc.o" endseg beginseg 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 b07e65de31..e203da9f03 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -674,7 +674,7 @@ void EnArrow_Draw(Actor* thisx, PlayState* play) { gSPMatrix(POLY_XLU_DISP++, &D_01000000, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_06F9F0); } else { - func_800B8050(&this->actor, play, MTXMODE_NEW); + func_800B8050(&this->actor, play, 0); gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_06F380); gDPSetCombineLERP(POLY_OPA_DISP++, TEXEL1, 0, PRIM_LOD_FRAC, TEXEL0, TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0, 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 3d4f4bd3dc..7007e7ed9c 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -189,13 +189,14 @@ void EnGe1_SetupPath(EnGe1* this, PlayState* play) { Vec3s* point; Vec3f nextPoint; - this->curPoint = 0; + this->curPointIndex = 0; + if (GERUDO_WHITE_GET_PATH(&this->picto.actor) != 0x3F) { this->path = &play->setupPathList[GERUDO_WHITE_GET_PATH(&this->picto.actor)]; if (this->path != NULL) { point = Lib_SegmentedToVirtual(this->path->points); Math_Vec3s_ToVec3f(&this->picto.actor.world.pos, point); - this->curPoint++; + this->curPointIndex++; point++; Math_Vec3s_ToVec3f(&nextPoint, point); @@ -214,7 +215,7 @@ void EnGe1_SetupPath(EnGe1* this, PlayState* play) { s32 EnGe1_FollowPath(EnGe1* this) { s32 pad; Path* path = this->path; - Vec3s* points; + Vec3s* curPoint; Vec3f point; s16 yawTarget; s16 pitchTarget; @@ -223,10 +224,10 @@ s32 EnGe1_FollowPath(EnGe1* this) { return true; } - points = Lib_SegmentedToVirtual(this->path->points); - points += this->curPoint; + curPoint = Lib_SegmentedToVirtual(this->path->points); + curPoint += this->curPointIndex; - Math_Vec3s_ToVec3f(&point, points); + Math_Vec3s_ToVec3f(&point, curPoint); yawTarget = Math_Vec3f_Yaw(&this->picto.actor.world.pos, &point); pitchTarget = Math_Vec3f_Pitch(&this->picto.actor.world.pos, &point); Math_SmoothStepToS(&this->picto.actor.world.rot.y, yawTarget, 0xA, 0x3E8, 0x64); @@ -260,9 +261,9 @@ void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play) { EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_STIFF_SHIVERING, ANIMMODE_LOOP, 0.0f); } - if (Cutscene_CheckActorAction(play, 0x79)) { + if (Cutscene_CheckActorAction(play, 121)) { this->picto.actor.draw = EnGe1_Draw; - csAction = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x79)]->action; + csAction = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 121)]->action; switch (csAction) { case 8: this->stateFlags &= ~GERUDO_WHITE_STATE_DISABLE_MOVEMENT; @@ -339,22 +340,27 @@ void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play) { this->picto.actor.draw = NULL; } - if (this->csAction == 9) { - if ((this->curPoint < this->path->count) && EnGe1_FollowPath(this)) { - this->curPoint++; - } + switch (this->csAction) { + case 9: + if ((this->curPointIndex < this->path->count) && EnGe1_FollowPath(this)) { + this->curPointIndex++; + } - // Tumble in the air - this->picto.actor.shape.rot.x += 0x3E8; - this->picto.actor.shape.rot.y += 0x7D0; - this->picto.actor.shape.rot.z += 0x1F4; + // Tumble in the air + this->picto.actor.shape.rot.x += 0x3E8; + this->picto.actor.shape.rot.y += 0x7D0; + this->picto.actor.shape.rot.z += 0x1F4; - if (this->screamTimer > 0) { - this->screamTimer--; - } else { - this->screamTimer = (s32)(Rand_ZeroFloat(10.0f) + 20.0f); - EnGe1_Scream(this); - } + if (this->screamTimer > 0) { + this->screamTimer--; + } else { + this->screamTimer = (s32)(Rand_ZeroFloat(10.0f) + 20.0f); + EnGe1_Scream(this); + } + break; + + default: + break; } } 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 5388a1186a..1cf716b0f6 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h @@ -29,7 +29,7 @@ typedef struct EnGe1 { /* 0x2A4 */ Vec3s headRot; /* 0x2AA */ Vec3s torsoRot; /* 0x2B0 */ Path* path; - /* 0x2B4 */ s32 curPoint; + /* 0x2B4 */ s32 curPointIndex; /* 0x2B8 */ s16 eyeIndex; /* 0x2BA */ s16 blinkTimer; /* 0x2BC */ u16 stateFlags; 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 4659c4aa95..a4b28fa85f 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -15,18 +15,14 @@ void EnGe2_Destroy(Actor* thisx, PlayState* play); void EnGe2_Update(Actor* thisx, PlayState* play); void EnGe2_Draw(Actor* thisx, PlayState* play); -void func_80B8BCEC(EnGe2* this, PlayState* play); -void func_80B8BD38(EnGe2* this, PlayState* play); -void func_80B8BE08(EnGe2* this, PlayState* play); -void func_80B8BF04(EnGe2* this, PlayState* play); -void func_80B8C048(EnGe2* this, PlayState* play); -void func_80B8C0B0(EnGe2* this, PlayState* play); -void func_80B8C45C(EnGe2* this, PlayState* play); -void func_80B8C59C(EnGe2* this, PlayState* play); -void func_80B8C644(EnGe2* this, PlayState* play); -void func_80B8C9B8(EnGe2* this, PlayState* play); +s32 EnGe2_SetupPath(EnGe2* this, PlayState* play); + +void EnGe2_LookAround(EnGe2* this, PlayState* play); +void EnGe2_Walk(EnGe2* this, PlayState* play); +void EnGe2_GuardStationary(EnGe2* this, PlayState* play); + +s32 EnGe2_ValidatePictograph(PlayState* play, Actor* thisx); -#if 0 ActorInit En_Ge2_InitVars = { ACTOR_EN_GE2, ACTORCAT_NPC, @@ -39,78 +35,741 @@ ActorInit En_Ge2_InitVars = { (ActorFunc)EnGe2_Draw, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80B8CE40 = { - { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x038BFBB3, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, +typedef enum { + /* 0 */ GERUDO_PURPLE_DETECTION_UNDETECTED, + /* 1 */ GERUDO_PURPLE_DETECTION_HEARD, + /* 2 */ GERUDO_PURPLE_DETECTION_PROXIMITY //!< Higher priority +} GerudoPurpleDetection; + +typedef enum { + /* 0 */ GERUDO_PURPLE_PATHSTATUS_NORMAL, //!< not near waypoint + /* 1 */ GERUDO_PURPLE_PATHSTATUS_AT_POINT, //!< no path or new waypoint + /* 2 */ GERUDO_PURPLE_PATHSTATUS_END //!< reached end of path +} GerudoPurplePathStatus; + +#define GERUDO_PURPLE_STATE_PATH_REVERSE (1 << 0) //!< Follow path backwards instead of forwards. +#define GERUDO_PURPLE_STATE_KO (1 << 1) +#define GERUDO_PURPLE_STATE_STUNNED (1 << 2) //!< Specifically by Deku Nuts +#define GERUDO_PURPLE_STATE_DISABLE_MOVEMENT \ + (1 << 3) //!< Disable normal movement to let pathing function control it completely. +#define GERUDO_PURPLE_STATE_CAPTURING (1 << 5) //!< Set but not used + +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x038BFBB3, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 30, 60, 0, { 0, 0, 0 } }, }; -#endif +void EnGe2_Init(Actor* thisx, PlayState* play) { + s32 pad; + EnGe2* this = THIS; -extern ColliderCylinderInit D_80B8CE40; + ActorShape_Init(&this->picto.actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); + SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoPurpleSkel, NULL, this->jointTable, this->morphTable, + GERUDO_PURPLE_LIMB_MAX); + Animation_PlayLoop(&this->skelAnime, &gGerudoPurpleWalkingAnim); -extern UNK_TYPE D_06008DD8; -extern UNK_TYPE D_060091D0; -extern UNK_TYPE D_06009D1C; -extern UNK_TYPE D_0600A344; + Collider_InitAndSetCylinder(play, &this->collider, &this->picto.actor, &sCylinderInit); + this->picto.actor.colChkInfo.mass = MASS_IMMOVABLE; + Actor_SetScale(&this->picto.actor, 0.01f); + this->picto.actor.uncullZoneForward = 1200.0f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/EnGe2_Init.s") + if (this->picto.actor.world.rot.z == 0) { + this->verticalDetectRange = 40.0f; + } else { + this->verticalDetectRange = fabsf(this->picto.actor.world.rot.z * 20.0f); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/EnGe2_Destroy.s") + this->picto.actor.world.rot.x = this->picto.actor.shape.rot.x = 0; + this->picto.actor.world.rot.z = this->picto.actor.shape.rot.z = 0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8B514.s") + this->picto.actor.targetMode = 6; + this->stateFlags = 0; + this->detectedStatus = GERUDO_PURPLE_DETECTION_UNDETECTED; + this->csAction = -1; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8B5AC.s") + this->picto.actor.terminalVelocity = -9.0f; + this->picto.actor.gravity = -1.0f; + this->picto.actor.speedXZ = 1.5f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8B6B4.s") + this->actionFunc = EnGe2_Walk; + this->picto.validationFunc = EnGe2_ValidatePictograph; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8B7A8.s") + EnGe2_SetupPath(this, play); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8B848.s") + this->picto.actor.flags |= ACTOR_FLAG_10; + if (play->actorCtx.flags & ACTORCTX_FLAG_1) { + this->picto.actor.flags |= (ACTOR_FLAG_10 | ACTOR_FLAG_20); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8B90C.s") + switch (GERUDO_PURPLE_GET_TYPE(&this->picto.actor)) { + case GERUDO_PURPLE_TYPE_BOAT_SENTRY: + Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f, + Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, 0.0f); + this->actionFunc = EnGe2_GuardStationary; + this->picto.actor.speedXZ = 0.0f; + this->picto.actor.uncullZoneForward = 4000.0f; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8BA40.s") + case GERUDO_PURPLE_TYPE_AVEIL_GUARD: + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_83_02)) { + Actor_Kill(&this->picto.actor); + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8BB3C.s") + default: + break; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8BC1C.s") +void EnGe2_Destroy(Actor* thisx, PlayState* play) { +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8BC78.s") +// Detect Player through hearing or proximity +GerudoPurpleDetection EnGe2_DetectPlayer(PlayState* play, EnGe2* this) { + if (this->picto.actor.xzDistToPlayer > 250.0f) { + return GERUDO_PURPLE_DETECTION_UNDETECTED; + } else if ((Player_GetMask(play) != PLAYER_MASK_STONE) && (this->picto.actor.xzDistToPlayer < 50.0f)) { + return GERUDO_PURPLE_DETECTION_PROXIMITY; + } else if (func_800B715C(play)) { + return GERUDO_PURPLE_DETECTION_HEARD; + } else { + return GERUDO_PURPLE_DETECTION_UNDETECTED; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8BCEC.s") +/** + * Spotted Player with line-of-sight + * + * @param play PlayState + * @param thisx Actor to use for range and angle checks + * @param pos Position to check from + * @param yaw Center of yaw range to check + * @param yawRange Spread of angles from `yaw` to check. If 0, do not check yaw + * @param xzRange Horizontal range to check + * @param yRange Vertical range to check + * @return true if Player is visible with these settings + */ +s32 EnGe2_LookForPlayer(PlayState* play, Actor* actor, Vec3f* pos, s16 yaw, s16 yawRange, f32 xzRange, f32 yRange) { + s16 yawToPlayer; + Vec3f posResult; + CollisionPoly* outPoly; + Player* player = GET_PLAYER(play); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8BD38.s") + if (Player_GetMask(play) == PLAYER_MASK_STONE) { + return false; + } + if (actor->xzDistToPlayer > xzRange) { + return false; + } + if (fabsf(actor->playerHeightRel) > yRange) { + return false; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8BD90.s") + yawToPlayer = actor->yawTowardsPlayer - yaw; + if ((yawRange > 0) && (yawRange < ABS_ALT(yawToPlayer))) { + return false; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8BE08.s") + if (BgCheck_AnyLineTest1(&play->colCtx, pos, &player->bodyPartsPos[7], &posResult, &outPoly, false)) { + return false; + } else { + return true; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8BF04.s") +/* Path functions */ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8BFC8.s") +/** + * Set up the path if it exists, choose the end and direction + * + * @return true if path is set up in reverse + */ +s32 EnGe2_SetupPath(EnGe2* this, PlayState* play) { + if (GERUDO_PURPLE_GET_PATH(&this->picto.actor) != GERUDO_PURPLE_PATH_NONE) { + this->path = &play->setupPathList[GERUDO_PURPLE_GET_PATH(&this->picto.actor)]; + if (this->path != NULL) { + Path* path = this->path; + Vec3s* points = Lib_SegmentedToVirtual(path->points); + f32 diffX = points[0].x - this->picto.actor.world.pos.x; + f32 diffZ = points[0].z - this->picto.actor.world.pos.z; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8C048.s") + if ((SQ(diffX) + SQ(diffZ)) < SQ(10.0f)) { + this->curPointIndex = 0; + this->stateFlags &= ~GERUDO_PURPLE_STATE_PATH_REVERSE; + } else { + this->curPointIndex = path->count - 1; + this->stateFlags |= GERUDO_PURPLE_STATE_PATH_REVERSE; + return true; + } + } + } else { + this->path = NULL; + this->curPointIndex = 0; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8C0B0.s") +void EnGe2_GetNextPath(EnGe2* this, PlayState* play) { + Path* curPath; + Path* nextPath; + Vec3s* points; + u8 unk1; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8C13C.s") + this->curPointIndex = 0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8C45C.s") + if (GERUDO_PURPLE_GET_PATH(&this->picto.actor) != GERUDO_PURPLE_PATH_NONE) { + curPath = &play->setupPathList[GERUDO_PURPLE_GET_PATH(&this->picto.actor)]; + unk1 = curPath->unk1; + nextPath = &play->setupPathList[unk1]; + this->path = nextPath; + points = Lib_SegmentedToVirtual(nextPath->points); + this->picto.actor.world.pos.x = points[0].x; + this->picto.actor.world.pos.z = points[0].z; + } else { + this->path = NULL; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8C59C.s") +void EnGe2_SetupBlownAwayPath(EnGe2* this, PlayState* play) { + s32 pad; + Vec3s* points; + Vec3f nextPoint; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8C644.s") + this->curPointIndex = 0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8C9B8.s") + if (GERUDO_PURPLE_GET_PATH(&this->picto.actor) != GERUDO_PURPLE_PATH_NONE) { + this->path = &play->setupPathList[GERUDO_PURPLE_GET_PATH(&this->picto.actor)]; + if (this->path != NULL) { + points = Lib_SegmentedToVirtual(this->path->points); + Math_Vec3s_ToVec3f(&this->picto.actor.world.pos, points); + this->curPointIndex++; + points++; + Math_Vec3s_ToVec3f(&nextPoint, points); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/EnGe2_Update.s") + this->picto.actor.world.rot.y = Math_Vec3f_Yaw(&this->picto.actor.world.pos, &nextPoint); + this->picto.actor.world.rot.x = Math_Vec3f_Pitch(&this->picto.actor.world.pos, &nextPoint); + this->picto.actor.speedXZ = 15.0f; + } + } else { + this->path = NULL; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8CC0C.s") +GerudoPurplePathStatus EnGe2_FollowPath(EnGe2* this) { + Path* path = this->path; + Vec3s* curPoint; + f32 diffX; + f32 diffZ; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8CCB4.s") + if (path == NULL) { + return GERUDO_PURPLE_PATHSTATUS_AT_POINT; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/func_80B8CCFC.s") + curPoint = (Vec3s*)Lib_SegmentedToVirtual(path->points); + curPoint += this->curPointIndex; + diffX = curPoint->x - this->picto.actor.world.pos.x; + diffZ = curPoint->z - this->picto.actor.world.pos.z; + this->picto.actor.world.rot.y = Math_Atan2S(diffX, diffZ); + Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.world.rot.y, 2, 0x7D0, 0xC8); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ge2/EnGe2_Draw.s") + if ((SQ(diffX) + SQ(diffZ)) < SQ(10.0f)) { + if (this->stateFlags & GERUDO_PURPLE_STATE_PATH_REVERSE) { + this->curPointIndex--; + if (this->curPointIndex < 0) { + return GERUDO_PURPLE_PATHSTATUS_END; + } + } else { + this->curPointIndex++; + if (this->curPointIndex >= path->count) { + return GERUDO_PURPLE_PATHSTATUS_END; + } + } + return GERUDO_PURPLE_PATHSTATUS_AT_POINT; + } + + return GERUDO_PURPLE_PATHSTATUS_NORMAL; +} + +/** + * Used for Blown Away cutscene path. + */ +s32 EnGe2_FollowPathWithoutGravity(EnGe2* this) { + s32 pad; + Vec3s* curPoint; + Path* path = this->path; + Vec3f point; + s16 yawTarget; + s16 pitchTarget; + + if (this->path == NULL) { + return true; + } + + curPoint = Lib_SegmentedToVirtual(path->points); + curPoint += this->curPointIndex; + + Math_Vec3s_ToVec3f(&point, curPoint); + yawTarget = Math_Vec3f_Yaw(&this->picto.actor.world.pos, &point); + pitchTarget = Math_Vec3f_Pitch(&this->picto.actor.world.pos, &point); + Math_SmoothStepToS(&this->picto.actor.world.rot.y, yawTarget, 0xA, 0x3E8, 0x64); + Math_SmoothStepToS(&this->picto.actor.world.rot.x, pitchTarget, 6, 0x7D0, 0xC8); + this->picto.actor.speedXZ = 15.0f; + + Actor_MoveWithoutGravityReverse(&this->picto.actor); + + if (Math_Vec3f_DistXYZ(&this->picto.actor.world.pos, &point) < 40.0f) { + return true; + } else { + return false; + } +} + +/* Action and helper functions */ + +void EnGe2_SpawnEffects(EnGe2* this, PlayState* play) { + static Vec3f effectVelocity = { 0.0f, -0.05f, 0.0f }; + static Vec3f effectAccel = { 0.0f, -0.025f, 0.0f }; + static Color_RGBA8 effectPrimColor = { 255, 255, 255, 0 }; + static Color_RGBA8 effectEnvColor = { 255, 150, 0, 0 }; + s16 effectAngle = play->state.frames * 0x2800; + Vec3f effectPos; + + effectPos.x = (Math_CosS(effectAngle) * 5.0f) + this->picto.actor.focus.pos.x; + effectPos.y = this->picto.actor.focus.pos.y + 10.0f; + effectPos.z = (Math_SinS(effectAngle) * 5.0f) + this->picto.actor.focus.pos.z; + EffectSsKirakira_SpawnDispersed(play, &effectPos, &effectVelocity, &effectAccel, &effectPrimColor, &effectEnvColor, + 1000, 16); +} + +void EnGe2_Scream(EnGe2* this) { + if ((s32)Rand_ZeroFloat(2.0f) == 0) { + Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_VO_FPVO00); + } else { + Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_VO_FPVO01); + } +} + +/** + * Wait for timer to finish, then set up the captured/thrown out transition. + */ +void EnGe2_ThrowPlayerOut(EnGe2* this, PlayState* play) { + if (this->timer > 0) { + this->timer--; + } else if (play->nextEntrance != play->setupExitList[GERUDO_PURPLE_GET_EXIT(&this->picto.actor)]) { + play->nextEntrance = play->setupExitList[GERUDO_PURPLE_GET_EXIT(&this->picto.actor)]; + play->transitionTrigger = TRANS_TRIGGER_START; + play->transitionType = TRANS_TYPE_38; + } +} + +/** + * Used if Aveil spots Player. + */ +void EnGe2_TurnToPlayerFast(EnGe2* this, PlayState* play) { + SkelAnime_Update(&this->skelAnime); + Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 2, 0x1000, 0x200); +} + +void EnGe2_CapturePlayer(EnGe2* this, PlayState* play) { + SkelAnime_Update(&this->skelAnime); + Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 2, 0x400, 0x100); + EnGe2_ThrowPlayerOut(this, play); +} + +void EnGe2_SetupCapturePlayer(EnGe2* this) { + this->picto.actor.speedXZ = 0.0f; + this->actionFunc = EnGe2_CapturePlayer; + Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f, + Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, -8.0f); +} + +void EnGe2_Charge(EnGe2* this, PlayState* play) { + SkelAnime_Update(&this->skelAnime); + Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 2, 0x400, 0x100); + this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y; + + if (this->picto.actor.xzDistToPlayer < 50.0f) { + EnGe2_SetupCapturePlayer(this); + } else if (!(this->picto.actor.bgCheckFlags & 1)) { + this->picto.actor.world.pos = this->picto.actor.prevPos; + EnGe2_SetupCapturePlayer(this); + } + + if (this->timer > 0) { + this->timer--; + } else { + EnGe2_ThrowPlayerOut(this, play); + } + + if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) { + Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EV_PIRATE_WALK); + } +} + +void EnGe2_SetupCharge(EnGe2* this, PlayState* play) { + SkelAnime_Update(&this->skelAnime); + Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 2, 0x400, 0x100); + this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y; + + if (this->picto.actor.shape.rot.y == this->picto.actor.yawTowardsPlayer) { + Animation_Change(&this->skelAnime, &gGerudoPurpleChargingAnim, 1.0f, 0.0f, + Animation_GetLastFrame(&gGerudoPurpleChargingAnim), 0, -8.0f); + this->timer = 50; + this->picto.actor.speedXZ = 4.0f; + this->actionFunc = EnGe2_Charge; + } +} + +void EnGe2_SetupLookAround(EnGe2* this) { + Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f, + Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, -8.0f); + this->timer = 60; + this->picto.actor.speedXZ = 0.0f; + this->actionFunc = EnGe2_LookAround; +} + +void EnGe2_Stunned(EnGe2* this, PlayState* play) { + if (this->picto.actor.colorFilterTimer == 0) { + EnGe2_SetupLookAround(this); + this->detectedStatus = GERUDO_PURPLE_DETECTION_UNDETECTED; + CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); + this->stateFlags &= ~GERUDO_PURPLE_STATE_STUNNED; + } +} + +void EnGe2_KnockedOut(EnGe2* this, PlayState* play) { + SkelAnime_Update(&this->skelAnime); + EnGe2_SpawnEffects(this, play); + + if (this->timer > 0) { + this->timer--; + } else { + EnGe2_SetupLookAround(this); + this->detectedStatus = GERUDO_PURPLE_DETECTION_UNDETECTED; + CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); + this->stateFlags &= ~GERUDO_PURPLE_STATE_KO; + this->picto.actor.flags |= ACTOR_FLAG_1; + } +} + +/** + * Carries out various patrol functions: + * - Turning to Player if being arrested + * - Turning to Player if spotted by Aveil + * - Looking for Player + * - Managing collisions and collider + */ +void EnGe2_PatrolDuties(EnGe2* this, PlayState* play) { + Player* player = GET_PLAYER(play); + f32 visionRange = gSaveContext.save.isNight ? 200.0f : 280.0f; + + if (player->csMode == 0x1A) { + this->picto.actor.speedXZ = 0.0f; + this->actionFunc = EnGe2_SetupCharge; + Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f, + Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, -8.0f); + this->stateFlags |= GERUDO_PURPLE_STATE_CAPTURING; + } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_80_08)) { + this->picto.actor.speedXZ = 0.0f; + this->actionFunc = EnGe2_TurnToPlayerFast; + Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f, + Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, -8.0f); + } else if (EnGe2_LookForPlayer(play, &this->picto.actor, &this->picto.actor.focus.pos, + this->picto.actor.shape.rot.y, 0x1800, visionRange, this->verticalDetectRange)) { + if ((GERUDO_PURPLE_GET_EXIT(&this->picto.actor) != GERUDO_PURPLE_EXIT_NONE) && !Play_InCsMode(play)) { + this->picto.actor.speedXZ = 0.0f; + func_800B7298(play, &this->picto.actor, 0x1A); + func_801000A4(NA_SE_SY_FOUND); + Message_StartTextbox(play, 0x1194, &this->picto.actor); + this->actionFunc = EnGe2_SetupCharge; + Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f, + Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, -8.0f); + } + } else if (this->collider.base.acFlags & AC_HIT) { + if ((this->collider.info.acHitInfo != NULL) && + (this->collider.info.acHitInfo->toucher.dmgFlags & DMG_DEKU_NUT)) { + Actor_SetColorFilter(&this->picto.actor, 0, 120, 0, 400); + this->picto.actor.speedXZ = 0.0f; + this->actionFunc = EnGe2_Stunned; + this->stateFlags |= GERUDO_PURPLE_STATE_STUNNED; + } else { + Animation_Change(&this->skelAnime, &gGerudoPurpleFallingToGroundAnim, 1.0f, 0.0f, + Animation_GetLastFrame(&gGerudoPurpleFallingToGroundAnim), 2, -8.0f); + this->timer = 200; + this->picto.actor.speedXZ = 0.0f; + this->actionFunc = EnGe2_KnockedOut; + Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_PIRATE_DEAD); + this->picto.actor.flags &= ~ACTOR_FLAG_1; + this->stateFlags |= GERUDO_PURPLE_STATE_KO; + } + } else if (this->picto.actor.home.rot.x == 0) { + CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); + } +} + +void EnGe2_LookAround(EnGe2* this, PlayState* play) { + u8 detectedStatus; + + SkelAnime_Update(&this->skelAnime); + + detectedStatus = EnGe2_DetectPlayer(play, this); + if (detectedStatus != GERUDO_PURPLE_DETECTION_UNDETECTED) { + this->timer = 100; + this->yawTarget = this->picto.actor.yawTowardsPlayer; + + if (this->detectedStatus < detectedStatus) { + this->detectedStatus = detectedStatus; + } + } + + if (this->timer > 0) { + this->timer--; + } else { + this->actionFunc = EnGe2_Walk; + Animation_Change(&this->skelAnime, &gGerudoPurpleWalkingAnim, 1.0f, 0.0f, + Animation_GetLastFrame(&gGerudoPurpleWalkingAnim), 0, -8.0f); + this->headRot.y = 0; + this->detectedStatus = GERUDO_PURPLE_DETECTION_UNDETECTED; + } + + switch (this->detectedStatus) { + case GERUDO_PURPLE_DETECTION_HEARD: + Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->yawTarget, 2, 0x3E8, 0x1F4); + break; + + case GERUDO_PURPLE_DETECTION_PROXIMITY: + Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->yawTarget, 2, 0xBB8, 0x3E8); + break; + + default: + break; + } + + this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y; + EnGe2_PatrolDuties(this, play); +} + +void EnGe2_Walk(EnGe2* this, PlayState* play) { + SkelAnime_Update(&this->skelAnime); + this->picto.actor.speedXZ = 1.5f; + + switch (EnGe2_FollowPath(this)) { + case GERUDO_PURPLE_PATHSTATUS_END: + EnGe2_SetupPath(this, play); + break; + + case GERUDO_PURPLE_PATHSTATUS_AT_POINT: + EnGe2_SetupLookAround(this); + this->detectedStatus = GERUDO_PURPLE_DETECTION_UNDETECTED; + break; + + default: // GERUDO_PURPLE_PATHSTATUS_NORMAL + break; + } + + this->detectedStatus = EnGe2_DetectPlayer(play, this); + if (this->detectedStatus != GERUDO_PURPLE_DETECTION_UNDETECTED) { + EnGe2_SetupLookAround(this); + this->yawTarget = this->picto.actor.yawTowardsPlayer; + } + EnGe2_PatrolDuties(this, play); +} + +void EnGe2_PerformCutsceneActions(EnGe2* this, PlayState* play) { + SkelAnime_Update(&this->skelAnime); + if (Cutscene_CheckActorAction(play, 476)) { + s16 csAction = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 476)]->action; + if (this->csAction != csAction) { + this->csAction = csAction; + + switch (csAction) { + case ENGE2_CSACTION_BEEHIVE_PATROL: + Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f, + Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, -8.0f); + EnGe2_GetNextPath(this, play); + break; + + case ENGE2_CSACTION_BEEHIVE_RUN_AWAY: + Animation_Change(&this->skelAnime, &gGerudoPurpleRunningAwayCutsceneAnim, 1.0f, 0.0f, + Animation_GetLastFrame(&gGerudoPurpleRunningAwayCutsceneAnim), 0, -5.0f); + this->screamTimer = (s32)(Rand_ZeroFloat(10.0f) + 20.0f); + break; + + case ENGE2_CSACTION_BEEHIVE_EXIT: + Actor_Kill(&this->picto.actor); + break; + + case ENGE2_CSACTION_GBT_ENTR_STAND_STILL: + Animation_Change(&this->skelAnime, &gGerudoPurpleGreatBayCutsceneAnim, 0.0f, 0.0f, 0.0f, 2, 0.0f); + break; + + case ENGE2_CSACTION_GBT_ENTR_BLOWN_AWAY: + Animation_Change(&this->skelAnime, &gGerudoPurpleGreatBayCutsceneAnim, 0.0f, 1.0f, 1.0f, 2, 0.0f); + EnGe2_SetupBlownAwayPath(this, play); + this->stateFlags |= GERUDO_PURPLE_STATE_DISABLE_MOVEMENT; + this->screamTimer = (s32)(Rand_ZeroFloat(10.0f) + 20.0f); + break; + + default: + break; + } + } + } + + switch (this->csAction) { + case ENGE2_CSACTION_BEEHIVE_RUN_AWAY: + EnGe2_FollowPath(this); + this->picto.actor.speedXZ = 5.0f; + + if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) { + Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EV_PIRATE_WALK); + } + + if (this->screamTimer > 0) { + this->screamTimer--; + } else { + this->screamTimer = (s32)(Rand_ZeroFloat(10.0f) + 20.0f); + EnGe2_Scream(this); + } + break; + + case ENGE2_CSACTION_GBT_ENTR_BLOWN_AWAY: + if ((this->curPointIndex < this->path->count) && EnGe2_FollowPathWithoutGravity(this)) { + this->curPointIndex++; + } + + // Tumble in the air + this->picto.actor.shape.rot.x += 0x3E8; + this->picto.actor.shape.rot.y += 0x7D0; + this->picto.actor.shape.rot.z += 0x1F4; + + if (this->screamTimer > 0) { + this->screamTimer--; + } else { + this->screamTimer = (s32)(Rand_ZeroFloat(10.0f) + 20.0f); + EnGe2_Scream(this); + } + break; + + default: + break; + } +} + +// Used for those on boats +void EnGe2_GuardStationary(EnGe2* this, PlayState* play) { + SkelAnime_Update(&this->skelAnime); + if (EnGe2_LookForPlayer(play, &this->picto.actor, &this->picto.actor.focus.pos, this->picto.actor.shape.rot.y, + 0x4000, 720.0f, this->verticalDetectRange)) { + if ((GERUDO_PURPLE_GET_EXIT(&this->picto.actor) != GERUDO_PURPLE_EXIT_NONE) && !Play_InCsMode(play)) { + func_800B7298(play, &this->picto.actor, 0x1A); + func_801000A4(NA_SE_SY_FOUND); + Message_StartTextbox(play, 0x1194, &this->picto.actor); + this->timer = 50; + EnGe2_SetupCapturePlayer(this); + } + } + + if (this->picto.actor.playerHeightRel < -150.0f) { + this->picto.actor.draw = NULL; + } else { + this->picto.actor.draw = EnGe2_Draw; + } +} + +void EnGe2_Update(Actor* thisx, PlayState* play) { + s32 pad; + EnGe2* this = THIS; + + if (!(this->stateFlags & GERUDO_PURPLE_STATE_DISABLE_MOVEMENT)) { + Actor_MoveWithGravity(&this->picto.actor); + } + Actor_UpdateBgCheckInfo(play, &this->picto.actor, 40.0f, 25.0f, 40.0f, 5); + Collider_UpdateCylinder(&this->picto.actor, &this->collider); + CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); + + if (Cutscene_CheckActorAction(play, 476)) { + this->actionFunc = EnGe2_PerformCutsceneActions; + this->stateFlags &= ~GERUDO_PURPLE_STATE_KO; + this->stateFlags &= ~GERUDO_PURPLE_STATE_PATH_REVERSE; + this->picto.actor.flags |= ACTOR_FLAG_20; + this->picto.actor.speedXZ = 0.0f; + } + + this->actionFunc(this, play); + + // Blinking + if (this->stateFlags & GERUDO_PURPLE_STATE_KO) { + this->eyeIndex = 2; + } else if (!(this->stateFlags & GERUDO_PURPLE_STATE_STUNNED)) { + if (DECR(this->blinkTimer) == 0) { + this->blinkTimer = Rand_S16Offset(60, 60); + } + this->eyeIndex = this->blinkTimer; + if (this->eyeIndex >= 3) { + this->eyeIndex = 0; + } + } +} + +s32 EnGe2_ValidatePictograph(PlayState* play, Actor* thisx) { + s32 ret = Snap_ValidatePictograph(play, thisx, PICTO_VALID_PIRATE_GOOD, &thisx->focus.pos, &thisx->shape.rot, 10.0f, + 400.0f, -1); + + ret |= Snap_ValidatePictograph(play, thisx, PICTO_VALID_PIRATE_TOO_FAR, &thisx->focus.pos, &thisx->shape.rot, 10.0f, + 1200.0f, -1); + return ret; +} + +s32 EnGe2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + EnGe2* this = THIS; + + if (limbIndex == GERUDO_PURPLE_NECK_LIMB) { + rot->x += this->headRot.y; + rot->z += this->headRot.x; + } + return false; +} + +void EnGe2_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + static Vec3f sFocusOffset = { 600.0f, 700.0f, 0.0f }; + + if (limbIndex == GERUDO_PURPLE_HEAD_LIMB) { + Matrix_MultVec3f(&sFocusOffset, &thisx->focus.pos); + } +} + +void EnGe2_Draw(Actor* thisx, PlayState* play) { + static TexturePtr sEyeTextures[] = { + gGerudoPurpleEyeOpenTex, + gGerudoPurpleEyeHalfTex, + gGerudoPurpleEyeClosedTex, + }; + s32 pad; + EnGe2* this = THIS; + + OPEN_DISPS(play->state.gfxCtx); + + func_8012C5B0(play->state.gfxCtx); + gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEyeTextures[this->eyeIndex])); + func_800B8050(&this->picto.actor, play, 0); + SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, + EnGe2_OverrideLimbDraw, EnGe2_PostLimbDraw, &this->picto.actor); + + CLOSE_DISPS(play->state.gfxCtx); +} 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 0558166db6..739e942775 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h @@ -2,14 +2,58 @@ #define Z_EN_GE2_H #include "global.h" +#include "z64snap.h" +#include "objects/object_gla/object_gla.h" struct EnGe2; typedef void (*EnGe2ActionFunc)(struct EnGe2*, PlayState*); +#define GERUDO_PURPLE_GET_EXIT(thisx) (((thisx)->params) & 0x1F) //!< Exit to send Player to when caught +#define GERUDO_PURPLE_GET_TYPE(thisx) (((thisx)->params & 0xE0) >> 5) +#define GERUDO_PURPLE_GET_PATH(thisx) ((((thisx)->params) & 0xFC00) >> 10) + +#define GERUDO_PURPLE_PARAMS(path, type, exit) (((path) & 0x1F) | (((type) & 7) << 5) | (((exit) & 0x3F) << 10)) + +#define GERUDO_PURPLE_EXIT_NONE 0x1F +#define GERUDO_PURPLE_PATH_NONE 0x3F + +typedef enum { + /* 0 */ GERUDO_PURPLE_TYPE_CUTSCENE, + /* 1 */ GERUDO_PURPLE_TYPE_BOAT_SENTRY, //!< on boats + /* 2 */ GERUDO_PURPLE_TYPE_AVEIL_GUARD, + /* 7 */ GERUDO_PURPLE_TYPE_FORTRESS = 7 //!< In both courtyard and rooms +} GerudoPurpleType; + +//! TODO: work out where to put this +typedef enum { + /* 1 */ ENGE2_CSACTION_BEEHIVE_PATROL = 1, + /* 2 */ ENGE2_CSACTION_BEEHIVE_RUN_AWAY, + /* 3 */ ENGE2_CSACTION_BEEHIVE_EXIT, + /* 4 */ ENGE2_CSACTION_GBT_ENTR_STAND_STILL, + /* 5 */ ENGE2_CSACTION_GBT_ENTR_BLOWN_AWAY +} EnGe2CsAction; + typedef struct EnGe2 { - /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x1C4]; + /* 0x000 */ PictoActor picto; + /* 0x148 */ ColliderCylinder collider; + /* 0x194 */ SkelAnime skelAnime; + /* 0x1D8 */ Vec3s jointTable[GERUDO_PURPLE_LIMB_MAX]; + /* 0x25C */ Vec3s morphTable[GERUDO_PURPLE_LIMB_MAX]; + /* 0x2E0 */ s16 eyeIndex; + /* 0x2E2 */ s16 blinkTimer; + /* 0x2E4 */ Vec3s headRot; + /* 0x2E8 */ Vec3s torsoRot; // unused, inferred from similar usage in other actors + /* 0x2F0 */ Path* path; + /* 0x2F4 */ s32 curPointIndex; + /* 0x2F8 */ u16 stateFlags; + /* 0x2FA */ s16 yawTarget; //!< used when Player detected to fix the yaw to turn to + /* 0x2FC */ f32 verticalDetectRange; //!< vertical range to look for the player within + /* 0x300 */ u8 timer; + /* 0x301 */ u8 detectedStatus; + /* 0x302 */ s16 csAction; + /* 0x304 */ s16 unk304; // unused + /* 0x306 */ s16 screamTimer; /* 0x308 */ EnGe2ActionFunc actionFunc; } EnGe2; // size = 0x30C 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 f188e1df08..f2733c3c1c 100644 --- a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c +++ b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c @@ -1134,7 +1134,7 @@ void func_80B43074(EnKgy* this, PlayState* play) { OPEN_DISPS(play->state.gfxCtx); func_8012C28C(play->state.gfxCtx); - func_800B8050(&this->actor, play, MTXMODE_NEW); + func_800B8050(&this->actor, play, 0); Matrix_Push(); Matrix_Translate(-800.0f, 3100.0f, 8400.0f, MTXMODE_APPLY); Matrix_RotateXS(0x4000, MTXMODE_APPLY); 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 c48ff332ce..e4b69cbd25 100644 --- a/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c +++ b/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c @@ -16,7 +16,7 @@ void ObjBoat_Destroy(Actor* thisx, PlayState* play); void ObjBoat_Update(Actor* thisx, PlayState* play); void ObjBoat_Draw(Actor* thisx, PlayState* play); -void func_80B9B428(Actor* thisx, PlayState* play2); +void ObjBoat_UpdateCutscene(Actor* thisx, PlayState* play2); ActorInit Obj_Boat_InitVars = { ACTOR_OBJ_BOAT, @@ -37,14 +37,21 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP), }; -s16 func_80B9AF50(ObjBoat* this, Vec3f* arg0) { +/** + * Get the next point on the path and the yaw to use to get there. + * + * @param this + * @param nextPoint Position of next point on path + * @return yaw to use (or opposite of yaw if reversing) + */ +s16 ObjBoat_GetNextPoint(ObjBoat* this, Vec3f* nextPoint) { s16 yaw; - Vec3s* temp = &this->unk_164[(s32)this->unk_15C]; + Vec3s* curPoint = &this->points[(s32)this->curPointIndex]; - Math_Vec3s_ToVec3f(arg0, &temp[this->unk_15D]); - yaw = Math_Vec3f_Yaw(&this->dyna.actor.world.pos, arg0); + Math_Vec3s_ToVec3f(nextPoint, &curPoint[this->direction]); + yaw = Math_Vec3f_Yaw(&this->dyna.actor.world.pos, nextPoint); - return ((this->unk_15D > 0) ? yaw : (yaw + 0x8000)); + return ((this->direction > 0) ? yaw : yaw + 0x8000); } void ObjBoat_Init(Actor* thisx, PlayState* play) { @@ -57,17 +64,17 @@ void ObjBoat_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 3); DynaPolyActor_LoadMesh(play, &this->dyna, &object_kaizoku_obj_Colheader_009A88); if (thisx->params < 0) { - this->dyna.actor.update = func_80B9B428; + this->dyna.actor.update = ObjBoat_UpdateCutscene; } else { path = &play->setupPathList[OBJBOAT_GET_PATH(thisx)]; - this->unk_163 = path->count - 1; - this->unk_164 = Lib_SegmentedToVirtual(path->points); - this->unk_15D = 1; - this->dyna.actor.world.pos.x = this->unk_164[this->unk_15C].x; - this->dyna.actor.world.pos.z = this->unk_164[this->unk_15C].z; - this->dyna.actor.shape.rot.y = func_80B9AF50(this, &sp24); + this->maxPointIndex = path->count - 1; + this->points = Lib_SegmentedToVirtual(path->points); + this->direction = 1; + this->dyna.actor.world.pos.x = this->points[this->curPointIndex].x; + this->dyna.actor.world.pos.z = this->points[this->curPointIndex].z; + this->dyna.actor.shape.rot.y = ObjBoat_GetNextPoint(this, &sp24); this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y; - this->unk_15D = -this->unk_15D; + this->direction = -this->direction; } } @@ -77,11 +84,11 @@ void ObjBoat_Destroy(Actor* thisx, PlayState* play) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); } -void func_80B9B124(ObjBoat* this) { - this->unk_160 += 1000; - this->dyna.actor.world.pos.y = Math_SinS(this->unk_160) + this->dyna.actor.home.pos.y; - this->dyna.actor.shape.rot.x = Math_SinS(this->unk_160) * 100.0f; - this->dyna.actor.shape.rot.z = Math_SinS(this->unk_160 * 2) * 50.0f; +void ObjBoat_SetRotations(ObjBoat* this) { + this->angle += 0x3E8; + this->dyna.actor.world.pos.y = Math_SinS(this->angle) + this->dyna.actor.home.pos.y; + this->dyna.actor.shape.rot.x = Math_SinS(this->angle) * 100.0f; + this->dyna.actor.shape.rot.z = Math_SinS(this->angle * 2) * 50.0f; } void ObjBoat_Update(Actor* thisx, PlayState* play) { @@ -89,93 +96,102 @@ void ObjBoat_Update(Actor* thisx, PlayState* play) { ObjBoat* this = THIS; Player* player = GET_PLAYER(play); s32 temp = DynaPolyActor_IsInRidingMovingState(&this->dyna); - f32 sp3C = 0.0f; - s16 sp3A = this->dyna.actor.shape.rot.y; - Vec3f sp2C; + f32 speedTarget = 0.0f; + s16 yawTarget = this->dyna.actor.shape.rot.y; + Vec3f nextPoint; - if ((temp != 0) || ((DynaPolyActor_IsInRidingFallingState(&this->dyna)))) { - if ((this->unk_15F == 0) && (OBJBOAT_GET_4000(thisx) || ((temp != 0) && (this->unk_15C == this->unk_15E)))) { - this->unk_15D = -this->unk_15D; - if (this->unk_15D > 0) { - this->unk_15E = this->unk_163; + if (temp || ((DynaPolyActor_IsInRidingFallingState(&this->dyna)))) { + if ((this->timer == 0) && + (OBJBOAT_GET_4000(thisx) || (temp && (this->curPointIndex == this->lastPointIndex)))) { + this->direction = -this->direction; + if (this->direction > 0) { + this->lastPointIndex = this->maxPointIndex; } else { - this->unk_15E = 0; + this->lastPointIndex = 0; } - this->unk_15F = 60; + this->timer = 60; } } else if (this->dyna.actor.speedXZ == 0.0f) { - if (this->unk_15F != 0) { - this->unk_15F--; + if (this->timer != 0) { + this->timer--; } } - if (this->unk_15C != this->unk_15E) { - sp3A = func_80B9AF50(this, &sp2C); - if (Math_Vec3f_DistXZ(&this->dyna.actor.world.pos, &sp2C) < 200.0f) { - this->unk_15C += this->unk_15D; - if (this->unk_15C == this->unk_15E) { + + if (this->curPointIndex != this->lastPointIndex) { + yawTarget = ObjBoat_GetNextPoint(this, &nextPoint); + if (Math_Vec3f_DistXZ(&this->dyna.actor.world.pos, &nextPoint) < 200.0f) { + this->curPointIndex += this->direction; + if (this->curPointIndex == this->lastPointIndex) { if (OBJBOAT_GET_4000(thisx)) { - this->unk_15C = 0; + this->curPointIndex = 0; } else if (this->dyna.actor.speedXZ == 0.0f) { - this->unk_15C = 0; - this->unk_15D = -1; + this->curPointIndex = 0; + this->direction = -1; } } } else { - sp3C = this->unk_15D * (OBJBOAT_GET_4000(thisx) ? 5.0f : 3.0f); + speedTarget = this->direction * (OBJBOAT_GET_4000(thisx) ? 5.0f : 3.0f); } } + if (player->csMode != PLAYER_CSMODE_26) { - Math_ScaledStepToS(&this->dyna.actor.shape.rot.y, sp3A, (s16)(s32)(fabsf(this->dyna.actor.speedXZ) * 40.0f)); + Math_ScaledStepToS(&this->dyna.actor.shape.rot.y, yawTarget, (s32)(fabsf(this->dyna.actor.speedXZ) * 40.0f)); this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y; - Math_StepToF(&this->dyna.actor.speedXZ, sp3C, 0.05f); + Math_StepToF(&this->dyna.actor.speedXZ, speedTarget, 0.05f); Actor_MoveWithGravity(&this->dyna.actor); if (this->dyna.actor.speedXZ != 0.0f) { func_800B9010(&this->dyna.actor, NA_SE_EV_PIRATE_SHIP - SFX_FLAG); } } - func_80B9B124(this); + ObjBoat_SetRotations(this); } -void func_80B9B428(Actor* thisx, PlayState* play2) { +// Update used in cutscenes +void ObjBoat_UpdateCutscene(Actor* thisx, PlayState* play2) { PlayState* play = play2; ObjBoat* this = THIS; if (Cutscene_CheckActorAction(play, 511)) { CsCmdActorAction* actionIndex = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 511)]; - if (this->unk_15F != actionIndex->action) { + if (this->csAction != actionIndex->action) { this->dyna.actor.shape.rot.x = actionIndex->urot.x; + if (actionIndex->action != 1) { Path* path = &play->setupPathList[OBJBOAT_GET_PATH(&this->dyna.actor)]; if (actionIndex->action == 3) { path = &play->setupPathList[path->unk1]; } - this->unk_163 = path->count; - this->unk_164 = Lib_SegmentedToVirtual(path->points); - Math_Vec3s_ToVec3f(&this->dyna.actor.world.pos, this->unk_164); + + this->maxPointIndex = path->count; + this->points = Lib_SegmentedToVirtual(path->points); + Math_Vec3s_ToVec3f(&this->dyna.actor.world.pos, this->points); this->dyna.actor.speedXZ = actionIndex->urot.z * (45.0f / 0x2000); - this->unk_164++; - this->unk_15C = 1; + this->points++; + this->curPointIndex = 1; } - this->unk_15F = actionIndex->action; + + this->csAction = actionIndex->action; } else { if (actionIndex->action != 1) { - Vec3f vec; - f32 step; + Vec3f posTarget; + f32 distRemaining; - Math_Vec3s_ToVec3f(&vec, this->unk_164); - step = Math_Vec3f_StepTo(&this->dyna.actor.world.pos, &vec, this->dyna.actor.speedXZ); - if ((this->unk_15C < this->unk_163) && (step < this->dyna.actor.speedXZ)) { - this->unk_164++; - this->unk_15C++; + Math_Vec3s_ToVec3f(&posTarget, this->points); + distRemaining = Math_Vec3f_StepTo(&this->dyna.actor.world.pos, &posTarget, this->dyna.actor.speedXZ); + if ((this->curPointIndex < this->maxPointIndex) && (distRemaining < this->dyna.actor.speedXZ)) { + this->points++; + this->curPointIndex++; } } + if (actionIndex->action != 3) { - func_80B9B124(this); + ObjBoat_SetRotations(this); if (actionIndex->action == 2) { func_800B9010(&this->dyna.actor, NA_SE_EV_PIRATE_SHIP - SFX_FLAG); } } else { + // Tumble in the air this->dyna.actor.shape.rot.y += 0x7D0; this->dyna.actor.shape.rot.x += 0x3E8; this->dyna.actor.shape.rot.z += 0x1F4; 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 795c50689b..879e2e50cb 100644 --- a/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.h +++ b/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.h @@ -10,14 +10,17 @@ struct ObjBoat; typedef struct ObjBoat { /* 0x000 */ DynaPolyActor dyna; - /* 0x15C */ u8 unk_15C; - /* 0x15D */ s8 unk_15D; - /* 0x15E */ u8 unk_15E; - /* 0x15F */ u8 unk_15F; - /* 0x160 */ s16 unk_160; + /* 0x15C */ u8 curPointIndex; + /* 0x15D */ s8 direction; // To follow the path + /* 0x15E */ u8 lastPointIndex; // max point if direction is negative, first point if forwards + /* 0x15F */ union { + u8 timer; + u8 csAction; + }; + /* 0x160 */ s16 angle; // Angle used to set rotations /* 0x162 */ UNK_TYPE1 pad_162; - /* 0x163 */ u8 unk_163; - /* 0x164 */ Vec3s* unk_164; + /* 0x163 */ u8 maxPointIndex; // point at the other end from 0 + /* 0x164 */ Vec3s* points; } ObjBoat; // size = 0x168 #endif // Z_OBJ_BOAT_H 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 6620c51166..a4b211bef6 100644 --- a/src/overlays/actors/ovl_Obj_Lupygamelift/z_obj_lupygamelift.c +++ b/src/overlays/actors/ovl_Obj_Lupygamelift/z_obj_lupygamelift.c @@ -135,16 +135,16 @@ void func_80AF0514(ObjLupygamelift* this) { } void func_80AF0530(ObjLupygamelift* this, PlayState* play) { - f32 step; + f32 distRemaining; Vec3f target; target.x = this->points[this->pointIndex].x; target.y = this->points[this->pointIndex].y; target.z = this->points[this->pointIndex].z; - step = Math_Vec3f_StepTo(&this->dyna.actor.world.pos, &target, this->dyna.actor.speedXZ); - if (step > 30.0f) { + distRemaining = Math_Vec3f_StepTo(&this->dyna.actor.world.pos, &target, this->dyna.actor.speedXZ); + if (distRemaining > 30.0f) { Math_SmoothStepToF(&this->dyna.actor.speedXZ, this->targetSpeedXZ, 0.5f, 5.0f, 0.1f); - } else if (step > 0.0f) { + } else if (distRemaining > 0.0f) { Math_SmoothStepToF(&this->dyna.actor.speedXZ, 5.0f, 0.5f, 5.0f, 1.0f); } else { if (this->pointIndex < (this->count - 1)) { diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index c4fa65163c..d967763540 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -14704,33 +14704,33 @@ 0x80B8A718:("EnKaizoku_Draw",), 0x80B8B2D0:("EnGe2_Init",), 0x80B8B504:("EnGe2_Destroy",), - 0x80B8B514:("func_80B8B514",), - 0x80B8B5AC:("func_80B8B5AC",), - 0x80B8B6B4:("func_80B8B6B4",), - 0x80B8B7A8:("func_80B8B7A8",), - 0x80B8B848:("func_80B8B848",), - 0x80B8B90C:("func_80B8B90C",), - 0x80B8BA40:("func_80B8BA40",), - 0x80B8BB3C:("func_80B8BB3C",), - 0x80B8BC1C:("func_80B8BC1C",), - 0x80B8BC78:("func_80B8BC78",), - 0x80B8BCEC:("func_80B8BCEC",), - 0x80B8BD38:("func_80B8BD38",), - 0x80B8BD90:("func_80B8BD90",), - 0x80B8BE08:("func_80B8BE08",), - 0x80B8BF04:("func_80B8BF04",), - 0x80B8BFC8:("func_80B8BFC8",), - 0x80B8C048:("func_80B8C048",), - 0x80B8C0B0:("func_80B8C0B0",), - 0x80B8C13C:("func_80B8C13C",), - 0x80B8C45C:("func_80B8C45C",), - 0x80B8C59C:("func_80B8C59C",), - 0x80B8C644:("func_80B8C644",), - 0x80B8C9B8:("func_80B8C9B8",), + 0x80B8B514:("EnGe2_DetectPlayer",), + 0x80B8B5AC:("EnGe2_LookForPlayer",), + 0x80B8B6B4:("EnGe2_SetupPath",), + 0x80B8B7A8:("EnGe2_GetNextPath",), + 0x80B8B848:("EnGe2_SetupBlownAwayPath",), + 0x80B8B90C:("EnGe2_FollowPath",), + 0x80B8BA40:("EnGe2_FollowPathWithoutGravity",), + 0x80B8BB3C:("EnGe2_SpawnEffects",), + 0x80B8BC1C:("EnGe2_Scream",), + 0x80B8BC78:("EnGe2_ThrowPlayerOut",), + 0x80B8BCEC:("EnGe2_TurnToPlayerFast",), + 0x80B8BD38:("EnGe2_CapturePlayer",), + 0x80B8BD90:("EnGe2_SetupCapturePlayer",), + 0x80B8BE08:("EnGe2_Charge",), + 0x80B8BF04:("EnGe2_SetupCharge",), + 0x80B8BFC8:("EnGe2_SetupLookAround",), + 0x80B8C048:("EnGe2_Stunned",), + 0x80B8C0B0:("EnGe2_KnockedOut",), + 0x80B8C13C:("EnGe2_PatrolDuties",), + 0x80B8C45C:("EnGe2_LookAround",), + 0x80B8C59C:("EnGe2_Walk",), + 0x80B8C644:("EnGe2_PerformCutsceneActions",), + 0x80B8C9B8:("EnGe2_GuardStationary",), 0x80B8CAA8:("EnGe2_Update",), - 0x80B8CC0C:("func_80B8CC0C",), - 0x80B8CCB4:("func_80B8CCB4",), - 0x80B8CCFC:("func_80B8CCFC",), + 0x80B8CC0C:("EnGe2_ValidatePictograph",), + 0x80B8CCB4:("EnGe2_OverrideLimbDraw",), + 0x80B8CCFC:("EnGe2_PostLimbDraw",), 0x80B8CD3C:("EnGe2_Draw",), 0x80B8D030:("EnMaYts_UpdateEyes",), 0x80B8D0BC:("EnMaYts_ChangeAnim",), @@ -14960,9 +14960,9 @@ 0x80B9AF50:("func_80B9AF50",), 0x80B9AFE0:("ObjBoat_Init",), 0x80B9B0F0:("ObjBoat_Destroy",), - 0x80B9B124:("func_80B9B124",), + 0x80B9B124:("ObjBoat_SetRotations",), 0x80B9B1B8:("ObjBoat_Update",), - 0x80B9B428:("func_80B9B428",), + 0x80B9B428:("ObjBoat_UpdateCutscene",), 0x80B9B628:("ObjBoat_Draw",), 0x80B9B6E0:("func_80B9B6E0",), 0x80B9B74C:("func_80B9B74C",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 16dcf55afc..55f4ad5101 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -15182,13 +15182,13 @@ 0x80B8ADB0:("D_80B8ADB0","f32","",0x4), 0x80B8ADB4:("D_80B8ADB4","f32","",0x4), 0x80B8CE20:("En_Ge2_InitVars","UNK_TYPE1","",0x1), - 0x80B8CE40:("D_80B8CE40","UNK_TYPE1","",0x1), - 0x80B8CE6C:("D_80B8CE6C","UNK_TYPE1","",0x1), - 0x80B8CE78:("D_80B8CE78","UNK_TYPE1","",0x1), - 0x80B8CE84:("D_80B8CE84","UNK_TYPE1","",0x1), - 0x80B8CE88:("D_80B8CE88","UNK_TYPE1","",0x1), - 0x80B8CE8C:("D_80B8CE8C","UNK_TYPE1","",0x1), - 0x80B8CE98:("D_80B8CE98","UNK_TYPE1","",0x1), + 0x80B8CE40:("sCylinderInit","ColliderCylinderInit","",0x2C), + 0x80B8CE6C:("effectVelocity","Vec3f","",0xC), + 0x80B8CE78:("effectAccel","Vec3f","",0xC), + 0x80B8CE84:("effectPrimColor","Color_RGBA8","",0x4), + 0x80B8CE88:("effectEnvColor","Color_RGBA8","",0x4), + 0x80B8CE8C:("sFocusOffset","Vec3f","",0x1), + 0x80B8CE98:("sEyeTextures","TexturePtr","[3]",0xC), 0x80B8CEB0:("jtbl_80B8CEB0","UNK_PTR","",0x4), 0x80B8E150:("En_Ma_Yts_InitVars","UNK_TYPE1","",0x1), 0x80B8E170:("D_80B8E170","ColliderCylinderInit","",0x2C), From e75c51e841ca97ad9f2f258c8b163acdfa4a3cf5 Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Fri, 24 Feb 2023 10:08:06 -0500 Subject: [PATCH 11/29] WeekEventFlags: Entrance Cutscenes Watched (#1166) * entrance regs * cleanup comments * add comment * comments * missed a space * fix placement of comment --- include/z64save.h | 73 +++++++++++-------- .../actors/ovl_Dm_Ravine/z_dm_ravine.c | 2 +- .../actors/ovl_Door_Warp1/z_door_warp1.c | 5 +- .../z_en_horse_link_child.c | 3 +- src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c | 2 +- tools/weekeventregconvert.py | 62 ++++++++-------- 6 files changed, 80 insertions(+), 67 deletions(-) diff --git a/include/z64save.h b/include/z64save.h index acd2fe6f80..1b5531540b 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -503,36 +503,43 @@ typedef enum SunsSongState { #define PACK_WEEKEVENTREG_FLAG(index, mask) (((index) << 8) | (mask)) #define WEEKEVENTREG_00_01 PACK_WEEKEVENTREG_FLAG(0, 0x01) -#define WEEKEVENTREG_00_02 PACK_WEEKEVENTREG_FLAG(0, 0x02) -#define WEEKEVENTREG_00_04 PACK_WEEKEVENTREG_FLAG(0, 0x04) -#define WEEKEVENTREG_00_08 PACK_WEEKEVENTREG_FLAG(0, 0x08) -#define WEEKEVENTREG_00_10 PACK_WEEKEVENTREG_FLAG(0, 0x10) -#define WEEKEVENTREG_00_20 PACK_WEEKEVENTREG_FLAG(0, 0x20) -#define WEEKEVENTREG_00_40 PACK_WEEKEVENTREG_FLAG(0, 0x40) -#define WEEKEVENTREG_00_80 PACK_WEEKEVENTREG_FLAG(0, 0x80) -#define WEEKEVENTREG_01_01 PACK_WEEKEVENTREG_FLAG(1, 0x01) -#define WEEKEVENTREG_01_02 PACK_WEEKEVENTREG_FLAG(1, 0x02) -#define WEEKEVENTREG_01_04 PACK_WEEKEVENTREG_FLAG(1, 0x04) -#define WEEKEVENTREG_01_08 PACK_WEEKEVENTREG_FLAG(1, 0x08) -#define WEEKEVENTREG_01_10 PACK_WEEKEVENTREG_FLAG(1, 0x10) -#define WEEKEVENTREG_01_20 PACK_WEEKEVENTREG_FLAG(1, 0x20) -#define WEEKEVENTREG_01_40 PACK_WEEKEVENTREG_FLAG(1, 0x40) -#define WEEKEVENTREG_01_80 PACK_WEEKEVENTREG_FLAG(1, 0x80) -#define WEEKEVENTREG_02_01 PACK_WEEKEVENTREG_FLAG(2, 0x01) -#define WEEKEVENTREG_02_02 PACK_WEEKEVENTREG_FLAG(2, 0x02) -#define WEEKEVENTREG_02_04 PACK_WEEKEVENTREG_FLAG(2, 0x04) -#define WEEKEVENTREG_02_08 PACK_WEEKEVENTREG_FLAG(2, 0x08) -#define WEEKEVENTREG_02_10 PACK_WEEKEVENTREG_FLAG(2, 0x10) -#define WEEKEVENTREG_02_20 PACK_WEEKEVENTREG_FLAG(2, 0x20) -#define WEEKEVENTREG_02_40 PACK_WEEKEVENTREG_FLAG(2, 0x40) -#define WEEKEVENTREG_02_80 PACK_WEEKEVENTREG_FLAG(2, 0x80) -#define WEEKEVENTREG_03_01 PACK_WEEKEVENTREG_FLAG(3, 0x01) -#define WEEKEVENTREG_03_02 PACK_WEEKEVENTREG_FLAG(3, 0x02) -#define WEEKEVENTREG_03_04 PACK_WEEKEVENTREG_FLAG(3, 0x04) -#define WEEKEVENTREG_03_08 PACK_WEEKEVENTREG_FLAG(3, 0x08) -#define WEEKEVENTREG_03_10 PACK_WEEKEVENTREG_FLAG(3, 0x10) -#define WEEKEVENTREG_03_20 PACK_WEEKEVENTREG_FLAG(3, 0x20) -#define WEEKEVENTREG_03_40 PACK_WEEKEVENTREG_FLAG(3, 0x40) + +/* Entrance cutscenes watched */ + +#define WEEKEVENTREG_ENTERED_TERMINA_FIELD PACK_WEEKEVENTREG_FLAG(0, 0x02) +#define WEEKEVENTREG_ENTERED_IKANA_GRAVEYARD PACK_WEEKEVENTREG_FLAG(0, 0x04) +#define WEEKEVENTREG_ENTERED_ROMANI_RANCH PACK_WEEKEVENTREG_FLAG(0, 0x08) +#define WEEKEVENTREG_ENTERED_GORMAN_TRACK PACK_WEEKEVENTREG_FLAG(0, 0x10) +#define WEEKEVENTREG_ENTERED_MOUNTAIN_VILLAGE_WINTER PACK_WEEKEVENTREG_FLAG(0, 0x20) +#define WEEKEVENTREG_ENTERED_GORON_SHRINE PACK_WEEKEVENTREG_FLAG(0, 0x40) +#define WEEKEVENTREG_ENTERED_SNOWHEAD PACK_WEEKEVENTREG_FLAG(0, 0x80) +#define WEEKEVENTREG_ENTERED_SOUTHERN_SWAMP_POISONED PACK_WEEKEVENTREG_FLAG(1, 0x01) +#define WEEKEVENTREG_ENTERED_WOODFALL PACK_WEEKEVENTREG_FLAG(1, 0x02) +#define WEEKEVENTREG_ENTERED_DEKU_PALACE PACK_WEEKEVENTREG_FLAG(1, 0x04) +#define WEEKEVENTREG_ENTERED_GREAT_BAY_COAST PACK_WEEKEVENTREG_FLAG(1, 0x08) +#define WEEKEVENTREG_ENTERED_PIRATES_FORTRESS PACK_WEEKEVENTREG_FLAG(1, 0x10) +#define WEEKEVENTREG_ENTERED_ZORA_HALL PACK_WEEKEVENTREG_FLAG(1, 0x20) +#define WEEKEVENTREG_ENTERED_WATERFALL_RAPIDS PACK_WEEKEVENTREG_FLAG(1, 0x40) +#define WEEKEVENTREG_ENTERED_IKANA_CANYON PACK_WEEKEVENTREG_FLAG(1, 0x80) +// Attached to the scene but unused. Entrance cutscene is instead triggered by `ACTOR_OBJ_DEMO` +#define WEEKEVENTREG_ENTERED_IKANA_CASTLE PACK_WEEKEVENTREG_FLAG(2, 0x01) +#define WEEKEVENTREG_ENTERED_STONE_TOWER PACK_WEEKEVENTREG_FLAG(2, 0x02) +#define WEEKEVENTREG_ENTERED_STONE_TOWER_INVERTED PACK_WEEKEVENTREG_FLAG(2, 0x04) +#define WEEKEVENTREG_ENTERED_EAST_CLOCK_TOWN PACK_WEEKEVENTREG_FLAG(2, 0x08) +#define WEEKEVENTREG_ENTERED_WEST_CLOCK_TOWN PACK_WEEKEVENTREG_FLAG(2, 0x10) +#define WEEKEVENTREG_ENTERED_NORTH_CLOCK_TOWN PACK_WEEKEVENTREG_FLAG(2, 0x20) +#define WEEKEVENTREG_ENTERED_WOODFALL_TEMPLE PACK_WEEKEVENTREG_FLAG(2, 0x40) +#define WEEKEVENTREG_ENTERED_SNOWHEAD_TEMPLE PACK_WEEKEVENTREG_FLAG(2, 0x80) +// Attached to the scene but unused. Entrance cutscene is instead triggered by `ACTOR_OBJ_DEMO` +#define WEEKEVENTREG_ENTERED_PIRATES_FORTRESS_EXTERIOR PACK_WEEKEVENTREG_FLAG(3, 0x01) +#define WEEKEVENTREG_ENTERED_STONE_TOWER_TEMPLE PACK_WEEKEVENTREG_FLAG(3, 0x02) +#define WEEKEVENTREG_ENTERED_STONE_TOWER_TEMPLE_INVERTED PACK_WEEKEVENTREG_FLAG(3, 0x04) +// Unused as no cutscene is attached to this script +#define WEEKEVENTREG_ENTERED_THE_MOON PACK_WEEKEVENTREG_FLAG(3, 0x08) +#define WEEKEVENTREG_ENTERED_MOON_DEKU_TRIAL PACK_WEEKEVENTREG_FLAG(3, 0x10) +#define WEEKEVENTREG_ENTERED_MOON_GORON_TRIAL PACK_WEEKEVENTREG_FLAG(3, 0x20) +#define WEEKEVENTREG_ENTERED_MOON_ZORA_TRIAL PACK_WEEKEVENTREG_FLAG(3, 0x40) + #define WEEKEVENTREG_03_80 PACK_WEEKEVENTREG_FLAG(3, 0x80) #define WEEKEVENTREG_04_01 PACK_WEEKEVENTREG_FLAG(4, 0x01) #define WEEKEVENTREG_04_02 PACK_WEEKEVENTREG_FLAG(4, 0x02) @@ -565,7 +572,8 @@ typedef enum SunsSongState { #define WEEKEVENTREG_07_10 PACK_WEEKEVENTREG_FLAG(7, 0x10) #define WEEKEVENTREG_07_20 PACK_WEEKEVENTREG_FLAG(7, 0x20) #define WEEKEVENTREG_07_40 PACK_WEEKEVENTREG_FLAG(7, 0x40) -#define WEEKEVENTREG_07_80 PACK_WEEKEVENTREG_FLAG(7, 0x80) +// Entrance cutscene watched to the prison where the deku princess is kept. Also set in door_warp1.c +#define WEEKEVENTREG_ENTERED_WOODFALL_TEMPLE_PRISON PACK_WEEKEVENTREG_FLAG(7, 0x80) #define WEEKEVENTREG_08_01 PACK_WEEKEVENTREG_FLAG(8, 0x01) #define WEEKEVENTREG_08_02 PACK_WEEKEVENTREG_FLAG(8, 0x02) #define WEEKEVENTREG_08_04 PACK_WEEKEVENTREG_FLAG(8, 0x04) @@ -785,6 +793,9 @@ typedef enum SunsSongState { #define WEEKEVENTREG_31_10 PACK_WEEKEVENTREG_FLAG(31, 0x10) #define WEEKEVENTREG_31_20 PACK_WEEKEVENTREG_FLAG(31, 0x20) +//! @note: entrance cutscenes defined in `CutsceneEntry` can not use +//! any of the below weekEventFlags due to bitpacking + // Cremia asked the player to accompany her to town #define WEEKEVENTREG_31_40 PACK_WEEKEVENTREG_FLAG(31, 0x40) // Player is playing the Milk Run 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 25fee11db7..cd6890505b 100644 --- a/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c +++ b/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c @@ -32,7 +32,7 @@ void DmRavine_Init(Actor* thisx, PlayState* play) { s32 pad; DmRavine* this = THIS; - if (CHECK_WEEKEVENTREG_ALT(WEEKEVENTREG_00_10) | cREG(0)) { + if (CHECK_WEEKEVENTREG_ALT(WEEKEVENTREG_ENTERED_GORMAN_TRACK) | cREG(0)) { Actor_Kill(&this->actor); return; } 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 7ec2245d7d..df067d0a9c 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -652,7 +652,7 @@ void func_808BA10C(DoorWarp1* this, PlayState* play) { if (this->unk_202 != 0) { if (phi_v0_2 > 0) { - SET_WEEKEVENTREG(WEEKEVENTREG_07_80); + SET_WEEKEVENTREG(WEEKEVENTREG_ENTERED_WOODFALL_TEMPLE_PRISON); } switch (phi_v0_2) { @@ -711,7 +711,8 @@ void func_808BA10C(DoorWarp1* this, PlayState* play) { switch (phi_v0_2) { case 0: if (CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) { - SET_WEEKEVENTREG(WEEKEVENTREG_07_80); + // Skips the entrance cutscene as this flag is attached to `ENTRANCE(WOODFALL_TEMPLE, 1)` + SET_WEEKEVENTREG(WEEKEVENTREG_ENTERED_WOODFALL_TEMPLE_PRISON); play->nextEntrance = ENTRANCE(WOODFALL_TEMPLE, 1); play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_FADE_WHITE; 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 a10504720b..1e26b47e62 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 @@ -345,7 +345,8 @@ void func_808DF194(EnHorseLinkChild* this, PlayState* play) { sp4C = SkelAnime_Update(&this->skin.skelAnime); if ((sp4C != 0) || (this->unk_148 == 1) || (this->unk_148 == 0)) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_01_20)) { + // The carry-over of this flag from OoT was not done correctly + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_ENTERED_ZORA_HALL)) { f32 sp44 = Math3D_Distance(&this->actor.world.pos, &this->actor.home.pos); s32 pad; 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 060e793ca8..af796da2c8 100644 --- a/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c +++ b/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c @@ -1,7 +1,7 @@ /* * File: z_obj_demo.c * Overlay: ovl_Obj_Demo - * Description: + * Description: Cutscene triggers when player is in range */ #include "z_obj_demo.h" diff --git a/tools/weekeventregconvert.py b/tools/weekeventregconvert.py index e2092e5959..fbefc1b3db 100755 --- a/tools/weekeventregconvert.py +++ b/tools/weekeventregconvert.py @@ -5,36 +5,36 @@ import re weekEventReg = { ( 0 << 8) | 0x01: "WEEKEVENTREG_00_01", - ( 0 << 8) | 0x02: "WEEKEVENTREG_00_02", - ( 0 << 8) | 0x04: "WEEKEVENTREG_00_04", - ( 0 << 8) | 0x08: "WEEKEVENTREG_00_08", - ( 0 << 8) | 0x10: "WEEKEVENTREG_00_10", - ( 0 << 8) | 0x20: "WEEKEVENTREG_00_20", - ( 0 << 8) | 0x40: "WEEKEVENTREG_00_40", - ( 0 << 8) | 0x80: "WEEKEVENTREG_00_80", - ( 1 << 8) | 0x01: "WEEKEVENTREG_01_01", - ( 1 << 8) | 0x02: "WEEKEVENTREG_01_02", - ( 1 << 8) | 0x04: "WEEKEVENTREG_01_04", - ( 1 << 8) | 0x08: "WEEKEVENTREG_01_08", - ( 1 << 8) | 0x10: "WEEKEVENTREG_01_10", - ( 1 << 8) | 0x20: "WEEKEVENTREG_01_20", - ( 1 << 8) | 0x40: "WEEKEVENTREG_01_40", - ( 1 << 8) | 0x80: "WEEKEVENTREG_01_80", - ( 2 << 8) | 0x01: "WEEKEVENTREG_02_01", - ( 2 << 8) | 0x02: "WEEKEVENTREG_02_02", - ( 2 << 8) | 0x04: "WEEKEVENTREG_02_04", - ( 2 << 8) | 0x08: "WEEKEVENTREG_02_08", - ( 2 << 8) | 0x10: "WEEKEVENTREG_02_10", - ( 2 << 8) | 0x20: "WEEKEVENTREG_02_20", - ( 2 << 8) | 0x40: "WEEKEVENTREG_02_40", - ( 2 << 8) | 0x80: "WEEKEVENTREG_02_80", - ( 3 << 8) | 0x01: "WEEKEVENTREG_03_01", - ( 3 << 8) | 0x02: "WEEKEVENTREG_03_02", - ( 3 << 8) | 0x04: "WEEKEVENTREG_03_04", - ( 3 << 8) | 0x08: "WEEKEVENTREG_03_08", - ( 3 << 8) | 0x10: "WEEKEVENTREG_03_10", - ( 3 << 8) | 0x20: "WEEKEVENTREG_03_20", - ( 3 << 8) | 0x40: "WEEKEVENTREG_03_40", + ( 0 << 8) | 0x02: "WEEKEVENTREG_ENTERED_TERMINA_FIELD", + ( 0 << 8) | 0x04: "WEEKEVENTREG_ENTERED_IKANA_GRAVEYARD", + ( 0 << 8) | 0x08: "WEEKEVENTREG_ENTERED_ROMANI_RANCH", + ( 0 << 8) | 0x10: "WEEKEVENTREG_ENTERED_GORMAN_TRACK", + ( 0 << 8) | 0x20: "WEEKEVENTREG_ENTERED_MOUNTAIN_VILLAGE_WINTER", + ( 0 << 8) | 0x40: "WEEKEVENTREG_ENTERED_GORON_SHRINE", + ( 0 << 8) | 0x80: "WEEKEVENTREG_ENTERED_SNOWHEAD", + ( 1 << 8) | 0x01: "WEEKEVENTREG_ENTERED_SOUTHERN_SWAMP_POISONED", + ( 1 << 8) | 0x02: "WEEKEVENTREG_ENTERED_WOODFALL", + ( 1 << 8) | 0x04: "WEEKEVENTREG_ENTERED_DEKU_PALACE", + ( 1 << 8) | 0x08: "WEEKEVENTREG_ENTERED_GREAT_BAY_COAST", + ( 1 << 8) | 0x10: "WEEKEVENTREG_ENTERED_PIRATES_FORTRESS", + ( 1 << 8) | 0x20: "WEEKEVENTREG_ENTERED_ZORA_HALL", + ( 1 << 8) | 0x40: "WEEKEVENTREG_ENTERED_WATERFALL_RAPIDS", + ( 1 << 8) | 0x80: "WEEKEVENTREG_ENTERED_IKANA_CANYON", + ( 2 << 8) | 0x01: "WEEKEVENTREG_ENTERED_IKANA_CASTLE", + ( 2 << 8) | 0x02: "WEEKEVENTREG_ENTERED_STONE_TOWER", + ( 2 << 8) | 0x04: "WEEKEVENTREG_ENTERED_STONE_TOWER_INVERTED", + ( 2 << 8) | 0x08: "WEEKEVENTREG_ENTERED_EAST_CLOCK_TOWN", + ( 2 << 8) | 0x10: "WEEKEVENTREG_ENTERED_WEST_CLOCK_TOWN", + ( 2 << 8) | 0x20: "WEEKEVENTREG_ENTERED_NORTH_CLOCK_TOWN", + ( 2 << 8) | 0x40: "WEEKEVENTREG_ENTERED_WOODFALL_TEMPLE", + ( 2 << 8) | 0x80: "WEEKEVENTREG_ENTERED_SNOWHEAD_TEMPLE", + ( 3 << 8) | 0x01: "WEEKEVENTREG_ENTERED_PIRATES_FORTRESS_EXTERIOR", + ( 3 << 8) | 0x02: "WEEKEVENTREG_ENTERED_STONE_TOWER_TEMPLE", + ( 3 << 8) | 0x04: "WEEKEVENTREG_ENTERED_STONE_TOWER_TEMPLE_INVERTED", + ( 3 << 8) | 0x08: "WEEKEVENTREG_ENTERED_THE_MOON", + ( 3 << 8) | 0x10: "WEEKEVENTREG_ENTERED_MOON_DEKU_TRIAL", + ( 3 << 8) | 0x20: "WEEKEVENTREG_ENTERED_MOON_GORON_TRIAL", + ( 3 << 8) | 0x40: "WEEKEVENTREG_ENTERED_MOON_ZORA_TRIAL", ( 3 << 8) | 0x80: "WEEKEVENTREG_03_80", ( 4 << 8) | 0x01: "WEEKEVENTREG_04_01", ( 4 << 8) | 0x02: "WEEKEVENTREG_04_02", @@ -67,7 +67,7 @@ weekEventReg = { ( 7 << 8) | 0x10: "WEEKEVENTREG_07_10", ( 7 << 8) | 0x20: "WEEKEVENTREG_07_20", ( 7 << 8) | 0x40: "WEEKEVENTREG_07_40", - ( 7 << 8) | 0x80: "WEEKEVENTREG_07_80", + ( 7 << 8) | 0x80: "WEEKEVENTREG_ENTERED_WOODFALL_TEMPLE_PRISON", ( 8 << 8) | 0x01: "WEEKEVENTREG_08_01", ( 8 << 8) | 0x02: "WEEKEVENTREG_08_02", ( 8 << 8) | 0x04: "WEEKEVENTREG_08_04", From 8eb54f4b328dcdbf1d9b5517a7f958dcecc992d8 Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Fri, 24 Feb 2023 08:20:18 -0800 Subject: [PATCH 12/29] TransitionFade OK (#1160) * Match fade * Some adjustments from OoT PR * Missed 1 * iREG(50) * Fill * Sync * PR review --- assets/xml/objects/object_fbdemo_triforce.xml | 4 +- include/functions.h | 15 +- include/regs.h | 2 + include/variables.h | 1 - include/z64transition.h | 20 ++- spec | 1 - src/code/z_fbdemo_circle.c | 17 +- src/code/z_fbdemo_fade.c | 149 +++++++++++++++++- src/code/z_play.c | 3 +- src/code/z_skelanime.c | 1 + .../actors/ovl_Dm_Char01/z_dm_char01.c | 2 +- src/overlays/actors/ovl_En_Arrow/z_en_arrow.c | 2 +- src/overlays/actors/ovl_En_Wiz/z_en_wiz.c | 3 +- .../ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c | 2 +- .../ovl_fbdemo_triforce/z_fbdemo_triforce.c | 34 ++-- .../ovl_fbdemo_triforce/z_fbdemo_triforce.h | 10 +- .../fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c | 2 +- tools/disasm/variables.txt | 4 +- 18 files changed, 211 insertions(+), 61 deletions(-) diff --git a/assets/xml/objects/object_fbdemo_triforce.xml b/assets/xml/objects/object_fbdemo_triforce.xml index a00c9bf13e..ed23e36c38 100644 --- a/assets/xml/objects/object_fbdemo_triforce.xml +++ b/assets/xml/objects/object_fbdemo_triforce.xml @@ -1,7 +1,7 @@ - - + + diff --git a/include/functions.h b/include/functions.h index 110bb867a5..70114cb1f2 100644 --- a/include/functions.h +++ b/include/functions.h @@ -2273,15 +2273,14 @@ TransitionTile* TransitionTile_Init(TransitionTile* this, s32 cols, s32 rows); void TransitionTile_Draw(TransitionTile* this, Gfx** gfxP); void TransitionTile_Update(TransitionTile* this); -// void TransitionFade_Start(void); -void* TransitionFade_Init(TransitionFade* arg0); -void TransitionFade_Destroy(TransitionFade* arg0); -void TransitionFade_Update(TransitionFade* thisx, s32 updateRate); +void TransitionFade_Start(void* thisx); +void* TransitionFade_Init(void* thisx); +void TransitionFade_Destroy(void* thisx); +void TransitionFade_Update(void* thisx, s32 updateRate); void TransitionFade_Draw(void* thisx, Gfx** gfxP); -// void TransitionFade_IsDone(void); -void TransitionFade_SetColor(TransitionFade* arg0, u32 color); -void TransitionFade_SetType(TransitionFade* arg0, s32 arg1); -void TransitionFade_Start(TransitionFade* arg0); +s32 TransitionFade_IsDone(void* thisx); +void TransitionFade_SetColor(void* thisx, u32 color); +void TransitionFade_SetType(void* thisx, s32 type); void TransitionOverlay_ClearLoadInfo(TransitionOverlay *overlayEntry); void TransitionOverlay_SetSegment(TransitionOverlay *overlayEntry, void* vramStart, void* vramEnd, uintptr_t vromStart, uintptr_t vromEnd); void TransitionCircle_Start(void* thisx); diff --git a/include/regs.h b/include/regs.h index 9ea58aed14..9057078c33 100644 --- a/include/regs.h +++ b/include/regs.h @@ -122,6 +122,8 @@ #define R_REVERSE_FLOOR_INDEX XREG(94) #define R_MINIMAP_DISABLED XREG(95) +#define R_TRANS_FADE_FLASH_ALPHA_STEP iREG(50) // Set to a negative number to start the flash + #define R_B_LABEL_DD WREG(0) #define R_OW_MINIMAP_X WREG(29) #define R_OW_MINIMAP_Y WREG(30) diff --git a/include/variables.h b/include/variables.h index f12329143e..257fbfeb78 100644 --- a/include/variables.h +++ b/include/variables.h @@ -810,7 +810,6 @@ extern KaleidoMgrOverlay* gKaleidoMgrCurOvl; // extern UNK_TYPE4 D_801D0BB0; // extern UNK_TYPE1 D_801D0C80; // extern UNK_TYPE1 D_801D0CB0; -extern Gfx D_801D0D00[]; extern s32 gDbgCamEnabled; // extern UNK_TYPE1 D_801D0D54; // extern UNK_TYPE2 sQuakeIndex; diff --git a/include/z64transition.h b/include/z64transition.h index 943dad2057..741f344d72 100644 --- a/include/z64transition.h +++ b/include/z64transition.h @@ -65,14 +65,20 @@ typedef struct { /* 0x18 */ size_t size; } TransitionOverlay; -typedef struct { - /* 0x0 */ char unk_0[0xC]; -} TransitionFade; // size = 0xC - typedef enum { - /* 0 */ TRANSITION_CIRCLE_IN, - /* 1 */ TRANSITION_CIRCLE_OUT, -} TransitionCircleDirection; + /* 1 */ TRANS_INSTANCE_TYPE_FILL_OUT = 1, + /* 2 */ TRANS_INSTANCE_TYPE_FILL_IN, +} TransitionInstanceType; + +#define TRANS_INSTANCE_TYPE_FADE_FLASH 3 + +typedef struct { + /* 0x0 */ u8 type; + /* 0x1 */ u8 isDone; + /* 0x2 */ u8 direction; + /* 0x4 */ Color_RGBA8_u32 color; + /* 0x8 */ u16 timer; +} TransitionFade; // size = 0xC #define FBDEMO_CIRCLE_GET_MASK_TYPE(type) (type & 1) diff --git a/spec b/spec index 0a347c1a50..95a5df5f08 100644 --- a/spec +++ b/spec @@ -550,7 +550,6 @@ beginseg include "build/src/code/z_fbdemo_dlftbls.o" include "build/src/code/z_fbdemo.o" include "build/src/code/z_fbdemo_fade.o" - include "build/data/code/z_fbdemo_fade.data.o" include "build/src/code/z_fbdemo_circle.o" include "build/src/code/z_overlay.o" include "build/src/code/z_play.o" diff --git a/src/code/z_fbdemo_circle.c b/src/code/z_fbdemo_circle.c index 2a8144ea43..bc07df883d 100644 --- a/src/code/z_fbdemo_circle.c +++ b/src/code/z_fbdemo_circle.c @@ -1,6 +1,11 @@ #include "global.h" -Gfx D_801D0D00[] = { +typedef enum { + /* 0 */ TRANS_CIRCLE_DIR_IN, + /* 1 */ TRANS_CIRCLE_DIR_OUT, +} TransitionCircleDirection; + +Gfx sTransCircleSetupDL[] = { gsDPPipeSync(), gsDPSetOtherMode(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, @@ -23,7 +28,7 @@ void TransitionCircle_Start(void* thisx) { TransitionCircle* this = (TransitionCircle*)thisx; this->stepValue = 0.1f; - if (this->direction == TRANSITION_CIRCLE_IN) { + if (this->direction == TRANS_CIRCLE_DIR_IN) { this->targetRadius = 0.0f; this->startingRadius = 1.0f; } else { @@ -67,10 +72,10 @@ void TransitionCircle_SetType(void* thisx, s32 type) { if (type & TC_SET_PARAMS) { this->maskType = FBDEMO_CIRCLE_GET_MASK_TYPE(type); - } else if (type == 1) { - this->direction = TRANSITION_CIRCLE_OUT; + } else if (type == TRANS_INSTANCE_TYPE_FILL_OUT) { + this->direction = TRANS_CIRCLE_DIR_OUT; } else { - this->direction = TRANSITION_CIRCLE_IN; + this->direction = TRANS_CIRCLE_DIR_IN; } } @@ -121,7 +126,7 @@ void TransitionCircle_Draw(void* thisx, Gfx** gfxp) { TransitionCircle* this = (TransitionCircle*)thisx; gDPPipeSync(gfx++); - gSPDisplayList(gfx++, &D_801D0D00); + gSPDisplayList(gfx++, sTransCircleSetupDL); gDPSetPrimColor(gfx++, 0, this->color.a, this->color.r, this->color.g, this->color.b, 1); if (this->maskType == 0) { gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIM_LOD_FRAC, PRIMITIVE, 0, 0, 0, PRIMITIVE, TEXEL0, 0, diff --git a/src/code/z_fbdemo_fade.c b/src/code/z_fbdemo_fade.c index a0d9f1eaef..a9ab37d488 100644 --- a/src/code/z_fbdemo_fade.c +++ b/src/code/z_fbdemo_fade.c @@ -1,17 +1,150 @@ #include "global.h" -#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_fade/TransitionFade_Start.s") +#define THIS ((TransitionFade*)thisx) -#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_fade/TransitionFade_Init.s") +typedef enum { + /* 0 */ TRANS_FADE_DIR_IN, + /* 1 */ TRANS_FADE_DIR_OUT +} TransitionFadeDirection; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_fade/TransitionFade_Destroy.s") +typedef enum { + /* 0 */ TRANS_FADE_TYPE_NONE, + /* 1 */ TRANS_FADE_TYPE_ONE_WAY, + /* 2 */ TRANS_FADE_TYPE_FLASH +} TransitionFadeType; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_fade/TransitionFade_Update.s") +static Gfx sTransFadeSetupDL[] = { + gsDPPipeSync(), + gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | + G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH), + gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_BAYER | 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_1PRIMITIVE, + G_AC_NONE | G_ZS_PIXEL | G_RM_CLD_SURF | G_RM_CLD_SURF2), + gsDPSetCombineLERP(0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE), + gsSPEndDisplayList(), +}; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_fade/TransitionFade_Draw.s") +TransitionInit TransitionFade_InitVars = { + TransitionFade_Init, TransitionFade_Destroy, TransitionFade_Update, TransitionFade_Draw, + TransitionFade_Start, TransitionFade_SetType, TransitionFade_SetColor, NULL, + TransitionFade_IsDone, +}; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_fade/TransitionFade_IsDone.s") +void TransitionFade_Start(void* thisx) { + TransitionFade* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_fade/TransitionFade_SetColor.s") + switch (this->type) { + case TRANS_FADE_TYPE_NONE: + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo_fade/TransitionFade_SetType.s") + case TRANS_FADE_TYPE_ONE_WAY: + this->timer = 0; + this->color.a = (this->direction != TRANS_FADE_DIR_IN) ? 255 : 0; + break; + + case TRANS_FADE_TYPE_FLASH: + this->color.a = 0; + break; + + default: + break; + } + this->isDone = false; +} + +void* TransitionFade_Init(void* thisx) { + TransitionFade* this = THIS; + + bzero(this, sizeof(TransitionFade)); + return this; +} + +void TransitionFade_Destroy(void* thisx) { +} + +void TransitionFade_Update(void* thisx, s32 updateRate) { + s32 alpha; + s16 newAlpha; + TransitionFade* this = THIS; + + switch (this->type) { + case TRANS_FADE_TYPE_NONE: + break; + + case TRANS_FADE_TYPE_ONE_WAY: + //! FAKE: + THIS->timer += updateRate; + + if (this->timer >= ((void)0, gSaveContext.transFadeDuration)) { + this->timer = ((void)0, gSaveContext.transFadeDuration); + this->isDone = true; + } + + alpha = (255.0f * this->timer) / ((void)0, gSaveContext.transFadeDuration); + this->color.a = (this->direction != TRANS_FADE_DIR_IN) ? 255 - alpha : alpha; + break; + + case TRANS_FADE_TYPE_FLASH: + newAlpha = this->color.a; + if (R_TRANS_FADE_FLASH_ALPHA_STEP != 0) { + if (R_TRANS_FADE_FLASH_ALPHA_STEP < 0) { + if (Math_StepToS(&newAlpha, 255, 255)) { + R_TRANS_FADE_FLASH_ALPHA_STEP = 150; + } + } else { + Math_StepToS(&R_TRANS_FADE_FLASH_ALPHA_STEP, 20, 60); + if (Math_StepToS(&newAlpha, 0, R_TRANS_FADE_FLASH_ALPHA_STEP)) { + R_TRANS_FADE_FLASH_ALPHA_STEP = 0; + this->isDone = true; + } + } + } + this->color.a = newAlpha; + break; + + default: + break; + } +} + +void TransitionFade_Draw(void* thisx, Gfx** gfxP) { + TransitionFade* this = THIS; + Gfx* gfx; + Color_RGBA8_u32* color = &this->color; + + if (color->a != 0) { + gfx = *gfxP; + gSPDisplayList(gfx++, sTransFadeSetupDL); + gDPSetPrimColor(gfx++, 0, 0, color->r, color->g, color->b, color->a); + gSPDisplayList(gfx++, D_0E000000.fillRect); + *gfxP = gfx; + } +} + +s32 TransitionFade_IsDone(void* thisx) { + TransitionFade* this = THIS; + + return this->isDone; +} + +void TransitionFade_SetColor(void* thisx, u32 color) { + TransitionFade* this = THIS; + + this->color.rgba = color; +} + +void TransitionFade_SetType(void* thisx, s32 type) { + TransitionFade* this = THIS; + + if (type == TRANS_INSTANCE_TYPE_FILL_OUT) { + this->type = TRANS_FADE_TYPE_ONE_WAY; + this->direction = TRANS_FADE_DIR_OUT; + } else if (type == TRANS_INSTANCE_TYPE_FILL_IN) { + this->type = TRANS_FADE_TYPE_ONE_WAY; + this->direction = TRANS_FADE_DIR_IN; + } else if (type == TRANS_INSTANCE_TYPE_FADE_FLASH) { + this->type = TRANS_FADE_TYPE_FLASH; + } else { + this->type = TRANS_FADE_TYPE_NONE; + } +} diff --git a/src/code/z_play.c b/src/code/z_play.c index c6c3cc2735..f7e3dc5214 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -668,7 +668,8 @@ void Play_UpdateTransition(PlayState* this) { } this->transitionCtx.setType(&this->transitionCtx.instanceData, - (this->transitionTrigger == TRANS_TRIGGER_END) ? 1 : 2); + (this->transitionTrigger == TRANS_TRIGGER_END) ? TRANS_INSTANCE_TYPE_FILL_OUT + : TRANS_INSTANCE_TYPE_FILL_IN); this->transitionCtx.start(&this->transitionCtx.instanceData); if (this->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_CS_DELAYED) { diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index 318f498091..13ce84ec4f 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" #define ANIM_INTERP 1 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 069d829c1e..7e13a8e7ff 100644 --- a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c +++ b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c @@ -3,7 +3,7 @@ * Overlay: ovl_Dm_Char01 * Description: Woodfall scene objects (temple, water, walls, etc) */ - +#include "prevent_bss_reordering.h" #include "z_dm_char01.h" #include "objects/object_mtoride/object_mtoride.h" #include "overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.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 e203da9f03..d41da13260 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -373,7 +373,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) { } if (this->actor.params == ENARROW_8) { - iREG(50) = -1; + R_TRANS_FADE_FLASH_ALPHA_STEP = -1; Actor_Spawn(&play->actorCtx, play, ACTOR_EN_M_FIRE1, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, this->actor.speedXZ == 0.0f); sp82 = NA_SE_IT_DEKU; 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 ee2f3d158a..353fe01ab0 100644 --- a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c +++ b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c @@ -1261,7 +1261,8 @@ void EnWiz_UpdateDamage(EnWiz* this, PlayState* play) { // If the player throws a Deku Nut or hits a ghost's collider (something that is impossible // in the final game, since EnWiz_Init effectively disables them), then the below code will // "destroy" the ghost by turning into a cloud of smoke. - if ((iREG(50) != 0) || (this->ghostColliders.elements[i + 1].info.bumperFlags & BUMP_HIT)) { + if ((R_TRANS_FADE_FLASH_ALPHA_STEP != 0) || + (this->ghostColliders.elements[i + 1].info.bumperFlags & BUMP_HIT)) { //! @bug: If a single ghost is destroyed, then changing the fight state here will cause //! strange behavior; the ghosts will stand still and pretend to attack the player like //! the real Wizrobe. Since Deku Nuts destroy all ghosts at once, and since the ghost diff --git a/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c b/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c index ad61166d36..c64ad38c6b 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c +++ b/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.c @@ -77,6 +77,6 @@ void EffectSsStone1_Draw(PlayState* play, u32 index, EffectSs* this) { void EffectSsStone1_Update(PlayState* play, u32 index, EffectSs* this) { if ((this->life == 6) && (this->rReg0 != 0)) { - iREG(50) = 0; + R_TRANS_FADE_FLASH_ALPHA_STEP = 0; } } diff --git a/src/overlays/fbdemos/ovl_fbdemo_triforce/z_fbdemo_triforce.c b/src/overlays/fbdemos/ovl_fbdemo_triforce/z_fbdemo_triforce.c index f4f68d2302..c4eb826c70 100644 --- a/src/overlays/fbdemos/ovl_fbdemo_triforce/z_fbdemo_triforce.c +++ b/src/overlays/fbdemos/ovl_fbdemo_triforce/z_fbdemo_triforce.c @@ -31,8 +31,11 @@ void TransitionTriforce_Start(void* thisx) { case STATE_SPIRAL_IN_FAST: this->transPos = 1.0f; return; + + default: + this->transPos = 0.03f; + return; } - this->transPos = 0.03f; } void* TransitionTriforce_Init(void* thisx) { @@ -44,7 +47,7 @@ void* TransitionTriforce_Init(void* thisx) { this->transPos = 1.0f; this->state = STATE_SPIRAL_IN_FAST; this->step = 0.015f; - this->fadeType = TYPE_TRANSPARENT_TRIFORCE; + this->type = TRANS_INSTANCE_TYPE_FILL_OUT; return this; } @@ -77,7 +80,7 @@ void TransitionTriforce_SetColor(void* thisx, u32 color) { void TransitionTriforce_SetType(void* thisx, s32 type) { TransitionTriforce* this = (TransitionTriforce*)thisx; - this->fadeType = type; + this->type = type; } void TransitionTriforce_SetState(void* thisx, s32 state) { @@ -99,37 +102,43 @@ void TransitionTriforce_Draw(void* thisx, Gfx** gfxP) { guRotate(&modelView[1], rotation, 0.0f, 0.0f, 1.0f); guTranslate(&modelView[2], 0.0f, 0.0f, 0.0f); gDPPipeSync(gfx++); - gSPDisplayList(gfx++, sTriforceWipeDL); + gSPDisplayList(gfx++, sTransTriforceDL); gDPSetColor(gfx++, G_SETPRIMCOLOR, this->color.rgba); gDPSetCombineMode(gfx++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); gSPMatrix(gfx++, &this->projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gfx++, &modelView[0], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gfx++, &modelView[1], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gfx++, &modelView[2], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); - gSPVertex(gfx++, &sTriforceWipeVtx, ARRAY_COUNT(sTriforceWipeVtx), 0); + gSPVertex(gfx++, &sTransTriforceVtx, ARRAY_COUNT(sTransTriforceVtx), 0); if (!TransitionTriforce_IsDone(this)) { - switch (this->fadeType) { - case TYPE_TRANSPARENT_TRIFORCE: + switch (this->type) { + case TRANS_INSTANCE_TYPE_FILL_OUT: gSP2Triangles(gfx++, 0, 4, 5, 0, 4, 1, 3, 0); gSP1Triangle(gfx++, 5, 3, 2, 0); break; - case TYPE_FILLED_TRIFORCE: + case TRANS_INSTANCE_TYPE_FILL_IN: gSP2Triangles(gfx++, 3, 4, 5, 0, 0, 2, 6, 0); gSP2Triangles(gfx++, 0, 6, 7, 0, 1, 0, 7, 0); gSP2Triangles(gfx++, 1, 7, 8, 0, 1, 8, 9, 0); gSP2Triangles(gfx++, 1, 9, 2, 0, 2, 9, 6, 0); break; + + default: + break; } } else { - switch (this->fadeType) { - case TYPE_TRANSPARENT_TRIFORCE: + switch (this->type) { + case TRANS_INSTANCE_TYPE_FILL_OUT: break; - case TYPE_FILLED_TRIFORCE: + case TRANS_INSTANCE_TYPE_FILL_IN: gSP1Quadrangle(gfx++, 6, 7, 8, 9, 0); break; + + default: + break; } } gDPPipeSync(gfx++); @@ -143,6 +152,7 @@ s32 TransitionTriforce_IsDone(void* thisx) { return this->transPos <= 0.03f; } else if ((this->state == STATE_SPIRAL_OUT_SLOW) || (this->state == STATE_SPIRAL_OUT_FAST)) { return (this->transPos >= 1.0f); + } else { + return false; } - return false; } diff --git a/src/overlays/fbdemos/ovl_fbdemo_triforce/z_fbdemo_triforce.h b/src/overlays/fbdemos/ovl_fbdemo_triforce/z_fbdemo_triforce.h index cd7f4563e1..1bcfe5c3da 100644 --- a/src/overlays/fbdemos/ovl_fbdemo_triforce/z_fbdemo_triforce.h +++ b/src/overlays/fbdemos/ovl_fbdemo_triforce/z_fbdemo_triforce.h @@ -10,20 +10,14 @@ typedef enum { /* 2 */ STATE_SPIRAL_IN_FAST, /* 3 */ STATE_SPIRAL_OUT_SLOW, /* 4 */ STATE_SPIRAL_OUT_FAST -} FbTriforceState; - -typedef enum { - /* 0 */ TYPE_NONE, - /* 1 */ TYPE_TRANSPARENT_TRIFORCE, - /* 2 */ TYPE_FILLED_TRIFORCE -} TriforceFadeType; +} TransitionTriforceState; typedef struct { /* 0x000 */ Color_RGBA8_u32 color; /* 0x004 */ f32 transPos; /* 0x008 */ f32 step; /* 0x00C */ s32 state; - /* 0x010 */ s32 fadeType; + /* 0x010 */ s32 type; /* 0x018 */ Mtx projection; /* 0x058 */ s32 frame; /* 0x060 */ Mtx modelView[2][3]; 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 0c20dba93a..48c8bdf588 100644 --- a/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c +++ b/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c @@ -127,7 +127,7 @@ void TransitionWipe5_SetType(void* thisx, s32 type) { if (type & 0x80) { this->unk_11 = 0; this->unk_12 = type & 1; - } else if (type == 1) { + } else if (type == TRANS_INSTANCE_TYPE_FILL_OUT) { this->unk_10 = 1; } else { this->unk_10 = 0; diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 55f4ad5101..fb37d36c3a 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -12924,8 +12924,8 @@ 0x80AC4F60:("D_80AC4F60","f32","",0x4), 0x80AC4F64:("D_80AC4F64","f32","",0x4), 0x80AC5060:("D_80AC5060","UNK_TYPE1","",0x1), - 0x80AC5630:("sTriforceWipeDL","UNK_TYPE1","",0x1), - 0x80AC5660:("sTriforceWipeVtx","UNK_TYPE1","",0x1), + 0x80AC5630:("sTransTriforceDL","UNK_TYPE1","",0x1), + 0x80AC5660:("sTransTriforceVtx","UNK_TYPE1","",0x1), 0x80AC5700:("TransitionTriforce_InitVars","UNK_PTR","",0x4), 0x80AC5730:("D_80AC5730","f32","",0x4), 0x80AC5734:("D_80AC5734","f32","",0x4), From 2080f9906f083a4138d68caa027e4ed56953a169 Mon Sep 17 00:00:00 2001 From: louist103 <35883445+louist103@users.noreply.github.com> Date: Fri, 24 Feb 2023 11:42:59 -0500 Subject: [PATCH 13/29] EnStopHeishi OK (#1156) * merge data * its broken * func_80AE7718 * IDK for now * OK * cleanups * format * PR fixes * Delete BuildInfo.h * PR fixes * PR fixes * PR fixes * Update z_en_stop_heishi.c --- spec | 3 +- .../ovl_En_Stop_heishi/z_en_stop_heishi.c | 553 +++++++++++++++++- .../ovl_En_Stop_heishi/z_en_stop_heishi.h | 34 +- tools/disasm/functions.txt | 8 +- tools/disasm/variables.txt | 4 +- undefined_syms.txt | 5 - 6 files changed, 569 insertions(+), 38 deletions(-) diff --git a/spec b/spec index 95a5df5f08..df74629c33 100644 --- a/spec +++ b/spec @@ -3427,8 +3427,7 @@ beginseg name "ovl_En_Stop_heishi" compress include "build/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.o" - include "build/data/ovl_En_Stop_heishi/ovl_En_Stop_heishi.data.o" - include "build/data/ovl_En_Stop_heishi/ovl_En_Stop_heishi.reloc.o" + include "build/src/overlays/actors/ovl_En_Stop_heishi/ovl_En_Stop_heishi_reloc.o" endseg beginseg 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 c4d56b70ad..6d214b4fd5 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 @@ -18,8 +18,22 @@ void EnStopheishi_Draw(Actor* thisx, PlayState* play); void func_80AE7F34(EnStopheishi* this, PlayState* play); void func_80AE85C4(EnStopheishi* this, PlayState* play); +void func_80AE7E9C(EnStopheishi* this); +void func_80AE854C(EnStopheishi* this, PlayState* play); +void func_80AE795C(EnStopheishi* this, PlayState* play); + +typedef enum { + /* 0 */ SOLDIER_ANIM_LOOK_DOWN, + /* 1 */ SOLDIER_ANIM_COME_UP_HERE, + /* 2 */ SOLDIER_ANIM_STAND_HAND_ON_HIP, + /* 3 */ SOLDIER_ANIM_STAND_LOOK_DOWN, + /* 4 */ SOLDIER_ANIM_4, + /* 5 */ SOLDIER_ANIM_5, + /* 6 */ SOLDIER_ANIM_6, + /* 7 */ SOLDIER_ANIM_STAND_HAND_ON_CHEST, + /* 8 */ SOLDIER_ANIM_MAX, +} SoldierAnimation; -#if 0 ActorInit En_Stop_heishi_InitVars = { ACTOR_EN_STOP_HEISHI, ACTORCAT_NPC, @@ -32,45 +46,538 @@ ActorInit En_Stop_heishi_InitVars = { (ActorFunc)EnStopheishi_Draw, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80AE88B0 = { - { COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, }, +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 50, 260, 0, { 0, 0, 0 } }, }; -#endif +static u16 sLeaveMessages[] = { + 0x0516, 0x0517, 0x051A, 0x0000, 0x051C, 0x0000, 0x051E, 0x0000, 0x0520, 0x0521, 0x0524, 0x0000, 0x0526, 0x0000, + 0x0528, 0x0000, 0x052A, 0x052B, 0x052E, 0x0000, 0x0530, 0x0000, 0x0532, 0x0000, 0x0534, 0x0535, 0x0538, 0x0000, + 0x053A, 0x0000, 0x053C, 0x0000, 0x0518, 0x0519, 0x051B, 0x0000, 0x051D, 0x0000, 0x051F, 0x0000, 0x0522, 0x0523, + 0x0525, 0x0000, 0x0527, 0x0000, 0x0529, 0x0000, 0x052C, 0x052D, 0x052F, 0x0000, 0x0531, 0x0000, 0x0533, 0x0000, + 0x0536, 0x0537, 0x0539, 0x0000, 0x053B, 0x0000, 0x053D, 0x0000, 0x0514, 0x0000, 0x0560, 0x0000, 0x0562, 0x0000, + 0x0564, 0x0000, 0x0515, 0x0000, 0x0561, 0x0000, 0x0563, 0x0000, 0x0565, 0x0000, +}; -extern ColliderCylinderInit D_80AE88B0; +static u16 sThirdDayLeaveMessages[] = { + 0x0540, 0x0541, 0x0542, 0x0000, 0x0543, 0x0000, 0x0543, 0x0000, 0x0547, 0x0548, 0x0549, 0x0000, 0x054A, 0x0000, + 0x054B, 0x0000, 0x054F, 0x0550, 0x0551, 0x0000, 0x0552, 0x0000, 0x0553, 0x0000, 0x0557, 0x0558, 0x0559, 0x0000, + 0x055A, 0x0000, 0x055A, 0x0000, 0x0544, 0x0545, 0x0546, 0x0000, 0x0546, 0x0000, 0x0546, 0x0000, 0x054C, 0x054D, + 0x054E, 0x0000, 0x054E, 0x0000, 0x054E, 0x0000, 0x0554, 0x0555, 0x0556, 0x0000, 0x0556, 0x0000, 0x0556, 0x0000, + 0x055B, 0x055C, 0x055D, 0x0000, 0x055D, 0x0000, 0x055D, 0x0000, 0x053E, 0x0000, 0x053E, 0x0000, 0x053E, 0x0000, + 0x053E, 0x0000, 0x053F, 0x0000, 0x053F, 0x0000, 0x053F, 0x0000, 0x053F, 0x0000, +}; -extern UNK_TYPE D_06006C18; +static AnimationHeader* sAnimations[SOLDIER_ANIM_MAX] = { + &gSoldierLookDown, // SOLDIER_ANIM_LOOK_DOWN + &gSoldierComeUpHere, // SOLDIER_ANIM_COME_UP_HERE + &gSoldierStandHandOnHip, // SOLDIER_ANIM_STAND_HAND_ON_HIP + &gSoldierStandAndLookDown, // SOLDIER_ANIM_STAND_LOOK_DOWN + &object_sdn_Anim_0057BC, // SOLDIER_ANIM_4 + &object_sdn_Anim_005D28, // SOLDIER_ANIM_5 + &object_sdn_Anim_0064C0, // SOLDIER_ANIM_6 + &gSoldierStandWithHandOnChest, // SOLDIER_ANIM_STAND_HAND_ON_CHEST +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Stop_heishi/EnStopheishi_Init.s") +void EnStopheishi_Init(Actor* thisx, PlayState* play) { + EnStopheishi* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Stop_heishi/EnStopheishi_Destroy.s") + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); + SkelAnime_InitFlex(play, &this->skelAnime, &gSoldierSkel, &gSoldierStandHandOnHip, this->jointTable, + this->morphTable, SOLDIER_LIMB_MAX); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Stop_heishi/func_80AE750C.s") + this->actor.colChkInfo.mass = MASS_IMMOVABLE; + this->unk_276 = ENSTOPHEISHI_GET_F000(&this->actor); + this->switchFlag = ENSTOPHEISHI_GET_SWITCH_FLAG(&this->actor); + this->unk_288 = (this->actor.world.rot.z * 40.0f) + 50.0f; + this->actor.world.rot.z = 0; + if (this->switchFlag == 0x7F) { + this->switchFlag = -1; + } + if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + Actor_Kill(&this->actor); + return; + } + this->actor.targetMode = 0; + this->actor.gravity = -3.0f; + Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); + this->rotYTarget = this->actor.world.rot.y; + this->headTurnTimer2 = 6; + func_80AE7E9C(this); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Stop_heishi/func_80AE75C8.s") +void EnStopheishi_Destroy(Actor* thisx, PlayState* play) { + EnStopheishi* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Stop_heishi/func_80AE7718.s") + Collider_DestroyCylinder(play, &this->collider); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Stop_heishi/func_80AE77D4.s") +void EnStopHeishi_ChangeAnim(EnStopheishi* this, s32 animIndex) { + s32 mode; + f32 morphFrames; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Stop_heishi/func_80AE795C.s") + this->currentAnim = animIndex; + this->currentAnimFrameCount = Animation_GetLastFrame(sAnimations[animIndex]); + mode = ANIMMODE_ONCE; + morphFrames = -10.0f; + if ((animIndex >= SOLDIER_ANIM_STAND_HAND_ON_HIP) && (animIndex != SOLDIER_ANIM_4)) { + mode = ANIMMODE_LOOP; + } + if (animIndex == SOLDIER_ANIM_5) { + morphFrames = 0.0f; + } + Animation_Change(&this->skelAnime, sAnimations[animIndex], 1.0f, 0.0f, this->currentAnimFrameCount, mode, + morphFrames); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Stop_heishi/func_80AE7E9C.s") +void EnStopheishi_UpdateHeadNormal(EnStopheishi* this, PlayState* play) { + s32 yawDiff; + Player* player; + Vec3f playerPos; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Stop_heishi/func_80AE7F34.s") + yawDiff = ABS_ALT(BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.world.rot.y)); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Stop_heishi/func_80AE854C.s") + this->headRotXTarget = 0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Stop_heishi/func_80AE85C4.s") + if (this->actor.xzDistToPlayer < 200.0f) { + player = GET_PLAYER(play); + if (yawDiff < 0x4E20) { + this->headRotXTarget = this->actor.yawTowardsPlayer - this->actor.world.rot.y; + if (this->headRotXTarget > 0x2710) { + this->headRotXTarget = 0x2710; + } else if (this->headRotXTarget < -0x2710) { + this->headRotXTarget = -0x2710; + } + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Stop_heishi/EnStopheishi_Update.s") + Math_Vec3f_Copy(&playerPos, &player->actor.world.pos); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Stop_heishi/func_80AE87A4.s") + if ((player->transformation == PLAYER_FORM_DEKU) || (player->transformation == PLAYER_FORM_HUMAN)) { + playerPos.y += 57.0f + BREG(34); + } else { + playerPos.y += 70.0f + BREG(35); + } + this->pitchToPlayer = Math_Vec3f_Pitch(&this->actor.focus.pos, &playerPos); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Stop_heishi/func_80AE87EC.s") +void EnStopHeishi_UpdateHeadThirdDay(EnStopheishi* this) { + if (this->headTurnTimer1 != 0) { + this->headTurnTimer1--; + } + this->pitchToPlayer = -0xBB8; + this->headRotXTarget = 0; + if (this->headTurnTimer2 < 6) { + this->headRotXTarget = 0x1770; + if (((u32)this->headTurnTimer2 % 8) == 0) { + this->headRotXTarget = -0x1770; + } + if (this->headTurnTimer1 == 0) { + this->headTurnTimer2++; + this->headTurnTimer1 = 10; + if (this->headTurnTimer2 >= 6) { + this->headTurnTimer1 = 50; + } + } + } else if ((this->headTurnTimer1 == 0) && (Quake_NumActiveQuakes() != 0) && (this->headTurnTimer2 >= 6)) { + this->headTurnTimer2 = 0; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Stop_heishi/EnStopheishi_Draw.s") +void func_80AE77D4(EnStopheishi* this) { + this->unk_274 = 0; + this->maxMoveStep = 0.0f; + this->rotYTarget = this->actor.home.rot.y; + if (this->timer == 1) { + this->pitchToPlayer = 0; + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_5); + } + if ((this->timer == 0) && (this->unk_264 == 0)) { + if ((fabsf(this->actor.world.pos.x - this->actor.home.pos.x) > 3.0f) || + (fabsf(this->actor.world.pos.z - this->actor.home.pos.z) > 3.0f)) { + this->skelAnime.playSpeed = 3.0f; + Math_ApproachF(&this->actor.world.pos.x, this->actor.home.pos.x, 0.3f, 5.0f); + Math_ApproachF(&this->actor.world.pos.z, this->actor.home.pos.z, 0.3f, 5.0f); + } else { + this->unk_264 = 1; + } + } + if ((this->currentAnim != SOLDIER_ANIM_STAND_HAND_ON_HIP) && (this->currentAnim != SOLDIER_ANIM_STAND_LOOK_DOWN) && + (this->currentAnim != SOLDIER_ANIM_STAND_HAND_ON_CHEST) && (this->unk_264 != 0)) { + this->skelAnime.playSpeed = 1.0f; + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_STAND_HAND_ON_HIP); + if ((gSaveContext.save.day != 3) && gSaveContext.save.isNight) { + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_STAND_LOOK_DOWN); + } + if (gSaveContext.save.day == 3) { + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_STAND_HAND_ON_CHEST); + } + } +} + +void func_80AE795C(EnStopheishi* this, PlayState* play) { + Player* player = GET_PLAYER(play); + f32 curFrame = this->skelAnime.curFrame; + Vec3f newPos; + f32 xDiff; + f32 zDiff; + f32 playSpeed; + s16 yaw; + s16 rotY; + + if (ABS_ALT(BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.home.rot.y)) < 0x2000) { + this->rotYTarget = this->actor.yawTowardsPlayer; + } + playSpeed = + fabsf((f32)this->actor.yawTowardsPlayer - Math_Vec3f_Yaw(&this->actor.home.pos, &player->actor.world.pos)) * + 0.01f * 5.0f; + if (this->unk_274 != 4) { + this->skelAnime.playSpeed = CLAMP(playSpeed, 1.0f, 5.0f); + } + yaw = Math_Vec3f_Yaw(&this->actor.home.pos, &player->actor.world.pos); + xDiff = fabsf(this->actor.home.pos.x - player->actor.world.pos.x); + zDiff = fabsf(this->actor.home.pos.z - player->actor.world.pos.z); + Math_Vec3f_Copy(&newPos, &this->actor.home.pos); + rotY = this->actor.home.rot.y; + + if (rotY == -0x8000) { + if (yaw > 0) { + xDiff = Math_SinS(this->actor.home.rot.y + 0xC000) * xDiff; + zDiff = Math_CosS(this->actor.home.rot.y + 0xC000) * zDiff; + } else { + xDiff = Math_SinS(this->actor.home.rot.y + 0x4000) * xDiff; + zDiff = Math_CosS(this->actor.home.rot.y + 0x4000) * zDiff; + } + } else if (yaw < rotY) { + xDiff = Math_SinS(this->actor.home.rot.y + 0xC000) * xDiff; + zDiff = Math_CosS(this->actor.home.rot.y + 0xC000) * zDiff; + } else { + xDiff = Math_SinS(this->actor.home.rot.y + 0x4000) * xDiff; + zDiff = Math_CosS(this->actor.home.rot.y + 0x4000) * zDiff; + } + + if (this->unk_288 < xDiff) { + xDiff = this->unk_288; + } else if (xDiff < -this->unk_288) { + xDiff = -this->unk_288; + } + if (this->unk_288 < zDiff) { + zDiff = this->unk_288; + } else if (zDiff < -this->unk_288) { + zDiff = -this->unk_288; + } + newPos.x += xDiff; + newPos.z += zDiff; + Math_ApproachF(&this->actor.world.pos.x, newPos.x, 0.5f, this->maxMoveStep); + Math_ApproachF(&this->actor.world.pos.z, newPos.z, 0.5f, this->maxMoveStep); + Math_ApproachF(&this->maxMoveStep, 50.0f, 0.3f, 1.0f); + + switch (this->unk_274) { + case 0: + if (gSaveContext.save.day != 3) { + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_4); + this->unk_274 = 2; + } else { + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_STAND_HAND_ON_HIP); + this->unk_274 = 1; + } + break; + + case 1: + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_4); + this->unk_274 = 2; + break; + + case 2: + if (this->currentAnimFrameCount <= curFrame) { + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_5); + this->unk_274 = 3; + } + break; + + case 3: + if ((fabsf(this->actor.world.pos.x - newPos.x) < 2.0f) && + (fabsf(this->actor.world.pos.z - newPos.z) < 2.0f)) { + this->skelAnime.playSpeed = 1.0f; + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_6); + this->unk_274 = 4; + } + break; + + case 4: + if ((fabsf(this->actor.world.pos.x - newPos.x) > 4.0f) || + (fabsf(this->actor.world.pos.z - newPos.z) > 4.0f)) { + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_5); + this->unk_274 = 3; + } + break; + } + this->unk_264 = 0; + this->timer = 20; + this->pitchToPlayer = 0; + if (this->unk_276 == 3) { + Math_Vec3f_Copy(&newPos, &player->actor.world.pos); + if ((player->transformation == PLAYER_FORM_DEKU) || (player->transformation == PLAYER_FORM_HUMAN)) { + newPos.y += 77.0f + BREG(37); + this->pitchToPlayer = Math_Vec3f_Pitch(&this->actor.focus.pos, &newPos); + } + } +} + +void func_80AE7E9C(EnStopheishi* this) { + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_STAND_HAND_ON_HIP); + if ((gSaveContext.save.day != 3) && gSaveContext.save.isNight) { + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_STAND_LOOK_DOWN); + } + if (gSaveContext.save.day == 3) { + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_STAND_HAND_ON_CHEST); + } + this->unk_274 = 0; + this->disableCollider = false; + this->actionFunc = func_80AE7F34; + this->actor.speedXZ = 0.0f; +} + +void func_80AE7F34(EnStopheishi* this, PlayState* play) { + Player* player = GET_PLAYER(play); + s16 sp32; + s16 phi_a2; + s32 yawDiffAbs; + s16 yawDiff; + f32 xDiff; + f32 zDiff; + + SkelAnime_Update(&this->skelAnime); + if ((this->currentAnim == SOLDIER_ANIM_5) && (((s16)this->skelAnime.curFrame % 2) != 0)) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SOLDIER_WALK); + } + if (gSaveContext.save.day != 3) { + EnStopheishi_UpdateHeadNormal(this, play); + } else { + EnStopHeishi_UpdateHeadThirdDay(this); + } + Math_SmoothStepToS(&this->actor.world.rot.y, this->rotYTarget, 1, 0x1388, 0); + + sp32 = 0; + if (gSaveContext.save.isNight) { + sp32 = 0x20; + } + + phi_a2 = 0; + switch (player->transformation) { + case PLAYER_FORM_HUMAN: + if ((STOLEN_ITEM_1 == SLOT_SWORD_GREAT_FAIRY) || (STOLEN_ITEM_1 == ITEM_SWORD_KOKIRI) || + (STOLEN_ITEM_1 == ITEM_SWORD_RAZOR) || (STOLEN_ITEM_1 == ITEM_SWORD_GILDED) || + (STOLEN_ITEM_2 == SLOT_SWORD_GREAT_FAIRY) || (STOLEN_ITEM_2 == ITEM_SWORD_KOKIRI) || + (STOLEN_ITEM_2 == ITEM_SWORD_RAZOR) || (STOLEN_ITEM_2 == ITEM_SWORD_GILDED)) { + if (this->unk_265 != 0) { + phi_a2 = 1; + } + } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_12_20)) { + phi_a2 = 1; + } + break; + + case PLAYER_FORM_DEKU: + phi_a2 = 4; + break; + + case PLAYER_FORM_ZORA: + phi_a2 = 3; + break; + + case PLAYER_FORM_GORON: + phi_a2 = 2; + break; + } + + if (((phi_a2 == 1) || (phi_a2 == 2) || (phi_a2 == 3)) && + (((this->currentAnim == SOLDIER_ANIM_4)) || (this->currentAnim == SOLDIER_ANIM_5) || + (this->currentAnim == SOLDIER_ANIM_6))) { + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_STAND_HAND_ON_HIP); + if ((gSaveContext.save.day != 3) && gSaveContext.save.isNight) { + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_STAND_LOOK_DOWN); + } + if (gSaveContext.save.day == 3) { + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_STAND_HAND_ON_CHEST); + } + } + + if ((phi_a2 == 0) || (phi_a2 == 4)) { + xDiff = this->actor.home.pos.x - player->actor.world.pos.x; + zDiff = this->actor.home.pos.z - player->actor.world.pos.z; + this->collider.dim.radius = 50; + this->collider.dim.height = 260; + if (sqrtf(SQ(xDiff) + SQ(zDiff)) < 240.0f) { + func_80AE795C(this, play); + } else { + func_80AE77D4(this); + } + } else { + this->collider.dim.radius = 15; + this->collider.dim.height = 60; + } + if (phi_a2 != 4) { + this->messageIndex = this->unk_276 * 8; + this->messageIndex += sp32; + this->messageIndex += phi_a2 * 2; + } else { + this->messageIndex = 64; + if (sp32 != 0) { + this->messageIndex = 72; + } + this->messageIndex += this->unk_276 * 2; + } + if (gSaveContext.save.day != 3) { + this->actor.textId = sLeaveMessages[this->messageIndex]; + this->unk_27E = sLeaveMessages[this->messageIndex + 1]; + } else { + this->actor.textId = sThirdDayLeaveMessages[this->messageIndex]; + this->unk_27E = sThirdDayLeaveMessages[this->messageIndex + 1]; + } + if (this->unk_27E != 0) { + if ((STOLEN_ITEM_1 == ITEM_SWORD_GREAT_FAIRY) || (STOLEN_ITEM_1 == ITEM_SWORD_KOKIRI) || + (STOLEN_ITEM_1 == ITEM_SWORD_RAZOR) || (STOLEN_ITEM_1 == ITEM_SWORD_GILDED) || + (STOLEN_ITEM_2 == ITEM_SWORD_GREAT_FAIRY) || (STOLEN_ITEM_2 == ITEM_SWORD_KOKIRI) || + (STOLEN_ITEM_2 == ITEM_SWORD_RAZOR) || (STOLEN_ITEM_2 == ITEM_SWORD_GILDED)) { + if (this->actor.textId == 0x516) { + this->actor.textId = 0x56C; + } else if (this->actor.textId == 0x520) { + this->actor.textId = 0x56E; + } else if (this->actor.textId == 0x52A) { + this->actor.textId = 0x570; + } else if (this->actor.textId == 0x534) { + this->actor.textId = 0x572; + } else if (this->actor.textId == 0x518) { + this->actor.textId = 0x56D; + } else if (this->actor.textId == 0x522) { + this->actor.textId = 0x56F; + } else if (this->actor.textId == 0x52C) { + this->actor.textId = 0x571; + } else if (this->actor.textId == 0x536) { + this->actor.textId = 0x573; + } + } else if (GET_CUR_EQUIP_VALUE(EQUIP_TYPE_SWORD) == EQUIP_VALUE_SWORD_NONE) { + if (this->actor.textId == 0x516) { + this->actor.textId = 0x55E; + } else if (this->actor.textId == 0x520) { + this->actor.textId = 0x566; + } else if (this->actor.textId == 0x52A) { + this->actor.textId = 0x568; + } else if (this->actor.textId == 0x534) { + this->actor.textId = 0x56A; + } else if (this->actor.textId == 0x518) { + this->actor.textId = 0x55F; + } else if (this->actor.textId == 0x522) { + this->actor.textId = 0x567; + } else if (this->actor.textId == 0x52C) { + this->actor.textId = 0x569; + } else if (this->actor.textId == 0x536) { + this->actor.textId = 0x56B; + } + } + } + yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y; + yawDiffAbs = ABS_ALT(yawDiff); + + if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { + this->skelAnime.playSpeed = 1.0f; + func_80AE854C(this, play); + } else if (yawDiffAbs < 0x4BB9) { + func_800B8614(&this->actor, play, 70.0f); + } +} + +void func_80AE854C(EnStopheishi* this, PlayState* play) { + if (((this->unk_265 != 0) || (CHECK_WEEKEVENTREG(WEEKEVENTREG_12_20))) && + (this->currentAnim != SOLDIER_ANIM_STAND_HAND_ON_HIP)) { + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_STAND_HAND_ON_HIP); + } + this->pitchToPlayer = 0; + this->unk_274 = 0; + this->disableCollider = true; + this->actionFunc = func_80AE85C4; +} + +void func_80AE85C4(EnStopheishi* this, PlayState* play) { + SkelAnime_Update(&this->skelAnime); + EnStopheishi_UpdateHeadNormal(this, play); + if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { + if (this->unk_27E != 0) { + this->actor.textId = this->unk_27E; + func_80151938(play, this->actor.textId); + EnStopHeishi_ChangeAnim(this, SOLDIER_ANIM_STAND_HAND_ON_HIP); + SET_WEEKEVENTREG(WEEKEVENTREG_12_20); + this->unk_265 = 1; + this->unk_27E = 0; + } else { + func_801477B4(play); + func_80AE7E9C(this); + } + } +} + +void EnStopheishi_Update(Actor* thisx, PlayState* play) { + EnStopheishi* this = (EnStopheishi*)thisx; + s32 pad; + + if (this->timer != 0) { + this->timer--; + } + this->actor.shape.rot.y = this->actor.world.rot.y; + Math_SmoothStepToS(&this->headRotX, this->headRotXTarget, 1, 0x7D0, 0); + Math_SmoothStepToS(&this->headRotZ, this->pitchToPlayer, 1, 0x7D0, 0); + this->actionFunc(this, play); + Actor_MoveWithGravity(&this->actor); + Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D); + Actor_SetScale(&this->actor, 0.01f); + this->actor.uncullZoneForward = 500.0f; + Math_Vec3f_Copy(&this->actor.focus.pos, &this->headWorldPos); + Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot); + if (!this->disableCollider) { + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); + } +} + +s32 EnStopheishi_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + EnStopheishi* this = THIS; + + if (limbIndex == SOLDIER_LIMB_HEAD) { + rot->x += this->headRotX; + rot->z += this->headRotZ; + } + return false; +} + +void EnStopheishi_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + EnStopheishi* this = THIS; + + if (limbIndex == SOLDIER_LIMB_HEAD) { + Matrix_MultVec3f(&gZeroVec3f, &this->headWorldPos); + } +} + +void EnStopheishi_Draw(Actor* thisx, PlayState* play) { + EnStopheishi* this = THIS; + + func_8012C28C(play->state.gfxCtx); + SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, + EnStopheishi_OverrideLimbDraw, EnStopheishi_PostLimbDraw, &this->actor); +} 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 8e27f1c363..651a664960 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 @@ -2,16 +2,46 @@ #define Z_EN_STOP_HEISHI_H #include "global.h" +#include "objects/object_sdn/object_sdn.h" struct EnStopheishi; typedef void (*EnStopheishiActionFunc)(struct EnStopheishi*, PlayState*); +#define ENSTOPHEISHI_GET_SWITCH_FLAG(thisx) (((thisx)->params) & 0x3F) +#define ENSTOPHEISHI_GET_F000(thisx) ((((thisx)->params) >> 0xC) & 0xF) + typedef struct EnStopheishi { /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x110]; + /* 0x144 */ SkelAnime skelAnime; + /* 0x188 */ Vec3s jointTable[SOLDIER_LIMB_MAX]; + /* 0x1EE */ Vec3s morphTable[SOLDIER_LIMB_MAX]; /* 0x254 */ EnStopheishiActionFunc actionFunc; - /* 0x258 */ char unk_258[0x90]; + /* 0x258 */ s16 headRotZ; + /* 0x25A */ s16 headRotX; + /* ox25C */ UNK_TYPE1 unk_25C[2]; + /* 0x25E */ s16 pitchToPlayer; + /* 0x260 */ s16 headRotXTarget; + /* 0x262 */ s16 unk_262; // Unused + /* 0x264 */ u8 unk_264; // Locking value at `0` prevents leaving the guard pose, however locking to 1 doesn't prevent guarding. + /* 0x265 */ u8 unk_265; + /* 0x266 */ s16 unk_266; + /* 0x268 */ s32 currentAnim; + /* 0x26C */ f32 currentAnimFrameCount; + /* 0x270 */ s16 timer; + /* 0x272 */ s16 headTurnTimer1; + /* 0x274 */ s16 unk_274; + /* 0x276 */ s16 unk_276; + /* 0x278 */ s16 disableCollider; + /* 0x27A */ s16 switchFlag; + /* 0x27C */ s16 messageIndex; + /* 0x27E */ s16 unk_27E; + /* 0x280 */ s16 rotYTarget; + /* 0x284 */ s32 headTurnTimer2; + /* 0x288 */ f32 unk_288; + /* 0x28C */ f32 maxMoveStep; + /* 0x28C */ Vec3f headWorldPos; + /* 0x29C */ ColliderCylinder collider; } EnStopheishi; // size = 0x2E8 #endif // Z_EN_STOP_HEISHI_H diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index d967763540..d686a28952 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -12481,8 +12481,8 @@ 0x80AE6E8C:("EnShn_Draw",), 0x80AE73A0:("EnStopheishi_Init",), 0x80AE74E0:("EnStopheishi_Destroy",), - 0x80AE750C:("func_80AE750C",), - 0x80AE75C8:("func_80AE75C8",), + 0x80AE750C:("EnStopHeishi_ChangeAnim",), + 0x80AE75C8:("EnStopheishi_UpdateHeadNormal",), 0x80AE7718:("func_80AE7718",), 0x80AE77D4:("func_80AE77D4",), 0x80AE795C:("func_80AE795C",), @@ -12491,8 +12491,8 @@ 0x80AE854C:("func_80AE854C",), 0x80AE85C4:("func_80AE85C4",), 0x80AE8680:("EnStopheishi_Update",), - 0x80AE87A4:("func_80AE87A4",), - 0x80AE87EC:("func_80AE87EC",), + 0x80AE87A4:("EnStopheishi_OverrideLimbDraw",), + 0x80AE87EC:("EnStopheishi_PostLimbDraw",), 0x80AE882C:("EnStopheishi_Draw",), 0x80AE8B70:("ObjBigicicle_Init",), 0x80AE8DA4:("ObjBigicicle_Destroy",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index fb37d36c3a..4167de4b92 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -13260,10 +13260,10 @@ 0x80AE7270:("D_80AE7270","UNK_TYPE1","",0x1), 0x80AE7280:("jtbl_80AE7280","UNK_PTR","",0x4), 0x80AE8890:("En_Stop_heishi_InitVars","UNK_TYPE1","",0x1), - 0x80AE88B0:("D_80AE88B0","UNK_TYPE1","",0x1), + 0x80AE88B0:("sCylinderInit","UNK_TYPE1","",0x1), 0x80AE88DC:("D_80AE88DC","UNK_TYPE1","",0x1), 0x80AE897C:("D_80AE897C","UNK_TYPE1","",0x1), - 0x80AE8A1C:("D_80AE8A1C","UNK_TYPE1","",0x1), + 0x80AE8A1C:("sAnimations","UNK_TYPE1","",0x1), 0x80AE8A24:("D_80AE8A24","UNK_TYPE1","",0x1), 0x80AE8A2C:("D_80AE8A2C","UNK_TYPE1","",0x1), 0x80AE8A30:("D_80AE8A30","UNK_TYPE1","",0x1), diff --git a/undefined_syms.txt b/undefined_syms.txt index f6436d5430..1809e16000 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -970,11 +970,6 @@ D_06001AA0 = 0x06001AA0; D_06000304 = 0x06000304; -// ovl_En_Stop_heishi - -D_06006C18 = 0x06006C18; -D_0600D640 = 0x0600D640; - // ovl_En_Takaraya D_06000968 = 0x06000968; From 1e03e13b374f2bd26e761f24959c3260c82fa73d Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Mon, 27 Feb 2023 19:56:04 -0300 Subject: [PATCH 14/29] `z_eff_footmark` cleanup (#1180) * z64eff_footmark.h * arraycount and other clenaups * flag * extract data * gEffFootprints * singular * minor cleanup * review * pos * mf * format --- assets/xml/code/debug_display.xml | 2 +- assets/xml/code/eff_footmark.xml | 9 +++ include/functions.h | 4 -- include/variables.h | 3 - include/z64.h | 18 +----- include/z64eff_footmark.h | 33 +++++++++++ spec | 1 - src/code/z_eff_footmark.c | 93 ++++++++++++++++--------------- tools/disasm/variables.txt | 6 +- 9 files changed, 96 insertions(+), 73 deletions(-) create mode 100644 assets/xml/code/eff_footmark.xml create mode 100644 include/z64eff_footmark.h diff --git a/assets/xml/code/debug_display.xml b/assets/xml/code/debug_display.xml index c8ac659bcf..7a25bbd0c6 100644 --- a/assets/xml/code/debug_display.xml +++ b/assets/xml/code/debug_display.xml @@ -4,7 +4,7 @@ - + diff --git a/assets/xml/code/eff_footmark.xml b/assets/xml/code/eff_footmark.xml new file mode 100644 index 0000000000..2fae1fe16b --- /dev/null +++ b/assets/xml/code/eff_footmark.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/include/functions.h b/include/functions.h index 70114cb1f2..863cf50fa3 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1256,10 +1256,6 @@ u8 Cutscene_IsPlaying(PlayState* play); void GetItem_Draw(PlayState* play, s16 drawId); -void EffFootmark_Init(PlayState* play); -void EffFootmark_Add(PlayState* play, MtxF* displayMatrix, Actor* actor, u8 id, Vec3f* location, u16 size, u8 red, u8 green, u8 blue, u16 alpha, u16 alphaChange, u16 fadeoutDelay); -void EffFootmark_Update(PlayState* play); -void EffFootmark_Draw(PlayState* play); void SoundSource_InitAll(PlayState* play); void SoundSource_UpdateAll(PlayState* play); void SoundSource_PlaySfxAtFixedWorldPos(PlayState* play, Vec3f* worldPos, u32 duration, u16 sfxId); diff --git a/include/variables.h b/include/variables.h index 257fbfeb78..a5752eb7f7 100644 --- a/include/variables.h +++ b/include/variables.h @@ -479,9 +479,6 @@ extern EffectShieldParticleInit shieldParticleInitWood; extern u8 D_801BB12C; -// extern UNK_TYPE1 D_801BC210; -extern Gfx D_801BC240[9]; -extern Gfx D_801BC288[3]; // extern UNK_TYPE1 D_801BC41E; extern ActorCutscene actorCutscenesGlobalCutscenes[8]; extern s16 actorCutsceneCurrent; diff --git a/include/z64.h b/include/z64.h index e168bedbc8..9069dc819a 100644 --- a/include/z64.h +++ b/include/z64.h @@ -34,6 +34,7 @@ #include "z64curve.h" #include "z64cutscene.h" #include "z64dma.h" +#include "z64eff_footmark.h" #include "z64effect.h" #include "z64interface.h" #include "z64item.h" @@ -712,23 +713,6 @@ typedef struct { /* 0x130 */ OSThread thread; } AudioMgr; // size = 0x2E0 -typedef struct { - /* 0x00 */ MtxF displayMatrix; - /* 0x40 */ Actor* actor; - /* 0x44 */ Vec3f location; - /* 0x50 */ u8 flags; // bit 0 - footmark fades out - /* 0x51 */ u8 id; - /* 0x52 */ u8 red; - /* 0x53 */ u8 blue; - /* 0x54 */ u8 green; - /* 0x55 */ UNK_TYPE1 pad55[0x1]; - /* 0x56 */ u16 alpha; - /* 0x58 */ u16 alphaChange; - /* 0x5A */ u16 size; - /* 0x5C */ u16 fadeoutDelay; - /* 0x5E */ u16 age; -} EffFootmark; // size = 0x60 - typedef struct FireObj { /* 0x00 */ Vec3f position; /* 0x0C */ f32 size; diff --git a/include/z64eff_footmark.h b/include/z64eff_footmark.h new file mode 100644 index 0000000000..6d5fe3026a --- /dev/null +++ b/include/z64eff_footmark.h @@ -0,0 +1,33 @@ +#ifndef Z64EFF_FOOTMARK_H +#define Z64EFF_FOOTMARK_H + +#include "ultra64.h" +#include "z64math.h" + +struct PlayState; +struct Actor; + +typedef struct EffFootmark { + /* 0x00 */ MtxF mf; + /* 0x40 */ struct Actor* actor; + /* 0x44 */ Vec3f pos; + /* 0x50 */ u8 flags; // bit 0 - footmark fades out + /* 0x51 */ u8 id; + /* 0x52 */ u8 red; + /* 0x53 */ u8 blue; + /* 0x54 */ u8 green; + /* 0x56 */ u16 alpha; + /* 0x58 */ u16 alphaChange; + /* 0x5A */ u16 size; + /* 0x5C */ u16 fadeOutDelay; + /* 0x5E */ u16 age; +} EffFootmark; // size = 0x60 + +#define FOOTMARK_FLAG_1 (1 << 0) + +void EffFootmark_Init(struct PlayState* play); +void EffFootmark_Add(struct PlayState* play, MtxF* mf, struct Actor* actor, u8 id, Vec3f* pos, u16 size, u8 red, u8 green, u8 blue, u16 alpha, u16 alphaChange, u16 fadeOutDelay); +void EffFootmark_Update(struct PlayState* play); +void EffFootmark_Draw(struct PlayState* play); + +#endif diff --git a/spec b/spec index df74629c33..9a9deb9505 100644 --- a/spec +++ b/spec @@ -463,7 +463,6 @@ beginseg include "build/src/code/z_demo.o" include "build/src/code/z_draw.o" include "build/src/code/z_eff_footmark.o" - include "build/data/code/z_eff_footmark.data.o" include "build/src/code/z_sound_source.o" include "build/src/code/z_elf_message.o" include "build/src/code/z_en_hy_code.o" diff --git a/src/code/z_eff_footmark.c b/src/code/z_eff_footmark.c index 1dc3d72373..bcf6ff8241 100644 --- a/src/code/z_eff_footmark.c +++ b/src/code/z_eff_footmark.c @@ -1,14 +1,19 @@ -#include "global.h" +#include "z64eff_footmark.h" +#include "z64.h" +#include "macros.h" +#include "functions.h" + +#include "assets/code/eff_footmark/eff_footmark.c" void EffFootmark_Init(PlayState* play) { EffFootmark* footmark; s32 i; - for (footmark = play->footprintInfo, i = 0; i < 100; i++, footmark++) { + for (footmark = play->footprintInfo, i = 0; i < ARRAY_COUNT(play->footprintInfo); i++, footmark++) { footmark->actor = NULL; - footmark->location.x = 0; - footmark->location.y = 0; - footmark->location.z = 0; + footmark->pos.x = 0; + footmark->pos.y = 0; + footmark->pos.z = 0; footmark->flags = 0; footmark->id = 0; footmark->alpha = 0; @@ -16,47 +21,45 @@ void EffFootmark_Init(PlayState* play) { } } -void EffFootmark_Add(PlayState* play, MtxF* displayMatrix, Actor* actor, u8 id, Vec3f* location, u16 size, u8 red, - u8 green, u8 blue, u16 alpha, u16 alphaChange, u16 fadeoutDelay) { +void EffFootmark_Add(PlayState* play, MtxF* mf, Actor* actor, u8 id, Vec3f* pos, u16 size, u8 red, u8 green, u8 blue, + u16 alpha, u16 alphaChange, u16 fadeOutDelay) { s32 i; EffFootmark* footmark; EffFootmark* destination = NULL; EffFootmark* oldest = NULL; - s32 isNew = 1; + s32 isNew = true; - for (footmark = play->footprintInfo, i = 0; i < 100; i++, footmark++) { - if (((actor == footmark->actor) && (footmark->id == id)) && ((footmark->flags & 1) == 0)) { - if (fabsf((footmark->location).x - location->x) <= 1) { - if (fabsf((footmark->location).z - location->z) <= 1) { - isNew = 0; + for (footmark = play->footprintInfo, i = 0; i < ARRAY_COUNT(play->footprintInfo); i++, footmark++) { + if (((actor == footmark->actor) && (footmark->id == id)) && !(footmark->flags & FOOTMARK_FLAG_1)) { + if (fabsf(footmark->pos.x - pos->x) <= 1) { + if (fabsf(footmark->pos.z - pos->z) <= 1) { + isNew = false; break; } } - // This footmark is being re-added at a new location. Let's mark this one to start fading out. - footmark->flags = 1; + // This footmark is being re-added at a new pos. Let's mark this one to start fading out. + footmark->flags = FOOTMARK_FLAG_1; } if (footmark->actor == NULL) { destination = footmark; - } else { - if (destination == NULL) { - if ((oldest != NULL && footmark->age > oldest->age) || (oldest == NULL)) { - oldest = footmark; - } + } else if (destination == NULL) { + if (((oldest != NULL) && (footmark->age > oldest->age)) || (oldest == NULL)) { + oldest = footmark; } } } - if ((isNew) && ((destination != NULL || (oldest != NULL)))) { + if (isNew && ((destination != NULL) || (oldest != NULL))) { if (destination == NULL) { destination = oldest; } - Matrix_MtxFCopy(&destination->displayMatrix, displayMatrix); + Matrix_MtxFCopy(&destination->mf, mf); destination->actor = actor; - destination->location.x = location->x; - destination->location.y = location->y; - destination->location.z = location->z; + destination->pos.x = pos->x; + destination->pos.y = pos->y; + destination->pos.z = pos->z; destination->flags = 0; destination->id = id; destination->red = red; @@ -65,7 +68,7 @@ void EffFootmark_Add(PlayState* play, MtxF* displayMatrix, Actor* actor, u8 id, destination->alpha = alpha; destination->alphaChange = alphaChange; destination->size = size; - destination->fadeoutDelay = fadeoutDelay; + destination->fadeOutDelay = fadeOutDelay; destination->age = 0; } } @@ -74,22 +77,24 @@ void EffFootmark_Update(PlayState* play) { EffFootmark* footmark; s32 i; - for (footmark = play->footprintInfo, i = 0; i < 100; i++, footmark++) { - if (footmark->actor != NULL) { - if ((footmark->flags & 1) == 1) { - if ((u32)footmark->age < UINT16_MAX) { - footmark->age++; - } + for (footmark = play->footprintInfo, i = 0; i < ARRAY_COUNT(play->footprintInfo); i++, footmark++) { + if (footmark->actor == NULL) { + continue; + } - if (footmark->fadeoutDelay == 0) { - if (footmark->alpha >= footmark->alphaChange + 0x1000) { - footmark->alpha -= footmark->alphaChange; - } else { - footmark->actor = NULL; - } - } else if (footmark->fadeoutDelay > 0) { - footmark->fadeoutDelay--; + if (CHECK_FLAG_ALL(footmark->flags, FOOTMARK_FLAG_1)) { + if ((u32)footmark->age < UINT16_MAX) { + footmark->age++; + } + + if (footmark->fadeOutDelay == 0) { + if (footmark->alpha >= footmark->alphaChange + 0x1000) { + footmark->alpha -= footmark->alphaChange; + } else { + footmark->actor = NULL; } + } else if (footmark->fadeOutDelay > 0) { + footmark->fadeOutDelay--; } } } @@ -102,11 +107,11 @@ void EffFootmark_Draw(PlayState* play) { func_8012C448(play->state.gfxCtx); - gSPDisplayList(gfxCtx->polyXlu.p++, D_801BC240); + gSPDisplayList(gfxCtx->polyXlu.p++, gEffFootprintMaterialDL); - for (footmark = play->footprintInfo, i = 0; i < 100; i++, footmark++) { + for (footmark = play->footprintInfo, i = 0; i < ARRAY_COUNT(play->footprintInfo); i++, footmark++) { if (footmark->actor != NULL) { - Matrix_Put(&footmark->displayMatrix); + Matrix_Put(&footmark->mf); Matrix_Scale(footmark->size * (1.0f / 0x100) * 0.7f, 1, footmark->size * (1.0f / 0x100), MTXMODE_APPLY); gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD); @@ -114,7 +119,7 @@ void EffFootmark_Draw(PlayState* play) { gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, footmark->red, footmark->green, footmark->blue, footmark->alpha >> 8); - gSPDisplayList(gfxCtx->polyXlu.p++, D_801BC288); + gSPDisplayList(gfxCtx->polyXlu.p++, gEffFootprintModelDL); } } } diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 4167de4b92..b07e060c0b 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -927,9 +927,9 @@ 0x801BB15C:("D_801BB15C","UNK_TYPE2","",0x2), 0x801BB160:("D_801BB160","UNK_TYPE4","",0x4), 0x801BB170:("sDrawItemTable","DrawItemTableEntry","[118]",0x1098), - 0x801BC210:("D_801BC210","UNK_TYPE1","",0x1), - 0x801BC240:("D_801BC240","Gfx","[9]",0x48), - 0x801BC288:("D_801BC288","Gfx","[3]",0x18), + 0x801BC210:("gEffFootprintVtx","UNK_TYPE1","",0x1), + 0x801BC240:("gEffFootprintMaterialDL","Gfx","[9]",0x48), + 0x801BC288:("gEffFootprintModelDL","Gfx","[3]",0x18), 0x801BC2A0:("D_801BC2A0","UNK_TYPE1","",0x1), 0x801BC3F0:("gEnHyBodyParts","UNK_TYPE1","",0x1), 0x801BC400:("gEnHyParentBodyParts","UNK_TYPE1","",0x1), From c70ccf14d9618c57bf43f2ca2aabeb40d8679fcb Mon Sep 17 00:00:00 2001 From: Tom Overton Date: Tue, 28 Feb 2023 06:41:54 -0800 Subject: [PATCH 15/29] Add original asset names for all `object_e*` and `object_f*` files (#1181) * Add original asset names for all `object_e*` and `object_f*` files * Add c_keyframe note to fall2 --- assets/xml/objects/object_efc_star_field.xml | 4 +- assets/xml/objects/object_efc_tw.xml | 2 +- assets/xml/objects/object_eg.xml | 52 ++++++++++---------- assets/xml/objects/object_ending_obj.xml | 6 +-- assets/xml/objects/object_f40_obj.xml | 4 +- assets/xml/objects/object_f40_switch.xml | 6 +-- assets/xml/objects/object_f52_obj.xml | 10 ++-- assets/xml/objects/object_f53_obj.xml | 4 +- assets/xml/objects/object_fall.xml | 18 +++---- assets/xml/objects/object_fall2.xml | 6 +-- assets/xml/objects/object_famos.xml | 4 +- assets/xml/objects/object_fb.xml | 10 ++-- assets/xml/objects/object_firefly.xml | 2 +- assets/xml/objects/object_fish.xml | 24 ++++----- assets/xml/objects/object_flowerpot.xml | 8 +-- assets/xml/objects/object_fr.xml | 6 +-- assets/xml/objects/object_fsn.xml | 25 +++++----- assets/xml/objects/object_fu.xml | 4 +- assets/xml/objects/object_fu_kaiten.xml | 8 +-- assets/xml/objects/object_fu_mato.xml | 30 +++++------ assets/xml/objects/object_funen.xml | 2 +- assets/xml/objects/object_fusen.xml | 6 +-- assets/xml/objects/object_fwall.xml | 2 +- 23 files changed, 121 insertions(+), 122 deletions(-) diff --git a/assets/xml/objects/object_efc_star_field.xml b/assets/xml/objects/object_efc_star_field.xml index 72b7ef6367..90ea179291 100644 --- a/assets/xml/objects/object_efc_star_field.xml +++ b/assets/xml/objects/object_efc_star_field.xml @@ -1,8 +1,8 @@  - + - + diff --git a/assets/xml/objects/object_efc_tw.xml b/assets/xml/objects/object_efc_tw.xml index 709224f9d2..a7ca81b55a 100644 --- a/assets/xml/objects/object_efc_tw.xml +++ b/assets/xml/objects/object_efc_tw.xml @@ -4,7 +4,7 @@ - + diff --git a/assets/xml/objects/object_eg.xml b/assets/xml/objects/object_eg.xml index 6aba85e623..26e5c86bca 100644 --- a/assets/xml/objects/object_eg.xml +++ b/assets/xml/objects/object_eg.xml @@ -2,20 +2,20 @@ - + - + - + - + - + @@ -24,7 +24,7 @@ - + @@ -32,7 +32,7 @@ - + @@ -105,32 +105,32 @@ - - - - - - - - - - - - + + + + + + + + + + + + - + - - - - - + + + + + - + diff --git a/assets/xml/objects/object_ending_obj.xml b/assets/xml/objects/object_ending_obj.xml index ad13ce7b89..f8902e353d 100644 --- a/assets/xml/objects/object_ending_obj.xml +++ b/assets/xml/objects/object_ending_obj.xml @@ -1,13 +1,13 @@  - + - - + + diff --git a/assets/xml/objects/object_f40_obj.xml b/assets/xml/objects/object_f40_obj.xml index 59bff9d05e..17e7210def 100644 --- a/assets/xml/objects/object_f40_obj.xml +++ b/assets/xml/objects/object_f40_obj.xml @@ -11,7 +11,7 @@ - - + + diff --git a/assets/xml/objects/object_f40_switch.xml b/assets/xml/objects/object_f40_switch.xml index a5c823baaa..7e7fb5b1cf 100644 --- a/assets/xml/objects/object_f40_switch.xml +++ b/assets/xml/objects/object_f40_switch.xml @@ -1,8 +1,8 @@  - - - + + + diff --git a/assets/xml/objects/object_f52_obj.xml b/assets/xml/objects/object_f52_obj.xml index f80b676964..697a5b1001 100644 --- a/assets/xml/objects/object_f52_obj.xml +++ b/assets/xml/objects/object_f52_obj.xml @@ -1,16 +1,16 @@  - - + + - - + + - + diff --git a/assets/xml/objects/object_f53_obj.xml b/assets/xml/objects/object_f53_obj.xml index 424d7c0032..d93048a9d7 100644 --- a/assets/xml/objects/object_f53_obj.xml +++ b/assets/xml/objects/object_f53_obj.xml @@ -1,13 +1,13 @@  - + - + diff --git a/assets/xml/objects/object_fall.xml b/assets/xml/objects/object_fall.xml index 47fa1da705..04c1ff0581 100644 --- a/assets/xml/objects/object_fall.xml +++ b/assets/xml/objects/object_fall.xml @@ -7,14 +7,14 @@ --> - + - + - - - - \ + + + + @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -43,7 +43,7 @@ - + diff --git a/assets/xml/objects/object_fall2.xml b/assets/xml/objects/object_fall2.xml index 25439a50ad..12299ab743 100644 --- a/assets/xml/objects/object_fall2.xml +++ b/assets/xml/objects/object_fall2.xml @@ -4,7 +4,7 @@ moon's mouth, both used in the cutscene before warping to the moon. --> - + @@ -12,7 +12,7 @@ - + @@ -29,6 +29,6 @@ - + diff --git a/assets/xml/objects/object_famos.xml b/assets/xml/objects/object_famos.xml index d12a94d662..186e2b59bd 100644 --- a/assets/xml/objects/object_famos.xml +++ b/assets/xml/objects/object_famos.xml @@ -1,7 +1,7 @@  - + @@ -24,7 +24,7 @@ - + diff --git a/assets/xml/objects/object_fb.xml b/assets/xml/objects/object_fb.xml index bb630781c8..59ecaf9e52 100644 --- a/assets/xml/objects/object_fb.xml +++ b/assets/xml/objects/object_fb.xml @@ -1,10 +1,10 @@  - - - - - + + + + + diff --git a/assets/xml/objects/object_firefly.xml b/assets/xml/objects/object_firefly.xml index 4c6aacd166..acdcedb1de 100644 --- a/assets/xml/objects/object_firefly.xml +++ b/assets/xml/objects/object_firefly.xml @@ -1,6 +1,6 @@  - + diff --git a/assets/xml/objects/object_fish.xml b/assets/xml/objects/object_fish.xml index 4d9a86e51d..918c0eb5f2 100644 --- a/assets/xml/objects/object_fish.xml +++ b/assets/xml/objects/object_fish.xml @@ -1,6 +1,6 @@  - + @@ -54,10 +54,10 @@ - + - + @@ -78,7 +78,7 @@ - + @@ -99,10 +99,10 @@ - + - + @@ -137,26 +137,26 @@ - + - - + + - + - + - + diff --git a/assets/xml/objects/object_flowerpot.xml b/assets/xml/objects/object_flowerpot.xml index b6adc70d4c..01d16b6635 100644 --- a/assets/xml/objects/object_flowerpot.xml +++ b/assets/xml/objects/object_flowerpot.xml @@ -3,9 +3,9 @@ - - - - + + + + diff --git a/assets/xml/objects/object_fr.xml b/assets/xml/objects/object_fr.xml index 0cd28760ef..f7fa4354b8 100644 --- a/assets/xml/objects/object_fr.xml +++ b/assets/xml/objects/object_fr.xml @@ -1,8 +1,8 @@  - - - + + + diff --git a/assets/xml/objects/object_fsn.xml b/assets/xml/objects/object_fsn.xml index dd67874f0e..37867dc32d 100644 --- a/assets/xml/objects/object_fsn.xml +++ b/assets/xml/objects/object_fsn.xml @@ -57,15 +57,14 @@ - - - - - - - - - + + + + + + + + @@ -78,8 +77,8 @@ - - + + @@ -106,7 +105,7 @@ - - + + diff --git a/assets/xml/objects/object_fu.xml b/assets/xml/objects/object_fu.xml index 19404f90e5..fb41a85e8f 100644 --- a/assets/xml/objects/object_fu.xml +++ b/assets/xml/objects/object_fu.xml @@ -1,7 +1,7 @@  - - + + diff --git a/assets/xml/objects/object_fu_kaiten.xml b/assets/xml/objects/object_fu_kaiten.xml index 37a7ec4bc2..ad277bb261 100644 --- a/assets/xml/objects/object_fu_kaiten.xml +++ b/assets/xml/objects/object_fu_kaiten.xml @@ -1,18 +1,18 @@  - + - - + + - + diff --git a/assets/xml/objects/object_fu_mato.xml b/assets/xml/objects/object_fu_mato.xml index b28899f3c9..bedf6906fc 100644 --- a/assets/xml/objects/object_fu_mato.xml +++ b/assets/xml/objects/object_fu_mato.xml @@ -1,21 +1,21 @@  - - - - - - + + + + + + - - - - - - - - - + + + + + + + + + diff --git a/assets/xml/objects/object_funen.xml b/assets/xml/objects/object_funen.xml index 5f8c18c3d3..7a04100082 100644 --- a/assets/xml/objects/object_funen.xml +++ b/assets/xml/objects/object_funen.xml @@ -1,6 +1,6 @@  - + diff --git a/assets/xml/objects/object_fusen.xml b/assets/xml/objects/object_fusen.xml index 2e115b2b73..2ee47097ac 100644 --- a/assets/xml/objects/object_fusen.xml +++ b/assets/xml/objects/object_fusen.xml @@ -1,8 +1,8 @@  - - + + - + diff --git a/assets/xml/objects/object_fwall.xml b/assets/xml/objects/object_fwall.xml index 1bbb5d572b..a4311c173d 100644 --- a/assets/xml/objects/object_fwall.xml +++ b/assets/xml/objects/object_fwall.xml @@ -1,6 +1,6 @@  - + From 263fca77c30e1bd270a24633c9e786090738bbb1 Mon Sep 17 00:00:00 2001 From: Francis Jeanneau <14813038+francisjeanneau@users.noreply.github.com> Date: Wed, 1 Mar 2023 20:17:30 -0500 Subject: [PATCH 16/29] EnSi OK (#1174) * [decomp,actor] Decompile Init,Destroy & unnamed functions (func_8098CA20 is WIP) * [ovl_En_Si] Match func_8098CA20 function * [0vl_En_Si] Comment data in spec * [ovl_En_Si] Start documentation & cleanup * [ovl_En_Si] Clang format * [spec] Update ovl_En_Si reloc target * Style fixes & adjust fanfare parameter * Remove goto & styling fixes * Styling fixes * Remove unnecessary function declarations & dead code * Styling fixes & doc (MR suggestions) * Move GET_CHEST_FLAG macro to header file * Rename colliderSphere variable to collider * Rename func_8098CA20 to EnSi_UpdateCollision * Rename func_8098CBDC to EnSi_DraggedByHookshot * Rename func_8098CAD0 to EnSi_GiveToken * Rename func_8098CB70 to EnSi_Wait * Styling adjustment * Update tools/disasm/function.txt with new function names --------- Co-authored-by: Francis --- spec | 3 +- src/overlays/actors/ovl_En_Si/z_en_si.c | 110 +++++++++++++++++++----- src/overlays/actors/ovl_En_Si/z_en_si.h | 4 +- tools/disasm/functions.txt | 8 +- tools/disasm/variables.txt | 6 +- 5 files changed, 98 insertions(+), 33 deletions(-) diff --git a/spec b/spec index 9a9deb9505..e68cab673d 100644 --- a/spec +++ b/spec @@ -1974,8 +1974,7 @@ beginseg name "ovl_En_Si" compress include "build/src/overlays/actors/ovl_En_Si/z_en_si.o" - include "build/data/ovl_En_Si/ovl_En_Si.data.o" - include "build/data/ovl_En_Si/ovl_En_Si.reloc.o" + include "build/src/overlays/actors/ovl_En_Si/ovl_En_Si_reloc.o" endseg beginseg 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 5f7e111a4b..74a55261f7 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -15,10 +15,8 @@ void EnSi_Destroy(Actor* thisx, PlayState* play); void EnSi_Update(Actor* thisx, PlayState* play); void EnSi_Draw(Actor* thisx, PlayState* play); -void func_8098CB70(EnSi* this, PlayState* play); -void func_8098CBDC(EnSi* this, PlayState* play); +void EnSi_DraggedByHookshot(EnSi* this, PlayState* play); -#if 0 ActorInit En_Si_InitVars = { ACTOR_EN_SI, ACTORCAT_ITEMACTION, @@ -31,18 +29,29 @@ ActorInit En_Si_InitVars = { (ActorFunc)EnSi_Draw, }; -// static ColliderSphereInit sSphereInit = { -static ColliderSphereInit D_8098CD80 = { - { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_NO_PUSH | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_SPHERE, }, - { ELEMTYPE_UNK0, { 0xF7CFFFFF, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_ON | BUMP_HOOKABLE, OCELEM_ON, }, +static ColliderSphereInit sSphereInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_NO_PUSH | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_SPHERE, + }, + { + ELEMTYPE_UNK0, + { 0xF7CFFFFF, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 0, { { 0, 0, 0 }, 10 }, 100 }, }; -// sColChkInfoInit -static CollisionCheckInfoInit2 D_8098CDAC = { 1, 0, 0, 0, MASS_IMMOVABLE }; +static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE }; -// static DamageTable sDamageTable = { -static DamageTable D_8098CDB8 = { +static DamageTable sDamageTable = { /* Deku Nut */ DMG_ENTRY(1, 0x0), /* Deku Stick */ DMG_ENTRY(1, 0x0), /* Horse trample */ DMG_ENTRY(1, 0x0), @@ -77,24 +86,79 @@ static DamageTable D_8098CDB8 = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -#endif +void EnSi_UpdateCollision(EnSi* this, PlayState* play) { + this->collider.dim.worldSphere.center.x = this->actor.world.pos.x; + this->collider.dim.worldSphere.center.y = this->actor.world.pos.y; + this->collider.dim.worldSphere.center.z = this->actor.world.pos.z; + this->collider.dim.worldSphere.radius = this->collider.dim.modelSphere.radius * this->collider.dim.scale; + if (this->actor.colChkInfo.health > 0) { + CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); + } + CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); +} -extern ColliderSphereInit D_8098CD80; -extern CollisionCheckInfoInit2 D_8098CDAC; -extern DamageTable D_8098CDB8; +void EnSi_GiveToken(EnSi* this, PlayState* play) { + s32 chestFlag = ENSI_GET_CHEST_FLAG(&this->actor); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Si/func_8098CA20.s") + if ((chestFlag < 0x20) && (chestFlag >= 0)) { + Flags_SetTreasure(play, chestFlag); + } + Item_Give(play, ITEM_SKULL_TOKEN); + if (Inventory_GetSkullTokenCount(play->sceneId) >= 30) { + Message_StartTextbox(play, 0xFC, NULL); + Audio_PlayFanfare(NA_BGM_GET_ITEM | 0x900); + } else { + Message_StartTextbox(play, 0x52, NULL); + Audio_PlayFanfare(NA_BGM_GET_SMALL_ITEM); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Si/func_8098CAD0.s") +void EnSi_Wait(EnSi* this, PlayState* play) { + if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_2000)) { + this->actionFunc = EnSi_DraggedByHookshot; + } else if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) { + EnSi_GiveToken(this, play); + Actor_Kill(&this->actor); + return; + } + this->actor.shape.rot.y += 0x38E; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Si/func_8098CB70.s") +void EnSi_DraggedByHookshot(EnSi* this, PlayState* play) { + if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_2000)) { + EnSi_GiveToken(this, play); + Actor_Kill(&this->actor); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Si/func_8098CBDC.s") +void EnSi_Init(Actor* thisx, PlayState* play) { + EnSi* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Si/EnSi_Init.s") + Collider_InitSphere(play, &this->collider); + Collider_SetSphere(play, &this->collider, &this->actor, &sSphereInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); + Actor_SetScale(&this->actor, 0.25f); + this->actionFunc = EnSi_Wait; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Si/EnSi_Destroy.s") +void EnSi_Destroy(Actor* thisx, PlayState* play) { + EnSi* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Si/EnSi_Update.s") + Collider_DestroySphere(play, &this->collider); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Si/EnSi_Draw.s") +void EnSi_Update(Actor* thisx, PlayState* play) { + EnSi* this = THIS; + + this->actionFunc(this, play); + EnSi_UpdateCollision(this, play); + Actor_SetFocus(&this->actor, 0.0f); +} + +void EnSi_Draw(Actor* thisx, PlayState* play) { + EnSi* this = THIS; + + func_800B8118(&this->actor, play, 0); + func_800B8050(&this->actor, play, 0); + GetItem_Draw(play, GID_SKULL_TOKEN_2); +} 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 b401e5e6a5..07628bf86e 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.h +++ b/src/overlays/actors/ovl_En_Si/z_en_si.h @@ -3,6 +3,8 @@ #include "global.h" +#define ENSI_GET_CHEST_FLAG(thisx) (((thisx)->params & 0xFC) >> 2) + struct EnSi; typedef void (*EnSiActionFunc)(struct EnSi*, PlayState*); @@ -10,7 +12,7 @@ typedef void (*EnSiActionFunc)(struct EnSi*, PlayState*); typedef struct EnSi { /* 0x000 */ Actor actor; /* 0x144 */ EnSiActionFunc actionFunc; - /* 0x148 */ char unk_148[0x58]; + /* 0x148 */ ColliderSphere collider; } EnSi; // size = 0x1A0 #endif // Z_EN_SI_H diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index d686a28952..5a7397dc02 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -8354,10 +8354,10 @@ 0x8098BFB8:("EnDg_OverrideLimbDraw",), 0x8098BFD4:("EnDg_PostLimbDraw",), 0x8098C06C:("EnDg_Draw",), - 0x8098CA20:("func_8098CA20",), - 0x8098CAD0:("func_8098CAD0",), - 0x8098CB70:("func_8098CB70",), - 0x8098CBDC:("func_8098CBDC",), + 0x8098CA20:("EnSi_UpdateCollision",), + 0x8098CAD0:("EnSi_GiveToken",), + 0x8098CB70:("EnSi_Wait",), + 0x8098CBDC:("EnSi_DraggedByHookshot",), 0x8098CC18:("EnSi_Init",), 0x8098CC98:("EnSi_Destroy",), 0x8098CCC4:("EnSi_Update",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index b07e060c0b..420606edbd 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -9189,9 +9189,9 @@ 0x8098C498:("D_8098C498","f32","",0x4), 0x8098C49C:("jtbl_8098C49C","UNK_PTR","",0x4), 0x8098CD60:("En_Si_InitVars","UNK_TYPE1","",0x1), - 0x8098CD80:("D_8098CD80","UNK_TYPE1","",0x1), - 0x8098CDAC:("D_8098CDAC","UNK_PTR","",0x4), - 0x8098CDB8:("D_8098CDB8","UNK_TYPE1","",0x1), + 0x8098CD80:("sSphereInit","UNK_TYPE1","",0x1), + 0x8098CDAC:("sColChkInfoInit","UNK_PTR","",0x4), + 0x8098CDB8:("sDamageTable","UNK_TYPE1","",0x1), 0x8098E420:("Obj_Comb_InitVars","UNK_TYPE1","",0x1), 0x8098E440:("D_8098E440","UNK_TYPE1","",0x1), 0x8098E464:("D_8098E464","UNK_TYPE1","",0x1), From 5729b6d3f16aad52bf60bde988db681e204bb067 Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Thu, 2 Mar 2023 19:16:00 -0500 Subject: [PATCH 17/29] actor math cleanup (#1187) --- include/functions.h | 20 +++--- src/code/z_actor.c | 66 +++++++++---------- src/code/z_en_hy_code.c | 2 +- src/code/z_sub_s.c | 4 +- .../actors/ovl_Arms_Hook/z_arms_hook.c | 2 +- src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c | 2 +- .../actors/ovl_Door_Shutter/z_door_shutter.c | 2 +- src/overlays/actors/ovl_En_Am/z_en_am.c | 10 +-- src/overlays/actors/ovl_En_Az/z_en_az.c | 4 +- src/overlays/actors/ovl_En_Bat/z_en_bat.c | 4 +- src/overlays/actors/ovl_En_Bb/z_en_bb.c | 6 +- .../actors/ovl_En_Bigokuta/z_en_bigokuta.c | 4 +- .../actors/ovl_En_Bigpamet/z_en_bigpamet.c | 7 +- src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c | 4 +- .../actors/ovl_En_Bigslime/z_en_bigslime.c | 16 ++--- src/overlays/actors/ovl_En_Boom/z_en_boom.c | 4 +- src/overlays/actors/ovl_En_Crow/z_en_crow.c | 16 ++--- .../actors/ovl_En_Dekunuts/z_en_dekunuts.c | 8 +-- .../actors/ovl_En_Dinofos/z_en_dinofos.c | 4 +- src/overlays/actors/ovl_En_Dno/z_en_dno.c | 8 +-- .../actors/ovl_En_Dodongo/z_en_dodongo.c | 5 +- src/overlays/actors/ovl_En_Door/z_en_door.c | 2 +- src/overlays/actors/ovl_En_Fall/z_en_fall.c | 2 +- src/overlays/actors/ovl_En_Famos/z_en_famos.c | 16 ++--- .../actors/ovl_En_Firefly/z_en_firefly.c | 34 +++++----- .../actors/ovl_En_Floormas/z_en_floormas.c | 6 +- src/overlays/actors/ovl_En_Horse/z_en_horse.c | 22 +++---- .../z_en_horse_link_child.c | 14 ++-- .../actors/ovl_En_Invadepoh/z_en_invadepoh.c | 2 +- .../actors/ovl_En_Kaizoku/z_en_kaizoku.c | 2 +- src/overlays/actors/ovl_En_Kame/z_en_kame.c | 12 ++-- src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c | 4 +- .../actors/ovl_En_Minifrog/z_en_minifrog.c | 4 +- .../actors/ovl_En_Minislime/z_en_minislime.c | 14 ++-- src/overlays/actors/ovl_En_Mkk/z_en_mkk.c | 4 +- .../actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c | 6 +- src/overlays/actors/ovl_En_Ot/z_en_ot.c | 16 ++--- .../actors/ovl_En_Pametfrog/z_en_pametfrog.c | 26 ++++---- .../actors/ovl_En_Peehat/z_en_peehat.c | 2 +- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 8 ++- src/overlays/actors/ovl_En_Poh/z_en_poh.c | 4 +- .../actors/ovl_En_Railgibud/z_en_railgibud.c | 9 +-- src/overlays/actors/ovl_En_Rat/z_en_rat.c | 2 +- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 20 +++--- src/overlays/actors/ovl_En_Rg/z_en_rg.c | 6 +- .../actors/ovl_En_Snowman/z_en_snowman.c | 13 ++-- .../ovl_En_Talk_Gibud/z_en_talk_gibud.c | 9 +-- src/overlays/actors/ovl_En_Test3/z_en_test3.c | 4 +- .../actors/ovl_En_Thiefbird/z_en_thiefbird.c | 35 +++++----- src/overlays/actors/ovl_En_Tite/z_en_tite.c | 4 +- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 12 ++-- .../actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c | 2 +- .../ovl_En_Weather_Tag/z_en_weather_tag.c | 12 ++-- src/overlays/actors/ovl_En_Wf/z_en_wf.c | 24 +++---- .../ovl_Obj_Bigicicle/z_obj_bigicicle.c | 2 +- src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c | 2 +- .../ovl_Obj_Grass_Carry/z_obj_grass_carry.c | 4 +- tools/disasm/functions.txt | 20 +++--- tools/namefixer.py | 10 +++ tools/sizes/code_functions.csv | 20 +++--- 60 files changed, 315 insertions(+), 293 deletions(-) diff --git a/include/functions.h b/include/functions.h index 863cf50fa3..e3ff8fddda 100644 --- a/include/functions.h +++ b/include/functions.h @@ -635,16 +635,16 @@ void Actor_MoveWithoutGravity(Actor* actor); void Actor_UpdateVelocityWithoutGravityReverse(Actor* actor); void Actor_MoveWithoutGravityReverse(Actor* actor); void Actor_SetSpeeds(Actor* actor, f32 speed); -s16 Actor_YawBetweenActors(Actor* from, Actor* to); -s16 Actor_YawBetweenActorsTop(Actor* from, Actor* to); -s16 Actor_YawToPoint(Actor* actor, Vec3f* point); -s16 Actor_PitchBetweenActors(Actor* from, Actor* to); -s16 Actor_PitchBetweenActorsTop(Actor* from, Actor* to); -s16 Actor_PitchToPoint(Actor* actor, Vec3f* point); -f32 Actor_DistanceBetweenActors(Actor* actor1, Actor* actor2); -f32 Actor_DistanceToPoint(Actor* actor, Vec3f* point); -f32 Actor_XZDistanceBetweenActors(Actor* actor1, Actor* actor2); -f32 Actor_XZDistanceToPoint(Actor* actor, Vec3f* point); +s16 Actor_WorldYawTowardActor(Actor* actorA, Actor* actorB); +s16 Actor_FocusYawTowardActor(Actor* actorA, Actor* actorB); +s16 Actor_WorldYawTowardPoint(Actor* actor, Vec3f* refPoint); +s16 Actor_WorldPitchTowardActor(Actor* actorA, Actor* actorB); +s16 Actor_FocusPitchTowardActor(Actor* actorA, Actor* actorB); +s16 Actor_WorldPitchTowardPoint(Actor* actor, Vec3f* refPoint); +f32 Actor_WorldDistXYZToActor(Actor* actorA, Actor* actorB); +f32 Actor_WorldDistXYZToPoint(Actor* actor, Vec3f* refPoint); +f32 Actor_WorldDistXZToActor(Actor* actorA, Actor* actorB); +f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint); void Actor_OffsetOfPointInActorCoords(Actor* actor, Vec3f* offset, Vec3f* point); f32 Actor_HeightDiff(Actor* actor1, Actor* actor2); void func_800B6F20(PlayState* play, Input* input, f32 magnitude, s16 baseYaw); diff --git a/src/code/z_actor.c b/src/code/z_actor.c index a1b60fa695..912c3ee81c 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1207,44 +1207,44 @@ void Actor_UpdatePosFromSkelAnime(Actor* actor, SkelAnime* skelAnime) { actor->world.pos.z += pos.z * actor->scale.z; } -s16 Actor_YawBetweenActors(Actor* from, Actor* to) { - return Math_Vec3f_Yaw(&from->world.pos, &to->world.pos); +s16 Actor_WorldYawTowardActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_Yaw(&actorA->world.pos, &actorB->world.pos); } -s16 Actor_YawBetweenActorsTop(Actor* from, Actor* to) { - return Math_Vec3f_Yaw(&from->focus.pos, &to->focus.pos); +s16 Actor_FocusYawTowardActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_Yaw(&actorA->focus.pos, &actorB->focus.pos); } -s16 Actor_YawToPoint(Actor* actor, Vec3f* point) { - return Math_Vec3f_Yaw(&actor->world.pos, point); +s16 Actor_WorldYawTowardPoint(Actor* actor, Vec3f* refPoint) { + return Math_Vec3f_Yaw(&actor->world.pos, refPoint); } -s16 Actor_PitchBetweenActors(Actor* from, Actor* to) { - return Math_Vec3f_Pitch(&from->world.pos, &to->world.pos); +s16 Actor_WorldPitchTowardActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_Pitch(&actorA->world.pos, &actorB->world.pos); } -s16 Actor_PitchBetweenActorsTop(Actor* from, Actor* to) { - return Math_Vec3f_Pitch(&from->focus.pos, &to->focus.pos); +s16 Actor_FocusPitchTowardActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_Pitch(&actorA->focus.pos, &actorB->focus.pos); } -s16 Actor_PitchToPoint(Actor* actor, Vec3f* point) { - return Math_Vec3f_Pitch(&actor->world.pos, point); +s16 Actor_WorldPitchTowardPoint(Actor* actor, Vec3f* refPoint) { + return Math_Vec3f_Pitch(&actor->world.pos, refPoint); } -f32 Actor_DistanceBetweenActors(Actor* actor1, Actor* actor2) { - return Math_Vec3f_DistXYZ(&actor1->world.pos, &actor2->world.pos); +f32 Actor_WorldDistXYZToActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_DistXYZ(&actorA->world.pos, &actorB->world.pos); } -f32 Actor_DistanceToPoint(Actor* actor, Vec3f* point) { - return Math_Vec3f_DistXYZ(&actor->world.pos, point); +f32 Actor_WorldDistXYZToPoint(Actor* actor, Vec3f* refPoint) { + return Math_Vec3f_DistXYZ(&actor->world.pos, refPoint); } -f32 Actor_XZDistanceBetweenActors(Actor* actor1, Actor* actor2) { - return Math_Vec3f_DistXZ(&actor1->world.pos, &actor2->world.pos); +f32 Actor_WorldDistXZToActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_DistXZ(&actorA->world.pos, &actorB->world.pos); } -f32 Actor_XZDistanceToPoint(Actor* actor, Vec3f* point) { - return Math_Vec3f_DistXZ(&actor->world.pos, point); +f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint) { + return Math_Vec3f_DistXZ(&actor->world.pos, refPoint); } /** @@ -1416,7 +1416,7 @@ s32 Player_IsFacingActor(Actor* actor, s16 maxAngleDiff, PlayState* play) { * This function is unused in the original game. */ s32 Actor_ActorBIsFacingActorA(Actor* actorA, Actor* actorB, s16 maxAngleDiff) { - s16 angle = BINANG_ROT180(Actor_YawBetweenActors(actorA, actorB)); + s16 angle = BINANG_ROT180(Actor_WorldYawTowardActor(actorA, actorB)); s16 dist = angle - actorB->shape.rot.y; if (ABS_ALT(dist) < maxAngleDiff) { @@ -1444,7 +1444,7 @@ s32 Actor_IsFacingPlayer(Actor* actor, s16 angle) { * The maximum angle difference that qualifies as "facing" is specified by `maxAngleDiff`. */ s32 Actor_ActorAIsFacingActorB(Actor* actorA, Actor* actorB, s16 maxAngleDiff) { - s16 dist = Actor_YawBetweenActors(actorA, actorB) - actorA->shape.rot.y; + s16 dist = Actor_WorldYawTowardActor(actorA, actorB) - actorA->shape.rot.y; if (ABS_ALT(dist) < maxAngleDiff) { return true; @@ -1477,8 +1477,8 @@ s32 Actor_IsFacingAndNearPlayer(Actor* actor, f32 range, s16 maxAngleDiff) { * The maximum distance that qualifies as "nearby" is specified by `range`. */ s32 Actor_ActorAIsFacingAndNearActorB(Actor* actorA, Actor* actorB, f32 range, s16 maxAngleDiff) { - if (Actor_DistanceBetweenActors(actorA, actorB) < range) { - s16 dist = Actor_YawBetweenActors(actorA, actorB) - actorA->shape.rot.y; + if (Actor_WorldDistXYZToActor(actorA, actorB) < range) { + s16 dist = Actor_WorldYawTowardActor(actorA, actorB) - actorA->shape.rot.y; if (ABS_ALT(dist) < maxAngleDiff) { return true; @@ -2362,11 +2362,11 @@ Actor* Actor_UpdateActor(UpdateActor_Params* params) { CollisionCheck_ResetDamage(&actor->colChkInfo); } else { Math_Vec3f_Copy(&actor->prevPos, &actor->world.pos); - actor->xzDistToPlayer = Actor_XZDistanceBetweenActors(actor, ¶ms->player->actor); + actor->xzDistToPlayer = Actor_WorldDistXZToActor(actor, ¶ms->player->actor); actor->playerHeightRel = Actor_HeightDiff(actor, ¶ms->player->actor); actor->xyzDistToPlayerSq = SQ(actor->xzDistToPlayer) + SQ(actor->playerHeightRel); - actor->yawTowardsPlayer = Actor_YawBetweenActors(actor, ¶ms->player->actor); + actor->yawTowardsPlayer = Actor_WorldYawTowardActor(actor, ¶ms->player->actor); actor->flags &= ~ACTOR_FLAG_1000000; if ((DECR(actor->freezeTimer) == 0) && (actor->flags & params->unk_18)) { @@ -3584,8 +3584,8 @@ s32 func_800BC188(s32 index) { } s32 func_800BC1B4(Actor* actor, Actor* arg1, f32 arg2, f32 arg3) { - if ((arg3 > 0.0f) && (Actor_DistanceBetweenActors(arg1, actor) < ((arg3 * 2.5f) + arg2))) { - s16 temp_v1 = BINANG_SUB(Actor_YawBetweenActors(arg1, actor), arg1->world.rot.y); + if ((arg3 > 0.0f) && (Actor_WorldDistXYZToActor(arg1, actor) < ((arg3 * 2.5f) + arg2))) { + s16 temp_v1 = BINANG_SUB(Actor_WorldYawTowardActor(arg1, actor), arg1->world.rot.y); if (ABS_ALT(temp_v1) < 0x1400) { return true; @@ -4296,7 +4296,7 @@ Actor* Actor_FindNearby(PlayState* play, Actor* inActor, s16 actorId, u8 actorCa continue; } - if (Actor_DistanceBetweenActors(inActor, actor) <= distance) { + if (Actor_WorldDistXYZToActor(inActor, actor) <= distance) { return actor; } @@ -4416,7 +4416,7 @@ void func_800BE504(Actor* actor, ColliderCylinder* collider) { if ((collider->info.acHitInfo->toucher.dmgFlags & (0x10000 | 0x2000 | 0x1000 | 0x800 | 0x20))) { actor->world.rot.y = collider->base.ac->shape.rot.y; } else { - actor->world.rot.y = Actor_YawBetweenActors(collider->base.ac, actor); + actor->world.rot.y = Actor_WorldYawTowardActor(collider->base.ac, actor); } } @@ -4424,7 +4424,7 @@ void func_800BE568(Actor* actor, ColliderSphere* collider) { if (collider->info.acHitInfo->toucher.dmgFlags & (0x10000 | 0x2000 | 0x1000 | 0x800 | 0x20)) { actor->world.rot.y = collider->base.ac->shape.rot.y; } else { - actor->world.rot.y = Actor_YawBetweenActors(collider->base.ac, actor); + actor->world.rot.y = Actor_WorldYawTowardActor(collider->base.ac, actor); } } @@ -4433,7 +4433,7 @@ void func_800BE5CC(Actor* actor, ColliderJntSph* collider, s32 colliderIndex) { (0x10000 | 0x2000 | 0x1000 | 0x800 | 0x20)) { actor->world.rot.y = collider->base.ac->shape.rot.y; } else { - actor->world.rot.y = Actor_YawBetweenActors(collider->base.ac, actor); + actor->world.rot.y = Actor_WorldYawTowardActor(collider->base.ac, actor); } } @@ -4733,7 +4733,7 @@ void Actor_SpawnIceEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s32 l SoundSource_PlaySfxAtFixedWorldPos(play, &actor->world.pos, 30, NA_SE_EV_ICE_BROKEN); for (i = 0; i < limbPosCount; i++) { - yaw = Actor_YawToPoint(actor, limbPos); + yaw = Actor_WorldYawTowardPoint(actor, limbPos); for (j = 0; j < effectsPerLimb; j++) { randomYaw = ((s32)Rand_Next() >> 0x13) + yaw; diff --git a/src/code/z_en_hy_code.c b/src/code/z_en_hy_code.c index 01ec9eca30..66645753e5 100644 --- a/src/code/z_en_hy_code.c +++ b/src/code/z_en_hy_code.c @@ -69,7 +69,7 @@ EnDoor* EnHy_FindNearestDoor(Actor* actor, PlayState* play) { do { doorIter = SubS_FindActor(play, doorIter, ACTORCAT_DOOR, ACTOR_EN_DOOR); door = (EnDoor*)doorIter; - dist = Actor_DistanceBetweenActors(actor, &door->dyna.actor); + dist = Actor_WorldDistXYZToActor(actor, &door->dyna.actor); if (!isSetup || (dist < minDist)) { nearestDoor = door; minDist = dist; diff --git a/src/code/z_sub_s.c b/src/code/z_sub_s.c index 8f412364d8..a792f3ce2d 100644 --- a/src/code/z_sub_s.c +++ b/src/code/z_sub_s.c @@ -517,7 +517,7 @@ Actor* SubS_FindNearestActor(Actor* actor, PlayState* play, u8 actorCategory, s1 actorIter = actorTmp; if (actorIter != actor) { - dist = Actor_DistanceBetweenActors(actor, actorIter); + dist = Actor_WorldDistXYZToActor(actor, actorIter); if (!isSetup || dist < minDist) { closestActor = actorIter; minDist = dist; @@ -1522,7 +1522,7 @@ s32 func_8013E748(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, s32 ex s32 SubS_ActorAndPlayerFaceEachOther(PlayState* play, Actor* actor, void* data) { Player* player = GET_PLAYER(play); Vec3s* yawTols = (Vec3s*)data; - s16 playerYaw = ABS(BINANG_SUB(Actor_YawBetweenActors(&player->actor, actor), player->actor.shape.rot.y)); + s16 playerYaw = ABS(BINANG_SUB(Actor_WorldYawTowardActor(&player->actor, actor), player->actor.shape.rot.y)); s16 actorYaw = ABS(BINANG_SUB(actor->yawTowardsPlayer, actor->shape.rot.y)); s32 areFacing = false; s32 actorYawTol = ABS(yawTols->y); 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 e3ac3e7538..3607accaf7 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -168,7 +168,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { grabbed = NULL; this->grabbed = NULL; } else if (this->actor.child != NULL) { - f32 sp94 = Actor_DistanceBetweenActors(&this->actor, grabbed); + f32 sp94 = Actor_WorldDistXYZToActor(&this->actor, grabbed); f32 sp90 = sqrtf(SQXYZ(this->unk1FC)); Math_Vec3f_Diff(&grabbed->world.pos, &this->unk1FC, &this->actor.world.pos); 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 8233bb0cb4..931ca2ad07 100644 --- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c +++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c @@ -1254,7 +1254,7 @@ void DmStk_ClockTower_AdjustHeightAndRotation(DmStk* this, PlayState* play) { sin = Math_SinS(this->bobPhase) * 10.0f; Math_SmoothStepToF(&this->actor.world.pos.y, 160.0f + sin, 0.2f, 1.0f, 0.0001f); - this->actor.world.rot.y = Actor_YawBetweenActors(&this->actor, &player->actor); + this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, &player->actor); this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.world.rot.x = 0x1B58; 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 db564f3f26..cfad99d2ab 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -652,7 +652,7 @@ s32 func_808A1D68(DoorShutter* this, PlayState* play) { return true; } - temp_a0 = BINANG_SUB(Actor_YawToPoint(&this->actor, &play->view.eye), this->actor.shape.rot.y); + temp_a0 = BINANG_SUB(Actor_WorldYawTowardPoint(&this->actor, &play->view.eye), this->actor.shape.rot.y); temp_a1 = BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y); temp_a0 = ABS_ALT(temp_a0); 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 f76ebc4f3f..4ef21564d5 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -307,7 +307,7 @@ void func_808B03C0(EnAm* this, PlayState* play) { } if (this->explodeTimer == 0) { func_808B0640(this); - } else if ((this->returnHomeTimer == 0) || Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 240.0f) { + } else if ((this->returnHomeTimer == 0) || Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 240.0f) { func_808B0460(this); } } @@ -315,7 +315,7 @@ void func_808B03C0(EnAm* this, PlayState* play) { void func_808B0460(EnAm* this) { this->actor.world.rot.y = this->actor.shape.rot.y; this->speed = 0.0f; - this->armosYaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + this->armosYaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); this->actionFunc = func_808B04A8; } @@ -345,15 +345,15 @@ void func_808B0508(EnAm* this, PlayState* play) { void func_808B057C(EnAm* this) { this->speed = 6.0f; - this->armosYaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + this->armosYaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); this->explodeTimer = 1; this->actionFunc = func_808B05C8; } void func_808B05C8(EnAm* this, PlayState* play) { - this->armosYaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + this->armosYaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); func_808B0208(this, play); - if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 8.0f) { + if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 8.0f) { func_808B04E4(this); } } 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 e87bf9d62f..90b611529a 100644 --- a/src/overlays/actors/ovl_En_Az/z_en_az.c +++ b/src/overlays/actors/ovl_En_Az/z_en_az.c @@ -654,7 +654,7 @@ void func_80A95FE8(EnAz* this, PlayState* play) { } else { ActorCutscene_SetIntentToPlay(this->unk_3D0[0]); } - if (Actor_DistanceToPoint(&this->actor, &this->actor.home.pos) > 20.0f) { + if (Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos) > 20.0f) { func_800B9010(&this->actor, NA_SE_EV_BEAVER_SWIM_MOTOR - SFX_FLAG); func_800BE33C(&this->actor.world.pos, &this->actor.home.pos, &this->actor.world.rot, 0); Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x, 3, 0xE38, 0x38E); @@ -1615,7 +1615,7 @@ void func_80A98414(EnAz* this, PlayState* play) { if ((fish->actor.params < 0) && (fish->actor.room == this->actor.room) && (Math3D_Vec3fDistSq(&this->actor.world.pos, &fish->actor.world.pos) < SQ(200.0f))) { fish->unk_276 = 0x14; - fish->unk_274 = Actor_YawBetweenActors(&fish->actor, &this->actor); + fish->unk_274 = Actor_WorldYawTowardActor(&fish->actor, &this->actor); } } itemAction = itemAction->next; 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 cee109c700..e30612c17c 100644 --- a/src/overlays/actors/ovl_En_Bat/z_en_bat.c +++ b/src/overlays/actors/ovl_En_Bat/z_en_bat.c @@ -230,7 +230,7 @@ void EnBat_FlyIdle(EnBat* this, PlayState* play) { this->yawTarget = this->actor.wallYaw; } else if (Math3D_XZDistanceSquared(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x, this->actor.home.pos.z) > SQ(300.0f)) { - this->yawTarget = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + this->yawTarget = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); } else if (finishedRotStep && (Rand_ZeroOne() < 0.015f)) { this->yawTarget = this->actor.shape.rot.y + (((s32)(0x1000 * Rand_ZeroOne()) + 0x1000) * ((Rand_ZeroOne() < 0.5f) ? -1 : 1)); @@ -282,7 +282,7 @@ void EnBat_DiveAttack(EnBat* this, PlayState* play) { preyPos.y = player->actor.world.pos.y + 20.0f; preyPos.z = player->actor.world.pos.z; - pitchTarget = Actor_PitchToPoint(&this->actor, &preyPos); + pitchTarget = Actor_WorldPitchTowardPoint(&this->actor, &preyPos); pitchTarget = CLAMP(pitchTarget, -0x3000, 0x3000); Math_SmoothStepToS(&this->actor.shape.rot.x, pitchTarget, 2, 0x400, 0x40); } else { 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 c5657e3858..21c3465ba6 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -236,10 +236,10 @@ void EnBb_SetupFlyIdle(EnBb* this) { this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; this->flyHeightMod = (Math_CosS(this->bobPhase) * 10.0f) + 30.0f; - this->targetYRotation = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + this->targetYRotation = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); if ((this->actor.xzDistToPlayer < (this->attackRange + 120.0f)) || - (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 300.0f)) { + (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 300.0f)) { this->targetYRotation += (s16)((s32)Rand_Next() >> 0x11); } @@ -299,7 +299,7 @@ void EnBb_Attack(EnBb* this, PlayState* play) { if (((this->attackRange + 120.0f) < this->actor.xzDistToPlayer) || (this->timer == 0) || (Player_GetMask(play) == PLAYER_MASK_STONE) || - (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 400.0f)) { + (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 400.0f)) { EnBb_SetupFlyIdle(this); } } 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 1f037a8a8f..e3097696dd 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -133,7 +133,7 @@ void EnBigokuta_SetupCutsceneCamera(EnBigokuta* this, PlayState* play, Vec3f* su this->subCamId = ActorCutscene_GetCurrentSubCamId(this->picto.actor.cutscene); Play_SetCameraAtEye(play, this->subCamId, subCamAt, subCamEye); - angle = BINANG_SUB(Actor_YawToPoint(&this->picto.actor, subCamEye), this->picto.actor.home.rot.y); + angle = BINANG_SUB(Actor_WorldYawTowardPoint(&this->picto.actor, subCamEye), this->picto.actor.home.rot.y); if (angle > 0) { angle = BINANG_ADD(this->picto.actor.home.rot.y, 0x1800); } else { @@ -475,7 +475,7 @@ s32 EnBigokuta_IsNearSwampBoat(EnBigokuta* this, PlayState* play) { this->picto.actor.child = SubS_FindActor(play, NULL, ACTORCAT_BG, ACTOR_BG_INGATE); if ((this->picto.actor.child != NULL) && - (Actor_XZDistanceBetweenActors(&this->picto.actor, this->picto.actor.child) < 250.0f)) { + (Actor_WorldDistXZToActor(&this->picto.actor, this->picto.actor.child) < 250.0f)) { return true; } else { return false; 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 2c27a18013..3dad5b9c6a 100644 --- a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c +++ b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c @@ -431,7 +431,8 @@ void func_80A2844C(EnBigpamet* this, PlayState* play) { SkelAnime_Update(&this->skelAnime2); if (this->actor.parent->params == GEKKO_RETURN_TO_SNAPPER) { - Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, this->actor.parent), 0x400); + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, this->actor.parent), + 0x400); this->actor.world.rot.y = this->actor.shape.rot.y; } else if (this->actor.parent->params == GEKKO_JUMP_ON_SNAPPER) { this->actor.speedXZ = 0.0f; @@ -622,7 +623,7 @@ void func_80A28B98(EnBigpamet* this, PlayState* play) { if ((this->actor.draw == func_80A2966C) && (this->actionFunc != func_80A28DC0)) { this->actor.draw = EnBigpamet_Draw; } else if (this->collider.base.ac != NULL) { - this->actor.world.rot.y = BINANG_ROT180(Actor_YawBetweenActors(&this->actor, this->collider.base.ac)); + this->actor.world.rot.y = BINANG_ROT180(Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac)); } this->actor.shape.rot.y = this->actor.world.rot.y; @@ -638,7 +639,7 @@ void func_80A28B98(EnBigpamet* this, PlayState* play) { collectible = Item_DropCollectible(play, &this->actor.world.pos, ITEM00_ARROWS_10); if (collectible != NULL) { collectible->velocity.y = 15.0f; - collectible->world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + collectible->world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); } Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_PAMET_REVERSE); 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 5398418f2c..b8e4eee137 100644 --- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c +++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c @@ -558,8 +558,8 @@ void EnBigpo_IdleFlying(EnBigpo* this, PlayState* play) { this->actor.world.pos.y = (sin_rad(this->hoverHeightCycleTimer * (M_PI / 20)) * 10.0f) + this->savedHeight; Math_StepToF(&this->actor.speedXZ, 3.0f, 0.2f); func_800B9010(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); - if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { - this->unk208 = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { + this->unk208 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); } if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->unk208, 0x200) && (Rand_ZeroOne() < 0.075f)) { 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 9cf4b425b2..bfe668b3fc 100644 --- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c +++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c @@ -1500,7 +1500,7 @@ void EnBigslime_SetupCutsceneGrabPlayer(EnBigslime* this, PlayState* play) { this->grabPlayerTimer = 15; this->wavySurfaceTimer = 0; this->bigslimeCollider[0].base.atFlags &= ~AT_ON; - this->actor.world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); yaw = Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) - this->actor.world.rot.y; if (yaw > 0x4000) { @@ -2056,8 +2056,8 @@ void EnBigslime_JumpGekko(EnBigslime* this, PlayState* play) { } if (Math_SmoothStepToS(&this->actor.world.rot.y, this->gekkoYaw, 5, 0x1000, 0x80) == 0) { - if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 240.0f) { - yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 240.0f) { + yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); yawDiff = yaw - (s16)(this->actor.yawTowardsPlayer + 0x8000); this->gekkoYaw = ABS_ALT(yawDiff) < 0x3000 ? yaw : (yawDiff / 2) + (s16)(this->actor.yawTowardsPlayer + 0x8000); @@ -2088,7 +2088,7 @@ void EnBigslime_SetupIdleLookAround(EnBigslime* this) { Animation_PlayOnce(&this->skelAnime, &gGekkoNervousIdleAnim); this->idleTimer = 60; this->actor.speedXZ = 0.0f; - if (BINANG_SUB(Actor_YawToPoint(&this->actor, &this->actor.home.pos), this->gekkoRot.y) > 0) { + if (BINANG_SUB(Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), this->gekkoRot.y) > 0) { this->gekkoYaw = this->gekkoRot.y + (Rand_Next() >> 20) + 0x2000; } else { this->gekkoYaw = this->gekkoRot.y - (Rand_Next() >> 20) - 0x2000; @@ -2110,7 +2110,7 @@ void EnBigslime_IdleLookAround(EnBigslime* this, PlayState* play) { if ((this->skelAnime.animation == &gGekkoNervousIdleAnim) && Math_ScaledStepToS(&this->gekkoRot.y, this->gekkoYaw, 0x400)) { - if (BINANG_SUB(Actor_YawToPoint(&this->actor, &this->actor.home.pos), this->gekkoRot.y) > 0) { + if (BINANG_SUB(Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), this->gekkoRot.y) > 0) { this->gekkoYaw = this->gekkoRot.y + (Rand_Next() >> 20) + 0x2000; } else { this->gekkoYaw = this->gekkoRot.y - (Rand_Next() >> 20) - 0x2000; @@ -2224,8 +2224,8 @@ void EnBigslime_StunGekko(EnBigslime* this, PlayState* play) { void EnBigslime_SetupCutsceneFormBigslime(EnBigslime* this) { Animation_PlayOnce(&this->skelAnime, &gGekkoJumpUpAnim); this->gekkoCollider.base.acFlags &= ~AC_ON; - this->actor.world.rot.x = -Actor_PitchToPoint(&this->actor, &this->actor.home.pos); - this->actor.world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + this->actor.world.rot.x = -Actor_WorldPitchTowardPoint(&this->actor, &this->actor.home.pos); + this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); this->actionFunc = EnBigslime_CutsceneFormBigslime; this->actor.speedXZ = 0.0f; } @@ -2334,7 +2334,7 @@ void EnBigslime_SetupCutsceneDefeat(EnBigslime* this, PlayState* play) { subCamAt.y = this->actor.world.pos.y + 40.0f; subCamAt.z = this->actor.world.pos.z; - if (BINANG_SUB(Actor_YawToPoint(&this->actor, &this->actor.home.pos), this->actor.world.rot.y) > 0) { + if (BINANG_SUB(Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), this->actor.world.rot.y) > 0) { yawOffset = this->actor.world.rot.y + 0x4000; } else { yawOffset = this->actor.world.rot.y - 0x4000; 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 33af85b3e5..aeaed963b0 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -177,9 +177,9 @@ void func_808A2918(EnBoom* this, PlayState* play) { sp7C = this->player; if (sp7C != NULL) { - sp72 = Actor_YawToPoint(&this->actor, &sp7C->focus.pos); + sp72 = Actor_WorldYawTowardPoint(&this->actor, &sp7C->focus.pos); sp70 = this->actor.world.rot.y - sp72; - sp6E = Actor_PitchToPoint(&this->actor, &sp7C->focus.pos); + sp6E = Actor_WorldPitchTowardPoint(&this->actor, &sp7C->focus.pos); sp6C = this->actor.world.rot.x - sp6E; sp64 = (200.0f - Math_Vec3f_DistXYZ(&this->actor.world.pos, &sp7C->focus.pos)) * 0.005f; 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 b9e1071feb..8ffdc6b247 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -168,7 +168,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) { if ((this->actor.parent != NULL) && (this->actor.parent->home.rot.z == 0)) { this->actor.home.pos.x = this->actor.parent->world.pos.x; this->actor.home.pos.z = this->actor.parent->world.pos.z; - dist = Actor_XZDistanceToPoint(&this->actor, &this->actor.parent->world.pos); + dist = Actor_WorldDistXZToPoint(&this->actor, &this->actor.parent->world.pos); } else { dist = 450.0f; this->actor.flags |= ACTOR_FLAG_1; @@ -176,14 +176,14 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) { if (this->actor.bgCheckFlags & 8) { this->yawTarget = this->actor.wallYaw; - } else if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { - this->yawTarget = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + } else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { + this->yawTarget = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); } if ((Math_SmoothStepToS(&this->actor.shape.rot.y, this->yawTarget, 5, 0x300, 0x10) == 0) && onInitialAnimFrame && (Rand_ZeroOne() < 0.1f)) { - yaw = (Actor_YawToPoint(&this->actor, &this->actor.home.pos) - this->actor.shape.rot.y); + yaw = (Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos) - this->actor.shape.rot.y); if (yaw > 0) { this->yawTarget += Rand_S16Offset(0x1000, 0x1000); } else { @@ -258,16 +258,16 @@ void EnCrow_DiveAttack(EnCrow* this, PlayState* play) { } targetPos.x = this->actor.child->world.pos.x; targetPos.z = this->actor.child->world.pos.z; - pitchTarget = Actor_PitchToPoint(&this->actor, &targetPos); + pitchTarget = Actor_WorldPitchTowardPoint(&this->actor, &targetPos); pitchTarget = CLAMP(pitchTarget, -0x3000, 0x3000); Math_SmoothStepToS(&this->actor.shape.rot.x, pitchTarget, 2, 0x400, 0x40); } else { Math_SmoothStepToS(&this->actor.shape.rot.x, -0x800, 2, 0x100, 0x10); } - if (isFacingActor || (Actor_XZDistanceBetweenActors(&this->actor, this->actor.child) > 80.0f)) { - Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, this->actor.child), 4, 0xC00, - 0xC0); + if (isFacingActor || (Actor_WorldDistXZToActor(&this->actor, this->actor.child) > 80.0f)) { + Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, this->actor.child), 4, + 0xC00, 0xC0); } if (((this->timer == 0) || ((&player->actor != this->actor.child) && (this->actor.child->home.rot.z != 0)) || 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 6bc0fd8d19..4bf0f20d5b 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -299,7 +299,7 @@ void func_808BDA4C(EnDekunuts* this, PlayState* play) { sp58.x = player->actor.world.pos.x; sp58.z = player->actor.world.pos.z; sp58.y = player->actor.world.pos.y + 40.0f; - pitch = Actor_PitchToPoint(&this->actor, &sp58); + pitch = Actor_WorldPitchTowardPoint(&this->actor, &sp58); pitch = CLAMP(pitch, -0x3800, -0x2000); if (this->skelAnime.curFrame < 7.0f) { Math_ScaledStepToS(&this->actor.world.rot.x, pitch, 0x800); @@ -414,11 +414,11 @@ void func_808BDFB8(EnDekunuts* this, PlayState* play) { Math_StepToF(&this->actor.speedXZ, 7.5f, 1.0f); if (!Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_192, 1, 0xE38, 0xB6)) { if (this->actor.bgCheckFlags & 0x20) { - this->unk_192 = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + this->unk_192 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); } else if (this->actor.bgCheckFlags & 8) { this->unk_192 = this->actor.wallYaw; } else if (this->unk_18D == 0) { - yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); yaw2 = yaw - this->actor.yawTowardsPlayer; if (ABS_ALT(yaw2) > 0x2000) { this->unk_192 = yaw; @@ -431,7 +431,7 @@ void func_808BDFB8(EnDekunuts* this, PlayState* play) { } this->actor.shape.rot.y = BINANG_ROT180(this->actor.world.rot.y); - if ((this->unk_18D == 0) && (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 20.0f) && + if ((this->unk_18D == 0) && (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 20.0f) && (fabsf(this->actor.world.pos.y - this->actor.home.pos.y) < 2.0f)) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.flags &= ~ACTOR_FLAG_20; 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 643c167f07..687ea75578 100644 --- a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c +++ b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c @@ -415,7 +415,7 @@ s32 func_8089AE00(EnDinofos* this, PlayState* play) { temp_v0 = func_800BC270(play, &this->actor, 80.0f, 0x138B0); if (temp_v0 != NULL) { - temp_v1 = (Actor_YawBetweenActors(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_28E; + temp_v1 = (Actor_WorldYawTowardActor(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_28E; if (ABS_ALT(temp_v1) < 0x3000) { func_8089D11C(this, temp_v1 + this->unk_28E); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WARAU); @@ -425,7 +425,7 @@ s32 func_8089AE00(EnDinofos* this, PlayState* play) { temp_v0 = func_800BC444(play, &this->actor, 80.0f); if ((temp_v0 != NULL) && (temp_v0->id == ACTOR_EN_BOM_CHU)) { - temp_v1_2 = (Actor_YawBetweenActors(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_28E; + temp_v1_2 = (Actor_WorldYawTowardActor(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_28E; if (ABS_ALT(temp_v1_2) < 0x3000) { func_8089C024(this, 1); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WARAU); 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 12e048955b..15a34821ad 100644 --- a/src/overlays/actors/ovl_En_Dno/z_en_dno.c +++ b/src/overlays/actors/ovl_En_Dno/z_en_dno.c @@ -311,7 +311,7 @@ void func_80A71B68(EnDno* this, PlayState* play) { if (!(this->unk_3B0 & 0x20)) { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, EN_DNO_ANIM_PRAYER_LOOP, &this->animIndex); - this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, this->unk_460); + this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, this->unk_460); } } else { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, EN_DNO_ANIM_IDLE, &this->animIndex); @@ -347,8 +347,8 @@ void func_80A71C3C(EnDno* this, PlayState* play) { } case EN_DNO_ANIM_PRAYER_LOOP: - Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, this->unk_460), 2, 0xE38, - 0x222); + Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, this->unk_460), 2, + 0xE38, 0x222); break; } @@ -436,7 +436,7 @@ void func_80A71F18(EnDno* this, PlayState* play) { &this->animIndex); } Math_ScaledStepToS(&this->actor.shape.rot.y, - Actor_YawBetweenActors(&this->actor, this->unk_460), 0x71C); + Actor_WorldYawTowardActor(&this->actor, this->unk_460), 0x71C); break; case EN_DNO_ANIM_IMPLORE_END: 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 d1ec4ea701..e883a6f507 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -592,9 +592,10 @@ void func_80877500(EnDodongo* this, PlayState* play) { } } } else { - if ((Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 150.0f) || + if ((Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 150.0f) || (Player_GetMask(play) == PLAYER_MASK_STONE)) { - Math_ScaledStepToS(&this->actor.world.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 0x1F4); + Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 0x1F4); } this->timer--; 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 3d7e79a3dc..0df2b693eb 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -457,7 +457,7 @@ void func_80866A5C(EnDoor* this, PlayState* play) { this->unk_1A6 = 10; } } else if ((this->unk_1A4 == 4) && - (Actor_XZDistanceBetweenActors(&this->dyna.actor, &GET_PLAYER(play)->actor) > 120.0f)) { + (Actor_WorldDistXZToActor(&this->dyna.actor, &GET_PLAYER(play)->actor) > 120.0f)) { this->actionFunc = func_8086704C; this->dyna.actor.world.rot.y = -0x1800; } 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 ea76ef0747..f64001b84a 100644 --- a/src/overlays/actors/ovl_En_Fall/z_en_fall.c +++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.c @@ -798,7 +798,7 @@ void EnFall_LodMoon_DrawWithoutLerp(Actor* thisx, PlayState* play) { * to be 9000 units away before drawing it. */ void EnFall_LodMoon_DrawWithLerp(Actor* thisx, PlayState* play) { - f32 distanceToEye = Actor_DistanceToPoint(thisx, &play->view.eye); + f32 distanceToEye = Actor_WorldDistXYZToPoint(thisx, &play->view.eye); f32 scale; Vec3f translation; 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 27dcabc23c..fd45368985 100644 --- a/src/overlays/actors/ovl_En_Famos/z_en_famos.c +++ b/src/overlays/actors/ovl_En_Famos/z_en_famos.c @@ -273,7 +273,7 @@ void EnFamos_SetupDeathDebris(EnFamos* this) { s32 EnFamos_IsPlayerSeen(EnFamos* this, PlayState* play) { if ((Player_GetMask(play) != PLAYER_MASK_STONE) && - (Actor_XZDistanceToPoint(&GET_PLAYER(play)->actor, &this->calmPos) < this->aggroDistance) && + (Actor_WorldDistXZToPoint(&GET_PLAYER(play)->actor, &this->calmPos) < this->aggroDistance) && Actor_IsFacingPlayer(&this->actor, 0x5000)) { return true; } else { @@ -374,7 +374,7 @@ void EnFamos_SetupPathingIdle(EnFamos* this) { } Math_Vec3s_ToVec3f(&this->targetDest, &this->pathPoints[this->currentPathNode]); - this->targetYaw = Actor_YawToPoint(&this->actor, &this->targetDest); + this->targetYaw = Actor_WorldYawTowardPoint(&this->actor, &this->targetDest); this->actionFunc = EnFamos_PathingIdle; this->actor.speedXZ = 0.0f; } @@ -396,7 +396,7 @@ void EnFamos_PathingIdle(EnFamos* this, PlayState* play) { * Famos lost player; Turning to face back toward home. */ void EnFamos_SetupTurnHome(EnFamos* this) { - this->targetYaw = Actor_YawToPoint(&this->actor, &this->calmPos); + this->targetYaw = Actor_WorldYawTowardPoint(&this->actor, &this->calmPos); Math_Vec3f_Copy(&this->targetDest, &this->calmPos); this->actionFunc = EnFamos_TurnHome; this->actor.speedXZ = 0.0f; @@ -416,14 +416,14 @@ void EnFamos_TurnHome(EnFamos* this, PlayState* play) { */ void EnFamos_SetupReturnHome(EnFamos* this) { this->actor.world.rot.y = this->actor.shape.rot.y; - this->actor.world.rot.x = -Actor_PitchToPoint(&this->actor, &this->targetDest); + this->actor.world.rot.x = -Actor_WorldPitchTowardPoint(&this->actor, &this->targetDest); this->actionFunc = EnFamos_ReturnHome; } void EnFamos_ReturnHome(EnFamos* this, PlayState* play) { - f32 distanceToHome = Actor_XZDistanceToPoint(&this->actor, &this->targetDest); + f32 distanceToHome = Actor_WorldDistXZToPoint(&this->actor, &this->targetDest); - this->actor.shape.rot.y = Actor_YawToPoint(&this->actor, &this->targetDest); + this->actor.shape.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->targetDest); this->actor.world.rot.y = this->actor.shape.rot.y; EnFamos_UpdateBobbingHeight(this); if (this->isCalm) { @@ -497,7 +497,7 @@ void EnFamos_Chase(EnFamos* this, PlayState* play) { abovePlayerPos.x = player->actor.world.pos.x; abovePlayerPos.y = player->actor.world.pos.y + 100.0f; abovePlayerPos.z = player->actor.world.pos.z; - this->actor.world.rot.x = -Actor_PitchToPoint(&this->actor, &abovePlayerPos); + this->actor.world.rot.x = -Actor_WorldPitchTowardPoint(&this->actor, &abovePlayerPos); Math_StepToF(&this->actor.speedXZ, 6.0f, 0.5f); surfaceType = func_800C9B18(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); @@ -506,7 +506,7 @@ void EnFamos_Chase(EnFamos* this, PlayState* play) { EnFamos_SetupAttackAim(this); } else if ((Player_GetMask(play) == PLAYER_MASK_STONE) || - (this->aggroDistance < Actor_XZDistanceToPoint(&GET_PLAYER(play)->actor, &this->calmPos)) || + (this->aggroDistance < Actor_WorldDistXZToPoint(&GET_PLAYER(play)->actor, &this->calmPos)) || !Actor_IsFacingPlayer(&this->actor, 0x6000)) { EnFamos_SetupScanForPlayer(this); } 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 c41e6fd769..226874c816 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -208,8 +208,8 @@ s32 EnFirefly_ReturnToPerch(EnFirefly* this, PlayState* play) { return false; } - if (Actor_XZDistanceToPoint(&player->actor, &this->actor.home.pos) > 300.0f) { - distFromHome = Actor_DistanceToPoint(&this->actor, &this->actor.home.pos); + if (Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) > 300.0f) { + distFromHome = Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos); if (distFromHome < 5.0f) { EnFirefly_SetupPerch(this); @@ -218,9 +218,10 @@ s32 EnFirefly_ReturnToPerch(EnFirefly* this, PlayState* play) { this->actor.speedXZ *= distFromHome * 0.05f; } - Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 0x300); + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 0x300); Math_ScaledStepToS(&this->actor.shape.rot.x, - Actor_PitchToPoint(&this->actor, &this->actor.home.pos) + 0x1554, 0x100); + Actor_WorldPitchTowardPoint(&this->actor, &this->actor.home.pos) + 0x1554, 0x100); } return true; @@ -242,7 +243,7 @@ s32 EnFirefly_SeekTorch(EnFirefly* this, PlayState* play) { while (findTorch != NULL) { if ((findTorch->actor.id == ACTOR_OBJ_SYOKUDAI) && (findTorch->snuffTimer != OBJ_SYOKUDAI_SNUFF_OUT)) { - currentDist = Actor_DistanceBetweenActors(&this->actor, &findTorch->actor); + currentDist = Actor_WorldDistXYZToActor(&this->actor, &findTorch->actor); if (currentDist < currentMinDist) { currentMinDist = currentDist; closestTorch = findTorch; @@ -256,12 +257,13 @@ s32 EnFirefly_SeekTorch(EnFirefly* this, PlayState* play) { flamePos.y = closestTorch->actor.world.pos.y + 52.0f + 30.0f; flamePos.z = closestTorch->actor.world.pos.z; - if (Actor_DistanceToPoint(&this->actor, &flamePos) < 15.0f) { + if (Actor_WorldDistXYZToPoint(&this->actor, &flamePos) < 15.0f) { EnFirefly_Ignite(this); } else { - Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, &closestTorch->actor), + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &closestTorch->actor), 0x300); - Math_ScaledStepToS(&this->actor.shape.rot.x, Actor_PitchToPoint(&this->actor, &flamePos) + 0x1554, 0x100); + Math_ScaledStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &flamePos) + 0x1554, + 0x100); } return true; @@ -273,7 +275,7 @@ s32 EnFirefly_SeekTorch(EnFirefly* this, PlayState* play) { void EnFirefly_SetupFlyIdle(EnFirefly* this) { this->timer = Rand_S16Offset(70, 100); this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 1.5f; - Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 0x300); + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300); this->pitchTarget = ((this->maxAltitude < this->actor.world.pos.y) ? 0xC00 : -0xC00) + 0x1554; this->skelAnime.playSpeed = 1.0f; this->actionFunc = EnFirefly_FlyIdle; @@ -296,8 +298,8 @@ void EnFirefly_FlyIdle(EnFirefly* this, PlayState* play) { rand = Rand_ZeroOne(); if (rand < 0.5f) { - Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), - 0x300); + Math_ScaledStepToS(&this->actor.shape.rot.y, + Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300); } else if (rand < 0.8f) { this->actor.shape.rot.y += (s16)randPlusMinusPoint5Scaled(1536.0f); } @@ -447,8 +449,8 @@ void EnFirefly_DiveAttack(EnFirefly* this, PlayState* play) { preyPos.x = player->actor.world.pos.x; preyPos.y = player->actor.world.pos.y + 20.0f; preyPos.z = player->actor.world.pos.z; - Math_SmoothStepToS(&this->actor.shape.rot.x, Actor_PitchToPoint(&this->actor, &preyPos) + 0x1554, 2, 0x400, - 0x100); + Math_SmoothStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &preyPos) + 0x1554, 2, + 0x400, 0x100); } else { this->skelAnime.playSpeed = 1.5f; if (this->actor.xzDistToPlayer > 80.0f) { @@ -532,7 +534,8 @@ void EnFirefly_FlyAway(EnFirefly* this, PlayState* play) { if (this->actor.bgCheckFlags & 8) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); } else { - Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 0x300); + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 0x300); } Math_ScaledStepToS(&this->actor.shape.rot.x, this->pitchTarget, 0x100); @@ -627,7 +630,8 @@ void EnFirefly_DisturbDiveAttack(EnFirefly* this, PlayState* play) { preyPos.x = player->actor.world.pos.x; preyPos.y = player->actor.world.pos.y + 20.0f; preyPos.z = player->actor.world.pos.z; - Math_ScaledStepToS(&this->actor.shape.rot.x, Actor_PitchToPoint(&this->actor, &preyPos) + 0x1554, 0x100); + Math_ScaledStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &preyPos) + 0x1554, + 0x100); Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x300); } 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 c66ce4b168..94fc2dfc16 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -651,9 +651,9 @@ void func_808D1D6C(EnFloormas* this, PlayState* play) { return; } - Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, sp2C), 0x38E); + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, sp2C), 0x38E); - if (Actor_XZDistanceBetweenActors(&this->actor, sp2C) < 80.0f) { + if (Actor_WorldDistXZToActor(&this->actor, sp2C) < 80.0f) { func_808D2484(this); } } else { @@ -794,7 +794,7 @@ void func_808D24F0(EnFloormas* this, PlayState* play) { this->actor.speedXZ = 5.0f; this->actor.velocity.y = 7.0f; } else if (this->skelAnime.curFrame < 20.0f) { - Math_ApproachS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, phi_s1), 2, 0xE38); + Math_ApproachS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, phi_s1), 2, 0xE38); } else if (((phi_s1->world.pos.y - this->actor.world.pos.y) < -10.0f) && (fabsf(this->actor.world.pos.x - phi_s1->world.pos.x) < 10.0f) && (fabsf(this->actor.world.pos.z - phi_s1->world.pos.z) < 10.0f)) { 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 5ffc364c34..101751b19f 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -430,7 +430,7 @@ void func_8087B7C0(EnHorse* this, PlayState* play, Path* path) { return; } - sp4A = Actor_YawBetweenActors(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y; + sp4A = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y; if ((fabsf(Math_SinS(sp4A)) < 0.9f) && (Math_CosS(sp4A) > 0.0f)) { if (this->actor.speedXZ < this->unk_398) { @@ -455,7 +455,7 @@ void func_8087B7C0(EnHorse* this, PlayState* play, Path* path) { } this->unk_394 |= 1; } else if ((sp68 + 1) == this->curRaceWaypoint) { - s16 sp48 = Actor_YawBetweenActors(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y; + s16 sp48 = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y; if ((fabsf(Math_SinS(sp48)) < 0.9f) && (Math_CosS(sp48) > 0.0f)) { if (this->actor.speedXZ < this->unk_398) { @@ -622,7 +622,7 @@ s32 EnHorse_Spawn(EnHorse* this, PlayState* play) { this->actor.world.pos.z = spawnPos.z; this->actor.prevPos = this->actor.world.pos; this->actor.world.rot.y = 0; - this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, &GET_PLAYER(play)->actor); + this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor); spawn = true; SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->actor.world.pos, &this->actor.projectedPos, &this->actor.projectedW); @@ -648,7 +648,7 @@ s32 EnHorse_Spawn(EnHorse* this, PlayState* play) { this->actor.world.pos.z = spawnPos.z; this->actor.prevPos = this->actor.world.pos; this->actor.world.rot.y = 0; - this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, &GET_PLAYER(play)->actor); + this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor); spawn = true; SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->actor.world.pos, &this->actor.projectedPos, &this->actor.projectedW); @@ -2026,7 +2026,7 @@ void EnHorse_StartMovingAnimation(EnHorse* this, s32 anim, f32 morphFrames, f32 void EnHorse_SetFollowAnimation(EnHorse* this, PlayState* play) { s32 anim = ENHORSE_ANIM_WALK; - f32 distToPlayer = Actor_XZDistanceBetweenActors(&this->actor, &GET_PLAYER(play)->actor); + f32 distToPlayer = Actor_WorldDistXZToActor(&this->actor, &GET_PLAYER(play)->actor); if (distToPlayer > 400.0f) { anim = ENHORSE_ANIM_GALLOP; @@ -2063,7 +2063,7 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { f32 distToPlayer; D_801BDAA4 = 0; - distToPlayer = Actor_XZDistanceBetweenActors(&this->actor, &GET_PLAYER(play)->actor); + distToPlayer = Actor_WorldDistXZToActor(&this->actor, &GET_PLAYER(play)->actor); if (((this->playerDir == PLAYER_DIR_BACK_R) || (this->playerDir == PLAYER_DIR_BACK_L)) && (distToPlayer > 300.0f) && !(this->stateFlags & ENHORSE_TURNING_TO_PLAYER)) { @@ -2071,7 +2071,7 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { this->animIndex = ENHORSE_ANIM_REARING; this->stateFlags |= ENHORSE_TURNING_TO_PLAYER; - this->angleToPlayer = Actor_YawBetweenActors(&this->actor, &GET_PLAYER(play)->actor); + this->angleToPlayer = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor); angleDiff = (f32)this->angleToPlayer - this->actor.world.rot.y; if (angleDiff > 0x7FFF) { @@ -3032,7 +3032,7 @@ void EnHorse_FleePlayer(EnHorse* this, PlayState* play) { (nextAnimIndex == ENHORSE_ANIM_WALK)) { if (playerDistToHome < 300.0f) { yaw = player->actor.shape.rot.y; - yaw += ((Actor_YawBetweenActors(&this->actor, &player->actor) > 0) ? 1 : -1) * 0x3FFF; + yaw += ((Actor_WorldYawTowardActor(&this->actor, &player->actor) > 0) ? 1 : -1) * 0x3FFF; } else { yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos) - this->actor.world.rot.y; } @@ -4069,7 +4069,7 @@ void EnHorse_RegenBoost(EnHorse* this, PlayState* play) { void EnHorse_UpdatePlayerDir(EnHorse* this, PlayState* play) { Player* player = GET_PLAYER(play); - s16 angle = Actor_YawBetweenActors(&this->actor, &player->actor) - this->actor.world.rot.y; + s16 angle = Actor_WorldYawTowardActor(&this->actor, &player->actor) - this->actor.world.rot.y; f32 s = Math_SinS(angle); f32 c = Math_CosS(angle); @@ -4399,7 +4399,7 @@ s32 EnHorse_PlayerDirToMountSide(EnHorse* this, PlayState* play, Player* player) s32 EnHorse_MountSideCheck(EnHorse* this, PlayState* play, Player* player) { s32 mountSide; - if (Actor_XZDistanceBetweenActors(&this->actor, &player->actor) > 75.0f) { + if (Actor_WorldDistXZToActor(&this->actor, &player->actor) > 75.0f) { return 0; } @@ -4407,7 +4407,7 @@ s32 EnHorse_MountSideCheck(EnHorse* this, PlayState* play, Player* player) { return 0; } - if (Math_CosS(Actor_YawBetweenActors(&player->actor, &this->actor) - player->actor.world.rot.y) < + if (Math_CosS(Actor_WorldYawTowardActor(&player->actor, &this->actor) - player->actor.world.rot.y) < 0.17364818f) { // cos(80 degrees) return 0; } 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 1e26b47e62..9ec44193a2 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 @@ -208,7 +208,7 @@ void func_808DEA54(EnHorseLinkChild* this, s32 arg1) { } void func_808DEB14(EnHorseLinkChild* this, PlayState* play) { - f32 sp44 = Actor_XZDistanceBetweenActors(&this->actor, &GET_PLAYER(play)->actor); + f32 sp44 = Actor_WorldDistXZToActor(&this->actor, &GET_PLAYER(play)->actor); s32 phi_v0; if (SkelAnime_Update(&this->skin.skelAnime)) { @@ -248,7 +248,7 @@ void func_808DED40(EnHorseLinkChild* this, PlayState* play) { s32 phi_v0; if ((this->unk_148 == 4) || (this->unk_148 == 3) || (this->unk_148 == 2)) { - temp_a0 = Actor_YawBetweenActors(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y; + temp_a0 = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y; if (temp_a0 > 0x12C) { this->actor.world.rot.y += 0x12C; } else if (temp_a0 < -0x12C) { @@ -260,7 +260,7 @@ void func_808DED40(EnHorseLinkChild* this, PlayState* play) { } if (SkelAnime_Update(&this->skin.skelAnime)) { - temp_fv0 = Actor_XZDistanceBetweenActors(&this->actor, &GET_PLAYER(play)->actor); + temp_fv0 = Actor_WorldDistXZToActor(&this->actor, &GET_PLAYER(play)->actor); if (temp_fv0 > 1000.0f) { func_808DEA54(this, 0); return; @@ -309,7 +309,7 @@ void func_808DF088(EnHorseLinkChild* this, PlayState* play) { if (Math3D_Distance(&player->actor.world.pos, &this->actor.home.pos) < 250.0f) { sp32 = player->actor.shape.rot.y; - if (Actor_YawBetweenActors(&this->actor, &player->actor) > 0) { + if (Actor_WorldYawTowardActor(&this->actor, &player->actor) > 0) { phi_v0 = 1; } else { phi_v0 = -1; @@ -340,7 +340,7 @@ void func_808DF194(EnHorseLinkChild* this, PlayState* play) { func_808DF088(this, play); player = GET_PLAYER(play); - sp50 = Actor_XZDistanceBetweenActors(&this->actor, &player->actor); + sp50 = Actor_WorldDistXZToActor(&this->actor, &player->actor); sp48 = this->unk_148; sp4C = SkelAnime_Update(&this->skin.skelAnime); @@ -433,7 +433,7 @@ void func_808DF620(EnHorseLinkChild* this, PlayState* play) { } this->actor.speedXZ = 0.0f; - sp36 = Actor_YawBetweenActors(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y; + sp36 = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y; if ((Math_CosS(sp36) < 0.7071f) && (this->unk_148 == 2)) { func_800F415C(&this->actor, &GET_PLAYER(play)->actor.world.pos, 0x12C); @@ -480,7 +480,7 @@ void func_808DF838(EnHorseLinkChild* this, PlayState* play) { if (SkelAnime_Update(&this->skin.skelAnime)) { if (this->unk_1E0 == 0) { - phi_fv0 = Actor_XZDistanceBetweenActors(&this->actor, &GET_PLAYER(play)->actor); + phi_fv0 = Actor_WorldDistXZToActor(&this->actor, &GET_PLAYER(play)->actor); } else { phi_fv0 = Math3D_Distance(&this->actor.world.pos, &this->actor.home.pos); } 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 f1ebe1bb20..42104bd589 100644 --- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c +++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c @@ -3608,7 +3608,7 @@ void func_80B4B768(EnInvadepoh* this, PlayState* play) { s32 pad; Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f); - Math_SmoothStepToS(&this->actor.world.rot.y, Actor_YawBetweenActors(&this->actor, &D_80B5040C->actor), 5, 0x1388, + Math_SmoothStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardActor(&this->actor, &D_80B5040C->actor), 5, 0x1388, 0x64); func_80B44E90(this, play); if (Animation_OnFrame(&this->skelAnime, 13.0f) || Animation_OnFrame(&this->skelAnime, 19.0f)) { 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 70ca7313ab..81415caf5e 100644 --- a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c +++ b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c @@ -395,7 +395,7 @@ s32 func_80B85A00(EnKaizoku* this, PlayState* play, s16 arg2) { if (((this->picto.actor.bgCheckFlags & 8) && (sp32 < 0x2EE0)) || (explosiveActor->id == ACTOR_EN_BOM_CHU)) { if ((explosiveActor->id == ACTOR_EN_BOM_CHU) && - (Actor_DistanceBetweenActors(&this->picto.actor, explosiveActor) < 80.0f) && + (Actor_WorldDistXYZToActor(&this->picto.actor, explosiveActor) < 80.0f) && (BINANG_ADD(this->picto.actor.shape.rot.y - explosiveActor->world.rot.y, 0x8000) < 0x4000)) { if (this->action != KAIZOKU_ACTION_6) { func_80B87C7C(this); 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 6e021186ff..e9139c9346 100644 --- a/src/overlays/actors/ovl_En_Kame/z_en_kame.c +++ b/src/overlays/actors/ovl_En_Kame/z_en_kame.c @@ -229,8 +229,8 @@ void func_80AD7254(EnKame* this, PlayState* play) { if (this->unk_2A4 != this->actor.shape.rot.y) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->unk_2A4, 0x100); this->actor.world.rot.y = this->actor.shape.rot.y; - } else if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 40.0f) { - this->unk_2A4 = Actor_YawToPoint(&this->actor, &this->actor.home.pos) + ((s32)Rand_Next() >> 0x14); + } else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 40.0f) { + this->unk_2A4 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos) + ((s32)Rand_Next() >> 0x14); } this->unk_29E--; @@ -316,7 +316,7 @@ void func_80AD76CC(EnKame* this) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_CUTTER_ON); this->unk_2BC.y = this->actor.home.pos.y - 100.0f; } else { - this->actor.world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); Math_Vec3f_Copy(&this->unk_2BC, &this->actor.home.pos); this->unk_29E = 0; } @@ -363,12 +363,12 @@ void func_80AD7948(EnKame* this, PlayState* play) { func_80AD75A8(this, play); if (this->unk_29E == -1) { - s16 temp_v0 = Actor_YawToPoint(&this->actor, &this->unk_2BC) - this->actor.world.rot.y; + s16 temp_v0 = Actor_WorldYawTowardPoint(&this->actor, &this->unk_2BC) - this->actor.world.rot.y; temp_v1 = ABS_ALT(temp_v0); if ((this->actor.bgCheckFlags & 8) || (temp_v1 > 0x3000) || - (Actor_XZDistanceToPoint(&this->actor, &this->unk_2BC) < 50.0f)) { + (Actor_WorldDistXZToPoint(&this->actor, &this->unk_2BC) < 50.0f)) { s8 pad; if (this->unk_2BC.y < this->actor.home.pos.y) { @@ -706,7 +706,7 @@ void EnKame_Update(Actor* thisx, PlayState* play) { if ((this->collider.base.atFlags & AT_HIT) && (this->collider.base.atFlags & AT_BOUNCED)) { this->collider.base.atFlags &= ~(AT_BOUNCED | AT_HIT); func_80AD76CC(this); - if (Actor_XZDistanceToPoint(&this->actor, &this->unk_2BC) < 50.0f) { + if (Actor_WorldDistXZToPoint(&this->actor, &this->unk_2BC) < 50.0f) { this->collider.base.atFlags &= ~AT_ON; } this->unk_2A6 = 0x3B00; 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 0f95122d45..468368cd59 100644 --- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c +++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c @@ -701,7 +701,7 @@ void func_80A5CB74(EnKusa2* this) { sp3E = Rand_S16Offset(-10000, 20000) + this->actor.world.rot.y; if (this->unk_1C0 != NULL) { - sp36 = Actor_YawBetweenActors(&this->actor, &this->unk_1C0->actor); + sp36 = Actor_WorldYawTowardActor(&this->actor, &this->unk_1C0->actor); sp3C = Rand_S16Offset(-4000, 8000) + sp36; } else { sp3C = 0; @@ -976,7 +976,7 @@ void func_80A5D7C4(EnKusa2* this, PlayState* play) { if ((this->unk_1C0 != NULL) && (this->unk_1C0->unk_1BE != 0)) { this->actor.shape.shadowDraw = ActorShadow_DrawCircle; if (this2->unk_1C0 != NULL) { - sp2A = Actor_YawBetweenActors(&this->unk_1C0->actor, &this->actor); + sp2A = Actor_WorldYawTowardActor(&this->unk_1C0->actor, &this->actor); this->actor.home.rot.y = Rand_S16Offset(-1500, 3000) + sp2A; } this->unk_1C8 = Rand_S16Offset(72, 16); 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 f459a6a416..a8a059c1ff 100644 --- a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c +++ b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c @@ -338,7 +338,7 @@ void EnMinifrog_SetupNextFrogInit(EnMinifrog* this, PlayState* play) { missingFrog = nextFrog->frog; if (nextFrog->frog != NULL) { this->actor.home.rot.y = - (s16)Actor_YawBetweenActors(&this->actor, &missingFrog->actor); // Set home to missing frog + (s16)Actor_WorldYawTowardActor(&this->actor, &missingFrog->actor); // Set home to missing frog EnMinifrog_TurnToMissingFrog(this); } else { EnMinifrog_TurnToPlayer(this); @@ -427,7 +427,7 @@ void EnMinifrog_SetupNextFrogChoir(EnMinifrog* this, PlayState* play) { this->actor.home.rot.z = 0; this->actionFunc = EnMinifrog_NextFrogMissing; this->timer = 60; - this->actor.home.rot.y = Actor_YawBetweenActors(&this->actor, &this->frog->actor); + this->actor.home.rot.y = Actor_WorldYawTowardActor(&this->actor, &this->frog->actor); func_801A1F88(); this->flags &= ~0x100; this->flags &= ~(0x2 << MINIFROG_YELLOW | 0x2 << MINIFROG_CYAN | 0x2 << MINIFROG_PINK | 0x2 << MINIFROG_BLUE | 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 1ab5f2cc64..bf585ff61a 100644 --- a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c +++ b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c @@ -246,8 +246,8 @@ void EnMinislime_SetupFall(EnMinislime* this, PlayState* play) { this->actor.scale.x = 0.095f; this->actor.scale.z = 0.095f; this->actor.scale.y = 0.10700001f; - if (Actor_XZDistanceBetweenActors(&this->actor, &player->actor) < 225.0f) { - yaw = Actor_YawBetweenActors(&player->actor, &this->actor); + if (Actor_WorldDistXZToActor(&this->actor, &player->actor) < 225.0f) { + yaw = Actor_WorldYawTowardActor(&player->actor, &this->actor); this->actor.world.pos.x = Math_SinS(yaw) * 225.0f + player->actor.world.pos.x; this->actor.world.pos.z = Math_CosS(yaw) * 225.0f + player->actor.world.pos.z; } @@ -267,7 +267,7 @@ void EnMinislime_Fall(EnMinislime* this, PlayState* play) { void EnMinislime_SetupBreakFromBigslime(EnMinislime* this) { f32 velY; - this->actor.world.rot.y = Actor_YawBetweenActors(this->actor.parent, &this->actor); + this->actor.world.rot.y = Actor_WorldYawTowardActor(this->actor.parent, &this->actor); this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.speedXZ = Math_CosS(this->actor.world.rot.x) * 15.0f; velY = Math_SinS(this->actor.world.rot.x) * 15.0f; @@ -434,8 +434,8 @@ void EnMinislime_Idle(EnMinislime* this, PlayState* play) { if (this->actor.xzDistToPlayer < 300.0f) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; } else { - if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 200.0f) { - this->actor.world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 200.0f) { + this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); } else { this->actor.world.rot.y += (s16)((s32)Rand_Next() >> 0x13); } @@ -491,8 +491,8 @@ void EnMinislime_Bounce(EnMinislime* this, PlayState* play) { void EnMinislime_SetupMoveToBigslime(EnMinislime* this) { this->actor.gravity = 0.0f; this->actor.speedXZ = 15.0f; - this->actor.shape.rot.x = Actor_PitchToPoint(&this->actor, &this->actor.parent->home.pos); - this->actor.shape.rot.y = Actor_YawToPoint(&this->actor, &this->actor.parent->home.pos); + this->actor.shape.rot.x = Actor_WorldPitchTowardPoint(&this->actor, &this->actor.parent->home.pos); + this->actor.shape.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.parent->home.pos); this->actor.world.rot.x = -this->actor.shape.rot.x; this->actor.world.rot.y = this->actor.shape.rot.y; this->collider.base.atFlags &= ~AT_ON; 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 cbbaffca9d..c89fdcdfaa 100644 --- a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c +++ b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c @@ -267,7 +267,7 @@ void func_80A4E2E8(EnMkk* this, PlayState* play) { sp20 = Math_StepToF(&this->actor.speedXZ, 0.0f, 0.7f); } if ((player->stateFlags3 & 0x100) || (Player_GetMask(play) == PLAYER_MASK_STONE)) { - Math_ScaledStepToS(&this->unk_150, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 0x400); + Math_ScaledStepToS(&this->unk_150, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x400); } else if ((player->stateFlags2 & 0x80) || (player->actor.freezeTimer > 0)) { Math_ScaledStepToS(&this->unk_150, this->actor.yawTowardsPlayer + 0x8000, 0x400); } else { @@ -421,7 +421,7 @@ void EnMkk_Update(Actor* thisx, PlayState* play) { } if (Actor_IsFacingPlayer(&this->actor, 0x3000)) { player = GET_PLAYER(play); - this->actor.shape.rot.x = Actor_PitchToPoint(&this->actor, &player->actor.focus.pos); + this->actor.shape.rot.x = Actor_WorldPitchTowardPoint(&this->actor, &player->actor.focus.pos); this->actor.shape.rot.x = CLAMP(this->actor.shape.rot.x, -0x1800, 0x1800); } Actor_SetFocus(&this->actor, 10.0f); 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 86099a2141..483d58c3d8 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 @@ -171,7 +171,7 @@ void EnNeoReeba_WaitUnderground(EnNeoReeba* this, PlayState* play) { s32 pad; Player* player = GET_PLAYER(play); - if ((Actor_XZDistanceToPoint(&player->actor, &this->actor.home.pos) < 200.0f) && + if ((Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) < 200.0f) && (Player_GetMask(play) != PLAYER_MASK_STONE) && (fabsf(this->actor.playerHeightRel) < 100.0f)) { EnNeoReeba_SetupRise(this); } @@ -199,7 +199,7 @@ void EnNeoReeba_SetupChooseAction(EnNeoReeba* this) { void EnNeoReeba_ChooseAction(EnNeoReeba* this, PlayState* play) { Player* player = GET_PLAYER(play); - f32 distToPlayer = Actor_XZDistanceToPoint(&player->actor, &this->actor.home.pos); + f32 distToPlayer = Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos); if ((distToPlayer > 200.0f) || (fabsf(this->actor.playerHeightRel) > 100.0f)) { EnNeoReeba_SetupSink(this); @@ -318,7 +318,7 @@ void EnNeoReeba_ReturnHome(EnNeoReeba* this, PlayState* play) { this->actor.speedXZ -= 1.0f; } - if (Actor_XZDistanceToPoint(&player->actor, &this->actor.home.pos) > 200.0f || + if (Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) > 200.0f || fabsf(this->actor.playerHeightRel) > 100.0f) { EnNeoReeba_SetupSink(this); } 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 fef1ebe6bb..c2abc359a9 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -327,8 +327,8 @@ void func_80B5BE88(EnOt* this, PlayState* play) { void func_80B5BED4(EnOt* this, PlayState* play) { func_800BE33C(&this->actor.world.pos, &this->unk_360->actor.world.pos, &this->actor.world.rot, 0); - Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, &this->unk_360->actor), 3, 0xE38, - 0x38E); + Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &this->unk_360->actor), 3, + 0xE38, 0x38E); this->actor.speedXZ = 3.5f; this->actor.world.pos.y = this->unk_360->actor.world.pos.y; Actor_MoveWithoutGravityReverse(&this->actor); @@ -348,10 +348,10 @@ void func_80B5BFB8(EnOt* this, PlayState* play) { Math_StepToF(&this->actor.world.pos.y, temp_f0, 2.0f); } - Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, &this->unk_360->actor), 3, 0xE38, - 0x38E); + Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &this->unk_360->actor), 3, + 0xE38, 0x38E); - if (Actor_DistanceBetweenActors(&this->actor, &this->unk_360->actor) <= 52.519997f) { + if (Actor_WorldDistXYZToActor(&this->actor, &this->unk_360->actor) <= 52.519997f) { this->unk_73C = 50; Matrix_RotateYS(this->actor.world.rot.y, MTXMODE_NEW); Matrix_MultVecZ(52.519997f, &sp34); @@ -400,7 +400,7 @@ void func_80B5C244(EnOt* this, PlayState* play) { } void func_80B5C25C(EnOt* this, PlayState* play) { - this->unk_390 = Actor_YawBetweenActors(&this->actor, &this->unk_360->actor); + this->unk_390 = Actor_WorldYawTowardActor(&this->actor, &this->unk_360->actor); Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_390, 3, 0xE38, 0x38E); if (BINANG_SUB(BINANG_ROT180(this->unk_360->actor.shape.rot.y), this->actor.shape.rot.y) < 0x38E) { this->unk_32C |= 0x80; @@ -449,7 +449,7 @@ void func_80B5C3D8(EnOt* this, PlayState* play) { Math_Vec3f_Copy(&this->actor.world.pos, &this->unk_348); Math_Vec3f_Copy(&this->unk_360->actor.world.pos, &this->unk_360->unk_348); - temp = Actor_YawBetweenActors(&this->actor, &this->unk_360->actor); + temp = Actor_WorldYawTowardActor(&this->actor, &this->unk_360->actor); this->actor.shape.rot.y = temp; this->unk_360->actor.shape.rot.y = BINANG_ROT180(temp); @@ -498,7 +498,7 @@ void func_80B5C6DC(EnOt* this, PlayState* play) { s16 sp3E; Vec3f sp30; - sp3E = Actor_YawToPoint(&player->actor, &this->unk_394); + sp3E = Actor_WorldYawTowardPoint(&player->actor, &this->unk_394); Matrix_RotateYS(BINANG_ADD(sp3E, 0x4000), MTXMODE_NEW); if (this->unk_33C == 2) { Matrix_MultVecZ(26.259998f, &sp30); 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 82b4246577..9eeae341dc 100644 --- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c +++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c @@ -447,7 +447,7 @@ void EnPametfrog_RearOnSnapper(EnPametfrog* this, PlayState* play) { rearingPoint.x = this->actor.world.pos.x; rearingPoint.y = this->actor.world.pos.y + 10.0f; rearingPoint.z = this->actor.world.pos.z; - if (actor->world.rot.x < Actor_PitchToPoint(actor, &rearingPoint)) { + if (actor->world.rot.x < Actor_WorldPitchTowardPoint(actor, &rearingPoint)) { EnPametfrog_SetupRearOnSnapperWave(this); } else { EnPametfrog_SetupRearOnSnapperRise(this); @@ -504,7 +504,7 @@ void EnPametfrog_SetupFallOffSnapper(EnPametfrog* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_1; this->timer = 30; this->collider.base.ocFlags1 |= OC1_ON; - yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); subCamEye.x = (Math_SinS(yaw) * 300.0f) + this->actor.focus.pos.x; subCamEye.y = this->actor.focus.pos.y + 100.0f; subCamEye.z = (Math_CosS(yaw) * 300.0f) + this->actor.focus.pos.z; @@ -700,7 +700,7 @@ void EnPametfrog_SetupClimbDownWall(EnPametfrog* this) { Animation_Change(&this->skelAnime, &gGekkoJumpForwardAnim, 0.0f, 0.0f, Animation_GetLastFrame(&gGekkoJumpForwardAnim), ANIMMODE_ONCE, 0.0f); - this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, this->actor.child); + this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, this->actor.child); this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.shape.rot.x = 0; this->actor.shape.rot.z = 0; @@ -709,7 +709,7 @@ void EnPametfrog_SetupClimbDownWall(EnPametfrog* this) { this->collider.base.acFlags &= ~AC_ON; this->actor.velocity.y = 0.0f; this->actor.gravity = -1.0f; - yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); this->actor.world.pos.x += 30.0f * Math_SinS(yaw); this->actor.world.pos.z += 30.0f * Math_CosS(yaw); this->actor.bgCheckFlags &= ~1; @@ -723,7 +723,7 @@ void EnPametfrog_ClimbDownWall(EnPametfrog* this, PlayState* play) { if (this->actor.bgCheckFlags & 1) { EnPametfrog_SetupRunToSnapper(this); } else if (this->actor.floorHeight == BGCHECK_Y_MIN) { - yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); this->actor.world.pos.x += 5.0f * Math_SinS(yaw); this->actor.world.pos.z += 5.0f * Math_CosS(yaw); if (this->actor.world.pos.y < (this->actor.home.pos.y - 5.0f)) { @@ -741,7 +741,7 @@ void EnPametfrog_SetupRunToSnapper(EnPametfrog* this) { void EnPametfrog_RunToSnapper(EnPametfrog* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); EnPametfrog_JumpOnGround(this, play); - this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, this->actor.child); + this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, this->actor.child); this->actor.world.rot.y = this->actor.shape.rot.y; if (!(this->actor.bgCheckFlags & 1) || ((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) { this->actor.speedXZ = 12.0f; @@ -749,7 +749,7 @@ void EnPametfrog_RunToSnapper(EnPametfrog* this, PlayState* play) { this->actor.speedXZ = 0.0f; } - if ((this->actor.child->params == 1) && (Actor_XZDistanceBetweenActors(&this->actor, this->actor.child) < 120.0f) && + if ((this->actor.child->params == 1) && (Actor_WorldDistXZToActor(&this->actor, this->actor.child) < 120.0f) && Animation_OnFrame(&this->skelAnime, 0.0f)) { EnPametfrog_SetupJumpOnSnapper(this); } @@ -762,7 +762,7 @@ void EnPametfrog_SetupJumpOnSnapper(EnPametfrog* this) { this->collider.base.acFlags &= ~AC_ON; this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; - this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, this->actor.child); + this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, this->actor.child); this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.params = GEKKO_JUMP_ON_SNAPPER; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_GREET); @@ -822,7 +822,7 @@ void EnPametfrog_SetupFallInAir(EnPametfrog* this, PlayState* play) { } Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 16); - yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); this->actor.world.pos.x += 30.0f * Math_SinS(yaw); this->actor.world.pos.z += 30.0f * Math_CosS(yaw); if (this->subCamId != SUB_CAM_ID_DONE) { @@ -898,7 +898,7 @@ void EnPametfrog_FallOnGround(EnPametfrog* this, PlayState* play) { void EnPametfrog_SetupDefeatGekko(EnPametfrog* this, PlayState* play) { Vec3f subCamEye; - s16 yaw = Actor_YawToPoint(this->actor.child, &this->actor.home.pos); + s16 yaw = Actor_WorldYawTowardPoint(this->actor.child, &this->actor.home.pos); s16 yawDiff = this->actor.yawTowardsPlayer - yaw; yaw = yawDiff > 0 ? yaw - 0x2000 : yaw + 0x2000; @@ -923,7 +923,7 @@ void EnPametfrog_DefeatGekko(EnPametfrog* this, PlayState* play) { void EnPametfrog_SetupDefeatSnapper(EnPametfrog* this, PlayState* play) { Vec3f subCamEye; - s16 yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + s16 yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); s16 yawDiff = this->actor.yawTowardsPlayer - yaw; yaw = yawDiff > 0 ? yaw - 0x2000 : yaw + 0x2000; @@ -1171,7 +1171,7 @@ void EnPametfrog_SetupCallSnapper(EnPametfrog* this, PlayState* play) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_GREET); this->actor.flags &= ~ACTOR_FLAG_1; this->actor.colChkInfo.health = 6; - this->actor.world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y; if (yawDiff > 0) { this->actor.world.rot.y -= 0x2000; @@ -1209,7 +1209,7 @@ void EnPametfrog_SetupSnapperSpawn(EnPametfrog* this, PlayState* play) { subCamAt.x = this->actor.child->world.pos.x; subCamAt.z = this->actor.child->world.pos.z; subCamAt.y = this->actor.child->floorHeight + 50.0f; - if ((s16)(Actor_YawToPoint(&this->actor, &this->actor.home.pos) - this->actor.shape.rot.y) > 0) { + if ((s16)(Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos) - this->actor.shape.rot.y) > 0) { yaw = this->actor.child->shape.rot.y - 0x1000; } else { yaw = this->actor.child->shape.rot.y + 0x1000; 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 3e2fdcface..d2a1458f35 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -449,7 +449,7 @@ void func_80897A94(EnPeehat* this, PlayState* play) { this->unk_2B0 = 40; } else if (this->colliderCylinder.base.ocFlags1 & OC1_HIT) { this->colliderCylinder.base.ocFlags1 &= ~OC1_HIT; - if ((BINANG_SUB(Actor_YawBetweenActors(&this->actor, this->colliderCylinder.base.oc), + if ((BINANG_SUB(Actor_WorldYawTowardActor(&this->actor, this->colliderCylinder.base.oc), this->actor.world.rot.y)) > 0) { this->actor.world.rot.y -= 0x2000; } else { 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 2c1ad1e025..4928fd05b3 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 @@ -374,9 +374,11 @@ void EnPoSisters_AimlessIdleFlying(EnPoSisters* this, PlayState* play) { } if (this->actor.bgCheckFlags & 8) { // touching a wall - Math_ScaledStepToS(&this->actor.world.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 0x71C); - } else if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 600.0f) { - Math_ScaledStepToS(&this->actor.world.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 0x71C); + } else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 600.0f) { + Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 0x71C); } } 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 f1b0f74d46..0984506d6e 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -252,8 +252,8 @@ void func_80B2CBBC(EnPoh* this, PlayState* play) { this->unk_18E--; } - if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 400.0f) { - this->unk_192 = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 400.0f) { + this->unk_192 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); } Math_ScaledStepToS(&this->actor.world.rot.y, this->unk_192, 0x71C); 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 50a203c81a..6c5980f4f3 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c @@ -537,7 +537,7 @@ void EnRailgibud_SetupWalkToHome(EnRailgibud* this) { void EnRailgibud_WalkToHome(EnRailgibud* this, PlayState* play) { Math_SmoothStepToS(&this->headRotation.y, 0, 1, 100, 0); Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 100, 0); - if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 5.0f) { + if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 5.0f) { if (this->actor.speedXZ > 0.2f) { this->actor.speedXZ -= 0.2f; } else { @@ -550,7 +550,8 @@ void EnRailgibud_WalkToHome(EnRailgibud* this, PlayState* play) { EnRailgibud_SetupWalkInCircles(this); } } else { - Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 450); + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 450); this->actor.world.rot = this->actor.shape.rot; } if (EnRailgibud_PlayerInRangeWithCorrectState(this, play)) { @@ -750,7 +751,7 @@ s32 EnRailgibud_PlayerInRangeWithCorrectState(EnRailgibud* this, PlayState* play return false; } - if (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 100.0f && + if (Actor_WorldDistXYZToPoint(&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))) { @@ -768,7 +769,7 @@ s32 EnRailgibud_PlayerInRangeWithCorrectState(EnRailgibud* this, PlayState* play s32 EnRailgibud_PlayerOutOfRange(EnRailgibud* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) >= 100.0f) { + if (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) >= 100.0f) { return true; } 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 da0b27e6d1..017cd765ae 100644 --- a/src/overlays/actors/ovl_En_Rat/z_en_rat.c +++ b/src/overlays/actors/ovl_En_Rat/z_en_rat.c @@ -293,7 +293,7 @@ void EnRat_ChooseDirection(EnRat* this) { angle -= 0x8000; } } else { - if (Actor_DistanceToPoint(&this->actor, &this->actor.home.pos) > 50.0f) { + if (Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos) > 50.0f) { Vec3f homeInHome; Vec3f worldInHome; Vec3f worldPlusForwardInHome; 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 9a51c664f8..40ed111f47 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -649,11 +649,11 @@ void EnRd_WalkToPlayer(EnRd* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; SkelAnime_Update(&this->skelAnime); - if (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) { + if (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) { EnRd_SetupWalkToHome(this, play); } - if ((ABS_ALT(yaw) < 0x1554) && (Actor_DistanceBetweenActors(&this->actor, &player->actor) <= 150.0f)) { + if ((ABS_ALT(yaw) < 0x1554) && (Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 150.0f)) { 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))) { @@ -676,11 +676,11 @@ void EnRd_WalkToPlayer(EnRd* this, PlayState* play) { this->grabWaitTimer--; } - if (!this->grabWaitTimer && (Actor_DistanceBetweenActors(&this->actor, &player->actor) <= 45.0f) && + if (!this->grabWaitTimer && (Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 45.0f) && Actor_IsFacingPlayer(&this->actor, 0x38E3)) { player->actor.freezeTimer = 0; if ((player->transformation == PLAYER_FORM_GORON) || (player->transformation == PLAYER_FORM_DEKU)) { - if (Actor_DistanceToPoint(&this->actor, &this->actor.home.pos) < 150.0f) { + if (Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos) < 150.0f) { // If the Gibdo/Redead tries to grab Goron or Deku Link, it will fail to // do so. It will appear to take damage and shake its head side-to-side. EnRd_SetupGrabFail(this); @@ -716,9 +716,9 @@ void EnRd_SetupWalkToHome(EnRd* this, PlayState* play) { void EnRd_WalkToHome(EnRd* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 pad; - s16 sp36 = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + s16 sp36 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); - if (Actor_DistanceToPoint(&this->actor, &this->actor.home.pos) >= 5.0f) { + if (Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos) >= 5.0f) { Math_SmoothStepToS(&this->actor.shape.rot.y, sp36, 1, 450, 0); } else { this->actor.speedXZ = 0.0f; @@ -739,7 +739,7 @@ void EnRd_WalkToHome(EnRd* this, PlayState* play) { if (!(player->stateFlags1 & (0x200000 | 0x80000 | 0x40000 | 0x4000 | 0x2000 | 0x80)) && !(player->stateFlags2 & (0x4000 | 0x80)) && (player->transformation != PLAYER_FORM_GORON) && (player->transformation != PLAYER_FORM_DEKU) && - (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 150.0f)) { + (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) < 150.0f)) { this->actor.targetMode = 0; EnRd_SetupWalkToPlayer(this, play); } else if (EN_RD_GET_TYPE(&this->actor) > EN_RD_TYPE_DOES_NOT_MOURN_IF_WALKING) { @@ -779,10 +779,10 @@ void EnRd_WalkToParent(EnRd* this, PlayState* play) { if (this->actor.parent != NULL) { parentPos = this->actor.parent->world.pos; - yaw = Actor_YawToPoint(&this->actor, &parentPos); + yaw = Actor_WorldYawTowardPoint(&this->actor, &parentPos); Math_SmoothStepToS(&this->actor.shape.rot.y, yaw, 1, 250, 0); - if (Actor_DistanceToPoint(&this->actor, &parentPos) >= 45.0f) { + if (Actor_WorldDistXYZToPoint(&this->actor, &parentPos) >= 45.0f) { this->actor.speedXZ = 0.4f; } else { this->actor.speedXZ = 0.0f; @@ -1029,7 +1029,7 @@ void EnRd_Damage(EnRd* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; if (this->actor.parent != NULL) { EnRd_SetupWalkToParent(this); - } else if (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) { + } else if (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) { EnRd_SetupWalkToHome(this, play); } else { EnRd_SetupWalkToPlayer(this, play); 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 7f6d39886c..9e6e22098b 100644 --- a/src/overlays/actors/ovl_En_Rg/z_en_rg.c +++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.c @@ -428,7 +428,7 @@ s32 func_80BF45B4(EnRg* this) { } sp24 = 1; } else if (this->unk_310 & 0x40) { - s16 yaw = Actor_YawBetweenActors(&this->actor, ((void)0, this->collider2.base.ac)); + s16 yaw = Actor_WorldYawTowardActor(&this->actor, ((void)0, this->collider2.base.ac)); sp24 = 2; if (this->actor.colorFilterTimer == 0) { @@ -625,8 +625,8 @@ s32 func_80BF4DA8(EnRg* this) { s32 i; for (i = 0; i < ARRAY_COUNT(D_80BF596C); i++) { - temp_f20 = Actor_XZDistanceToPoint(&this->actor, &D_80BF596C[i]); - temp_v1 = Actor_YawToPoint(&this->actor, &D_80BF596C[i]) - this->actor.world.rot.y; + temp_f20 = Actor_WorldDistXZToPoint(&this->actor, &D_80BF596C[i]); + temp_v1 = Actor_WorldYawTowardPoint(&this->actor, &D_80BF596C[i]) - this->actor.world.rot.y; if ((temp_f20 < 100.0f) && (ABS_ALT(temp_v1) < 0xC00)) { if (temp_v1 > 0) { 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 994115f892..d8ffd854e6 100644 --- a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c +++ b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c @@ -242,8 +242,8 @@ void EnSnowman_Init(Actor* thisx, PlayState* play) { thisx->flags &= ~ACTOR_FLAG_1; Collider_InitAndSetCylinder(play, &this->collider, thisx, &sSnowballCylinderInit); - thisx->world.rot.y = Actor_YawBetweenActors(thisx, &player->actor); - thisx->velocity.y = (Actor_XZDistanceBetweenActors(thisx, &player->actor) * 0.035f) + -5.0f; + thisx->world.rot.y = Actor_WorldYawTowardActor(thisx, &player->actor); + thisx->velocity.y = (Actor_WorldDistXZToActor(thisx, &player->actor) * 0.035f) + -5.0f; thisx->velocity.y = CLAMP_MAX(thisx->velocity.y, 3.5f); if (EN_SNOWMAN_GET_TYPE(thisx) == EN_SNOWMAN_TYPE_SMALL_SNOWBALL) { thisx->speedXZ = 15.0f; @@ -405,8 +405,9 @@ void EnSnowman_MoveSnowPile(EnSnowman* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; } else if (this->actor.bgCheckFlags & 8) { this->snowPileTargetRotY = this->actor.wallYaw; - } else if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 200.0f) { - this->snowPileTargetRotY = Actor_YawToPoint(&this->actor, &this->actor.home.pos) + ((s32)Rand_Next() >> 0x14); + } else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 200.0f) { + this->snowPileTargetRotY = + Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos) + ((s32)Rand_Next() >> 0x14); } else if (Rand_ZeroOne() < 0.02f) { this->snowPileTargetRotY += (s16)(((Rand_Next() >> 0x13) + 0x1000) * ((Rand_ZeroOne() < 0.5f) ? -1 : 1)); } @@ -902,7 +903,7 @@ void EnSnowman_Combine(EnSnowman* this, PlayState* play) { SkelAnime_Update(&this->snowPileSkelAnime); parent = (EnSnowman*)this->actor.parent; child = (EnSnowman*)this->actor.child; - Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->combinePos), 0x1000); + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->combinePos), 0x1000); this->actor.world.rot.y = this->actor.shape.rot.y; if (this->combineState == EN_SNOWMAN_COMBINE_STATE_ACTIVE) { @@ -940,7 +941,7 @@ void EnSnowman_Combine(EnSnowman* this, PlayState* play) { this->fwork.targetScaleDuringCombine = 0.0f; } - if (Actor_XZDistanceToPoint(&this->actor, &this->combinePos) < 20.0f) { + if (Actor_WorldDistXZToPoint(&this->actor, &this->combinePos) < 20.0f) { this->actor.speedXZ = 0.0f; } 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 a840596342..4391140174 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 @@ -494,7 +494,7 @@ void EnTalkGibud_SetupWalkToHome(EnTalkGibud* this) { void EnTalkGibud_WalkToHome(EnTalkGibud* this, PlayState* play) { Math_SmoothStepToS(&this->headRotation.y, 0, 1, 100, 0); Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 100, 0); - if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 5.0f) { + if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 5.0f) { if (this->actor.speedXZ > 0.2f) { this->actor.speedXZ -= 0.2f; } else { @@ -507,7 +507,8 @@ void EnTalkGibud_WalkToHome(EnTalkGibud* this, PlayState* play) { EnTalkGibud_SetupIdle(this); } } else { - Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 450); + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 450); this->actor.world.rot = this->actor.shape.rot; } if (EnTalkGibud_PlayerInRangeWithCorrectState(this, play)) { @@ -895,7 +896,7 @@ void EnTalkGibud_FacePlayerWhenTalking(EnTalkGibud* this, PlayState* play) { s32 EnTalkGibud_PlayerInRangeWithCorrectState(EnTalkGibud* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 150.0f) && + if ((Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) < 150.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))) { @@ -913,7 +914,7 @@ s32 EnTalkGibud_PlayerInRangeWithCorrectState(EnTalkGibud* this, PlayState* play s32 EnTalkGibud_PlayerOutOfRange(EnTalkGibud* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) { + if (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) { return true; } 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 22883d53db..145725a47b 100644 --- a/src/overlays/actors/ovl_En_Test3/z_en_test3.c +++ b/src/overlays/actors/ovl_En_Test3/z_en_test3.c @@ -576,7 +576,7 @@ Actor* func_80A3F2BC(PlayState* play, EnTest3* this, s32 actorId, s32 category, if (actorId == actor->id) { f32 dy = this->player.actor.world.pos.y - actor->world.pos.y; - if ((fabsf(dy) < arg5) && (Actor_XZDistanceBetweenActors(&this->player.actor, actor) < arg4)) { + if ((fabsf(dy) < arg5) && (Actor_WorldDistXZToActor(&this->player.actor, actor) < arg4)) { return actor; } } @@ -688,7 +688,7 @@ s32 func_80A3F8D4(EnTest3* this, PlayState* play, struct_80A41828* arg2, Schedul func_80A3F15C(this, play, arg2); if (((postActor = func_80A3F2BC(play, this, ACTOR_EN_PST, ACTORCAT_PROP, 100.0f, 20.0f)) != NULL) || ((postActor = func_80A3F2BC(play, this, ACTOR_EN_PM, ACTORCAT_NPC, 100.0f, 20.0f)) != NULL)) { - this->player.actor.home.rot.y = Actor_YawBetweenActors(&this->player.actor, postActor); + this->player.actor.home.rot.y = Actor_WorldYawTowardActor(&this->player.actor, postActor); } play->startPlayerCutscene(play, &this->player, 0x61); return true; 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 58f44d468b..e08739547e 100644 --- a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c +++ b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c @@ -430,7 +430,7 @@ void func_80C11338(EnThiefbird* this, PlayState* play) { item = (EnItem00*)SubS_FindActor(play, &item->actor, ACTORCAT_MISC, ACTOR_EN_ITEM00); if (item != NULL) { if (item->unk152 > 0) { - if (Actor_XZDistanceBetweenActors(&player->actor, &item->actor) > 10.0f) { + if (Actor_WorldDistXZToActor(&player->actor, &item->actor) > 10.0f) { for (i = 0; i < ARRAY_COUNT(D_80C13664); i++) { if (item->actor.params == D_80C13664[i]) { break; @@ -438,7 +438,7 @@ void func_80C11338(EnThiefbird* this, PlayState* play) { } if (i != ARRAY_COUNT(D_80C13664)) { - temp_f0 = Actor_DistanceBetweenActors(&this->actor, &item->actor); + temp_f0 = Actor_WorldDistXYZToActor(&this->actor, &item->actor); if (temp_f0 < phi_f20) { this->unk_3EC = item; phi_f20 = temp_f0; @@ -487,14 +487,14 @@ void func_80C11590(EnThiefbird* this, PlayState* play) { if (this->actor.bgCheckFlags & 8) { this->unk_192 = this->actor.wallYaw; } else { - if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { - this->unk_192 = Actor_YawToPoint(&this->actor, &this->actor.home.pos); + if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { + this->unk_192 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); } } if (!Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_192, 5, 0x300, 0x10) && (sp38 != 0) && (Rand_ZeroOne() < 0.1f)) { - s16 yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos) - this->actor.shape.rot.y; + s16 yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos) - this->actor.shape.rot.y; if (yaw > 0) { this->unk_192 += Rand_S16Offset(4096, 4096); @@ -554,7 +554,7 @@ void func_80C1193C(EnThiefbird* this, PlayState* play) { this->unk_18E--; } - pitch = Actor_PitchBetweenActors(&this->actor, &player->actor); + pitch = Actor_WorldPitchTowardActor(&this->actor, &player->actor); pitch = CLAMP(pitch, -0x2800, 0x2800); Math_SmoothStepToS(&this->actor.shape.rot.x, pitch, 4, 0x800, 0x80); if (this->actor.bgCheckFlags & 8) { @@ -697,7 +697,7 @@ void func_80C11F6C(EnThiefbird* this, PlayState* play) { this->unk_190 = -0x1000; this->unk_192 = BINANG_ROT180(this->actor.yawTowardsPlayer); } else { - this->unk_190 = Actor_PitchToPoint(&this->actor, &D_80C13920); + this->unk_190 = Actor_WorldPitchTowardPoint(&this->actor, &D_80C13920); } this->unk_18E = 40; @@ -737,8 +737,8 @@ void func_80C1215C(EnThiefbird* this, PlayState* play) { } else if (this->unk_3E8 == 0) { this->unk_192 = BINANG_ROT180(this->actor.yawTowardsPlayer); } else { - this->unk_192 = Actor_YawToPoint(&this->actor, &D_80C13920); - this->unk_190 = Actor_PitchToPoint(&this->actor, &D_80C13920); + this->unk_192 = Actor_WorldYawTowardPoint(&this->actor, &D_80C13920); + this->unk_190 = Actor_WorldPitchTowardPoint(&this->actor, &D_80C13920); } Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_192, 6, 0x1000, 0x100); @@ -801,14 +801,15 @@ void func_80C124B0(EnThiefbird* this, PlayState* play) { if (this->actor.bgCheckFlags & 8) { this->unk_192 = this->actor.wallYaw; } else { - this->unk_192 = Actor_YawToPoint(&this->actor, &D_80C13920); + this->unk_192 = Actor_WorldYawTowardPoint(&this->actor, &D_80C13920); } Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_192, 6, 0x1000, 0x100); - Math_SmoothStepToS(&this->actor.shape.rot.x, Actor_PitchToPoint(&this->actor, &D_80C13920), 6, 0x1000, 0x100); + Math_SmoothStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &D_80C13920), 6, 0x1000, + 0x100); temp_v0 = func_800BC270(play, &this->actor, 80.0f, 0x138B0); if (temp_v0 != NULL) { - temp_v1 = temp_v0->world.rot.x - Actor_PitchToPoint(temp_v0, &this->actor.focus.pos); + temp_v1 = temp_v0->world.rot.x - Actor_WorldPitchTowardPoint(temp_v0, &this->actor.focus.pos); if (ABS_ALT(temp_v1) < 0x1800) { if (temp_v1 > 0) { this->unk_3E0 = 25.0f; @@ -826,7 +827,7 @@ void func_80C124B0(EnThiefbird* this, PlayState* play) { this->unk_3E0 * Math_SinS(this->actor.shape.rot.x) * Math_CosS(this->actor.shape.rot.y); } - if (Actor_DistanceToPoint(&this->actor, &D_80C13920) < 1000.0f) { + if (Actor_WorldDistXYZToPoint(&this->actor, &D_80C13920) < 1000.0f) { func_80C126A8(this); } } @@ -863,7 +864,7 @@ void func_80C127F4(EnThiefbird* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if ((this->unk_3EC != NULL) && ((this->unk_3EC->actor.update == NULL) || (this->unk_3EC->unk152 == 0) || - (Actor_XZDistanceBetweenActors(&player->actor, &this->unk_3EC->actor) <= 10.0f))) { + (Actor_WorldDistXZToActor(&player->actor, &this->unk_3EC->actor) <= 10.0f))) { this->unk_3EC = NULL; } @@ -883,13 +884,13 @@ void func_80C127F4(EnThiefbird* this, PlayState* play) { if (this->actor.bgCheckFlags & 8) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 3, 0x2000, 0x100); } else { - Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, &this->unk_3EC->actor), 3, - 0x2000, 0x100); + Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &this->unk_3EC->actor), + 3, 0x2000, 0x100); } temp_v0 = Math_Vec3f_Pitch(&this->limbPos[9], &this->unk_3EC->actor.world.pos); temp_v0 = CLAMP(temp_v0, -0x3000, 0x3000); Math_SmoothStepToS(&this->actor.shape.rot.x, temp_v0, 4, 0x800, 0x80); - temp_f0 = Actor_DistanceToPoint(&this->unk_3EC->actor, &this->limbPos[9]); + temp_f0 = Actor_WorldDistXYZToPoint(&this->unk_3EC->actor, &this->limbPos[9]); this->actor.speedXZ = (0.02f * temp_f0) + 2.0f; this->actor.speedXZ = CLAMP_MAX(this->actor.speedXZ, 4.0f); if ((this->unk_3EC->actor.speedXZ <= 0.0f) && (temp_f0 < 40.0f)) { 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 eb005b2246..2fe8752c29 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -838,8 +838,8 @@ void func_80895AC0(EnTite* this, PlayState* play) { if (temp_v0 > 0x3000) { this->unk_2BC = (temp_v0 >> 9) * this->unk_2BC; } - } else if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 200.0f) { - temp_v1 = this->actor.shape.rot.y - Actor_YawToPoint(&this->actor, &this->actor.home.pos); + } else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 200.0f) { + temp_v1 = this->actor.shape.rot.y - Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); temp_v0 = ABS_ALT(temp_v1); if (temp_v0 > 0x2000) { this->unk_2BC = (temp_v0 >> 9) * this->unk_2BC; 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 1bdc92b4a0..dcc2403b8f 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -442,8 +442,8 @@ s32 func_80AECE60(EnTk* this, PlayState* play) { do { doorIter = SubS_FindActor(play, doorIter, ACTORCAT_DOOR, ACTOR_EN_DOOR); if (doorIter != NULL) { - if (Actor_XZDistanceBetweenActors(&this->actor, doorIter) <= 120.0f) { - if (ABS(BINANG_SUB(Actor_YawToPoint(&this->actor, &doorIter->world.pos), + if (Actor_WorldDistXZToActor(&this->actor, doorIter) <= 120.0f) { + if (ABS(BINANG_SUB(Actor_WorldYawTowardPoint(&this->actor, &doorIter->world.pos), this->actor.shape.rot.y)) <= 0x2000) { this->unk_2CA |= 0x400; door = (EnDoor*)doorIter; @@ -459,7 +459,7 @@ s32 func_80AECE60(EnTk* this, PlayState* play) { do { doorIter = SubS_FindActor(play, doorIter, ACTORCAT_DOOR, ACTOR_EN_DOOR); if (doorIter != NULL) { - if (Actor_XZDistanceBetweenActors(&this->actor, doorIter) <= 160.0f) { + if (Actor_WorldDistXZToActor(&this->actor, doorIter) <= 160.0f) { door = (EnDoor*)doorIter; break; } @@ -911,7 +911,7 @@ s32 func_80AEE300(PlayState* play, Actor* arg1, Actor* arg2, void* _arg3) { f32 temp_f0; if ((arg2 != arg1) && (ENTK_GET_F(arg2) == 3)) { - temp_f0 = Actor_DistanceBetweenActors(arg1, arg2); + temp_f0 = Actor_WorldDistXYZToActor(arg1, arg2); if (temp_f0 < arg3->unk_04) { arg3->unk_00 = arg2; arg3->unk_04 = temp_f0; @@ -932,7 +932,7 @@ void func_80AEE374(EnTk* this, PlayState* play) { return; } - this->unk_2CC = Actor_YawToPoint(&this->actor, &sp30.unk_00->world.pos); + this->unk_2CC = Actor_WorldYawTowardPoint(&this->actor, &sp30.unk_00->world.pos); this->actionFunc = func_80AEE414; } @@ -968,7 +968,7 @@ void func_80AEE4D0(EnTk* this, PlayState* play) { bigPoe = SubS_FindActor(play, bigPoe, ACTORCAT_PROP, ACTOR_EN_BIGPO); if (bigPoe != NULL) { - if ((bigPoe->params == 3) && (Actor_DistanceBetweenActors(&this->actor, bigPoe) < 80.0f)) { + if ((bigPoe->params == 3) && (Actor_WorldDistXYZToActor(&this->actor, bigPoe) < 80.0f)) { bigPoe->params = 4; this->unk_2CA |= 0x20; this->unk_2E4++; 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 32038c4117..3cfc1eba73 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 @@ -98,7 +98,7 @@ void func_80A66278(EnWarpUzu* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { func_80A66384(this, play); } else { - phi_a0 = ABS((s16)(Actor_YawBetweenActors(&this->actor, &player->actor) - this->actor.shape.rot.y)); + phi_a0 = ABS((s16)(Actor_WorldYawTowardActor(&this->actor, &player->actor) - this->actor.shape.rot.y)); temp_v0 = player->actor.shape.rot.y - this->actor.shape.rot.y; phi_v1 = ABS(temp_v0); if (phi_a0 >= 0x2AAB) { 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 b4f63eb88c..742ea8846b 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 @@ -119,7 +119,7 @@ u8 func_80966608(EnWeatherTag* this, PlayState* play, UNK_TYPE a3, UNK_TYPE a4, Player* player = GET_PLAYER(play); u8 returnVal = 0; - if (WEATHER_TAG_RANGE100(&this->actor) > Actor_XZDistanceBetweenActors(&player->actor, &this->actor)) { + if (WEATHER_TAG_RANGE100(&this->actor) > Actor_WorldDistXZToActor(&player->actor, &this->actor)) { if (play->envCtx.unk_1F == play->envCtx.unk_20) { D_801BDBB8 = 1; if (!(play->envCtx.unk_1E == 0) || ((play->envCtx.unk_1F != 1) && (play->envCtx.unk_21 == 0))) { @@ -147,7 +147,7 @@ u8 func_80966758(EnWeatherTag* this, PlayState* play, UNK_TYPE a3, UNK_TYPE a4, Player* player = GET_PLAYER(play); u8 returnVal = 0; - if (WEATHER_TAG_RANGE100(&this->actor) < Actor_XZDistanceBetweenActors(&player->actor, &this->actor)) { + if (WEATHER_TAG_RANGE100(&this->actor) < Actor_WorldDistXZToActor(&player->actor, &this->actor)) { if (play->envCtx.unk_1F == play->envCtx.unk_20) { D_801BDBB8 = 1; if (!(play->envCtx.unk_1E == 0) || ((play->envCtx.unk_1F != 1) && (play->envCtx.unk_21 == 0))) { @@ -173,7 +173,7 @@ void func_8096689C(EnWeatherTag* this, PlayState* play) { f32 distance; f32 partialResult; - distance = Actor_XZDistanceBetweenActors(&player->actor, &this->actor); + distance = Actor_WorldDistXZToActor(&player->actor, &this->actor); if (this->fadeDistance < distance) { distance = this->fadeDistance; } @@ -422,7 +422,7 @@ void func_809672DC(EnWeatherTag* this, PlayState* play) { Actor_GetClosestPosOnPath(this->pathPoints, this->pathCount, &GET_PLAYER(play)->actor.world.pos, &this->actor.world.pos, false); - distance = Actor_XZDistanceBetweenActors(&player->actor, &this->actor); + distance = Actor_WorldDistXZToActor(&player->actor, &this->actor); range = WEATHER_TAG_RANGE100(&this->actor); if (distance < range) { @@ -447,7 +447,7 @@ void func_809672DC(EnWeatherTag* this, PlayState* play) { void func_809674C8(EnWeatherTag* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (Actor_XZDistanceBetweenActors(&player->actor, &this->actor) < WEATHER_TAG_RANGE100(&this->actor)) { + if (Actor_WorldDistXZToActor(&player->actor, &this->actor) < WEATHER_TAG_RANGE100(&this->actor)) { if (CURRENT_DAY == 2) { if ((gSaveContext.save.time >= CLOCK_TIME(7, 0)) && (gSaveContext.save.time < CLOCK_TIME(17, 30)) && (play->envCtx.unk_F2[2] == 0)) { @@ -471,7 +471,7 @@ void func_809674C8(EnWeatherTag* this, PlayState* play) { // WEATHERTAG_TYPE_LOCALDAY2RAIN 2 void func_80967608(EnWeatherTag* this, PlayState* play) { if ((WEATHER_TAG_RANGE100(&this->actor) + 10.0f) < - Actor_XZDistanceBetweenActors(&GET_PLAYER(play)->actor, &this->actor)) { + Actor_WorldDistXZToActor(&GET_PLAYER(play)->actor, &this->actor)) { gWeatherMode = 0; EnWeatherTag_SetupAction(this, func_809674C8); } 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 8d6daa3c2c..b3841a887c 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -299,10 +299,10 @@ void EnWf_Init(Actor* thisx, PlayState* play) { if (this->actor.child != NULL) { Player* player = GET_PLAYER(play); - this->actor.child->xzDistToPlayer = Actor_XZDistanceBetweenActors(&this->actor, &player->actor); + this->actor.child->xzDistToPlayer = Actor_WorldDistXZToActor(&this->actor, &player->actor); this->unk_2A4 = (temp_s0 * 0.5f) + 45.0f; this->unk_29C = 0x32000 / this->unk_2A4; - this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, &player->actor); + this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, &player->actor); this->actor.world.pos.x -= this->unk_2A4 * Math_SinS(this->actor.shape.rot.y); this->actor.world.pos.z -= this->unk_2A4 * Math_CosS(this->actor.shape.rot.y); } @@ -405,7 +405,7 @@ s32 func_80990948(PlayState* play, EnWf* this, s16 arg2) { if (((this->unk_295 == 0) || ((this->unk_295 == 1) && (this->actor.child != NULL) && (this->actor.child->update != NULL))) && (this->actor.xzDistToPlayer > 160.0f) && - (this->unk_2A8 < Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos))) { + (this->unk_2A8 < Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos))) { func_80993524(this); return true; } @@ -1217,7 +1217,7 @@ void func_80993018(EnWf* this, PlayState* play) { } else if (this->actor.child->xzDistToPlayer < (80.0f + this->unk_2A4)) { func_80993350(this); } else { - s16 temp_v0 = Actor_YawBetweenActors(this->actor.child, &this->actor); + s16 temp_v0 = Actor_WorldYawTowardActor(this->actor.child, &this->actor); s16 temp_v1 = BINANG_SUB(temp_v0 - this->actor.child->yawTowardsPlayer, 0x8000); if (ABS_ALT(temp_v1) > 0x800) { @@ -1251,7 +1251,7 @@ void func_80993194(EnWf* this, PlayState* play) { if (this->actor.child->xzDistToPlayer < (80.0f + this->unk_2A4)) { func_80993350(this); } else { - sp36 = Actor_YawBetweenActors(this->actor.child, &this->actor); + sp36 = Actor_WorldYawTowardActor(this->actor.child, &this->actor); sp34 = Math_SmoothStepToS(&sp36, BINANG_ROT180(this->actor.child->yawTowardsPlayer), 10, this->unk_29C, 16); this->actor.world.pos.x = (Math_SinS(sp36) * this->unk_2A4) + this->actor.child->world.pos.x; @@ -1293,7 +1293,7 @@ void func_809933A0(EnWf* this, PlayState* play) { if (func_80990EAC(this)) { func_80990ED4(this); } else { - sp2E = Actor_YawBetweenActors(this->actor.child, &this->actor); + sp2E = Actor_WorldYawTowardActor(this->actor.child, &this->actor); Math_ScaledStepToS(&sp2E, this->actor.child->yawTowardsPlayer, this->unk_29C >> 2); sp2C = sp2E - this->actor.child->yawTowardsPlayer; this->actor.world.pos.x = (Math_SinS(sp2E) * this->unk_2A4) + this->actor.child->world.pos.x; @@ -1330,7 +1330,7 @@ void func_8099357C(EnWf* this, PlayState* play) { func_80990E4C(this, play); if (this->unk_295 != 0) { if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) { - sp2E = Actor_YawBetweenActors(&this->actor, this->actor.child); + sp2E = Actor_WorldYawTowardActor(&this->actor, this->actor.child); if (func_80990EAC(this)) { this->actor.child = NULL; func_80991738(this); @@ -1348,7 +1348,7 @@ void func_8099357C(EnWf* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, sp2E, 10, 0x800, 16); this->actor.world.rot.y = this->actor.shape.rot.y; - if (Actor_XZDistanceBetweenActors(&this->actor, this->actor.child) < (this->unk_2A4 + 10.0f)) { + if (Actor_WorldDistXZToActor(&this->actor, this->actor.child) < (this->unk_2A4 + 10.0f)) { func_80993148(this); } } else { @@ -1356,10 +1356,10 @@ void func_8099357C(EnWf* this, PlayState* play) { func_80991738(this); } } else { - Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 10, 0x800, - 16); + Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 10, + 0x800, 16); this->actor.world.rot.y = this->actor.shape.rot.y; - if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 40.0f) { + if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 40.0f) { func_809910F0(this); } } @@ -1590,7 +1590,7 @@ s32 func_8099408C(PlayState* play, EnWf* this) { s16 temp_v1; if (temp_v0 != NULL) { - temp_v1 = (Actor_YawBetweenActors(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_29E; + temp_v1 = (Actor_WorldYawTowardActor(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_29E; if (ABS_ALT(temp_v1) < 0x3000) { if (Rand_ZeroOne() < 0.5f) { func_8099223C(this); 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 4b7e9f4714..b4c53a4381 100644 --- a/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c +++ b/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c @@ -247,7 +247,7 @@ void func_80AE9258(ObjBigicicle* this, PlayState* play) { icePoly = (ObjIcePoly*)itemAction; temp_f0 = this->actor.world.pos.y - icePoly->actor.world.pos.y; if ((temp_f0 < icePoly->colliders1[0].dim.height) && (temp_f0 > 0.0f) && - (Actor_XZDistanceBetweenActors(&this->actor, &icePoly->actor) < icePoly->colliders1[0].dim.radius)) { + (Actor_WorldDistXZToActor(&this->actor, &icePoly->actor) < icePoly->colliders1[0].dim.radius)) { Flags_SetSwitch(play, this->actor.params); this->actionFunc = func_80AE939C; return; 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 cfecbdad05..cc5e1caf13 100644 --- a/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c +++ b/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c @@ -82,7 +82,7 @@ void ObjBoyo_UpdatePlayerBumpValues(ObjBoyo* this, Player* target) { void ObjBoyo_UpdatePirateBumpValues(ObjBoyo* src, EnKaizoku* target) { target->unk_2F0 = 30.0f; - target->unk_2F4 = Actor_YawBetweenActors(&src->actor, &target->picto.actor); + target->unk_2F4 = Actor_WorldYawTowardActor(&src->actor, &target->picto.actor); } void ObjBoyo_UpdateBombBumpValues(ObjBoyo* src, EnBom* target) { 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 9872fb0b71..a803f7904d 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 @@ -227,10 +227,10 @@ void func_809AB4A8(ObjGrassCarry* this, PlayState* play) { Math_Vec3f_Copy(&this->actor.world.pos, &this->unk_194->unk_00); this->actor.shape.rot.y = this->actor.world.rot.y = this->unk_194->unk_0C; this->unk_198 = this2->unk_194->unk_0E; - this->actor.xzDistToPlayer = Actor_XZDistanceBetweenActors(&this->actor, &player->actor); + this->actor.xzDistToPlayer = Actor_WorldDistXZToActor(&this->actor, &player->actor); this->actor.playerHeightRel = Actor_HeightDiff(&this->actor, &player->actor); this->actor.xyzDistToPlayerSq = SQ(this->actor.xzDistToPlayer) + SQ(this->actor.playerHeightRel); - this->actor.yawTowardsPlayer = Actor_YawBetweenActors(&this->actor, &player->actor); + this->actor.yawTowardsPlayer = Actor_WorldYawTowardActor(&this->actor, &player->actor); Actor_LiftActor(&this->actor, play); } } diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 5a7397dc02..a2358f653f 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -722,16 +722,16 @@ 0x800B6BD8:("Actor_MoveWithoutGravityReverse",), 0x800B6C04:("Actor_SetSpeeds",), 0x800B6C58:("Actor_UpdatePosFromSkelAnime",), - 0x800B6CD4:("Actor_YawBetweenActors",), - 0x800B6D00:("Actor_YawBetweenActorsTop",), - 0x800B6D2C:("Actor_YawToPoint",), - 0x800B6D50:("Actor_PitchBetweenActors",), - 0x800B6D7C:("Actor_PitchBetweenActorsTop",), - 0x800B6DA8:("Actor_PitchToPoint",), - 0x800B6DCC:("Actor_DistanceBetweenActors",), - 0x800B6DF8:("Actor_DistanceToPoint",), - 0x800B6E1C:("Actor_XZDistanceBetweenActors",), - 0x800B6E48:("Actor_XZDistanceToPoint",), + 0x800B6CD4:("Actor_WorldYawTowardActor",), + 0x800B6D00:("Actor_FocusYawTowardActor",), + 0x800B6D2C:("Actor_WorldYawTowardPoint",), + 0x800B6D50:("Actor_WorldPitchTowardActor",), + 0x800B6D7C:("Actor_FocusPitchTowardActor",), + 0x800B6DA8:("Actor_WorldPitchTowardPoint",), + 0x800B6DCC:("Actor_WorldDistXYZToActor",), + 0x800B6DF8:("Actor_WorldDistXYZToPoint",), + 0x800B6E1C:("Actor_WorldDistXZToActor",), + 0x800B6E48:("Actor_WorldDistXZToPoint",), 0x800B6E6C:("Actor_OffsetOfPointInActorCoords",), 0x800B6F0C:("Actor_HeightDiff",), 0x800B6F20:("func_800B6F20",), diff --git a/tools/namefixer.py b/tools/namefixer.py index 9de1fc43b0..012e6b436c 100755 --- a/tools/namefixer.py +++ b/tools/namefixer.py @@ -137,6 +137,16 @@ wordReplace = { "func_800B8214": "Actor_GetWorld", "func_800B8248": "Actor_GetWorldPosShapeRot", "func_800BE22C": "Actor_ApplyDamage", + "Actor_YawBetweenActors": "Actor_WorldYawTowardActor", + "Actor_YawBetweenActorsTop": "Actor_FocusYawTowardActor", + "Actor_YawToPoint": "Actor_WorldYawTowardPoint", + "Actor_PitchBetweenActors": "Actor_WorldPitchTowardActor", + "Actor_PitchBetweenActorsTop": "Actor_FocusPitchTowardActor", + "Actor_PitchToPoint": "Actor_WorldPitchTowardPoint", + "Actor_DistanceBetweenActors": "Actor_WorldDistXYZToActor", + "Actor_DistanceToPoint": "Actor_WorldDistXYZToPoint", + "Actor_XZDistanceBetweenActors": "Actor_WorldDistXZToActor", + "Actor_XZDistanceToPoint": "Actor_WorldDistXZToPoint", "Audio_PlaySoundAtPosition": "SoundSource_PlaySfxAtFixedWorldPos", "func_800F0590": "SoundSource_PlaySfxEachFrameAtFixedWorldPos", "func_8016970C": "Play_SetCameraAtEye", diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 7b7e4b1b4a..ee686ff7d6 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -236,16 +236,16 @@ asm/non_matchings/code/z_actor/Actor_UpdateVelocityWithoutGravityReverse.s,Actor asm/non_matchings/code/z_actor/Actor_MoveWithoutGravityReverse.s,Actor_MoveWithoutGravityReverse,0x800B6BD8,0xB asm/non_matchings/code/z_actor/Actor_SetSpeeds.s,Actor_SetSpeeds,0x800B6C04,0x15 asm/non_matchings/code/z_actor/Actor_UpdatePosFromSkelAnime.s,Actor_UpdatePosFromSkelAnime,0x800B6C58,0x1F -asm/non_matchings/code/z_actor/Actor_YawBetweenActors.s,Actor_YawBetweenActors,0x800B6CD4,0xB -asm/non_matchings/code/z_actor/Actor_YawBetweenActorsTop.s,Actor_YawBetweenActorsTop,0x800B6D00,0xB -asm/non_matchings/code/z_actor/Actor_YawToPoint.s,Actor_YawToPoint,0x800B6D2C,0x9 -asm/non_matchings/code/z_actor/Actor_PitchBetweenActors.s,Actor_PitchBetweenActors,0x800B6D50,0xB -asm/non_matchings/code/z_actor/Actor_PitchBetweenActorsTop.s,Actor_PitchBetweenActorsTop,0x800B6D7C,0xB -asm/non_matchings/code/z_actor/Actor_PitchToPoint.s,Actor_PitchToPoint,0x800B6DA8,0x9 -asm/non_matchings/code/z_actor/Actor_DistanceBetweenActors.s,Actor_DistanceBetweenActors,0x800B6DCC,0xB -asm/non_matchings/code/z_actor/Actor_DistanceToPoint.s,Actor_DistanceToPoint,0x800B6DF8,0x9 -asm/non_matchings/code/z_actor/Actor_XZDistanceBetweenActors.s,Actor_XZDistanceBetweenActors,0x800B6E1C,0xB -asm/non_matchings/code/z_actor/Actor_XZDistanceToPoint.s,Actor_XZDistanceToPoint,0x800B6E48,0x9 +asm/non_matchings/code/z_actor/Actor_WorldYawTowardActor.s,Actor_WorldYawTowardActor,0x800B6CD4,0xB +asm/non_matchings/code/z_actor/Actor_FocusYawTowardActor.s,Actor_FocusYawTowardActor,0x800B6D00,0xB +asm/non_matchings/code/z_actor/Actor_WorldYawTowardPoint.s,Actor_WorldYawTowardPoint,0x800B6D2C,0x9 +asm/non_matchings/code/z_actor/Actor_WorldPitchTowardActor.s,Actor_WorldPitchTowardActor,0x800B6D50,0xB +asm/non_matchings/code/z_actor/Actor_FocusPitchTowardActor.s,Actor_FocusPitchTowardActor,0x800B6D7C,0xB +asm/non_matchings/code/z_actor/Actor_WorldPitchTowardPoint.s,Actor_WorldPitchTowardPoint,0x800B6DA8,0x9 +asm/non_matchings/code/z_actor/Actor_WorldDistXYZToActor.s,Actor_WorldDistXYZToActor,0x800B6DCC,0xB +asm/non_matchings/code/z_actor/Actor_WorldDistXYZToPoint.s,Actor_WorldDistXYZToPoint,0x800B6DF8,0x9 +asm/non_matchings/code/z_actor/Actor_WorldDistXZToActor.s,Actor_WorldDistXZToActor,0x800B6E1C,0xB +asm/non_matchings/code/z_actor/Actor_WorldDistXZToPoint.s,Actor_WorldDistXZToPoint,0x800B6E48,0x9 asm/non_matchings/code/z_actor/Actor_OffsetOfPointInActorCoords.s,Actor_OffsetOfPointInActorCoords,0x800B6E6C,0x28 asm/non_matchings/code/z_actor/Actor_HeightDiff.s,Actor_HeightDiff,0x800B6F0C,0x5 asm/non_matchings/code/z_actor/func_800B6F20.s,func_800B6F20,0x800B6F20,0x2A From cc8772a896f8a654d36787ac23114d9f24a506d0 Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Fri, 3 Mar 2023 00:09:16 -0500 Subject: [PATCH 18/29] Name `Actor_PlaySfx` and `Player_PlaySfx` (#1190) * name funcs * namefixer * function comments --- include/functions.h | 4 +- include/z64actor.h | 1 - src/code/z_actor.c | 19 +- src/code/z_effect_soft_sprite_old_init.c | 6 +- src/code/z_en_hy_code.c | 4 +- .../actors/ovl_Arrow_Fire/z_arrow_fire.c | 2 +- .../actors/ovl_Arrow_Ice/z_arrow_ice.c | 2 +- .../actors/ovl_Arrow_Light/z_arrow_light.c | 2 +- .../ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c | 2 +- .../ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c | 2 +- .../ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c | 2 +- .../ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c | 2 +- .../ovl_Bg_Dblue_Balance/z_bg_dblue_balance.c | 8 +- .../ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c | 4 +- .../z_bg_dblue_waterfall.c | 2 +- .../ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.c | 2 +- .../actors/ovl_Bg_F40_Block/z_bg_f40_block.c | 8 +- .../ovl_Bg_F40_Switch/z_bg_f40_switch.c | 4 +- .../z_bg_hakugin_elvpole.c | 4 +- .../ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c | 2 +- .../z_bg_hakugin_switch.c | 2 +- .../actors/ovl_Bg_Icefloe/z_bg_icefloe.c | 4 +- .../actors/ovl_Bg_Icicle/z_bg_icicle.c | 2 +- .../ovl_Bg_Ikana_Block/z_bg_ikana_block.c | 10 +- .../ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c | 4 +- .../z_bg_ikana_rotaryroom.c | 4 +- .../ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c | 4 +- .../actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c | 2 +- .../actors/ovl_Bg_Ingate/z_bg_ingate.c | 2 +- .../ovl_Bg_Keikoku_Saku/z_bg_keikoku_saku.c | 4 +- .../ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c | 6 +- .../actors/ovl_Bg_Ladder/z_bg_ladder.c | 2 +- .../ovl_Bg_Last_Bwall/z_bg_last_bwall.c | 2 +- .../actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c | 6 +- .../ovl_Bg_Open_Shutter/z_bg_open_shutter.c | 10 +- .../actors/ovl_Bg_Spdweb/z_bg_spdweb.c | 2 +- .../actors/ovl_Bg_Tobira01/z_bg_tobira01.c | 2 +- src/overlays/actors/ovl_Boss_02/z_boss_02.c | 12 +- src/overlays/actors/ovl_Boss_03/z_boss_03.c | 22 +-- src/overlays/actors/ovl_Boss_04/z_boss_04.c | 14 +- .../actors/ovl_Demo_Syoten/z_demo_syoten.c | 4 +- .../actors/ovl_Dm_Char00/z_dm_char00.c | 98 +++++----- .../actors/ovl_Dm_Char01/z_dm_char01.c | 4 +- .../actors/ovl_Dm_Char02/z_dm_char02.c | 4 +- .../actors/ovl_Dm_Char03/z_dm_char03.c | 4 +- .../actors/ovl_Dm_Char05/z_dm_char05.c | 24 +-- .../actors/ovl_Dm_Char08/z_dm_char08.c | 6 +- .../actors/ovl_Dm_Char09/z_dm_char09.c | 2 +- src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c | 172 +++++++++--------- .../actors/ovl_Door_Shutter/z_door_shutter.c | 14 +- .../actors/ovl_Door_Warp1/z_door_warp1.c | 18 +- .../z_eff_kamejima_wave.c | 2 +- .../actors/ovl_Eff_Lastday/z_eff_lastday.c | 2 +- .../ovl_En_Akindonuts/z_en_akindonuts.c | 10 +- src/overlays/actors/ovl_En_Al/z_en_al.c | 4 +- src/overlays/actors/ovl_En_Am/z_en_am.c | 12 +- src/overlays/actors/ovl_En_Ani/z_en_ani.c | 2 +- src/overlays/actors/ovl_En_Arrow/z_en_arrow.c | 14 +- .../ovl_En_Attack_Niw/z_en_attack_niw.c | 4 +- src/overlays/actors/ovl_En_Az/z_en_az.c | 10 +- src/overlays/actors/ovl_En_Baba/z_en_baba.c | 2 +- src/overlays/actors/ovl_En_Baguo/z_en_baguo.c | 12 +- src/overlays/actors/ovl_En_Bat/z_en_bat.c | 8 +- src/overlays/actors/ovl_En_Bb/z_en_bb.c | 22 +-- .../actors/ovl_En_Bbfall/z_en_bbfall.c | 14 +- src/overlays/actors/ovl_En_Bee/z_en_bee.c | 2 +- .../actors/ovl_En_Bigokuta/z_en_bigokuta.c | 12 +- .../actors/ovl_En_Bigpamet/z_en_bigpamet.c | 16 +- src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c | 20 +- .../actors/ovl_En_Bigslime/z_en_bigslime.c | 20 +- src/overlays/actors/ovl_En_Bjt/z_en_bjt.c | 6 +- src/overlays/actors/ovl_En_Bom/z_en_bom.c | 14 +- .../ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c | 10 +- .../actors/ovl_En_Bombal/z_en_bombal.c | 2 +- .../actors/ovl_En_Bombers/z_en_bombers.c | 4 +- .../actors/ovl_En_Bombers2/z_en_bombers2.c | 6 +- src/overlays/actors/ovl_En_Bombf/z_en_bombf.c | 10 +- .../actors/ovl_En_Bomjima/z_en_bomjima.c | 12 +- .../actors/ovl_En_Bomjimb/z_en_bomjimb.c | 14 +- src/overlays/actors/ovl_En_Boom/z_en_boom.c | 2 +- .../actors/ovl_En_Bubble/z_en_bubble.c | 4 +- src/overlays/actors/ovl_En_Cha/z_en_cha.c | 4 +- .../actors/ovl_En_Col_Man/z_en_col_man.c | 4 +- src/overlays/actors/ovl_En_Cow/z_en_cow.c | 2 +- src/overlays/actors/ovl_En_Crow/z_en_crow.c | 10 +- src/overlays/actors/ovl_En_Dai/z_en_dai.c | 14 +- .../actors/ovl_En_Daiku2/z_en_daiku2.c | 2 +- .../actors/ovl_En_Dekubaba/z_en_dekubaba.c | 26 +-- .../actors/ovl_En_Dekunuts/z_en_dekunuts.c | 20 +- src/overlays/actors/ovl_En_Dg/z_en_dg.c | 32 ++-- .../actors/ovl_En_Dinofos/z_en_dinofos.c | 38 ++-- src/overlays/actors/ovl_En_Dnk/z_en_dnk.c | 4 +- src/overlays/actors/ovl_En_Dno/z_en_dno.c | 4 +- src/overlays/actors/ovl_En_Dnp/z_en_dnp.c | 20 +- src/overlays/actors/ovl_En_Dnq/z_en_dnq.c | 2 +- src/overlays/actors/ovl_En_Dns/z_en_dns.c | 8 +- .../actors/ovl_En_Dodongo/z_en_dodongo.c | 24 +-- src/overlays/actors/ovl_En_Door/z_en_door.c | 14 +- .../actors/ovl_En_Dragon/z_en_dragon.c | 22 +-- .../actors/ovl_En_Dy_Extra/z_en_dy_extra.c | 2 +- src/overlays/actors/ovl_En_Egol/z_en_egol.c | 26 +-- src/overlays/actors/ovl_En_Elf/z_en_elf.c | 22 +-- .../actors/ovl_En_Elfgrp/z_en_elfgrp.c | 4 +- .../actors/ovl_En_Elforg/z_en_elforg.c | 4 +- .../actors/ovl_En_Encount2/z_en_encount2.c | 2 +- .../actors/ovl_En_Estone/z_en_estone.c | 2 +- src/overlays/actors/ovl_En_Fall/z_en_fall.c | 18 +- src/overlays/actors/ovl_En_Famos/z_en_famos.c | 14 +- src/overlays/actors/ovl_En_Fg/z_en_fg.c | 8 +- .../actors/ovl_En_Firefly/z_en_firefly.c | 8 +- src/overlays/actors/ovl_En_Fish/z_en_fish.c | 4 +- src/overlays/actors/ovl_En_Fish2/z_en_fish2.c | 6 +- .../actors/ovl_En_Fishing/z_en_fishing.c | 8 +- .../actors/ovl_En_Floormas/z_en_floormas.c | 46 ++--- src/overlays/actors/ovl_En_Fsn/z_en_fsn.c | 4 +- .../actors/ovl_En_Fu_Kago/z_en_fu_kago.c | 4 +- .../actors/ovl_En_Fu_Mato/z_en_fu_mato.c | 6 +- src/overlays/actors/ovl_En_Fz/z_en_fz.c | 16 +- .../actors/ovl_En_Gamelupy/z_en_gamelupy.c | 2 +- src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 8 +- src/overlays/actors/ovl_En_Ge2/z_en_ge2.c | 10 +- src/overlays/actors/ovl_En_Geg/z_en_geg.c | 6 +- src/overlays/actors/ovl_En_Giant/z_en_giant.c | 4 +- .../actors/ovl_En_Ginko_Man/z_en_ginko_man.c | 4 +- src/overlays/actors/ovl_En_Gk/z_en_gk.c | 8 +- src/overlays/actors/ovl_En_Gm/z_en_gm.c | 18 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 48 ++--- .../actors/ovl_En_Goroiwa/z_en_goroiwa.c | 10 +- .../ovl_En_Grasshopper/z_en_grasshopper.c | 18 +- src/overlays/actors/ovl_En_Gs/z_en_gs.c | 24 +-- .../ovl_En_Guard_Nuts/z_en_guard_nuts.c | 8 +- .../actors/ovl_En_Hakurock/z_en_hakurock.c | 4 +- .../actors/ovl_En_Hanabi/z_en_hanabi.c | 4 +- src/overlays/actors/ovl_En_Hg/z_en_hg.c | 2 +- src/overlays/actors/ovl_En_Hgo/z_en_hgo.c | 2 +- .../ovl_En_Hidden_Nuts/z_en_hidden_nuts.c | 20 +- .../actors/ovl_En_Hint_Skb/z_en_hint_skb.c | 22 +-- src/overlays/actors/ovl_En_Horse/z_en_horse.c | 8 +- src/overlays/actors/ovl_En_Ig/z_en_ig.c | 8 +- src/overlays/actors/ovl_En_Ik/z_en_ik.c | 30 +-- src/overlays/actors/ovl_En_In/z_en_in.c | 16 +- .../actors/ovl_En_Insect/z_en_insect.c | 4 +- .../actors/ovl_En_Invadepoh/z_en_invadepoh.c | 16 +- .../actors/ovl_En_Jc_Mato/z_en_jc_mato.c | 2 +- .../actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c | 6 +- .../actors/ovl_En_Kaizoku/z_en_kaizoku.c | 50 ++--- .../actors/ovl_En_Kakasi/z_en_kakasi.c | 18 +- src/overlays/actors/ovl_En_Kame/z_en_kame.c | 26 +-- .../actors/ovl_En_Kanban/z_en_kanban.c | 10 +- .../actors/ovl_En_Karebaba/z_en_karebaba.c | 12 +- .../actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 6 +- src/overlays/actors/ovl_En_Kgy/z_en_kgy.c | 2 +- src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c | 10 +- .../actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c | 8 +- src/overlays/actors/ovl_En_Light/z_en_light.c | 4 +- .../actors/ovl_En_Look_Nuts/z_en_look_nuts.c | 4 +- src/overlays/actors/ovl_En_Ma4/z_en_ma4.c | 4 +- .../actors/ovl_En_Maruta/z_en_maruta.c | 4 +- .../actors/ovl_En_Minifrog/z_en_minifrog.c | 2 +- .../actors/ovl_En_Minislime/z_en_minislime.c | 6 +- src/overlays/actors/ovl_En_Mkk/z_en_mkk.c | 6 +- src/overlays/actors/ovl_En_Mm/z_en_mm.c | 6 +- src/overlays/actors/ovl_En_Mm3/z_en_mm3.c | 2 +- .../actors/ovl_En_Mushi2/z_en_mushi2.c | 6 +- .../actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c | 16 +- src/overlays/actors/ovl_En_Niw/z_en_niw.c | 20 +- src/overlays/actors/ovl_En_Nwc/z_en_nwc.c | 12 +- src/overlays/actors/ovl_En_Osk/z_en_osk.c | 22 +-- src/overlays/actors/ovl_En_Osn/z_en_osn.c | 4 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 2 +- src/overlays/actors/ovl_En_Ot/z_en_ot.c | 6 +- src/overlays/actors/ovl_En_Owl/z_en_owl.c | 4 +- .../actors/ovl_En_Pamera/z_en_pamera.c | 8 +- .../actors/ovl_En_Pametfrog/z_en_pametfrog.c | 38 ++-- .../actors/ovl_En_Peehat/z_en_peehat.c | 12 +- src/overlays/actors/ovl_En_Pm/z_en_pm.c | 14 +- .../actors/ovl_En_Po_Fusen/z_en_po_fusen.c | 2 +- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 26 +-- src/overlays/actors/ovl_En_Poh/z_en_poh.c | 24 +-- src/overlays/actors/ovl_En_Pp/z_en_pp.c | 20 +- src/overlays/actors/ovl_En_Pr/z_en_pr.c | 4 +- src/overlays/actors/ovl_En_Pr2/z_en_pr2.c | 8 +- src/overlays/actors/ovl_En_Prz/z_en_prz.c | 2 +- .../actors/ovl_En_Racedog/z_en_racedog.c | 2 +- src/overlays/actors/ovl_En_Raf/z_en_raf.c | 18 +- .../actors/ovl_En_Rail_Skb/z_en_rail_skb.c | 28 +-- .../actors/ovl_En_Railgibud/z_en_railgibud.c | 26 +-- src/overlays/actors/ovl_En_Rat/z_en_rat.c | 12 +- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 44 ++--- src/overlays/actors/ovl_En_Rg/z_en_rg.c | 8 +- .../ovl_En_River_Sound/z_en_river_sound.c | 2 +- src/overlays/actors/ovl_En_Rr/z_en_rr.c | 16 +- src/overlays/actors/ovl_En_Ru/z_en_ru.c | 4 +- .../actors/ovl_En_Ruppecrow/z_en_ruppecrow.c | 16 +- .../actors/ovl_En_S_Goro/z_en_s_goro.c | 4 +- src/overlays/actors/ovl_En_Sb/z_en_sb.c | 6 +- .../actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.c | 2 +- .../actors/ovl_En_Scopenuts/z_en_scopenuts.c | 10 +- .../actors/ovl_En_Sellnuts/z_en_sellnuts.c | 14 +- src/overlays/actors/ovl_En_Skb/z_en_skb.c | 20 +- .../actors/ovl_En_Snowman/z_en_snowman.c | 24 +-- src/overlays/actors/ovl_En_Ssh/z_en_ssh.c | 22 +-- src/overlays/actors/ovl_En_St/z_en_st.c | 12 +- .../ovl_En_Stone_heishi/z_en_stone_heishi.c | 2 +- .../ovl_En_Stop_heishi/z_en_stop_heishi.c | 2 +- .../actors/ovl_En_Suttari/z_en_suttari.c | 4 +- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 34 ++-- .../ovl_En_Syateki_Crow/z_en_syateki_crow.c | 6 +- .../z_en_syateki_dekunuts.c | 8 +- .../ovl_En_Syateki_Man/z_en_syateki_man.c | 8 +- .../ovl_En_Syateki_Okuta/z_en_syateki_okuta.c | 12 +- .../ovl_En_Syateki_Wf/z_en_syateki_wf.c | 8 +- .../ovl_En_Talk_Gibud/z_en_talk_gibud.c | 22 +-- .../actors/ovl_En_Tanron2/z_en_tanron2.c | 18 +- .../actors/ovl_En_Tanron3/z_en_tanron3.c | 6 +- .../actors/ovl_En_Tanron5/z_en_tanron5.c | 4 +- .../actors/ovl_En_Thiefbird/z_en_thiefbird.c | 16 +- .../actors/ovl_En_Time_Tag/z_en_time_tag.c | 2 +- src/overlays/actors/ovl_En_Tite/z_en_tite.c | 40 ++-- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 8 +- src/overlays/actors/ovl_En_Trt/z_en_trt.c | 4 +- src/overlays/actors/ovl_En_Trt2/z_en_trt2.c | 4 +- src/overlays/actors/ovl_En_Tru/z_en_tru.c | 10 +- .../actors/ovl_En_Tru_Mt/z_en_tru_mt.c | 4 +- .../actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c | 4 +- src/overlays/actors/ovl_En_Vm/z_en_vm.c | 6 +- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 26 +-- .../actors/ovl_En_Warp_tag/z_en_warp_tag.c | 2 +- .../ovl_En_Water_Effect/z_en_water_effect.c | 2 +- src/overlays/actors/ovl_En_Wf/z_en_wf.c | 40 ++-- src/overlays/actors/ovl_En_Wiz/z_en_wiz.c | 28 +-- .../actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c | 16 +- .../actors/ovl_En_Wood02/z_en_wood02.c | 6 +- src/overlays/actors/ovl_En_Yb/z_en_yb.c | 2 +- src/overlays/actors/ovl_En_Zo/z_en_zo.c | 4 +- src/overlays/actors/ovl_En_Zog/z_en_zog.c | 14 +- .../actors/ovl_En_Zoraegg/z_en_zoraegg.c | 14 +- src/overlays/actors/ovl_En_Zot/z_en_zot.c | 2 +- src/overlays/actors/ovl_En_Zow/z_en_zow.c | 4 +- src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c | 2 +- .../actors/ovl_Obj_Armos/z_obj_armos.c | 6 +- src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c | 2 +- src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c | 4 +- src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c | 2 +- .../actors/ovl_Obj_Dhouse/z_obj_dhouse.c | 2 +- src/overlays/actors/ovl_Obj_Dora/z_obj_dora.c | 6 +- .../ovl_Obj_Flowerpot/z_obj_flowerpot.c | 4 +- .../actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c | 4 +- .../actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c | 2 +- .../actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c | 2 +- .../actors/ovl_Obj_Iceblock/z_obj_iceblock.c | 8 +- .../ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.c | 4 +- .../actors/ovl_Obj_Kibako/z_obj_kibako.c | 4 +- .../actors/ovl_Obj_Kibako2/z_obj_kibako2.c | 2 +- .../ovl_Obj_Lightswitch/z_obj_lightswitch.c | 6 +- .../ovl_Obj_Makekinsuta/z_obj_makekinsuta.c | 2 +- .../actors/ovl_Obj_Nozoki/z_obj_nozoki.c | 8 +- .../actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c | 12 +- .../actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c | 6 +- .../ovl_Obj_Skateblock/z_obj_skateblock.c | 2 +- .../actors/ovl_Obj_Snowball/z_obj_snowball.c | 4 +- .../ovl_Obj_Snowball2/z_obj_snowball2.c | 4 +- .../ovl_Obj_Spidertent/z_obj_spidertent.c | 2 +- .../ovl_Obj_Spinyroll/z_obj_spinyroll.c | 2 +- .../actors/ovl_Obj_Switch/z_obj_switch.c | 4 +- src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c | 2 +- src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c | 4 +- .../ovl_Obj_Tokei_Step/z_obj_tokei_step.c | 2 +- .../actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c | 12 +- src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c | 2 +- .../actors/ovl_Obj_Tsubo/z_obj_tsubo.c | 4 +- src/overlays/actors/ovl_Obj_Um/z_obj_um.c | 2 +- .../actors/ovl_Obj_Usiyane/z_obj_usiyane.c | 2 +- .../ovl_Obj_Vspinyroll/z_obj_vspinyroll.c | 2 +- .../ovl_Obj_Warpstone/z_obj_warpstone.c | 2 +- .../actors/ovl_Obj_Wturn/z_obj_wturn.c | 2 +- .../ovl_Obj_Y2shutter/z_obj_y2shutter.c | 6 +- tools/disasm/functions.txt | 4 +- tools/namefixer.py | 4 +- tools/sizes/code_functions.csv | 4 +- 280 files changed, 1433 insertions(+), 1425 deletions(-) diff --git a/include/functions.h b/include/functions.h index e3ff8fddda..0aa19e492e 100644 --- a/include/functions.h +++ b/include/functions.h @@ -706,8 +706,8 @@ void func_800B8D50(PlayState* play, Actor* actor, f32 arg2, s16 yaw, f32 arg4, u void func_800B8D98(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4); void func_800B8DD4(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5); void func_800B8E1C(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4); -void func_800B8E58(Player* player, u16 sfxId); -void Actor_PlaySfxAtPos(Actor* actor, u16 sfxId); +void Player_PlaySfx(Player* player, u16 sfxId); +void Actor_PlaySfx(Actor* actor, u16 sfxId); void func_800B8EF4(PlayState* play, Actor* actor); void func_800B8F98(Actor* actor, u16 sfxId); void func_800B8FC0(Actor* actor, u16 sfxId); diff --git a/include/z64actor.h b/include/z64actor.h index 04c8fd02a3..7c48cd5cfa 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -218,7 +218,6 @@ typedef struct { /* 0x148 */ f32 pushForce; /* 0x14C */ f32 unk14C; /* 0x150 */ s16 yRotation; - /* 0x152 */ u16 unk152; /* 0x154 */ u32 flags; /* 0x158 */ u8 stateFlags; /* 0x15A */ s16 pad15A; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 912c3ee81c..6ba05d4f96 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -2130,7 +2130,10 @@ void func_800B8E1C(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4) func_800B8DD4(play, actor, arg2, arg3, arg4, 0); } -void func_800B8E58(Player* player, u16 sfxId) { +/** + * Play a sound effect at the player's position + */ +void Player_PlaySfx(Player* player, u16 sfxId) { if (player->currentMask == PLAYER_MASK_GIANT) { func_8019F170(&player->actor.projectedPos, sfxId); } else { @@ -2140,9 +2143,9 @@ void func_800B8E58(Player* player, u16 sfxId) { } /** - * Plays the sound effect at the actor's position + * Play a sound effect at the actor's position */ -void Actor_PlaySfxAtPos(Actor* actor, u16 sfxId) { +void Actor_PlaySfx(Actor* actor, u16 sfxId) { Audio_PlaySfxAtPos(&actor->projectedPos, sfxId); } @@ -3839,7 +3842,7 @@ void Actor_SpawnShieldParticlesMetal(PlayState* play, Vec3f* pos) { void Actor_SetColorFilter(Actor* actor, u16 colorFlag, u16 colorIntensityMax, u16 xluFlag, u16 duration) { if ((colorFlag == 0x8000) && !(colorIntensityMax & 0x8000)) { - Actor_PlaySfxAtPos(actor, NA_SE_EN_LIGHT_ARROW_HIT); + Actor_PlaySfx(actor, NA_SE_EN_LIGHT_ARROW_HIT); } actor->colorFilterParams = colorFlag | xluFlag | ((colorIntensityMax & 0xF8) << 5) | duration; @@ -4476,13 +4479,13 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16 // Apply sfx along with damage effect if ((actor != NULL) && (effectAlpha > 0.05f) && (play->gameOverCtx.state == GAMEOVER_INACTIVE)) { if (type == ACTOR_DRAW_DMGEFF_FIRE) { - Actor_PlaySfxAtPos(actor, NA_SE_EV_BURN_OUT - SFX_FLAG); + Actor_PlaySfx(actor, NA_SE_EV_BURN_OUT - SFX_FLAG); } else if (type == ACTOR_DRAW_DMGEFF_BLUE_FIRE) { - Actor_PlaySfxAtPos(actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG); + Actor_PlaySfx(actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG); } else if (type == ACTOR_DRAW_DMGEFF_FROZEN_SFX) { - Actor_PlaySfxAtPos(actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); + Actor_PlaySfx(actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); } else if ((type == ACTOR_DRAW_DMGEFF_LIGHT_ORBS) || (type == ACTOR_DRAW_DMGEFF_BLUE_LIGHT_ORBS)) { - Actor_PlaySfxAtPos(actor, NA_SE_EN_COMMON_DEADLIGHT - SFX_FLAG); + Actor_PlaySfx(actor, NA_SE_EN_COMMON_DEADLIGHT - SFX_FLAG); } } diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c index 4f24651d13..0b08f4dd07 100644 --- a/src/code/z_effect_soft_sprite_old_init.c +++ b/src/code/z_effect_soft_sprite_old_init.c @@ -805,7 +805,7 @@ void EffectSsEnIce_SpawnFlying(PlayState* play, Actor* actor, Vec3f* pos, Color_ initParams.scale = scale; if (actor != NULL) { - Actor_PlaySfxAtPos(actor, NA_SE_PL_FREEZE_S); + Actor_PlaySfx(actor, NA_SE_PL_FREEZE_S); } EffectSs_Spawn(play, EFFECT_SS_EN_ICE, 80, &initParams); @@ -897,7 +897,7 @@ void EffectSsEnFire_SpawnVec3f(PlayState* play, Actor* actor, Vec3f* pos, s16 sc initParams.bodyPart = bodyPart; if (actor != NULL) { - Actor_PlaySfxAtPos(actor, NA_SE_EV_FLAME_IGNITION); + Actor_PlaySfx(actor, NA_SE_EV_FLAME_IGNITION); } EffectSs_Spawn(play, EFFECT_SS_EN_FIRE, 128, &initParams); @@ -917,7 +917,7 @@ void EffectSsEnFire_SpawnVec3s(PlayState* play, Actor* actor, Vec3s* pos, s16 sc initParams.bodyPart = bodyPart; if (actor != NULL) { - Actor_PlaySfxAtPos(actor, NA_SE_EV_FLAME_IGNITION); + Actor_PlaySfx(actor, NA_SE_EV_FLAME_IGNITION); } EffectSs_Spawn(play, EFFECT_SS_EN_FIRE, 128, &initParams); diff --git a/src/code/z_en_hy_code.c b/src/code/z_en_hy_code.c index 66645753e5..85a5e7e84f 100644 --- a/src/code/z_en_hy_code.c +++ b/src/code/z_en_hy_code.c @@ -267,12 +267,12 @@ s32 EnHy_PlayWalkingSound(EnHy* enHy, PlayState* play, f32 distAboveThreshold) { enHy->isLeftFootOnGround = isFootOnGround = SubS_IsFloorAbove(play, &enHy->leftFootPos, distAboveThreshold); if (enHy->isLeftFootOnGround && !wasLeftFootOnGround && isFootOnGround) { - Actor_PlaySfxAtPos(&enHy->actor, sfxId); + Actor_PlaySfx(&enHy->actor, sfxId); } enHy->isRightFootOnGround = isFootOnGround = SubS_IsFloorAbove(play, &enHy->rightFootPos, distAboveThreshold); if (enHy->isRightFootOnGround && !wasRightFootOnGround && isFootOnGround) { - Actor_PlaySfxAtPos(&enHy->actor, sfxId); + Actor_PlaySfx(&enHy->actor, sfxId); } return false; 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 41a3f25eca..971b778be5 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -186,7 +186,7 @@ void FireArrow_Fly(ArrowFire* this, PlayState* play) { FireArrow_Lerp(&this->firedPos, &this->actor.world.pos, 0.05f); if (arrow->unk_261 & 1) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_EXPLOSION_FRAME); + Actor_PlaySfx(&this->actor, NA_SE_IT_EXPLOSION_FRAME); ArrowFire_SetupAction(this, FireArrow_Hit); this->timer = 32; this->alpha = 255; 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 5c5cd0c872..62c97ccde0 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -160,7 +160,7 @@ void ArrowIce_Fly(ArrowIce* this, PlayState* play) { ArrowIce_LerpFiredPosition(&this->firedPos, &this->actor.world.pos, 0.05f); if (arrow->unk_261 & 1) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_EXPLOSION_ICE); + Actor_PlaySfx(&this->actor, NA_SE_IT_EXPLOSION_ICE); ArrowIce_SetupAction(this, ArrowIce_Hit); this->timer = 32; this->alpha = 255; 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 b7918b5b46..360afa4ac9 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -154,7 +154,7 @@ void ArrowLight_Fly(ArrowLight* this, PlayState* play) { ArrowLight_Lerp(&this->firedPos, &this->actor.world.pos, 0.05f); if (arrow->unk_261 & 1) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_EXPLOSION_LIGHT); + Actor_PlaySfx(&this->actor, NA_SE_IT_EXPLOSION_LIGHT); ArrowLight_SetupAction(this, ArrowLight_Hit); this->timer = 32; this->alpha = 255; 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 dcf37d848e..647fabf73f 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 @@ -184,7 +184,7 @@ void func_80C0A458(BgAstrBombwall* this, PlayState* play) { func_800C62BC(play, &play->colCtx.dyna, this->dyna.bgId); this->dyna.actor.draw = NULL; func_80C0A120(this, play); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); this->actionFunc = func_80C0A4BC; } 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 0320912931..ef2ca52738 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 @@ -343,7 +343,7 @@ void BgCraceMovebg_ClosingDoor_SetupDoNothing(BgCraceMovebg* this, PlayState* pl this->targetDoorHeight = 0.0f; this->doorHeight = 0.0f; this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); this->actionFunc = BgCraceMovebg_ClosingDoor_DoNothing; } 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 68b2d77d2e..533ce6292b 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 @@ -108,7 +108,7 @@ void BgCtowerGear_Splash(BgCtowerGear* this, PlayState* play) { } } } - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WATERWHEEL_LEVEL); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WATERWHEEL_LEVEL); } } 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 85dcb0aca7..5cc9d4b8df 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 @@ -99,7 +99,7 @@ void BgCtowerRot_DoorDoNothing(BgCtowerRot* this, PlayState* play) { void BgCtowerRot_DoorClose(BgCtowerRot* this, PlayState* play) { if (!Math_SmoothStepToF(&this->timer, 0.0f, 0.1f, 15.0f, 0.1f)) { if (this->dyna.actor.params == BGCTOWERROT_STONE_DOOR_MAIN) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); ActorCutscene_Stop(this->dyna.actor.cutscene); } this->actionFunc = BgCtowerRot_DoorDoNothing; 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 c962cf8efd..064b14f7bd 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 @@ -485,7 +485,7 @@ void func_80B82DE0(BgDblueBalance* this, PlayState* play) { this->unk_178 *= -0.6f; this->unk_17C++; if (this->unk_182) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SEESAW_WATER_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SEESAW_WATER_BOUND); sp5C = this->unk_15C; Matrix_Push(); Matrix_RotateYS(BINANG_SUB(this->dyna.actor.shape.rot.y, 0x4000), MTXMODE_NEW); @@ -498,7 +498,7 @@ void func_80B82DE0(BgDblueBalance* this, PlayState* play) { func_80B8296C(play, &sp50, 70.0f); } else { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SEESAW_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SEESAW_BOUND); } } else { this->dyna.actor.shape.rot.z = 0x1C72; @@ -510,7 +510,7 @@ void func_80B82DE0(BgDblueBalance* this, PlayState* play) { this->unk_178 *= -0.6f; this->unk_17C++; if (this->unk_182) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SEESAW_WATER_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SEESAW_WATER_BOUND); sp3C = this->unk_160; Matrix_Push(); Matrix_RotateYS(BINANG_ADD(this->dyna.actor.shape.rot.y, 0x4000), MTXMODE_NEW); @@ -523,7 +523,7 @@ void func_80B82DE0(BgDblueBalance* this, PlayState* play) { func_80B8296C(play, &sp30, 47.0f); } else { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SEESAW_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SEESAW_BOUND); } } else { this->dyna.actor.shape.rot.z = -0x1C72; 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 45b42942b0..b597f695a3 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 @@ -422,7 +422,7 @@ void func_80A2A444(BgDblueMovebg* this, PlayState* play) { 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); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); if (func_80A29A80(play, this->unk_1C8, this->unk_1C4)) { this->unk_172 |= 1; @@ -524,7 +524,7 @@ void func_80A2A7F8(BgDblueMovebg* this, PlayState* play) { this->unk_18A = 0; this->unk_17E = 0; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); if (func_80A29A80(play, this->unk_1C8, this->unk_1C4)) { this->unk_172 |= 1; 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 b4c97fddef..3ba003ee5f 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 @@ -223,7 +223,7 @@ void func_80B841A0(BgDblueWaterfall* this, PlayState* play) { EffectSsGSplash_Spawn(play, &sp94, NULL, NULL, 0, 250); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_REFLECTION_WATER); + Actor_PlaySfx(&this->actor, NA_SE_IT_REFLECTION_WATER); } } 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 6ec845e2c2..1244695578 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 @@ -164,7 +164,7 @@ void BgDkjailIvy_BeginCutscene(BgDkjailIvy* this, PlayState* play) { 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); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_GRASS_WALL_BROKEN); BgDkjailIvy_SetupFadeOut(this); } else { ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); 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 71aa958dc7..b110ba68f1 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 @@ -278,14 +278,14 @@ void func_80BC4228(BgF40Block* this, PlayState* play) { } else { this->actionFunc = func_80BC4530; ActorCutscene_Stop(this->dyna.actor.cutscene); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_C); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_C); } } if (func_80BC3D08(this, play, 0)) { ActorCutscene_Stop(this->dyna.actor.cutscene); this->actionFunc = func_80BC41AC; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_F); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_F); return; } @@ -338,14 +338,14 @@ void func_80BC4448(BgF40Block* this, PlayState* play) { } else { this->actionFunc = func_80BC4380; ActorCutscene_Stop(this->dyna.actor.cutscene); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_C); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_C); } } if (func_80BC3D08(this, play, 0)) { ActorCutscene_Stop(this->dyna.actor.cutscene); this->actionFunc = func_80BC43CC; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_F); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_F); } } 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 3a7916e7d3..558c77064a 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 @@ -129,7 +129,7 @@ void BgF40Switch_Destroy(Actor* thisx, PlayState* play) { void BgF40Switch_Unpress(BgF40Switch* this, PlayState* play) { this->dyna.actor.scale.y += 0.0495f; if (this->dyna.actor.scale.y >= 0.165f) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_SWITCH); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_SWITCH); this->actionFunc = BgF40Switch_IdleUnpressed; this->dyna.actor.scale.y = 0.165f; } @@ -144,7 +144,7 @@ void BgF40Switch_IdlePressed(BgF40Switch* this, PlayState* play) { void BgF40Switch_Press(BgF40Switch* this, PlayState* play) { this->dyna.actor.scale.y -= 0.0495f; if (this->dyna.actor.scale.y <= 0.0165f) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_SWITCH); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_SWITCH); Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10); if (this->isInitiator) { ActorCutscene_Stop(this->dyna.actor.cutscene); 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 0b8d2490b5..42a7c4e055 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 @@ -68,7 +68,7 @@ void func_80ABD92C(BgHakuginElvpole* this, PlayState* play) { sp28 = true; } else if (this->unk_15E > 0) { if (this->unk_15E == 100) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); } this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 120.0f; //! FAKE: @@ -83,7 +83,7 @@ void func_80ABD92C(BgHakuginElvpole* this, PlayState* play) { this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 320.0f; Flags_UnsetSwitch(play, BGHAKUGINELVPOLE_GET_SWITCHFLAG(&this->dyna.actor)); this->unk_15E = -1; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); } } else if ((BGHAKUGINELVPOLE_GET_SWITCHFLAG(&this->dyna.actor) != 0x7F) && Flags_GetSwitch(play, BGHAKUGINELVPOLE_GET_SWITCHFLAG(&this->dyna.actor))) { 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 7f77b66453..d4d7e1724b 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 @@ -839,7 +839,7 @@ void func_80A9CE1C(BgHakuginPost* this, PlayState* play) { temp = (s16)(this->dyna.actor.yawTowardsPlayer + 0x58F0); D_80A9E028.unk_0000[i].unk_28 = ((s16)(player->actor.shape.rot.y - temp) / 3) + temp; D_80A9E028.unk_0000[i].unk_34 = 2; - func_800B8E58(player, NA_SE_IT_HAMMER_HIT); + Player_PlaySfx(player, NA_SE_IT_HAMMER_HIT); func_8019F128(NA_SE_EV_SLIDE_DOOR_OPEN); Flags_SetSwitch(play, D_80A9E028.unk_0000[i].unk_2E); this->unk_178 = 20; 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 aa22dd8af8..3f7379d34d 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 @@ -102,7 +102,7 @@ static InitChainEntry sInitChain2[] = { void func_80B15790(BgHakuginSwitch* this, u16 sfxId) { if (this->unk_1B2 <= 0) { - Actor_PlaySfxAtPos(&this->dyna.actor, sfxId); + Actor_PlaySfx(&this->dyna.actor, sfxId); } } 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 265490e52b..27e5d2fee9 100644 --- a/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c +++ b/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c @@ -86,7 +86,7 @@ void func_80AC4A80(BgIcefloe* this, PlayState* play) { this->timer = 20; SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->dyna.actor.world.pos, &this->dyna.actor.projectedPos, &this->dyna.actor.projectedW); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_ICE_STAND_APPEAR); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_ICE_STAND_APPEAR); this->actionFunc = BgIcefloe_Grow; } @@ -133,7 +133,7 @@ void func_80AC4C34(BgIcefloe* this, PlayState* play) { void func_80AC4CF0(BgIcefloe* this) { this->timer = 50; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_ICE_MELT_LEVEL); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_ICE_MELT_LEVEL); this->actionFunc = func_80AC4D2C; } 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 7432136529..0e8c0f493d 100644 --- a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c +++ b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c @@ -142,7 +142,7 @@ void BgIcicle_Shiver(BgIcicle* this, PlayState* play) { } if (!(this->shiverTimer % 4)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_ICE_SWING); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_ICE_SWING); } if (this->shiverTimer == 0) { 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 9d249314a5..b6206ecb76 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 @@ -294,7 +294,7 @@ void func_80B7F290(BgIkanaBlock* this, PlayState* play) { Player* player = GET_PLAYER(play); if (!func_80B7EB94(this, play)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } player->stateFlags2 &= ~PLAYER_STATE2_10; @@ -334,10 +334,10 @@ void func_80B7F398(BgIkanaBlock* this, PlayState* play) { this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y; if (func_80B7EE70(this, play)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); - Actor_PlaySfxAtPos(&this->dyna.actor, - SurfaceType_GetSfx(&play->colCtx, this->dyna.actor.floorPoly, this->dyna.actor.floorBgId) + - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfx(&this->dyna.actor, + SurfaceType_GetSfx(&play->colCtx, this->dyna.actor.floorPoly, this->dyna.actor.floorBgId) + + SFX_FLAG); func_80B7F0A4(this); } } 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 678080ae16..3c31f8846c 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 @@ -158,7 +158,7 @@ void BgIkanaDharma_WaitForHit(BgIkanaDharma* this, PlayState* play) { tempAngle2 = (BINANG_SUB(player->actor.shape.rot.y, tempAngle1) >> 1); this->dyna.actor.world.rot.y = tempAngle1 + tempAngle2 + 0xF000; this->dyna.actor.speedXZ = 20.0f; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_DARUMA_VANISH); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_DARUMA_VANISH); BgIkanaDharma_SetupStartCutscene(this); } else if ((this->dyna.actor.flags & ACTOR_FLAG_40) == ACTOR_FLAG_40 && sFirstHitBgIkanaDharma == NULL && this->dyna.actor.xzDistToPlayer < 420.0f) { @@ -234,7 +234,7 @@ void BgIkanaDharma_Update(Actor* thisx, PlayState* play) { Quake_SetQuakeValues(quakeIndex, 4, 0, 0, 0); Quake_SetCountdown(quakeIndex, 12); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } } else { if (actorBelow->actor.id == ACTOR_BG_IKANA_DHARMA) { 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 4561d4049a..3a0107e11c 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 @@ -648,9 +648,9 @@ void func_80B814B8(BgIkanaRotaryroom* this, PlayState* play) { if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) { if (player->actor.bgCheckFlags & 0x100) { - func_800B8E58(player, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->voiceSfxIdOffset); + Player_PlaySfx(player, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->voiceSfxIdOffset); func_80169EFC(&play->state); - func_800B8E58(player, NA_SE_VO_LI_TAKEN_AWAY + player->ageProperties->voiceSfxIdOffset); + Player_PlaySfx(player, NA_SE_VO_LI_TAKEN_AWAY + player->ageProperties->voiceSfxIdOffset); play->haltAllActors = true; play_sound(NA_SE_OC_ABYSS); this->actionFunc = NULL; 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 f9a9fcc379..a9070cb8b3 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 @@ -156,7 +156,7 @@ void func_80C0ABA8(BgIkninSusceil* this, PlayState* play) { if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) { func_80C0A86C(this, play, 4, 14, 1); Flags_UnsetSwitch(play, SUSCEIL_GET_SWITCHFLAG(&this->dyna.actor)); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BIGWALL_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BIGWALL_BOUND); func_80C0AC74(this); } else { func_800B9010(&this->dyna.actor, NA_SE_EV_ICE_PILLAR_FALL - SFX_FLAG); @@ -230,7 +230,7 @@ void BgIkninSusceil_Update(Actor* thisx, PlayState* play) { (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); + Player_PlaySfx(player, NA_SE_PL_BODY_HIT); func_80C0AE3C(this); } } 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 ba65baca42..2651c52bc9 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 @@ -149,7 +149,7 @@ s32 func_80BD7E0C(BgIknvObj* this, s16 targetRotation, PlayState* play) { func_800B9010(&this->dyna.actor, NA_SE_EV_STONEDOOR_OPEN_S - SFX_FLAG); return false; } - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); return true; } 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 4bfa17c1c3..55940f3fa7 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -207,7 +207,7 @@ void func_80953F9C(BgIngate* this, PlayState* play) { this->actionFunc = func_809542A0; } } else if ((ActorCutscene_GetCurrentIndex() == -1) && (this->timePath != NULL)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_CRUISER - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_CRUISER - SFX_FLAG); func_80953BEC(this); } } 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 12bfc0f3c2..282a43925a 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 @@ -61,10 +61,10 @@ void func_80A5389C(BgKeikokuSaku* this, PlayState* play) { } void func_80A538E0(BgKeikokuSaku* this, PlayState* play) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); this->dyna.actor.world.pos.z -= 2.0f + BREG(8); if (this->dyna.actor.world.pos.z < (BREG(9) + 2660.0f)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP); this->timer = 30; this->actionFunc = func_80A53994; } 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 5892376ba1..5a23089a21 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 @@ -207,7 +207,7 @@ void BgKin2Picture_Wait(BgKin2Picture* this, PlayState* play) { } else { // Gold Skulltula can be heard behind Skullkid's painting. if (this->skulltulaNoiseTimer >= 0) { if (this->skulltulaNoiseTimer == 0) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_STALGOLD_ROLL); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EN_STALGOLD_ROLL); if (Rand_ZeroOne() < 0.1f) { this->skulltulaNoiseTimer = Rand_S16Offset(40, 80); @@ -297,7 +297,7 @@ void BgKin2Picture_Fall(BgKin2Picture* this, PlayState* play) { } if (this->landTimer < 3) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SMALL_WOODPLATE_BOUND_0); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SMALL_WOODPLATE_BOUND_0); } } } @@ -318,7 +318,7 @@ void BgKin2Picture_Fall(BgKin2Picture* this, PlayState* play) { } func_800C6314(play, &play->colCtx.dyna, this->dyna.bgId); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WOODPLATE_BROKEN); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WOODPLATE_BROKEN); BgKin2Picture_SetupDoNothing(this); } else { this->dyna.actor.shape.yOffset = Math_SinS(this->dyna.actor.shape.rot.x) * 40.0f; 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 f766fef784..1443516149 100644 --- a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c +++ b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c @@ -100,7 +100,7 @@ void BgLadder_StartCutscene(BgLadder* this, PlayState* play) { if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); this->dyna.actor.draw = BgLadder_Draw; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SECRET_LADDER_APPEAR); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SECRET_LADDER_APPEAR); this->action = BgLadder_FadeIn; } else { ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); 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 d704adf861..521e14d631 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 @@ -248,7 +248,7 @@ void func_80C188C4(BgLastBwall* this, PlayState* play) { func_800C62BC(play, &play->colCtx.dyna, this->dyna.bgId); this->dyna.actor.draw = NULL; func_80C184EC(this, play); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); this->actionFunc = BgLastBwall_DoNothing; } 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 497ed10abc..0c12374a1b 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 @@ -216,7 +216,7 @@ void BgNumaHana_SetupClosedIdle(BgNumaHana* this) { */ void BgNumaHana_ClosedIdle(BgNumaHana* this, PlayState* play) { if (this->fire.state != 3) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_FLAME_IGNITION); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_FLAME_IGNITION); if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); SET_WEEKEVENTREG(WEEKEVENTREG_12_01); @@ -247,7 +247,7 @@ void BgNumaHana_UnfoldInnerPetals(BgNumaHana* this, PlayState* play) { this->settleZRotation = 0; this->settleAngle = 0; this->settleScale = 420.0f; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_FLOWERPETAL_STOP); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_FLOWERPETAL_STOP); } this->transitionTimer++; } @@ -279,7 +279,7 @@ void BgNumaHana_UnfoldOuterPetals(BgNumaHana* this, PlayState* play) { this->settleZRotation = 0; this->settleAngle = 0x5120; this->settleScale = 130.0f; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_FLOWERPETAL_STOP); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_FLOWERPETAL_STOP); } this->transitionTimer++; } 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 c264b9775d..3f7e45f673 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 @@ -111,7 +111,7 @@ void func_80ACAD88(BgOpenShutter* this, PlayState* play) { if (this->unk_15C != 0) { Player* player = GET_PLAYER(play); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN); Camera_ChangeDoorCam(play->cameraPtrs[CAM_ID_MAIN], &this->dyna.actor, player->unk_3BA, 0.0f, 12, 15, 10); this->unk_164 = 0; this->actionFunc = func_80ACAE5C; @@ -136,7 +136,7 @@ void func_80ACAE5C(BgOpenShutter* this, PlayState* play) { this->unk_164++; } if (this->unk_164 >= 10) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE); this->actionFunc = func_80ACAEF0; } } @@ -149,7 +149,7 @@ void func_80ACAEF0(BgOpenShutter* this, PlayState* play) { if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) { this->dyna.actor.floorHeight = this->dyna.actor.home.pos.y; Actor_SpawnFloorDustRing(play, &this->dyna.actor, &this->dyna.actor.world.pos, 60.0f, 10, 8.0f, 500, 10, true); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BIGWALL_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BIGWALL_BOUND); quakeIndex = Quake_Add(Play_GetCamera(play, CAM_ID_MAIN), QUAKE_TYPE_3); Quake_SetSpeed(quakeIndex, -32536); @@ -172,14 +172,14 @@ void BgOpenShutter_Update(Actor* thisx, PlayState* play2) { index = Cutscene_GetActorActionIndex(play, 0x7C); if (play->csCtx.actorActions[index]->action == BGOPENSHUTTER_DOOR_OPEN) { if (this->actionFunc == func_80ACAD88) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN); this->actionFunc = func_80ACAE5C; this->dyna.actor.velocity.y = 0.0f; } this->unk_164 = 0; } else if (play->csCtx.actorActions[index]->action == BGOPENSHUTTER_DOOR_CLOSED) { if (this->actionFunc == func_80ACAE5C) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE); this->actionFunc = func_80ACAEF0; } } 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 fb8d464c8b..5a886d5b30 100644 --- a/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c +++ b/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c @@ -336,7 +336,7 @@ void func_809CE4C8(BgSpdweb* this, PlayState* play) { } } else if (this->unk_162 == 11) { if (this->unk_164 > 3.0f) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WEB_VIBRATION); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WEB_VIBRATION); } else { AudioSfx_StopById(NA_SE_EV_WEB_VIBRATION); } 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 d6617ef1c0..46fe15007b 100644 --- a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c +++ b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c @@ -62,7 +62,7 @@ void BgTobira01_Open(BgTobira01* this, PlayState* play) { if (this->timer != prevTimer) { if (1) {} - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_OPEN_S - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_OPEN_S - SFX_FLAG); this->dyna.actor.world.pos.y = (this->yOffset = (this->timer * (5.0f / 3.0f)) + this->dyna.actor.home.pos.y); this->timer2 = 180; } 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 805d79170f..7269a61e7e 100644 --- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c +++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c @@ -732,7 +732,7 @@ void func_809DAB78(Boss02* this, PlayState* play) { this->unk_0170 = this->unk_017C; this->unk_0170.y = temp_f0; this->unk_016C = 120; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_INBOSS_ROAR_OLD); + Actor_PlaySfx(&this->actor, NA_SE_EN_INBOSS_ROAR_OLD); } this->actor.flags &= ~ACTOR_FLAG_1; @@ -941,7 +941,7 @@ void func_809DAB78(Boss02* this, PlayState* play) { sTwinmoldStatic->subCamAtVel = 0.0f; play_sound(NA_SE_EN_INBOSS_DEAD_PRE2_OLD); } else if (!(this->unk_0146[1] & 0xF) && (Rand_ZeroOne() < 0.5f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_INBOSS_DAMAGE_OLD); + Actor_PlaySfx(&this->actor, NA_SE_EN_INBOSS_DAMAGE_OLD); } return; @@ -982,7 +982,7 @@ void func_809DAB78(Boss02* this, PlayState* play) { Audio_QueueSeqCmd(NA_BGM_CLEAR_BOSS | 0x8000); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_INBOSS_DEAD_OLD); + Actor_PlaySfx(&this->actor, NA_SE_EN_INBOSS_DEAD_OLD); } } return; @@ -1075,7 +1075,7 @@ void func_809DBFB4(Boss02* this, PlayState* play) { this->unk_0156 = 15; if (i == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_INBOSS_DAMAGE_OLD); + Actor_PlaySfx(&this->actor, NA_SE_EN_INBOSS_DAMAGE_OLD); this->unk_015C = 1; } else { Audio_PlaySfxAtPos(&this->unk_167C, NA_SE_EN_INBOSS_DAMAGE_OLD); @@ -1201,9 +1201,9 @@ void Boss02_Twinmold_Update(Actor* thisx, PlayState* play) { if (this->unk_016C != 0) { if ((this->unk_016C == 60) && (this->unk_0144 < 20)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_INBOSS_ROAR_OLD); + Actor_PlaySfx(&this->actor, NA_SE_EN_INBOSS_ROAR_OLD); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_INBOSS_SAND_OLD - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_INBOSS_SAND_OLD - SFX_FLAG); if (this->unk_0144 > 20) { sp3C.x = randPlusMinusPoint5Scaled(100.0f * D_809DF5B0) + this->unk_0170.x; 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 f51c944582..c5d729729e 100644 --- a/src/overlays/actors/ovl_Boss_03/z_boss_03.c +++ b/src/overlays/actors/ovl_Boss_03/z_boss_03.c @@ -1190,7 +1190,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) { this->subCamFov = 80.0f; case 2: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KONB_DEMO_MOVE_OLD - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_KONB_DEMO_MOVE_OLD - SFX_FLAG); xDiff = D_809E9104[this->unk_242].x - this->actor.world.pos.x; yDiff = D_809E9104[this->unk_242].y - this->actor.world.pos.y; @@ -1206,7 +1206,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) { } if ((this->csTimer == 40) || (this->csTimer == (u32)(KREG(91) + 270))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_WATER_DEEP); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_WATER_DEEP); } if (this->csTimer > 50) { @@ -1230,10 +1230,10 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) { this->csTimer = 0; } if (this->csTimer == 165) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_WATER_MID); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_WATER_MID); } if (this->csTimer == 180) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_WATER_DEEP); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_WATER_DEEP); } } } @@ -1304,14 +1304,14 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) { this->actor.speedXZ = 20.0f; Audio_QueueSeqCmd(NA_BGM_BOSS | 0x8000); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KONB_JUMP_OLD); + Actor_PlaySfx(&this->actor, NA_SE_EN_KONB_JUMP_OLD); this->skelAnime.playSpeed = 1.0f; } } break; case 6: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KONB_JUMP_LEV_OLD - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_KONB_JUMP_LEV_OLD - SFX_FLAG); if (this->csTimer == 30) { TitleCard_InitBossName(&play->state, &play->actorCtx.titleCtxt, @@ -1514,10 +1514,10 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) { Math_ApproachF(&this->actor.world.pos.z, sp84.z, 0.1f, 5.0f); if (Animation_OnFrame(&this->skelAnime, this->floppingAnimLastFrame)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KONB_DEAD_JUMP2_OLD); + Actor_PlaySfx(&this->actor, NA_SE_EN_KONB_DEAD_JUMP2_OLD); } if (Animation_OnFrame(&this->skelAnime, this->floppingAnimLastFrame * 0.5f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KONB_DEAD_JUMP_OLD); + Actor_PlaySfx(&this->actor, NA_SE_EN_KONB_DEAD_JUMP_OLD); } if ((this->workTimer[WORK_TIMER_UNK0_C] == 0) && ((this->waterHeight - 100.0f) < this->actor.world.pos.y)) { @@ -1547,7 +1547,7 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) { this->actor.speedXZ = 10.0f; this->actor.world.rot.y = this->unk_2BE + 0x8000; this->unk_240 = 0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KONB_DEAD_JUMP2_OLD); + Actor_PlaySfx(&this->actor, NA_SE_EN_KONB_DEAD_JUMP2_OLD); } } Math_ApproachF(&this->unk_56C, 0.01f, 1.0f, 0.0005f); @@ -1704,7 +1704,7 @@ void Boss03_SpawnSmallFishesCutscene(Boss03* this, PlayState* play) { this->numSpawnedSmallFish++; } if ((this->csTimer % 8) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KONB_MINI_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_KONB_MINI_APPEAR); } } } @@ -2003,7 +2003,7 @@ void Boss03_Update(Actor* thisx, PlayState* play2) { ((this->waterHeight - 50.0f < this->actor.world.pos.y) && (this->actor.prevPos.y <= this->waterHeight - 50.0f))) { if ((this->actor.velocity.y < 0.0f) && (this->actionFunc != Boss03_DeathCutscene)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KONB_SINK_OLD); + Actor_PlaySfx(&this->actor, NA_SE_EN_KONB_SINK_OLD); } Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WATER_EFFECT, this->actor.world.pos.x, this->waterHeight, 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 00892063c3..832466fa7c 100644 --- a/src/overlays/actors/ovl_Boss_04/z_boss_04.c +++ b/src/overlays/actors/ovl_Boss_04/z_boss_04.c @@ -289,7 +289,7 @@ void func_809EC568(Boss04* this, PlayState* play) { case 10: if (this->unk_704 == 3) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_DEMO_EYE); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_DEMO_EYE); this->unk_74A = 1; } this->unk_2D0 = 10000.0f; @@ -319,7 +319,7 @@ void func_809EC568(Boss04* this, PlayState* play) { } case 12: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ME_ATTACK - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_ME_ATTACK - SFX_FLAG); Math_ApproachF(&this->subCamAt.x, this->actor.world.pos.x, 0.5f, 1000.0f); Math_ApproachF(&this->subCamAt.y, this->actor.world.pos.y, 0.5f, 1000.0f); Math_ApproachF(&this->subCamAt.z, this->actor.world.pos.z, 0.5f, 1000.0f); @@ -331,7 +331,7 @@ void func_809EC568(Boss04* this, PlayState* play) { this->unk_2DA = 10; 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_SPLASH); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KONB_JUMP_LEV_OLD - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_KONB_JUMP_LEV_OLD - SFX_FLAG); this->subCamAtOscillator = 20; } break; @@ -501,7 +501,7 @@ void func_809ECF58(Boss04* this, PlayState* play) { sp3C.y = this->actor.floorHeight + 2.0f; sp3C.z = this->actor.world.pos.z; EffectSsGRipple_Spawn(play, &sp3C, 1400, 500, 0); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ME_ATTACK - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_ME_ATTACK - SFX_FLAG); } } @@ -520,7 +520,7 @@ void func_809ED224(Boss04* this) { this->actor.speedXZ = 0.0f; this->unk_2D0 = 10000.0f; this->unk_2C8 = 200; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ME_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_ME_DEAD); this->actor.flags &= ~ACTOR_FLAG_1; Audio_RestorePrevBgm(); this->unk_1F6 = 10; @@ -569,7 +569,7 @@ void func_809ED45C(Boss04* this, PlayState* play) { if ((this->unk_1FE == 0) && (this->collider1.elements[0].info.bumperFlags & BUMP_HIT)) { this->collider1.elements[0].info.bumperFlags &= ~BUMP_HIT; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ME_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_ME_DAMAGE); damage = this->actor.colChkInfo.damage; this->actor.colChkInfo.health = this->actor.colChkInfo.health - damage; if ((s8)this->actor.colChkInfo.health <= 0) { @@ -765,7 +765,7 @@ void Boss04_Update(Actor* thisx, PlayState* play2) { } if (this->unk_74A != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ME_EXIST - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_ME_EXIST - SFX_FLAG); } } 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 60f9e898bb..a91877288f 100644 --- a/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c +++ b/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c @@ -226,7 +226,7 @@ void func_80C16A74(DemoSyoten* this, PlayState* play) { if ((play->csCtx.frames >= 160) && (play->csCtx.frames < 322)) { func_800B9010(&this->actor, NA_SE_EV_IKANA_SOUL_LV - SFX_FLAG); } else if (play->csCtx.frames == 322) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_IKANA_SOUL_TRANSFORM); + Actor_PlaySfx(&this->actor, NA_SE_EV_IKANA_SOUL_TRANSFORM); } temp_a0 = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_3F0)]->action; @@ -344,7 +344,7 @@ void func_80C16DD4(DemoSyoten* this, PlayState* play) { case 2: this->actor.draw = DemoSyoten_Draw; this->unk_3E6 = -6; - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH); + Actor_PlaySfx(&this->actor, NA_SE_IT_DM_FLYING_GOD_DASH); break; } } 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 43cc626037..997004fea7 100644 --- a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c +++ b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c @@ -157,15 +157,15 @@ void func_80AA561C(DmChar00* this, PlayState* play) { case 1222: case 1682: case 2194: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); break; case 1858: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_ATTACK); break; case 2043: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_SURPRISE); + Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_SURPRISE); break; } } else { @@ -177,11 +177,11 @@ void func_80AA561C(DmChar00* this, PlayState* play) { case 1687: case 2194: case 2210: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); break; case 2043: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MONDO_SURPRISE); + Actor_PlaySfx(&this->actor, NA_SE_EV_MONDO_SURPRISE); break; } } @@ -189,7 +189,7 @@ void func_80AA561C(DmChar00* this, PlayState* play) { void func_80AA5720(DmChar00* this, PlayState* play) { if ((DMCHAR00_GET(&this->actor) == DMCHAR00_0) && (play->csCtx.frames == 505)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SPOT_LIGHT_OPEN); + Actor_PlaySfx(&this->actor, NA_SE_EV_SPOT_LIGHT_OPEN); } } @@ -207,51 +207,51 @@ void func_80AA575C(DmChar00* this, PlayState* play) { case 877: case 882: case 887: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_ATTACK); break; case 520: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_SPIT); + Actor_PlaySfx(&this->actor, NA_SE_EV_BELL_SPIT); break; case 774: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_SURPRISE); + Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_SURPRISE); break; case 904: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_SIGH); + Actor_PlaySfx(&this->actor, NA_SE_EV_BELL_SIGH); break; case 813: case 972: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_BRAKE); + Actor_PlaySfx(&this->actor, NA_SE_EV_BELL_BRAKE); break; } } else if (play->csCtx.frames == 660) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MONDO_SURPRISE); + Actor_PlaySfx(&this->actor, NA_SE_EV_MONDO_SURPRISE); } } void func_80AA5890(DmChar00* this, PlayState* play) { if ((DMCHAR00_GET(&this->actor) == DMCHAR00_0) && (play->csCtx.frames == 20)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); } } void func_80AA58CC(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { if (play->csCtx.frames == 568) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_SURPRISE); + Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_SURPRISE); } } else { switch (play->csCtx.frames) { case 375: case 479: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); break; case 534: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_ATTACK); break; } } @@ -263,17 +263,17 @@ void func_80AA5950(DmChar00* this, PlayState* play) { void func_80AA5960(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { if (play->csCtx.frames == 280) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_SURPRISE); + Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_SURPRISE); } } else { switch (play->csCtx.frames) { case 87: case 190: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); break; case 244: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_ATTACK); break; } } @@ -283,16 +283,16 @@ void func_80AA59E4(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { switch (play->csCtx.frames) { case 125: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); break; case 1832: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_WHITE_OUT_INTO_MOON); + Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_SY_WHITE_OUT_INTO_MOON); break; } } else if (play->csCtx.frames == 125) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); } } @@ -300,16 +300,16 @@ void func_80AA5A6C(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { switch (play->csCtx.frames) { case 44: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); break; case 891: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_WHITE_OUT_INTO_MOON); + Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_SY_WHITE_OUT_INTO_MOON); break; } } else if (play->csCtx.frames == 44) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); } } @@ -318,31 +318,31 @@ void func_80AA5AF4(DmChar00* this, PlayState* play) { switch (play->csCtx.frames) { case 352: case 401: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); break; case 440: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); break; case 550: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_BRAKE); + Actor_PlaySfx(&this->actor, NA_SE_EV_BELL_BRAKE); break; } } else { switch (play->csCtx.frames) { case 362: case 401: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); break; case 454: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); break; } if ((play->csCtx.frames >= 500) && (play->csCtx.frames < 602)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_SHIVER - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_SHIVER - SFX_FLAG); } } } @@ -351,32 +351,32 @@ void func_80AA5BF8(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { switch (play->csCtx.frames) { case 762: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_SHOT_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_SHOT_DASH); break; case 797: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); break; } } else { switch (play->csCtx.frames) { case 762: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_SHOT_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_SHOT_DASH); break; case 797: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); break; } } if ((this->unk_261 == 53) && Animation_OnFrame(&this->skelAnime, 16.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); } } void func_80AA5CD4(DmChar00* this, PlayState* play) { if ((DMCHAR00_GET(&this->actor) != DMCHAR00_0) && (play->csCtx.frames == 467)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); } } @@ -384,11 +384,11 @@ void func_80AA5D10(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { switch (play->csCtx.frames) { case 8: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_SURPRISE); + Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_SURPRISE); break; case 130: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_NAVY_VANISH); + Actor_PlaySfx(&this->actor, NA_SE_EV_NAVY_VANISH); break; } } @@ -399,11 +399,11 @@ void func_80AA5D6C(DmChar00* this, PlayState* play) { switch (play->csCtx.frames) { case 2: case 166: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); break; case 31: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_SURPRISE); + Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_SURPRISE); break; } } @@ -415,11 +415,11 @@ void func_80AA5DC8(DmChar00* this, PlayState* play) { case 233: case 415: case 593: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); break; case 130: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_NAVY_VANISH); + Actor_PlaySfx(&this->actor, NA_SE_EV_NAVY_VANISH); break; } } @@ -429,19 +429,19 @@ void func_80AA5E2C(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_1) { switch (play->csCtx.frames) { case 32: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); break; case 42: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); break; case 192: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_BRAKE); + Actor_PlaySfx(&this->actor, NA_SE_EV_BELL_BRAKE); break; case 215: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DIVE_INTO_WEED); + Actor_PlaySfx(&this->actor, NA_SE_EV_DIVE_INTO_WEED); break; } } 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 7e13a8e7ff..dab5b3c08a 100644 --- a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c +++ b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c @@ -201,7 +201,7 @@ void func_80AA88A8(DmChar01* this, PlayState* play) { if (Cutscene_CheckActorAction(play, 135)) { if (play->csCtx.frames == play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 135)]->startFrame) { D_80AAAE24 = 1; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_FORT_RISING); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_FORT_RISING); } } else { D_80AAAE24 = 0; @@ -277,7 +277,7 @@ void func_80AA8C28(DmChar01* this, PlayState* play) { switch (this->unk_346) { case 0: - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WATER_PURIFICATION); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WATER_PURIFICATION); D_80AAAE22 = -2200; D_80AAAE20 = 100; this->unk_346++; 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 b618281c2d..3fc6e7edfb 100644 --- a/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c +++ b/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c @@ -63,13 +63,13 @@ void DmChar02_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animationInfo, u16 void DmChar02_PlaySfxForDroppingOcarinaCutscene(DmChar02* this, PlayState* play) { switch (play->csCtx.frames) { case 95: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OCARINA_BOUND_0); + Actor_PlaySfx(&this->actor, NA_SE_EV_OCARINA_BOUND_0); break; case 101: case 105: case 112: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OCARINA_BOUND_1); + Actor_PlaySfx(&this->actor, NA_SE_EV_OCARINA_BOUND_1); break; } } 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 714913231b..b960ce6981 100644 --- a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c +++ b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c @@ -130,10 +130,10 @@ void func_80AAB710(DmChar03* this, PlayState* play) { void func_80AAB838(DmChar03* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 5.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_MASK_BOUND_0); + Actor_PlaySfx(&this->actor, NA_SE_IT_MASK_BOUND_0); } else if ((Animation_OnFrame(&this->skelAnime, 10.0f)) || (Animation_OnFrame(&this->skelAnime, 18.0f)) || (Animation_OnFrame(&this->skelAnime, 30.0f)) || (Animation_OnFrame(&this->skelAnime, 38.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_MASK_BOUND_1); + Actor_PlaySfx(&this->actor, NA_SE_IT_MASK_BOUND_1); } } 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 7e368b9e3c..77c7c5dabd 100644 --- a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c +++ b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c @@ -493,21 +493,21 @@ void func_80AACF04(DmChar05* this, PlayState* play) { void func_80AAD3F8(DmChar05* this, PlayState* play) { if (play->csCtx.frames == 490) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EVIL_POWER); + Actor_PlaySfx(&this->actor, NA_SE_EN_EVIL_POWER); } if (play->csCtx.frames > 550) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MASK_FLOAT - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_MASK_FLOAT - SFX_FLAG); } } void func_80AAD450(DmChar05* this, PlayState* play) { if (play->csCtx.frames == 262) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EVIL_POWER); + Actor_PlaySfx(&this->actor, NA_SE_EN_EVIL_POWER); } if (play->csCtx.frames > 318) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MASK_FLOAT - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_MASK_FLOAT - SFX_FLAG); } } @@ -516,31 +516,31 @@ void func_80AAD4A8(DmChar05* this, PlayState* play) { if (Cutscene_CheckActorAction(play, 109) && (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 109)]->action == 3)) { if (Animation_OnFrame(&this->skelAnime, 14.0f) || Animation_OnFrame(&this->skelAnime, 15.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_MASK_BOUND_0); + Actor_PlaySfx(&this->actor, NA_SE_IT_MASK_BOUND_0); } else if (Animation_OnFrame(&this->skelAnime, 19.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_MASK_BOUND_1); + Actor_PlaySfx(&this->actor, NA_SE_IT_MASK_BOUND_1); } } } else if (DMCHAR05_GET(&this->actor) == DMCHAR05_1) { if (Cutscene_CheckActorAction(play, 473)) { if ((play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 473)]->action == 3) && Animation_OnFrame(&this->skelAnime, 5.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_MASK_BOUND_SAND); + Actor_PlaySfx(&this->actor, NA_SE_IT_MASK_BOUND_SAND); } } } else if (DMCHAR05_GET(&this->actor) == DMCHAR05_2) { if (Cutscene_CheckActorAction(play, 518) && (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 518)]->action == 2)) { if (Animation_OnFrame(&this->skelAnime, 7.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_MASK_BOUND_0); + Actor_PlaySfx(&this->actor, NA_SE_IT_MASK_BOUND_0); } if (Animation_OnFrame(&this->skelAnime, 14.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_MASK_BOUND_1); + Actor_PlaySfx(&this->actor, NA_SE_IT_MASK_BOUND_1); } if (Animation_OnFrame(&this->skelAnime, 18.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_MASK_BOUND_1); + Actor_PlaySfx(&this->actor, NA_SE_IT_MASK_BOUND_1); } } } else if (DMCHAR05_GET(&this->actor) == DMCHAR05_3) { @@ -555,10 +555,10 @@ void func_80AAD4A8(DmChar05* this, PlayState* play) { } else if (play->sceneId == SCENE_SPOT00) { if (gSaveContext.sceneLayer == 9) { if ((play->csCtx.currentCsIndex == 0) && (play->csCtx.frames == 255)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EVIL_POWER); + Actor_PlaySfx(&this->actor, NA_SE_EN_EVIL_POWER); } } else if ((gSaveContext.sceneLayer == 0xB) && (play->csCtx.frames == 115)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EVIL_POWER_PREDEMO); + Actor_PlaySfx(&this->actor, NA_SE_EN_EVIL_POWER_PREDEMO); } } } 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 4129adfbef..5f08b839fd 100644 --- a/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c +++ b/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c @@ -509,7 +509,7 @@ void func_80AAFE88(DmChar08* this, PlayState* play) { break; case 14: - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BIG_TORTOISE_ROLL); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BIG_TORTOISE_ROLL); this->animIndex = TURTLE_ANIM_FLOAT; break; } @@ -896,11 +896,11 @@ void func_80AB096C(DmChar08* this, PlayState* play) { if ((play->csCtx.state != 0) && (play->sceneId == SCENE_31MISAKI) && (gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 0)) { if ((play->csCtx.frames >= 890) && (play->csCtx.frames < 922)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_EARTHQUAKE_LAST2 - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_EARTHQUAKE_LAST2 - SFX_FLAG); } } if ((this->animIndex == TURTLE_ANIM_SWIM) && Animation_OnFrame(&this->skelAnime, 16.0f)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BIG_TORTOISE_SWIM); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BIG_TORTOISE_SWIM); } } 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 654bc6c07c..425bcdcfb1 100644 --- a/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.c +++ b/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.c @@ -203,7 +203,7 @@ void DmChar09_Update(Actor* thisx, PlayState* play) { func_80AB2268(this, play); func_80AB24BC(this, play); if ((play->csCtx.state != 0) && this->unk_22E && DMCHAR09_GET_100(thisx)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_POSTMAN_WALK + SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_POSTMAN_WALK + SFX_FLAG); } } 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 931ca2ad07..f2f7a9ae5d 100644 --- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c +++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c @@ -338,7 +338,7 @@ void DmStk_ChangeAnim(DmStk* this, PlayState* play, SkelAnime* skelAnime, Animat void DmStk_PlaySfxForIntroCutsceneFirstPart(DmStk* this, PlayState* play) { switch (play->csCtx.frames + 20) { case 1195: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_APPEAR); break; case 1232: @@ -346,48 +346,48 @@ void DmStk_PlaySfxForIntroCutsceneFirstPart(DmStk* this, PlayState* play) { case 1252: case 1255: case 1257: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_SHAKEHEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_SHAKEHEAD); break; case 1285: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL03_LAUGH_BIG); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL03_LAUGH_BIG); break; case 1343: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); break; case 1410: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_ON); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_MASK_ON); break; case 1603: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_WALK); break; case 1610: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_REVERSE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_REVERSE); break; case 2095: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_SURPRISED); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_SURPRISED); break; case 2190: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_JUMP); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_JUMP); break; case 2212: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_ONGND); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_ONGND); break; case 2214: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL02_LAUGH_SHORT); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL02_LAUGH_SHORT); break; case 2250: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL06_SURPRISED); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_DOWN_K); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL06_SURPRISED); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_DOWN_K); break; case 2255: @@ -416,7 +416,7 @@ void DmStk_PlaySfxForIntroCutsceneFirstPart(DmStk* this, PlayState* play) { case 2508: case 2519: case 2530: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_RIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_RIDE); break; } } @@ -455,11 +455,11 @@ void DmStk_PlaySfxForIntroCutsceneSecondPart(DmStk* this, PlayState* play) { case 232: case 243: case 254: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_RIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_RIDE); break; case 173: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL03_LAUGH_BIG); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL03_LAUGH_BIG); break; } } @@ -471,15 +471,15 @@ void DmStk_PlaySfxForIntroCutsceneSecondPart(DmStk* this, PlayState* play) { void DmStk_PlaySfxForObtainingMajorasMaskCutscene(DmStk* this, PlayState* play) { switch (play->csCtx.frames) { case 18: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_GASAGOSO); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_GASAGOSO); break; case 90: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_ON); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_MASK_ON); break; case 142: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EVIL_POWER); + Actor_PlaySfx(&this->actor, NA_SE_EN_EVIL_POWER); break; } } @@ -501,11 +501,11 @@ void DmStk_PlaySfxForCurseCutsceneFirstPart(DmStk* this, PlayState* play) { break; case 560: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL02_LAUGH_SHORT); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL02_LAUGH_SHORT); break; case 890: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL21_PSYCHO_VOICE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL21_PSYCHO_VOICE); break; } } @@ -524,7 +524,7 @@ void DmStk_PlaySfxForCurseCutsceneSecondPart(DmStk* this, PlayState* play) { break; case 71: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_BODY); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_BODY); break; case 365: @@ -536,30 +536,30 @@ void DmStk_PlaySfxForCurseCutsceneSecondPart(DmStk* this, PlayState* play) { break; case 265: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL03_LAUGH_BIG); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL03_LAUGH_BIG); break; case 126: - Actor_PlaySfxAtPos(&player->actor, NA_SE_VO_DUMMY_150); + Actor_PlaySfx(&player->actor, NA_SE_VO_DUMMY_150); break; case 197: - Actor_PlaySfxAtPos(&player->actor, NA_SE_VO_DUMMY_134); + Actor_PlaySfx(&player->actor, NA_SE_VO_DUMMY_134); break; case 207: - Actor_PlaySfxAtPos(&player->actor, NA_SE_VO_DUMMY_135); + Actor_PlaySfx(&player->actor, NA_SE_VO_DUMMY_135); break; case 217: - Actor_PlaySfxAtPos(&player->actor, NA_SE_VO_DUMMY_136); + Actor_PlaySfx(&player->actor, NA_SE_VO_DUMMY_136); break; } if (player) {} if ((play->csCtx.frames >= 263) && (play->csCtx.frames < 698)) { - Actor_PlaySfxAtPos(&player->actor, NA_SE_EN_STALKIDS_BODY_LEV - SFX_FLAG); + Actor_PlaySfx(&player->actor, NA_SE_EN_STALKIDS_BODY_LEV - SFX_FLAG); } } @@ -577,37 +577,37 @@ void DmStk_PlaySfxForClockTowerIntroCutsceneVersion1(DmStk* this, PlayState* pla break; case 258: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_TURN); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_TURN); break; case 524: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_TURN); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL04_ANGER); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_TURN); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL04_ANGER); break; case 534: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_ROLL); break; case 678: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_STRETCH); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_STRETCH); break; } if ((this->animIndex == SK_ANIM_OCARINA_JUGGLE) && (play->csCtx.frames < 700)) { if (Animation_OnFrame(&this->skelAnime, 5.0f) || Animation_OnFrame(&this->skelAnime, 25.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_OTEDAMA1); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_OTEDAMA1); } else if (Animation_OnFrame(&this->skelAnime, 17.0f) || Animation_OnFrame(&this->skelAnime, 40.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_OTEDAMA2); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_OTEDAMA2); } } if (play->csCtx.frames >= 700) { if (sMoonCallTimer < 128) { if ((sMoonCallTimer & 0x1F) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL20_CALL_MOON); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL20_CALL_MOON); } else if ((sMoonCallTimer & 0x1F) == 16) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL20_CALL_MOON2); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL20_CALL_MOON2); } sMoonCallTimer++; @@ -622,8 +622,8 @@ void DmStk_PlaySfxForClockTowerIntroCutsceneVersion1(DmStk* this, PlayState* pla */ void DmStk_PlaySfxForDroppingOcarinaCutscene(DmStk* this, PlayState* play) { if (play->csCtx.frames == 3) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL06_SURPRISED); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_DOWN_K); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL06_SURPRISED); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_DOWN_K); } } @@ -632,7 +632,7 @@ void DmStk_PlaySfxForDroppingOcarinaCutscene(DmStk* this, PlayState* play) { */ void DmStk_PlaySfxForShiveringInRainCutscene(DmStk* this, PlayState* play) { if ((play->csCtx.frames >= 642) && (play->csCtx.frames < 845)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_NE_STAL23_COLD - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_NE_STAL23_COLD - SFX_FLAG); } } @@ -648,16 +648,16 @@ void DmStk_PlaySfxForPlayingWithFairiesCutscene(DmStk* this, PlayState* play) { case 72: case 77: case 79: - Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_WALK_WATER2); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_PL_WALK_WATER2); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_WALK); break; case 186: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_UP); break; case 230: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL22_LAUGH_KID_L); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL22_LAUGH_KID_L); break; } } @@ -674,7 +674,7 @@ void DmStk_PlaySfxForEndingCutsceneFirstPart(DmStk* this, PlayState* play) { break; case 660: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_SHAKEHEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_SHAKEHEAD); break; } } @@ -692,27 +692,27 @@ void DmStk_PlaySfxForEndingCutsceneSecondPart(DmStk* this, PlayState* play) { break; case 45: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_RIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_RIDE); break; case 93: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); break; case 245: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_RIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_RIDE); break; case 269: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL11_LAUGH_SHY2); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL11_LAUGH_SHY2); break; case 327: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_SHAKEHEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_SHAKEHEAD); break; case 455: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_RIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_RIDE); break; case 1730: @@ -720,7 +720,7 @@ void DmStk_PlaySfxForEndingCutsceneSecondPart(DmStk* this, PlayState* play) { break; case 1395: - func_800B8E58(player, NA_SE_VO_DUMMY_34); + Player_PlaySfx(player, NA_SE_VO_DUMMY_34); break; case 1850: @@ -735,20 +735,20 @@ void DmStk_PlaySfxForEndingCutsceneSecondPart(DmStk* this, PlayState* play) { if (this->animIndex == SK_ANIM_SHAKE_HEAD) { if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 17.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); } if (Animation_OnFrame(&this->skelAnime, 28.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_RIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_RIDE); } } else if (this->animIndex == SK_ANIM_LAUGH_AFTER_SNIFF) { if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f) || Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); } } else if ((this->animIndex == SK_ANIM_SNIFF) && (Animation_OnFrame(&this->skelAnime, 16.0f) || Animation_OnFrame(&this->skelAnime, 23.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_NOSE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_NOSE); } } @@ -766,25 +766,25 @@ void DmStk_PlaySfxForClockTowerIntroCutsceneVersion2(DmStk* this, PlayState* pla break; case 234: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_TURN); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL04_ANGER); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_TURN); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL04_ANGER); break; case 244: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_ROLL); break; case 388: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_STRETCH); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_STRETCH); break; } if (play->csCtx.frames >= 408) { if (sMoonCallTimer < 128) { if ((sMoonCallTimer & 0x1F) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL20_CALL_MOON); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL20_CALL_MOON); } else if ((sMoonCallTimer & 0x1F) == 16) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL20_CALL_MOON2); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL20_CALL_MOON2); } sMoonCallTimer++; @@ -812,19 +812,19 @@ void DmStk_PlaySfxForCutsceneAfterPlayingOathToOrder(DmStk* this, PlayState* pla case 332: case 335: case 344: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); break; case 367: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_BODY_LEV); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_BODY_LEV); break; case 470: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_HEADACHE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_HEADACHE); break; case 486: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); Audio_PlaySfxAtPos(&this->oathToOrderCutsceneVoicePos, NA_SE_EN_STAL08_CRY_BIG); break; @@ -833,11 +833,11 @@ void DmStk_PlaySfxForCutsceneAfterPlayingOathToOrder(DmStk* this, PlayState* pla break; case 590: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); break; case 592: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_RIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_RIDE); break; case 594: @@ -849,16 +849,16 @@ void DmStk_PlaySfxForCutsceneAfterPlayingOathToOrder(DmStk* this, PlayState* pla if ((play->csCtx.frames >= 62) && (play->csCtx.frames < 273)) { if ((Rand_ZeroOne() < 0.75f) && ((play->state.frames % 2) != 0)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_EARTHQUAKE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_EARTHQUAKE); } } if ((play->csCtx.frames >= 498) && (play->csCtx.frames < 577)) { if ((play->state.frames % 4) == 0) { if ((play->state.frames & 4) != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_BODY_LEV); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_BODY_LEV); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); } } } @@ -876,16 +876,16 @@ void DmStk_PlaySfxForCutsceneAfterPlayingOathToOrder(DmStk* this, PlayState* pla void DmStk_PlaySfxForMoonWarpCutsceneVersion1(DmStk* this, PlayState* play) { switch (play->csCtx.frames) { case 551: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_PULLED); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_PULLED); break; case 711: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); break; case 716: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_ON); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_ONGND); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_MASK_ON); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_ONGND); break; } } @@ -898,16 +898,16 @@ void DmStk_PlaySfxForMoonWarpCutsceneVersion1(DmStk* this, PlayState* play) { void DmStk_PlaySfxForMoonWarpCutsceneVersion2(DmStk* this, PlayState* play) { switch (play->csCtx.frames) { case 311: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_PULLED); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_PULLED); break; case 365: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); break; case 372: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_ON); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_ONGND); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_MASK_ON); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_ONGND); break; } } @@ -984,24 +984,24 @@ void DmStk_PlaySfxForCutscenes(DmStk* this, PlayState* play) { if (this->animIndex == SK_ANIM_WALK) { if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_WALK); } } else if (this->animIndex == SK_ANIM_SEARCH_LINK) { if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 13.0f) || Animation_OnFrame(&this->skelAnime, 20.0f) || Animation_OnFrame(&this->skelAnime, 27.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_CALM_HIT); + Actor_PlaySfx(&this->actor, NA_SE_PL_CALM_HIT); } } else if (this->animIndex == SK_ANIM_PICK_UP_OCARINA_AND_START_PLAYING) { if (Animation_OnFrame(&this->skelAnime, 3.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_PUT_OUT_ITEM); + Actor_PlaySfx(&this->actor, NA_SE_PL_PUT_OUT_ITEM); } } else if (this->animIndex == SK_ANIM_PLAY_OCARINA_AND_LAUGH) { if (Animation_OnFrame(&this->skelAnime, 14.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_UNSKILLFUL_OCARINA); + Actor_PlaySfx(&this->actor, NA_SE_EV_UNSKILLFUL_OCARINA); } if (Animation_OnFrame(&this->skelAnime, 45.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL01_LAUGH); + Actor_PlaySfx(&this->actor, NA_SE_EN_STAL01_LAUGH); } } } @@ -1225,7 +1225,7 @@ void DmStk_ClockTower_WaitForIntroCutsceneVersion2ToEnd(DmStk* this, PlayState* void DmStk_ClockTower_StartDropOcarinaCutscene(DmStk* this, PlayState* play) { if (ActorCutscene_GetCanPlayNext(10)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_DAMAGE); ActorCutscene_Start(10, &this->actor); this->actor.shape.rot.x = 0; this->actor.world.rot.x = this->actor.shape.rot.x; @@ -1280,7 +1280,7 @@ void DmStk_ClockTower_DeflectHit(DmStk* this, PlayState* play) { this->animIndex = SK_ANIM_DEFLECT_ATTACK; DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_DOWN_K); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_DOWN_K); this->actionFunc = DmStk_ClockTower_WaitForDeflectionToEnd; } 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 cfad99d2ab..7a365e5472 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -346,9 +346,9 @@ void func_808A1090(DoorShutter* this, PlayState* play) { Flags_SetSwitch(play, DOORSHUTTER_GET_7F(&this->actor)); if (this->doorType != 5) { gSaveContext.save.inventory.dungeonKeys[gSaveContext.mapIndex]--; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK_B); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK_B); } } } else { @@ -416,7 +416,7 @@ s32 func_808A1340(DoorShutter* this, PlayState* play) { if (this->actor.velocity.y == 0.0f) { func_808A1288(this, play); if (this->unk_163 != 7) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SLIDE_DOOR_OPEN); + Actor_PlaySfx(&this->actor, NA_SE_EV_SLIDE_DOOR_OPEN); } } @@ -449,9 +449,9 @@ s32 func_808A1478(DoorShutter* this, PlayState* play, f32 arg2) { if (temp == this->unk_168) { if (arg2 == 1.0f) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_METALDOOR_CLOSE); + Actor_PlaySfx(&this->actor, NA_SE_EV_METALDOOR_CLOSE); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_METALDOOR_OPEN); + Actor_PlaySfx(&this->actor, NA_SE_EV_METALDOOR_OPEN); } if ((this->unk_160 != -1) && (ActorCutscene_GetCurrentIndex() == this->unk_160)) { @@ -512,7 +512,7 @@ void func_808A1684(DoorShutter* this, PlayState* play) { if (DoorShutter_SetupDoor(this, play)) { this->actor.velocity.y = 30.0f; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SLIDE_DOOR_CLOSE); + Actor_PlaySfx(&this->actor, NA_SE_EV_SLIDE_DOOR_CLOSE); } DoorShutter_SetupAction(this, func_808A1B48); } @@ -608,7 +608,7 @@ void func_808A1B48(DoorShutter* this, PlayState* play) { this->actor.floorHeight = this->actor.home.pos.y; Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 45.0f, 10, 8.0f, 500, 10, 0); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BIGWALL_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EV_BIGWALL_BOUND); quakeIndex = Quake_Add(Play_GetCamera(play, CAM_ID_MAIN), QUAKE_TYPE_3); Quake_SetSpeed(quakeIndex, -32536); 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 df067d0a9c..00f1693a5b 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -328,7 +328,7 @@ void func_808B90CC(DoorWarp1* this, PlayState* play) { DoorWarp1_SetupAction(this, func_808B921C); } - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WARP_HOLE_ENERGY - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WARP_HOLE_ENERGY - SFX_FLAG); } void func_808B921C(DoorWarp1* this, PlayState* play) { @@ -349,7 +349,7 @@ void func_808B921C(DoorWarp1* this, PlayState* play) { DoorWarp1_SetupAction(this, func_808B93A0); } - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BOSS_WARP_HOLE - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BOSS_WARP_HOLE - SFX_FLAG); } void func_808B93A0(DoorWarp1* this, PlayState* play) { @@ -372,7 +372,7 @@ void func_808B93A0(DoorWarp1* this, PlayState* play) { } } func_808BB8D4(this, play, 1); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BOSS_WARP_HOLE - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BOSS_WARP_HOLE - SFX_FLAG); } void func_808B94A4(DoorWarp1* this, PlayState* play) { @@ -380,7 +380,7 @@ void func_808B94A4(DoorWarp1* this, PlayState* play) { DoorWarp1_SetupAction(this, func_808B921C); } func_808BB8D4(this, play, 1); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BOSS_WARP_HOLE - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BOSS_WARP_HOLE - SFX_FLAG); } void func_808B9524(DoorWarp1* this, PlayState* play) { @@ -415,14 +415,14 @@ void func_808B958C(DoorWarp1* this, PlayState* play) { } Math_SmoothStepToF(&this->unk_1A8, 6.0f, 0.2f, 0.02f, 0.01f); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_LINK_WARP - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_LINK_WARP - SFX_FLAG); } void func_808B96A0(DoorWarp1* this, PlayState* play) { } void func_808B96B0(DoorWarp1* this, PlayState* play) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); Math_SmoothStepToF(&this->unk_1B0, 255.0f, 0.4f, 10.0f, 0.01f); Math_SmoothStepToF(&this->unk_1B4, 255.0f, 0.4f, 10.0f, 0.01f); @@ -442,7 +442,7 @@ void func_808B96B0(DoorWarp1* this, PlayState* play) { } void func_808B977C(DoorWarp1* this, PlayState* play) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); if (func_808B866C(this, play) && !Play_InCsMode(play)) { Player* player = GET_PLAYER(play); @@ -515,7 +515,7 @@ void func_808B9B30(DoorWarp1* this, PlayState* play) { } void func_808B9BE8(DoorWarp1* this, PlayState* play) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); Math_SmoothStepToF(&this->unk_1B0, 255.0f, 0.2f, 2.0f, 0.1f); Math_SmoothStepToF(&this->unk_1B4, 255.0f, 0.2f, 2.0f, 0.1f); if (this->unk_1C4 < 10) { @@ -594,7 +594,7 @@ void func_808B9ED8(DoorWarp1* this, PlayState* play) { } void func_808B9F10(DoorWarp1* this, PlayState* play) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); if ((this->unk_203 == 0) && func_808B866C(this, play) && !Play_InCsMode(play) && (this->unk_203 == 0)) { Player* player = GET_PLAYER(play); 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 75ff275a14..0ebb5139dc 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 @@ -90,7 +90,7 @@ void func_80BCEC6C(EffKamejimaWave* this, PlayState* play) { this->actor.draw = EffKamejimaWave_Draw; sVtxAlpha = 255; this->actor.shape.rot.x = 0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_TORTOISE_WAKE_UP); + Actor_PlaySfx(&this->actor, NA_SE_EV_TORTOISE_WAKE_UP); } } else { this->actor.draw = NULL; 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 0041f1e99c..015e9e715d 100644 --- a/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c +++ b/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c @@ -195,7 +195,7 @@ void func_80BEBF78(EffLastday* this, PlayState* play) { case EFFLASTDAY_ACTION_2: if (!this->actor.home.rot.z) { this->actor.home.rot.z = true; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_COMING_FIRE); + Actor_PlaySfx(&this->actor, NA_SE_EV_COMING_FIRE); } this->actor.draw = EffLastday_Draw; if (this->alpha < 255) { 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 d2bdf0ceec..6b48c9779e 100644 --- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c +++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c @@ -1173,7 +1173,7 @@ void func_80BEEB20(EnAkindonuts* this, PlayState* play) { } if (phi_v0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80BEEDC0; this->unk_338 = 3; this->collider.dim.height = 64; @@ -1186,12 +1186,12 @@ void func_80BEEB20(EnAkindonuts* this, PlayState* play) { if ((this->unk_338 == 4) || (this->unk_338 == 18)) { this->unk_338 = 17; this->collider.dim.height = 0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DOWN); SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 17); } else if (this->unk_338 == 2) { this->unk_338 = 16; this->collider.dim.height = 32; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_UP); SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 16); } else if (this->unk_338 == 17) { phi_v0 = DECR(this->unk_33A); @@ -1433,7 +1433,7 @@ void func_80BEF518(EnAkindonuts* this, PlayState* play) { this->unk_33E = 3; this->unk_338 = 19; SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_338); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DOWN); this->unk_32C &= ~2; this->unk_32C |= 0x80; this->unk_358 = this->actor.world.pos.y; @@ -1492,7 +1492,7 @@ void func_80BEF83C(EnAkindonuts* this, PlayState* play) { this->unk_34C = 0.3f; this->unk_338 = 9; SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_338); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80BEF9F0; } } 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 da1cc7d7e1..4430656334 100644 --- a/src/overlays/actors/ovl_En_Al/z_en_al.c +++ b/src/overlays/actors/ovl_En_Al/z_en_al.c @@ -257,7 +257,7 @@ s32 func_80BDE4E0(EnAl* this, s16* arg1, s16 arg2) { } if (arg2 == *arg1) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIR_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIR_ROLL); func_80BDE27C(this, 3); this->unk_4E8 = 0; (*arg1)++; @@ -292,7 +292,7 @@ s32 func_80BDE678(EnAl* this, s16* arg1, s16 arg2) { } if (arg2 == *arg1) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIR_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIR_ROLL); func_80BDE27C(this, 4); this->unk_4E8 = 0; (*arg1)++; 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 4ef21564d5..79ec20df6f 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -198,7 +198,7 @@ void EnAm_SpawnEffects(EnAm* this, PlayState* play) { effectPos.z = randPlusMinusPoint5Scaled(65.0f) + this->actor.world.pos.z; EffectSsKirakira_SpawnSmall(play, &effectPos, &sVelocity, &sAccel, &D_808B1118, &D_808B111C); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AMOS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_AMOS_WALK); Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 4.0f, 3, 8.0f, 300, 15, 0); } @@ -231,8 +231,8 @@ void EnAm_RemoveEnemyTexture(EnAm* this, PlayState* play) { } void EnAm_WakeUp(EnAm* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AMOS_WAVE); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AMOS_VOICE); + Actor_PlaySfx(&this->actor, NA_SE_EN_AMOS_WAVE); + Actor_PlaySfx(&this->actor, NA_SE_EN_AMOS_VOICE); this->returnHomeTimer = 300; this->actionFunc = EnAm_ApplyEnemyTexture; } @@ -372,7 +372,7 @@ void func_808B066C(EnAm* this, PlayState* play) { this->armosYaw = this->actor.yawTowardsPlayer; func_808B0208(this, play); if (this->armosYaw == this->actor.shape.rot.y) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AMOS_VOICE); + Actor_PlaySfx(&this->actor, NA_SE_EN_AMOS_VOICE); func_808B0358(this); } } @@ -384,7 +384,7 @@ void EnAm_TakeDamage(EnAm* this, PlayState* play) { func_800BE504(&this->actor, &this->enemyCollider); this->actor.speedXZ = 6.0f; Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, Animation_GetLastFrame(&gArmosTakeDamageAnim) - 10); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_DAMAGE); this->enemyCollider.base.acFlags &= ~AC_ON; this->textureBlend = 255; this->actionFunc = func_808B07A8; @@ -426,7 +426,7 @@ void func_808B0894(EnAm* this, PlayState* play) { if (bomb != NULL) { bomb->timer = 0; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_DEAD); Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0); for (i = 0; i < 8; i++) { 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 8e98ae8a33..9d0600b2e8 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -225,7 +225,7 @@ void EnAni_FallToGround(EnAni* this, PlayState* play) { Quake_SetQuakeValues(quakeIndex, 7, 0, 0, 0); Quake_SetCountdown(quakeIndex, 20); - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_HAMMER_HIT); + Actor_PlaySfx(&this->actor, NA_SE_IT_HAMMER_HIT); } Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x2, 0x7D0, 0x100); 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 d41da13260..8fe5c121e0 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -176,22 +176,22 @@ void func_8088A594(EnArrow* this, PlayState* play) { switch (this->actor.params) { case ENARROW_6: - func_800B8E58(player, NA_SE_IT_SLING_SHOT); + Player_PlaySfx(player, NA_SE_IT_SLING_SHOT); break; case ENARROW_0: case ENARROW_1: case ENARROW_2: - func_800B8E58(player, NA_SE_IT_ARROW_SHOT); + Player_PlaySfx(player, NA_SE_IT_ARROW_SHOT); break; case ENARROW_3: case ENARROW_4: case ENARROW_5: - func_800B8E58(player, NA_SE_IT_MAGIC_ARROW_SHOT); + Player_PlaySfx(player, NA_SE_IT_MAGIC_ARROW_SHOT); case ENARROW_7: - func_800B8E58(player, NA_SE_PL_DEKUNUTS_FIRE); + Player_PlaySfx(player, NA_SE_PL_DEKUNUTS_FIRE); break; } @@ -289,7 +289,7 @@ void func_8088AA98(EnArrow* this, PlayState* play) { EffectSsGSplash_Spawn(play, &sp44, NULL, NULL, 0, 300); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DIVE_INTO_WATER_L); + Actor_PlaySfx(&this->actor, NA_SE_EV_DIVE_INTO_WATER_L); EffectSsGRipple_Spawn(play, &sp44, 100, 500, 0); EffectSsGRipple_Spawn(play, &sp44, 100, 500, 4); @@ -403,7 +403,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) { this->unk_261 |= 2; Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos); func_8088A7D8(play, this); - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_HOOKSHOT_STICK_CRE); + Actor_PlaySfx(&this->actor, NA_SE_IT_HOOKSHOT_STICK_CRE); } } else if (this->unk_262 != 0) { this->actionFunc = func_8088B630; @@ -416,7 +416,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) { if ((this->actor.params >= ENARROW_3) && (this->actor.params < ENARROW_6)) { this->actor.draw = NULL; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_ARROW_STICK_OBJ); + Actor_PlaySfx(&this->actor, NA_SE_IT_ARROW_STICK_OBJ); this->unk_261 |= 1; } } 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 b4501ffa08..18ccfb030c 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 @@ -408,12 +408,12 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) { if (this->crySfxTimer == 0) { this->crySfxTimer = 30; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_A); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHICKEN_CRY_A); } if (this->flutterSfxTimer == 0) { this->flutterSfxTimer = 7; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_CHICKEN_FLUTTER); + Actor_PlaySfx(&this->actor, NA_SE_EN_CHICKEN_FLUTTER); } } } 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 90b611529a..38690e122c 100644 --- a/src/overlays/actors/ovl_En_Az/z_en_az.c +++ b/src/overlays/actors/ovl_En_Az/z_en_az.c @@ -593,7 +593,7 @@ void func_80A95CEC(EnAz* this, PlayState* play) { func_800B9010(&this->actor, NA_SE_EV_HONEYCOMB_FALL - SFX_FLAG); } else { if (this->actor.bgCheckFlags & 2) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GERUDOFT_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_DOWN); } if (SubS_StartActorCutscene(&this->actor, 0x7C, this->unk_3D0[0], SUBS_CUTSCENE_NORMAL)) { func_80A97C0C(this, play); @@ -625,7 +625,7 @@ void func_80A95E88(EnAz* this, PlayState* play) { if (this->actor.depthInWater > 8.0f) { if (this->unk_374 & 2) { if ((this->skelAnime.curFrame < this->skelAnime.playSpeed) && (this->skelAnime.curFrame >= 0.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BEAVER_SWIM_HAND); + Actor_PlaySfx(&this->actor, NA_SE_EV_BEAVER_SWIM_HAND); } } else { func_800B9010(&this->actor, NA_SE_EV_BEAVER_SWIM_MOTOR - SFX_FLAG); @@ -1574,7 +1574,7 @@ void func_80A97F9C(EnAz* this, PlayState* play) { if (this->actor.depthInWater > 8.0f) { if (this->unk_374 & 2) { if ((this->skelAnime.curFrame < this->skelAnime.playSpeed) && (this->skelAnime.curFrame >= 0.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BEAVER_SWIM_HAND); + Actor_PlaySfx(&this->actor, NA_SE_EV_BEAVER_SWIM_HAND); } } else { func_800B9010(&this->actor, NA_SE_EV_BEAVER_SWIM_MOTOR - SFX_FLAG); @@ -1638,10 +1638,10 @@ void EnAz_Update(Actor* thisx, PlayState* play2) { this->actionFunc(this, play); Actor_SetFocus(&this->actor, 40.0f); if (this->unk_374 & 0x200) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DIVE_INTO_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_DIVE_INTO_WATER); } if (this->unk_374 & 0x400) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_JUMP_OUT_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_JUMP_OUT_WATER); } this->unk_37E++; if (this->unk_37E >= 4) { 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 6040076f4d..dd8c5a96fb 100644 --- a/src/overlays/actors/ovl_En_Baba/z_en_baba.c +++ b/src/overlays/actors/ovl_En_Baba/z_en_baba.c @@ -690,7 +690,7 @@ void EnBaba_KnockedOver(EnBaba* this, PlayState* play) { if (this->animIndex == BOMB_SHOP_LADY_ANIM_KNOCKED_OVER) { if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_BBVO00); + Actor_PlaySfx(&this->actor, NA_SE_VO_BBVO00); } if (curFrame == endFrame) { 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 9017e0f89a..2a4afb087a 100644 --- a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c +++ b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c @@ -160,7 +160,7 @@ void EnBaguo_UndergroundIdle(EnBaguo* this, PlayState* play) { this->action = NEJIRON_ACTION_INACTIVE; if (this->actor.xzDistToPlayer < 200.0f && Player_GetMask(play) != PLAYER_MASK_STONE) { this->actor.draw = EnBaguo_DrawBody; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_BAKUO_APPEAR); this->actor.world.rot.z = 0; this->actor.world.rot.x = this->actor.world.rot.z; this->actor.flags &= ~ACTOR_FLAG_8000000; @@ -205,7 +205,7 @@ void EnBaguo_Idle(EnBaguo* this, PlayState* play) { if ((play->gameplayFrames % 8) == 0) { Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale - 20.0f, 10, 8.0f, 500, 10, 1); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_VOICE); + Actor_PlaySfx(&this->actor, NA_SE_EN_BAKUO_VOICE); } } } @@ -265,7 +265,7 @@ void EnBaguo_Roll(EnBaguo* this, PlayState* play) { } } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_ROLL - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_BAKUO_ROLL - SFX_FLAG); } } @@ -290,7 +290,7 @@ void EnBaguo_RetreatUnderground(EnBaguo* this, PlayState* play) { this->actor.shape.yOffset = -3000.0f; this->actor.draw = EnBaguo_DrawBody; Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_BAKUO_APPEAR); this->actor.flags |= ACTOR_FLAG_8000000; this->actor.flags &= ~ACTOR_FLAG_1; this->actionFunc = EnBaguo_UndergroundIdle; @@ -346,8 +346,8 @@ void EnBaguo_CheckForDetonation(EnBaguo* 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_POP); - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_IT_BOMB_EXPLOSION); + Actor_PlaySfx(&this->actor, NA_SE_EN_BAKUO_DEAD); this->timer = 30; this->actor.flags |= ACTOR_FLAG_8000000; 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 e30612c17c..a8b93fc2f8 100644 --- a/src/overlays/actors/ovl_En_Bat/z_en_bat.c +++ b/src/overlays/actors/ovl_En_Bat/z_en_bat.c @@ -193,7 +193,7 @@ void EnBat_StepAnimation(EnBat* this, s32 frameStep) { this->animationFrame -= ARRAY_COUNT(sWingsDLs); } if ((prevFrame < BAD_BAT_FLAP_FRAME) && (this->animationFrame >= BAD_BAT_FLAP_FRAME)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FFLY_FLY); + Actor_PlaySfx(&this->actor, NA_SE_EN_FFLY_FLY); } } @@ -299,7 +299,7 @@ void EnBat_DiveAttack(EnBat* this, PlayState* play) { (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_FFLY_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_FFLY_ATTACK); } this->collider.base.atFlags &= ~AT_ON; sNumberAttacking--; @@ -320,7 +320,7 @@ void EnBat_SetupDie(EnBat* this, PlayState* play) { this->actor.speedXZ *= Math_CosS(this->actor.world.rot.x); this->actor.bgCheckFlags &= ~1; this->actor.velocity.y = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FFLY_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_FFLY_DEAD); if (this->actor.colChkInfo.damageEffect == BAD_BAT_DMGEFF_ICE) { this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX; @@ -400,7 +400,7 @@ void EnBat_SetupStunned(EnBat* this) { this->actor.speedXZ = 0.0f; this->actor.world.pos.y += 13.0f; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); Actor_SetColorFilter(&this->actor, 0, 255, 0, this->timer); this->actionFunc = EnBat_Stunned; } 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 21c3465ba6..793054c330 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -255,9 +255,9 @@ void EnBb_FlyIdle(EnBb* this, PlayState* play) { EnBb_UpdateStateForFlying(this); if (Animation_OnFrame(&this->skelAnime, 5.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLE_WING); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_WING); } else if ((Animation_OnFrame(&this->skelAnime, 0.0f)) && (Rand_ZeroOne() < 0.1f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLE_LAUGH); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_LAUGH); } DECR(this->attackWaitTimer); @@ -288,11 +288,11 @@ void EnBb_Attack(EnBb* this, PlayState* play) { EnBb_UpdateStateForFlying(this); if ((Animation_OnFrame(&this->skelAnime, 0.0f)) || (Animation_OnFrame(&this->skelAnime, 5.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLE_MOUTH); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_MOUTH); } else if ((Animation_OnFrame(&this->skelAnime, 2.0f)) || (Animation_OnFrame(&this->skelAnime, 7.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLE_WING); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_WING); } else if ((Animation_OnFrame(&this->skelAnime, 0.0f)) && (Rand_ZeroOne() < 0.1f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLE_LAUGH); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_LAUGH); } this->timer--; @@ -313,7 +313,7 @@ void EnBb_SetupDown(EnBb* this) { this->flameScaleY = 0.0f; this->flameScaleX = 0.0f; this->actor.gravity = -2.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLE_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_DOWN); this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnBb_Down; } @@ -326,9 +326,9 @@ void EnBb_Down(EnBb* this, PlayState* play) { EnBb_CheckForWall(this); if (this->actor.bgCheckFlags & 1) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); if (this->timer == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLE_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_UP); EnBb_SetupFlyIdle(this); return; } @@ -346,7 +346,7 @@ void EnBb_Down(EnBb* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; if (Animation_OnFrame(&this->skelAnime, 5.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLE_WING); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_WING); } if (this->timer > 0) { @@ -412,7 +412,7 @@ void EnBb_Dead(EnBb* this, PlayState* play) { void EnBb_SetupDamage(EnBb* this) { this->collider.base.acFlags &= ~AC_ON; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLE_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_DAMAGE); func_800BE568(&this->actor, &this->collider); if (this->actor.colChkInfo.damageEffect == EN_BB_DMGEFF_ZORA_MAGIC) { @@ -565,7 +565,7 @@ void EnBb_UpdateDamage(EnBb* this, PlayState* play) { this->collider.base.atFlags &= ~AT_HIT; this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000; this->actor.shape.rot.y = this->actor.world.rot.y; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLE_BITE); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_BITE); if (this->flameScaleX > 0.0f) { gSaveContext.jinxTimer = 1200; 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 1dfc74a222..faaf9c67ae 100644 --- a/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c +++ b/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c @@ -223,7 +223,7 @@ s32 EnBbfall_IsTouchingLava(EnBbfall* this, PlayState* play) { void EnBbfall_PlaySfx(EnBbfall* this) { if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 5.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLE_MOUTH); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_MOUTH); } func_800B9010(&this->actor, NA_SE_EN_BUBLEFALL_FIRE - SFX_FLAG); @@ -306,7 +306,7 @@ void EnBbfall_SetupEmerge(EnBbfall* this) { this->actor.velocity.y = 17.0f; EnBbfall_EnableColliders(this); this->actor.flags |= ACTOR_FLAG_1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLEFALL_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLEFALL_APPEAR); this->actionFunc = EnBbfall_Emerge; } @@ -376,7 +376,7 @@ void EnBbfall_SetupDown(EnBbfall* this) { this->flameScaleY = 0.0f; this->flameScaleX = 0.0f; this->actor.gravity = -2.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLE_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_DOWN); this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnBbfall_Down; } @@ -391,9 +391,9 @@ void EnBbfall_Down(EnBbfall* this, PlayState* play) { return; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); if (this->timer == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLE_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_UP); EnBbfall_EnableColliders(this); this->actor.velocity.y = 8.0f; EnBbfall_SetupFly(this); @@ -413,7 +413,7 @@ void EnBbfall_Down(EnBbfall* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; if (Animation_OnFrame(&this->skelAnime, 5.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLE_WING); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_WING); } if (this->timer > 0) { @@ -478,7 +478,7 @@ void EnBbfall_Dead(EnBbfall* this, PlayState* play) { void EnBbfall_SetupDamage(EnBbfall* this) { this->collider.base.acFlags &= ~AC_ON; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLE_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_DAMAGE); func_800BE5CC(&this->actor, &this->collider, 0); if (this->actor.colChkInfo.damageEffect == EN_BBFALL_DMGEFF_ZORA_MAGIC) { 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 cf8c5f68a4..602d428020 100644 --- a/src/overlays/actors/ovl_En_Bee/z_en_bee.c +++ b/src/overlays/actors/ovl_En_Bee/z_en_bee.c @@ -262,7 +262,7 @@ void EnBee_Update(Actor* thisx, PlayState* play) { } } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BEE_FLY - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_BEE_FLY - SFX_FLAG); EnBee_UpdateDamage(this, play); Math_Vec3s_Copy(&this->actor.shape.rot, &this->actor.world.rot); Actor_SetFocus(&this->actor, 0.0f); 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 e3097696dd..142328b1ad 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -237,7 +237,7 @@ void EnBigokuta_SetupRise(EnBigokuta* this, PlayState* play) { EffectSsGSplash_Spawn(play, &splashPos, NULL, NULL, 0, Rand_S16Offset(1000, 200)); angle = BINANG_ADD(angle, 0x2000); } - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_DAIOCTA_LAND); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_DAIOCTA_LAND); this->actionFunc = EnBigokuta_RiseOutOfWater; } @@ -259,7 +259,7 @@ void EnBigokuta_IdleAboveWater(EnBigokuta* this, PlayState* play) { Math_ApproachS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 5, 0x1000); if ((this->picto.actor.xzDistToPlayer > 400.0f) || (this->picto.actor.playerHeightRel > 200.0f)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_DAIOCTA_SINK); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_DAIOCTA_SINK); EnBigokuta_SetupIdle(this); } else if ((this->picto.actor.xzDistToPlayer < 200.0f) && play->grabPlayer(play, GET_PLAYER(play))) { EnBigokuta_SetupSuckInPlayer(this, play); @@ -295,7 +295,7 @@ void EnBigokuta_SetupSuckInPlayer(EnBigokuta* this, PlayState* play) { this->playerHoldPos.y = (this->picto.actor.home.pos.y - 49.5f) + 42.899998f; this->playerHoldPos.z = (Math_CosS(this->picto.actor.shape.rot.y) * 66.0f) + this->picto.actor.world.pos.z; - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_SLIME_DEAD); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_SLIME_DEAD); this->actionFunc = EnBigokuta_SuckInPlayer; } @@ -347,7 +347,7 @@ void EnBigokuta_HoldPlayer(EnBigokuta* this, PlayState* play) { if (this->timer == 0) { EnBigokuta_ShootPlayer(this, play); - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_DAIOCTA_REVERSE); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_DAIOCTA_REVERSE); } } else if (this->timer == -24) { EnBigokuta_SetupIdleAboveWater(this); @@ -396,7 +396,7 @@ void EnBigokuta_PlayDeathCutscene(EnBigokuta* this, PlayState* play) { void EnBigokuta_SetupDeathEffects(EnBigokuta* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gBigOctoDeathAnim, -5.0f); - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_DAIOCTA_DEAD2); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_DAIOCTA_DEAD2); this->picto.actor.flags &= ~1; this->timer = 10; this->actionFunc = EnBigokuta_PlayDeathEffects; @@ -422,7 +422,7 @@ void EnBigokuta_PlayDeathEffects(EnBigokuta* this, PlayState* play) { dustPos.z = this->picto.actor.world.pos.z; func_800B0DE0(play, &dustPos, &gZeroVec3f, &gZeroVec3f, &D_80AC45B0, &D_80AC45B4, 1200, 20); - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_OCTAROCK_DEAD2); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_OCTAROCK_DEAD2); } } else { this->picto.actor.world.pos.y -= 0.2f; 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 3dad5b9c6a..af18596bfe 100644 --- a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c +++ b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c @@ -219,7 +219,7 @@ void func_80A2778C(EnBigpamet* this) { ptr->unk_20 = Rand_ZeroFloat(0.0025000002f) + 0.002f; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_PAMET_BREAK); + Actor_PlaySfx(&this->actor, NA_SE_EN_B_PAMET_BREAK); } void func_80A27970(EnBigpamet* this, PlayState* play2) { @@ -295,7 +295,7 @@ void func_80A27B58(EnBigpamet* this) { ptr->unk_20 = Rand_ZeroFloat(0.0025000002f) + 0.002f; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_PAMET_BREAK); + Actor_PlaySfx(&this->actor, NA_SE_EN_B_PAMET_BREAK); } void func_80A27DD8(EnBigpamet* this, PlayState* play) { @@ -447,8 +447,8 @@ void func_80A284E4(EnBigpamet* this) { this->unk_2A8 = 1.0f; this->unk_2A4 = 1.0f; this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_PAMET_VOICE); - Actor_PlaySfxAtPos(this->actor.parent, NA_SE_EN_FROG_VOICE1); + Actor_PlaySfx(&this->actor, NA_SE_EN_B_PAMET_VOICE); + Actor_PlaySfx(this->actor.parent, NA_SE_EN_FROG_VOICE1); this->actionFunc = func_80A2855C; } @@ -469,7 +469,7 @@ void func_80A28618(EnBigpamet* this) { this->actor.draw = func_80A2966C; this->unk_2A8 = 0.5f; this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_CUTTER_ON); + Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_CUTTER_ON); this->actionFunc = func_80A2866C; } @@ -557,7 +557,7 @@ void func_80A287E8(EnBigpamet* this, PlayState* play) { } void func_80A28970(EnBigpamet* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_CUTTER_OFF); + Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_CUTTER_OFF); this->actor.shape.rot.z = 0; this->collider.base.atFlags &= ~AT_ON; this->collider.info.bumper.dmgFlags = 0xF7CFFFFF; @@ -642,14 +642,14 @@ void func_80A28B98(EnBigpamet* this, PlayState* play) { collectible->world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_PAMET_REVERSE); + Actor_PlaySfx(&this->actor, NA_SE_EN_B_PAMET_REVERSE); this->actionFunc = func_80A28D0C; } void func_80A28D0C(EnBigpamet* this, PlayState* play) { SkelAnime_Update(&this->skelAnime2); if (this->actor.bgCheckFlags & 1) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HIPLOOP_LAND); + Actor_PlaySfx(&this->actor, NA_SE_EN_HIPLOOP_LAND); func_80A27FE8(this, play); func_80A28D80(this); } 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 b8e4eee137..f5aab7460f 100644 --- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c +++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c @@ -259,7 +259,7 @@ void EnBigpo_UpdateSpin(EnBigpo* this) { this->actor.shape.rot.y += this->rotVelocity; if ((oldYaw < 0) && (this->actor.shape.rot.y > 0)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_ROLL); // spinning sfx during spin attack + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_ROLL); // spinning sfx during spin attack } } @@ -395,7 +395,7 @@ void EnBigpo_SpawnCutsceneStage5(EnBigpo* this) { Animation_PlayLoop(&this->skelAnime, &gBigpoAwakenStretchAnim); this->actor.draw = EnBigpo_DrawMainBigpo; Actor_SetScale(&this->actor, 0.014f); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_APPEAR); this->actionFunc = EnBigpo_SpawnCutsceneStage6; } @@ -483,7 +483,7 @@ void EnBigpo_SetupWarpOut(EnBigpo* this) { this->idleTimer = 32; this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DISAPPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DISAPPEAR); this->actionFunc = EnBigpo_WarpingOut; } @@ -505,7 +505,7 @@ void EnBigpo_SetupWarpIn(EnBigpo* this, PlayState* play) { f32 distance = CLAMP_MIN(this->actor.xzDistToPlayer, 200.0f); s16 randomYaw = ((s32)Rand_Next() >> 0x14) + this->actor.yawTowardsPlayer; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_APPEAR); Animation_PlayLoop(&this->skelAnime, &gBigpoAwakenStretchAnim); this->rotVelocity = 0x2000; this->actor.world.pos.x = (Math_SinS(randomYaw) * distance) + player->actor.world.pos.x; @@ -725,7 +725,7 @@ void EnBigpo_BurnAwayDeath(EnBigpo* this, PlayState* play) { func_800B9010(&this->actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG); // burning sfx } if (this->idleTimer == 18) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_DISAPPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_DISAPPEAR); } } @@ -795,7 +795,7 @@ void EnBigpo_SpawnScoopSoul(EnBigpo* this) { this->actor.scale.x = 0.0f; this->actor.scale.y = 0.0f; this->savedHeight = this->actor.world.pos.y; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_METAL_BOX_BOUND); // misnamed? + Actor_PlaySfx(&this->actor, NA_SE_EV_METAL_BOX_BOUND); // misnamed? this->actionFunc = EnBigpo_ScoopSoulAppearing; } @@ -824,7 +824,7 @@ void EnBigpo_ScoopSoulIdle(EnBigpo* this, PlayState* play) { if (this->idleTimer == 0) { // took too long, soul is leaving - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH); EnBigpo_SetupScoopSoulLeaving(this); } else { Actor_PickUp(&this->actor, play, GI_MAX, 35.0f, 60.0f); @@ -1123,13 +1123,13 @@ s32 EnBigpo_ApplyDamage(EnBigpo* this, PlayState* play) { if (Actor_ApplyDamage(&this->actor) == 0) { this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DEAD); Enemy_StartFinishingBlow(play, &this->actor); if (this->actor.params == ENBIGPO_SUMMONED) { // dampe type Audio_RestorePrevBgm(); } } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DAMAGE); } // light arrows @@ -1164,7 +1164,7 @@ void EnBigpo_Update(Actor* thisx, PlayState* play) { this->unk20C = 0; } if (this->unk20C == 40) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH); EnBigpo_SetupWarpOut(this); } } 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 bfe668b3fc..22ccb33940 100644 --- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c +++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c @@ -772,7 +772,7 @@ void EnBigslime_BreakIntoMinislime(EnBigslime* this, PlayState* play) { this->actor.bgCheckFlags &= ~1; this->formBigslimeTimer = 2; EnBigslime_AddIceShardEffect(this, play); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_SLIME_BREAK); + Actor_PlaySfx(&this->actor, NA_SE_EN_B_SLIME_BREAK); EnBigslime_SetupJumpGekko(this); } @@ -1213,7 +1213,7 @@ void EnBigslime_SetTargetVtxToWideCone(EnBigslime* this) { } void EnBigslime_SetupSquishFlat(EnBigslime* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_SLIME_JUMP2); + Actor_PlaySfx(&this->actor, NA_SE_EN_B_SLIME_JUMP2); this->squishFlatTimer = 20; this->actor.scale.x = 0.2f; this->actor.scale.z = 0.2f; @@ -1412,7 +1412,7 @@ void EnBigslime_SetupRise(EnBigslime* this) { Animation_PlayLoop(&this->skelAnime, &gGekkoSwimForwardAnim); EnBigslime_GekkoSfxOutsideBigslime(this, NA_SE_EN_FROG_JUMP_ABOVE); EnBigslime_GekkoSfxOutsideBigslime(this, NA_SE_EN_UTSUBO_APPEAR_TRG); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_SLIME_JUMP1); + Actor_PlaySfx(&this->actor, NA_SE_EN_B_SLIME_JUMP1); this->riseCounter = 0; this->bigslimeCollider[0].base.atFlags &= ~AT_ON; this->actor.gravity = 0.0f; @@ -1515,7 +1515,7 @@ void EnBigslime_SetupCutsceneGrabPlayer(EnBigslime* this, PlayState* play) { this->subCamYawGrabPlayer += this->actor.world.rot.y; Animation_PlayLoop(&this->skelAnime, &gGekkoBoxingStanceAnim); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_SLIME_EAT); + Actor_PlaySfx(&this->actor, NA_SE_EN_B_SLIME_EAT); this->actionFunc = EnBigslime_CutsceneGrabPlayer; } @@ -1624,7 +1624,7 @@ void EnBigslime_AttackPlayerInBigslime(EnBigslime* this, PlayState* play) { } play->damagePlayer(play, -4); - func_800B8E58(player, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_DAMAGE_S); + Player_PlaySfx(player, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_DAMAGE_S); this->gekkoRot.y += (s16)(Rand_S16Offset(0x4000, 0x4000) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); this->gekkoPosOffset.x = Math_SinS(this->gekkoRot.y) * -50.0f; this->gekkoPosOffset.z = Math_CosS(this->gekkoRot.y) * -50.0f; @@ -1701,7 +1701,7 @@ void EnBigslime_WindupThrowPlayer(EnBigslime* this, PlayState* play) { this->gekkoPosOffset.z = Math_CosS(this->gekkoRot.y) * -50.0f; } else { if (this->windupPunchTimer == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_SLIME_REVERSE); + Actor_PlaySfx(&this->actor, NA_SE_EN_B_SLIME_REVERSE); EnBigslime_GekkoSfxInsideBigslime(this, NA_SE_EN_FROG_PUNCH1); } @@ -2284,7 +2284,7 @@ void EnBigslime_FormBigslime(EnBigslime* this, PlayState* play) { this->actor.speedXZ = 0.0f; Animation_PlayLoop(&this->skelAnime, &gGekkoSwimForwardAnim); this->formBigslimeCutsceneTimer--; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_SLIME_COMBINE); + Actor_PlaySfx(&this->actor, NA_SE_EN_B_SLIME_COMBINE); } else if (this->isAnimUpdate) { this->formBigslimeCutsceneTimer--; if (this->formBigslimeCutsceneTimer == 0) { @@ -2644,7 +2644,7 @@ void EnBigslime_ApplyDamageEffectGekko(EnBigslime* this, PlayState* play) { EnBigslime_SetupCutscene(this); } else if (this->actor.colChkInfo.damageEffect == BIGSLIME_DMGEFF_ELECTRIC_STUN) { this->stunTimer = 40; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->gekkoDrawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_SMALL; this->gekkoDrawDmgEffScale = 0.75f; this->gekkoDrawDmgEffAlpha = 2.0f; @@ -2652,7 +2652,7 @@ void EnBigslime_ApplyDamageEffectGekko(EnBigslime* this, PlayState* play) { } else if (this->actor.colChkInfo.damageEffect == BIGSLIME_DMGEFF_STUN || this->actor.colChkInfo.damageEffect == BIGSLIME_DMGEFF_DEKU_STUN) { this->stunTimer = 40; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); EnBigslime_SetupStunGekko(this); } else if (this->actor.colChkInfo.damageEffect == BIGSLIME_DMGEFF_ICE) { EnBigslime_GekkoFreeze(this); @@ -2722,7 +2722,7 @@ void EnBigslime_AddIceShardEffect(EnBigslime* this, PlayState* play) { } } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_BROKEN); + Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_BROKEN); EnBigslime_InitShockwave(this, play); } 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 08070b61d7..207e4f9620 100644 --- a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c +++ b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c @@ -182,7 +182,7 @@ s32 EnBjt_Appear(EnBjt* this) { s32 finished = false; if (!this->playedSfx) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_TOILET_HAND_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EV_TOILET_HAND_APPEAR); this->playedSfx = true; } @@ -207,7 +207,7 @@ s32 EnBjt_Vanish(EnBjt* this) { s32 finished = false; if (!this->playedSfx) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_TOILET_HAND_VANISH); + Actor_PlaySfx(&this->actor, NA_SE_EV_TOILET_HAND_VANISH); this->playedSfx = true; } @@ -292,7 +292,7 @@ s32 EnBjt_ChooseBehaviour(Actor* thisx, PlayState* play) { this->playedSfx = false; this->behaviour++; } else if (this->timer == 10) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_TOILET_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_TOILET_WATER); } break; 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 9e49ca0b17..bfedfda2c1 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -217,7 +217,7 @@ void func_80871058(EnBom* this, PlayState* play) { BINANG_SUB(this->actor.wallYaw - this->actor.world.rot.y + this->actor.wallYaw, 0x8000); } - Actor_PlaySfxAtPos(&this->actor, this->isPowderKeg ? NA_SE_EV_PUT_DOWN_WOODBOX : NA_SE_EV_BOMB_BOUND); + Actor_PlaySfx(&this->actor, this->isPowderKeg ? NA_SE_EV_PUT_DOWN_WOODBOX : NA_SE_EV_BOMB_BOUND); Actor_MoveWithGravity(&this->actor); this->actor.speedXZ *= 0.7f; this->actor.bgCheckFlags &= ~8; @@ -281,7 +281,7 @@ void func_80871058(EnBom* this, PlayState* play) { } if (this->actor.bgCheckFlags & 2) { - Actor_PlaySfxAtPos(&this->actor, this->isPowderKeg ? NA_SE_EV_TRE_BOX_BOUND : NA_SE_EV_BOMB_BOUND); + Actor_PlaySfx(&this->actor, this->isPowderKeg ? NA_SE_EV_TRE_BOX_BOUND : NA_SE_EV_BOMB_BOUND); if (this->actor.velocity.y < sp58->y) { if ((sp54 == 4) || (sp54 == 14) || (sp54 == 15)) { this->actor.velocity.y = 0.0f; @@ -462,7 +462,7 @@ void EnBom_Update(Actor* thisx, PlayState* play) { } if ((!this->isPowderKeg && (this->timer == 67)) || (this->isPowderKeg && (this->timer <= 2400))) { - Actor_PlaySfxAtPos(thisx, NA_SE_PL_TAKE_OUT_SHIELD); + Actor_PlaySfx(thisx, NA_SE_PL_TAKE_OUT_SHIELD); Actor_SetScale(thisx, enBomScales[this->isPowderKeg]); } @@ -491,7 +491,7 @@ void EnBom_Update(Actor* thisx, PlayState* play) { : (this->flashSpeedScale == 3) ? 1 : 2); } else { - Actor_PlaySfxAtPos(thisx, NA_SE_IT_BOMB_IGNIT - SFX_FLAG); + Actor_PlaySfx(thisx, NA_SE_IT_BOMB_IGNIT - SFX_FLAG); } sp80.y += 3.0f; @@ -545,9 +545,9 @@ void EnBom_Update(Actor* thisx, PlayState* play) { this->actionFunc = func_808715B8; if (this->isPowderKeg) { gSaveContext.powderKegTimer = 0; - Actor_PlaySfxAtPos(thisx, NA_SE_IT_BIG_BOMB_EXPLOSION); + Actor_PlaySfx(thisx, NA_SE_IT_BIG_BOMB_EXPLOSION); } else { - Actor_PlaySfxAtPos(thisx, NA_SE_IT_BOMB_EXPLOSION); + Actor_PlaySfx(thisx, NA_SE_IT_BOMB_EXPLOSION); } } } @@ -581,7 +581,7 @@ void EnBom_Update(Actor* thisx, PlayState* play) { this->unk_1FC = KREG(81) + 10; } else if (thisx->bgCheckFlags & 0x40) { thisx->bgCheckFlags &= ~0x40; - Actor_PlaySfxAtPos(thisx, NA_SE_EV_BOMB_DROP_WATER); + Actor_PlaySfx(thisx, NA_SE_EV_BOMB_DROP_WATER); } } } 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 da6e8d6d05..0e06574d80 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 @@ -123,27 +123,27 @@ void func_809C49CC(EnBomBowlMan* this) { if ((this->unk_2F8 == 5) && (Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 17.0f) || Animation_OnFrame(&this->skelAnime, 18.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_WALK); } if ((this->unk_2F8 == 0xB) && (Animation_OnFrame(&this->skelAnime, 4.0f) || Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 12.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_WALK); } if ((this->unk_2F8 == 0x12) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 4.0f) || Animation_OnFrame(&this->skelAnime, 6.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_WALK); } if ((this->unk_2F8 == 0xF) && Animation_OnFrame(&this->skelAnime, 15.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_LAND); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_LAND); } if ((this->unk_2F8 == 6) && Animation_OnFrame(&this->skelAnime, 8.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_LAND); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_LAND); } } 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 bcb7cb5348..cccddedfdf 100644 --- a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c +++ b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c @@ -136,7 +136,7 @@ void func_80C05C44(EnBombal* this, PlayState* play) { } SET_WEEKEVENTREG(WEEKEVENTREG_83_04); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MUJURA_BALLOON_BROKEN); + Actor_PlaySfx(&this->actor, NA_SE_EV_MUJURA_BALLOON_BROKEN); this->timer = 30; this->isPopped = true; this->actionFunc = func_80C05DE8; 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 2ca62ef0a0..7d678b8add 100644 --- a/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c +++ b/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c @@ -165,13 +165,13 @@ void func_80C038B4(EnBombers* this) { if ((this->unk_2C4 == 2) && (Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 17.0f) || Animation_OnFrame(&this->skelAnime, 18.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_WALK); } if ((this->unk_2C4 == 15) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 4.0f) || Animation_OnFrame(&this->skelAnime, 6.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_WALK); } } 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 74575628f6..3157c9d5b1 100644 --- a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c +++ b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c @@ -234,7 +234,7 @@ void func_80C04D8C(EnBombers2* this, PlayState* play) { this->textIdIndex = 6; this->actor.textId = sTextIds[this->textIdIndex]; func_80151938(play, this->actor.textId); - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_PIECE_OF_HEART); + Actor_PlaySfx(&this->actor, NA_SE_SY_PIECE_OF_HEART); this->talkState = TEXT_STATE_5; return; } @@ -266,7 +266,7 @@ void func_80C04D8C(EnBombers2* this, PlayState* play) { this->correctDigitSlots[j] = false; } this->textIdIndex = 4; - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_ERROR); + Actor_PlaySfx(&this->actor, NA_SE_SY_ERROR); this->actor.textId = sTextIds[this->textIdIndex]; func_80151938(play, this->actor.textId); this->talkState = TEXT_STATE_5; @@ -357,7 +357,7 @@ void EnBombers2_Update(Actor* thisx, PlayState* play) { if ((this->animIndex == 2) && (Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 17.0f) || Animation_OnFrame(&this->skelAnime, 18.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_WALK); } this->actor.shape.rot.y = this->actor.world.rot.y; if (this->unk_2C0 != 2) { 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 0b5ffff54d..fe0101ab4f 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -156,7 +156,7 @@ void func_808AEAE0(EnBombf* this, PlayState* play) { func_800B8C20(&this->actor, &bombf->actor, play); this->timer = 180; this->unk_204 = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_PULL_UP_ROCK); + Actor_PlaySfx(&this->actor, NA_SE_PL_PULL_UP_ROCK); this->actor.flags &= ~ACTOR_FLAG_1; } else { player->actor.child = NULL; @@ -352,7 +352,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) { this->actor.world.rot.y = BINANG_SUB(this->actor.wallYaw - this->actor.world.rot.y + this->actor.wallYaw, 0x8000); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMB_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_BOUND); Actor_MoveWithGravity(&this->actor); DREG(6) = 1; Actor_UpdateBgCheckInfo(play, &this->actor, 5.0f, 10.0f, 0.0f, 0x1F); @@ -378,7 +378,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) { if ((play->gameplayFrames % 2) == 0) { EffectSsGSpk_SpawnFuse(play, &this->actor, &sp68, &sp8C, &sp74); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_IGNIT - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_IT_BOMB_IGNIT - SFX_FLAG); sp68.y += 3.0f; func_800B0DE0(play, &sp68, &sp8C, &sp5C, &sp58, &sp58, 0x32, 5); } @@ -407,7 +407,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, sp68.x, sp68.y, sp68.z, 0, 0, 0, CLEAR_TAG_SMALL_EXPLOSION); - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); + Actor_PlaySfx(&this->actor, NA_SE_IT_BOMB_EXPLOSION); play->envCtx.lightSettings.diffuseColor1[0] = play->envCtx.lightSettings.diffuseColor1[1] = play->envCtx.lightSettings.diffuseColor1[2] = 250; @@ -445,7 +445,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) { if (this->actor.bgCheckFlags & 0x40) { this->actor.bgCheckFlags &= ~0x40; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMB_DROP_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_DROP_WATER); } } } 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 b17079b6eb..b0c879d0e7 100644 --- a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c +++ b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c @@ -219,21 +219,21 @@ void func_80BFE524(EnBomjima* this) { if ((this->animIndex == 5) && (Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 17.0f) || Animation_OnFrame(&this->skelAnime, 18.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_WALK); } if ((this->animIndex == 18) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 4.0f) || Animation_OnFrame(&this->skelAnime, 6.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_WALK); } if ((this->animIndex == 15) && Animation_OnFrame(&this->skelAnime, 15.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_LAND); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_LAND); } if ((this->animIndex == 6) && Animation_OnFrame(&this->skelAnime, 8.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_LAND); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_LAND); } } @@ -409,7 +409,7 @@ void func_80BFEB64(EnBomjima* this, PlayState* play) { this->unk_2DC = Math_Vec3f_Yaw(&this->actor.world.pos, &this->bombal->actor.world.pos); if (Animation_OnFrame(&this->skelAnime, 19.0f)) { this->unk_2C0 = 5; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_SHOT_BREATH); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_SHOT_BREATH); } if (this->unk_2C0 == 1) { @@ -848,7 +848,7 @@ void func_80BFFF54(EnBomjima* this, PlayState* play) { if (this->animIndex == 8) { if ((D_80C009F4 == 1) && Animation_OnFrame(&this->skelAnime, 7.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HUMAN_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EV_HUMAN_BOUND); D_80C009F4 = 2; } 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 7e07ed9d6d..5f852993ba 100644 --- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c +++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c @@ -185,20 +185,20 @@ void func_80C011CC(EnBomjimb* this) { if ((this->unk_2DC == 5) && (Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 17.0f) || Animation_OnFrame(&this->skelAnime, 18.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_WALK); } if ((this->unk_2DC == 19) && (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_WALK); } if ((this->unk_2DC == 18) && Animation_OnFrame(&this->skelAnime, 15.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_LAND); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_LAND); } if ((this->unk_2DC == 7) && Animation_OnFrame(&this->skelAnime, 8.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_LAND); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMBERS_LAND); } } @@ -451,7 +451,7 @@ void func_80C01CD0(EnBomjimb* this, PlayState* play) { } if ((this->unk_2C0 == 0) && (this->unk_2E4->bgCheckFlags & 1)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PUT_DOWN_WOODBOX); + Actor_PlaySfx(&this->actor, NA_SE_EV_PUT_DOWN_WOODBOX); this->unk_2C0 = 1; } @@ -693,7 +693,7 @@ void func_80C02740(EnBomjimb* this, PlayState* play) { if (gSaveContext.save.bombersCaughtNum > 4) { Audio_PlayFanfare(NA_BGM_GET_ITEM | 0x900); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_PIECE_OF_HEART); + Actor_PlaySfx(&this->actor, NA_SE_SY_PIECE_OF_HEART); } switch (this->unk_2C8) { @@ -749,7 +749,7 @@ void func_80C02A14(EnBomjimb* this, PlayState* play) { player->actor.freezeTimer = 3; if (this->unk_2E0 == 0) { if (Animation_OnFrame(&this->skelAnime, 7.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HUMAN_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EV_HUMAN_BOUND); this->unk_2E0 = 1; } } 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 aeaed963b0..afc91770f6 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -95,7 +95,7 @@ void func_808A24DC(EnBoom* this, PlayState* play) { EffectSsGSplash_Spawn(play, &sp34, NULL, NULL, 0, 300); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DIVE_INTO_WATER_L); + Actor_PlaySfx(&this->actor, NA_SE_EV_DIVE_INTO_WATER_L); EffectSsGRipple_Spawn(play, &sp34, 100, 500, 0); EffectSsGRipple_Spawn(play, &sp34, 100, 500, 4); 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 cbf9e9f3ca..6cfb05c686 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -247,7 +247,7 @@ void EnBubble_Fly(EnBubble* this, PlayState* play) { this->velocityFromBounce.y = this->bounceDirection.y * bounceSpeed; this->velocityFromBounce.z = this->bounceDirection.z * bounceSpeed; this->yVelocity = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AWA_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EN_AWA_BOUND); this->modelRotSpeed = 128.0f; this->modelEllipticity = 0.48f; } else if ((this->actor.bgCheckFlags & 0x20) && (bounceDirection.y < 0.0f)) { @@ -266,7 +266,7 @@ void EnBubble_Fly(EnBubble* this, PlayState* play) { this->velocityFromBounce.y = (this->bounceDirection.y * bounceSpeed); this->velocityFromBounce.z = (this->bounceDirection.z * bounceSpeed); this->yVelocity = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AWA_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EN_AWA_BOUND); this->modelRotSpeed = 128.0f; this->modelEllipticity = 0.48f; } 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 d32fe32ac9..92030934f3 100644 --- a/src/overlays/actors/ovl_En_Cha/z_en_cha.c +++ b/src/overlays/actors/ovl_En_Cha/z_en_cha.c @@ -84,12 +84,12 @@ void EnCha_Ring(EnCha* this, PlayState* play) { void EnCha_Idle(EnCha* this, PlayState* play) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_60_04)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DOOR_BELL); + Actor_PlaySfx(&this->actor, NA_SE_EV_DOOR_BELL); CLEAR_WEEKEVENTREG(WEEKEVENTREG_60_04); this->actor.home.rot.z = 0x7D0; } if (this->collider.base.acFlags & AC_HIT) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DOOR_BELL); + Actor_PlaySfx(&this->actor, NA_SE_EV_DOOR_BELL); this->actor.home.rot.z = 0x7D0; if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_51_04)) { SET_WEEKEVENTREG(WEEKEVENTREG_51_04); 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 b3038dd608..61304db8e8 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 @@ -167,7 +167,7 @@ void func_80AFDFB4(EnColMan* this, PlayState* play) { this->actor.speedXZ = 2.0f + BREG(56) + Rand_ZeroFloat(2.0f); this->actor.velocity.y = 12.0f + BREG(57) + Rand_ZeroFloat(5.0f); this->hasSetRandomValues = true; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ANSATSUSYA_ROCK); + Actor_PlaySfx(&this->actor, NA_SE_EN_ANSATSUSYA_ROCK); return; } @@ -210,7 +210,7 @@ void func_80AFE25C(EnColMan* this, PlayState* play) { } } - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); + Actor_PlaySfx(&this->actor, NA_SE_IT_BOMB_EXPLOSION); Actor_Kill(&this->actor); } } 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 4e9040d83a..e6262dad02 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -344,7 +344,7 @@ void EnCow_Update(Actor* thisx, PlayState* play2) { if (SkelAnime_Update(&this->skelAnime)) { if (this->skelAnime.animation == &gCowChewAnim) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_COW_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EV_COW_CRY); Animation_Change(&this->skelAnime, &gCowMooAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gCowMooAnim), ANIMMODE_ONCE, 1.0f); } else { 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 8ffdc6b247..43f6349408 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -189,7 +189,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) { } else { this->yawTarget -= Rand_S16Offset(0x1000, 0x1000); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_CRY); } if ((this->actor.depthInWater > -40.0f) || (this->actor.bgCheckFlags & 1)) { @@ -278,7 +278,7 @@ void EnCrow_DiveAttack(EnCrow* this, PlayState* play) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_ATTACK); } EnCrow_SetupFlyIdle(this); } @@ -303,7 +303,7 @@ void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) { this->actor.bgCheckFlags &= ~1; scale = (this->actor.scale.x * 100.0f); this->actor.world.pos.y += 20.0f * scale; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_DEAD); if (this->actor.colChkInfo.damageEffect == GUAY_DMGEFF_ICE) { this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX; @@ -393,7 +393,7 @@ void EnCrow_SetupTurnAway(EnCrow* this) { } else { Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->actionFunc = EnCrow_TurnAway; } @@ -528,7 +528,7 @@ void EnCrow_Update(Actor* thisx, PlayState* play) { Actor_SetFocus(&this->actor, height); if ((this->actor.colChkInfo.health != 0) && (Animation_OnFrame(&this->skelAnime, 3.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_FLUTTER); + Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_FLUTTER); } if (this->drawDmgEffAlpha > 0.0f) { if (this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { 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 2101797744..4e4285b521 100644 --- a/src/overlays/actors/ovl_En_Dai/z_en_dai.c +++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.c @@ -291,7 +291,7 @@ s32 func_80B3E96C(EnDai* this, PlayState* play) { break; case 1: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SNOWSTORM_HARD); + Actor_PlaySfx(&this->actor, NA_SE_EV_SNOWSTORM_HARD); Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WEATHER_TAG, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0x1388, 0x708, 0x3E8, 0); func_80B3E5DC(this, 3); @@ -456,7 +456,7 @@ void func_80B3F044(EnDai* this, PlayState* play) { break; case 2: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROLL_AND_FALL); + Actor_PlaySfx(&this->actor, NA_SE_EV_ROLL_AND_FALL); break; case 3: @@ -479,27 +479,27 @@ void func_80B3F044(EnDai* this, PlayState* play) { case 2: if (play->csCtx.frames == 360) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIGOLON_SLEEP3 - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_DAIGOLON_SLEEP3 - SFX_FLAG); } if (Animation_OnFrame(&this->skelAnime, 43.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_GORON_BOUND_1); + Actor_PlaySfx(&this->actor, NA_SE_EV_GORON_BOUND_1); } this->unk_1D6 = func_80B3E8BC(this, this->unk_1CC); break; case 3: if (Animation_OnFrame(&this->skelAnime, 6.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIGOLON_SLEEP1); + Actor_PlaySfx(&this->actor, NA_SE_EN_DAIGOLON_SLEEP1); } this->unk_1D6 = func_80B3E8BC(this, this->unk_1CC); break; case 4: if (Animation_OnFrame(&this->skelAnime, 30.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIGOLON_SLEEP2); + Actor_PlaySfx(&this->actor, NA_SE_EN_DAIGOLON_SLEEP2); } if (Animation_OnFrame(&this->skelAnime, 35.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_GORON_BOUND_0); + Actor_PlaySfx(&this->actor, NA_SE_EV_GORON_BOUND_0); } this->unk_1D6 = func_80B3E8BC(this, this->unk_1CC); break; 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 0e5e7a3eab..f0c1dd47ad 100644 --- a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c +++ b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c @@ -234,7 +234,7 @@ void func_80BE66E4(EnDaiku2* this, PlayState* play) { func_800B8614(&this->actor, play, 80.0f); if ((this->unk_276 == 8) && Animation_OnFrame(&this->skelAnime, 6.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROCK_BROKEN); + Actor_PlaySfx(&this->actor, NA_SE_EV_ROCK_BROKEN); for (i = 0; i < 10; i++) { Math_Vec3f_Copy(&sp70, &this->actor.world.pos); 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 45b851271a..6a75aedc34 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -363,7 +363,7 @@ void EnDekubaba_SetupGrow(EnDekubaba* this) { this->collider.base.colType = COLTYPE_HIT6; this->collider.base.acFlags &= ~AC_HARD; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_WAKEUP); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKU_WAKEUP); this->actionFunc = EnDekubaba_Grow; } @@ -520,9 +520,9 @@ void EnDekubaba_DecideLunge(EnDekubaba* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f)) { if (this->actor.params == DEKUBABA_BIG) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_MOUTH); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKU_MOUTH); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIZUBABA1_MOUTH); + Actor_PlaySfx(&this->actor, NA_SE_EN_MIZUBABA1_MOUTH); } } @@ -604,9 +604,9 @@ void EnDekubaba_Lunge(EnDekubaba* this, PlayState* play) { if (this->timer == 0) { if (Animation_OnFrame(&this->skelAnime, 1.0f)) { if (this->actor.params == DEKUBABA_BIG) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKU_ATTACK); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIZUBABA1_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_MIZUBABA1_ATTACK); } } @@ -638,9 +638,9 @@ void EnDekubaba_Lunge(EnDekubaba* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f)) { if (this->actor.params == DEKUBABA_BIG) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_MOUTH); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKU_MOUTH); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIZUBABA1_MOUTH); + Actor_PlaySfx(&this->actor, NA_SE_EN_MIZUBABA1_MOUTH); } } } @@ -729,7 +729,7 @@ void EnDekubaba_PullBack(EnDekubaba* this, PlayState* play) { } else { this->timer++; if (this->timer == 10) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_SCRAPE); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKU_SCRAPE); } if (this->timer >= 12) { @@ -872,7 +872,7 @@ void EnDekubaba_PrunedSomersaultDie(EnDekubaba* this, PlayState* play) { } if (this->actor.bgCheckFlags & 2) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); this->timer = 1; } } else if (this->timer == 1) { @@ -1149,9 +1149,9 @@ void EnDekubaba_UpdateDamage(EnDekubaba* this, PlayState* play) { if (this->actor.colChkInfo.health != 0) { if ((this->timer == 2) || (this->timer == 3)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKU_DAMAGE); } } else { Enemy_StartFinishingBlow(play, &this->actor); @@ -1164,9 +1164,9 @@ void EnDekubaba_UpdateDamage(EnDekubaba* this, PlayState* play) { } if (this->actor.params == DEKUBABA_BIG) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKU_DEAD); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_JR_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKU_JR_DEAD); } } } 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 4bf0f20d5b..15a2401f86 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -188,7 +188,7 @@ void func_808BD49C(EnDekunuts* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 9.0f)) { this->collider.base.acFlags |= AC_ON; } else if (Animation_OnFrame(&this->skelAnime, 8.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_UP); } this->collider.dim.height = (s32)((CLAMP(this->skelAnime.curFrame, 9.0f, 12.0f) - 9.0f) * 9.0f) + 5; @@ -320,7 +320,7 @@ void func_808BDA4C(EnDekunuts* this, PlayState* play) { if (Actor_Spawn(&play->actorCtx, play, ACTOR_EN_NUTSBALL, pos.x, pos.y, pos.z, this->actor.world.rot.x, this->actor.shape.rot.y, 0, params) != NULL) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_THROW); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_THROW); } } else if ((this->unk_190 >= 2) && Animation_OnFrame(&this->skelAnime, 12.0f)) { Animation_MorphToPlayOnce(&this->skelAnime, &gDekuScrubSpitAnim, -3.0f); @@ -333,7 +333,7 @@ void func_808BDA4C(EnDekunuts* this, PlayState* play) { void func_808BDC9C(EnDekunuts* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gDekuScrubBurrowAnim, -5.0f); this->unk_190 = 0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DOWN); this->actionFunc = func_808BDD54; } @@ -341,7 +341,7 @@ void func_808BDCF0(EnDekunuts* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gDekuScrubBurrowAnim, -5.0f); this->collider.base.acFlags &= ~AC_ON; this->unk_190 = 80; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DOWN); this->actionFunc = func_808BDD54; } @@ -369,7 +369,7 @@ void func_808BDE7C(EnDekunuts* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gDekuScrubUnburrowAnim, -3.0f); this->collider.dim.height = 37; this->actor.colChkInfo.mass = 50; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DAMAGE); this->actor.world.rot.x = 0; this->actor.flags |= ACTOR_FLAG_20; this->collider.base.acFlags &= ~AC_ON; @@ -405,7 +405,7 @@ void func_808BDFB8(EnDekunuts* this, PlayState* play) { } if (this->unk_18C != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); this->unk_18C = 0; } else { this->unk_18C = 1; @@ -477,8 +477,8 @@ void func_808BE294(EnDekunuts* this, s32 arg1) { this->actor.world.rot.x = 0; this->collider.base.acFlags &= ~AC_ON; this->actionFunc = func_808BE358; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DAMAGE); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_CUTBODY); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_CUTBODY); Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, Animation_GetLastFrame(&gDekuScrubDamageAnim)); } @@ -521,7 +521,7 @@ void func_808BE484(EnDekunuts* this) { Animation_PlayOnce(&this->skelAnime, &gDekuScrubDieAnim); this->actionFunc = func_808BE4D4; this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DEAD); } void func_808BE4D4(EnDekunuts* this, PlayState* play) { @@ -594,7 +594,7 @@ void func_808BE73C(EnDekunuts* this, PlayState* play) { if (this->actor.colChkInfo.damageEffect == 1) { this->unk_190 = 40; Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); func_808BE3A8(this); return; } 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 d9bebb4046..fe8143b15e 100644 --- a/src/overlays/actors/ovl_En_Dg/z_en_dg.c +++ b/src/overlays/actors/ovl_En_Dg/z_en_dg.c @@ -368,31 +368,31 @@ void EnDg_SpawnFloorDustRing(EnDg* this, PlayState* play) { void EnDg_PlaySfxWalk(EnDg* this) { if (Animation_OnFrame(&this->skelAnime, 1.0f) || Animation_OnFrame(&this->skelAnime, 7.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MONKEY_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_MONKEY_WALK); } } void EnDg_PlaySfxBark(EnDg* this, f32 frame) { if (Animation_OnFrame(&this->skelAnime, frame)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_BARK); + Actor_PlaySfx(&this->actor, NA_SE_EV_SMALL_DOG_BARK); } } void EnDg_PlaySfxAngryBark(EnDg* this, f32 frame) { if (Animation_OnFrame(&this->skelAnime, frame)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_ANG_BARK); + Actor_PlaySfx(&this->actor, NA_SE_EV_SMALL_DOG_ANG_BARK); } } void EnDg_PlaySfxWhine(EnDg* this) { if (Animation_OnFrame(&this->skelAnime, 23.0f) || Animation_OnFrame(&this->skelAnime, 28.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_WHINE); + Actor_PlaySfx(&this->actor, NA_SE_EV_SMALL_DOG_WHINE); } } void EnDg_PlaySfxGrowl(EnDg* this, f32 frame) { if (Animation_OnFrame(&this->skelAnime, frame)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_GROAN); + Actor_PlaySfx(&this->actor, NA_SE_EV_SMALL_DOG_GROAN); } } @@ -481,7 +481,7 @@ void EnDg_TryPickUp(EnDg* this, PlayState* play) { } if (Actor_HasParent(&this->actor, play)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_BARK); + Actor_PlaySfx(&this->actor, NA_SE_EV_SMALL_DOG_BARK); this->grabState = DOG_GRAB_STATE_HELD; sSelectedRacetrackDogInfo = sRacetrackDogInfo[this->index]; if (!sIsAnyDogHeld) { @@ -562,7 +562,7 @@ void EnDg_CheckForBremenMaskMarch(EnDg* this, PlayState* play) { } else if ((this->actionFunc == EnDg_ApproachPlayer) || (this->actionFunc == EnDg_SitNextToPlayer)) { if (DECR(this->bremenBarkTimer) == 0) { this->bremenBarkTimer = 10; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_BARK); + Actor_PlaySfx(&this->actor, NA_SE_EV_SMALL_DOG_BARK); } } } @@ -778,9 +778,9 @@ void EnDg_RunAwayFromGoron(EnDg* this, PlayState* play) { EnDg_PlaySfxWalk(this); if (Animation_OnFrame(&this->skelAnime, 3.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EV_SMALL_DOG_CRY); } else if (Animation_OnFrame(&this->skelAnime, 6.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MONKEY_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_MONKEY_WALK); } } @@ -960,7 +960,7 @@ void EnDg_WalkToPlayer(EnDg* this, PlayState* play) { void EnDg_SetupBremenMaskApproachPlayer(EnDg* this, PlayState* play) { if (func_801A46F8() == 1) { this->bremenBarkTimer = 10; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_BARK); + Actor_PlaySfx(&this->actor, NA_SE_EV_SMALL_DOG_BARK); this->actionFunc = EnDg_ApproachPlayer; } } @@ -1064,7 +1064,7 @@ void EnDg_BackAwayFromPlayer(EnDg* this, PlayState* play) { } EnDg_PlaySfxWalk(this); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_GROAN); + Actor_PlaySfx(&this->actor, NA_SE_EV_SMALL_DOG_GROAN); } /** @@ -1106,7 +1106,7 @@ void EnDg_SetupSwim(EnDg* this, PlayState* play) { this->actor.gravity = 0.0f; this->actor.velocity.y = -3.0f; this->swimTimer = 10; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMB_DROP_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_DROP_WATER); this->actionFunc = EnDg_Swim; } @@ -1138,7 +1138,7 @@ void EnDg_Swim(EnDg* this, PlayState* play) { if (DECR(this->swimTimer) == 0) { if (!(this->dogFlags & DOG_FLAG_SWIMMING)) { this->dogFlags |= DOG_FLAG_SWIMMING; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OUT_OF_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_OUT_OF_WATER); } this->swimTimer = 5; @@ -1181,7 +1181,7 @@ void EnDg_Swim(EnDg* this, PlayState* play) { this->dogFlags &= ~DOG_FLAG_SWIMMING; this->behavior = DOG_BEHAVIOR_DEFAULT; this->timer = Rand_S16Offset(60, 60); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OUT_OF_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_OUT_OF_WATER); EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f); this->actionFunc = EnDg_IdleMove; @@ -1227,7 +1227,7 @@ void EnDg_JumpOutOfWater(EnDg* this, PlayState* play) { this->actor.velocity.y = 10.0f; this->actor.gravity = -3.0f; this->timer = Rand_S16Offset(60, 60); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OUT_OF_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_OUT_OF_WATER); EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); this->actionFunc = EnDg_IdleMove; Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f); @@ -1263,7 +1263,7 @@ void EnDg_Thrown(EnDg* this, PlayState* play) { if (this->actor.bgCheckFlags & 1) { if (this->dogFlags & DOG_FLAG_THROWN) { this->dogFlags &= ~DOG_FLAG_THROWN; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MONKEY_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_MONKEY_WALK); } this->actor.speedXZ = 0.0f; 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 687ea75578..53889ac175 100644 --- a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c +++ b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c @@ -418,7 +418,7 @@ s32 func_8089AE00(EnDinofos* this, PlayState* play) { temp_v1 = (Actor_WorldYawTowardActor(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_28E; if (ABS_ALT(temp_v1) < 0x3000) { func_8089D11C(this, temp_v1 + this->unk_28E); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WARAU); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_WARAU); return true; } } @@ -428,7 +428,7 @@ s32 func_8089AE00(EnDinofos* this, PlayState* play) { temp_v1_2 = (Actor_WorldYawTowardActor(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_28E; if (ABS_ALT(temp_v1_2) < 0x3000) { func_8089C024(this, 1); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WARAU); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_WARAU); return true; } } @@ -445,7 +445,7 @@ s32 func_8089AE00(EnDinofos* this, PlayState* play) { } else { func_8089C024(this, 3); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WARAU); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_WARAU); return true; } @@ -496,7 +496,7 @@ void func_8089B288(EnDinofos* this, PlayState* play) { void func_8089B320(EnDinofos* this) { this->actor.gravity = -2.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_CRY); this->unk_2BC.x = (Math_SinS(this->actor.shape.rot.y - 0x0E00) * 86.0f) + this->actor.world.pos.x; this->unk_2BC.y = this->actor.floorHeight + 6.0f; this->unk_2BC.z = (Math_CosS(this->actor.shape.rot.y - 0x0E00) * 86.0f) + this->actor.world.pos.z; @@ -536,7 +536,7 @@ void func_8089B4A4(EnDinofos* this) { this->unk_2BC.x = (Math_SinS(this->actor.shape.rot.y + 0x200) * 123.0f) + this->actor.world.pos.x; this->unk_2BC.y = this->actor.floorHeight + 11.0f; this->unk_2BC.z = (Math_CosS(this->actor.shape.rot.y + 0x200) * 123.0f) + this->actor.world.pos.z; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BOMCHU_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_BOMCHU_WALK); this->unk_290 = 0; this->unk_292 = -1; this->actionFunc = func_8089B580; @@ -578,7 +578,7 @@ void func_8089B6E8(EnDinofos* this) { void func_8089B72C(EnDinofos* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 2.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_ATTACK); } if (SkelAnime_Update(&this->skelAnime)) { @@ -666,7 +666,7 @@ void func_8089B98C(EnDinofos* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_WALK); } } } @@ -787,7 +787,7 @@ void func_8089BD28(EnDinofos* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 5.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_WALK); } } } @@ -836,7 +836,7 @@ void func_8089C164(EnDinofos* this) { } this->actor.bgCheckFlags &= ~1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_JUMP); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_JUMP); this->actionFunc = func_8089C1F8; } @@ -851,7 +851,7 @@ void func_8089C244(EnDinofos* this) { this->actor.bgCheckFlags &= ~1; this->actor.speedXZ = 8.0f; this->actor.velocity.y = 16.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_JUMP); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_JUMP); this->unk_290 = 0; this->unk_292 = -1; this->actionFunc = func_8089C2A8; @@ -888,7 +888,7 @@ void func_8089C398(EnDinofos* this) { this->actor.speedXZ = 0.0f; func_8089AD70(this); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BOMCHU_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_BOMCHU_WALK); this->actionFunc = func_8089C44C; } @@ -906,7 +906,7 @@ void func_8089C44C(EnDinofos* this, PlayState* play) { void func_8089C4F8(EnDinofos* this) { Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_0025B4); this->colliderQuad.base.atFlags &= ~AT_BOUNCED; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_CRY); this->unk_290 = 0; this->unk_292 = -1; this->actor.speedXZ = 0.0f; @@ -928,7 +928,7 @@ void func_8089C56C(EnDinofos* this, PlayState* play) { } else if (Animation_OnFrame(&this->skelAnime, 13.0f)) { this->colliderQuad.base.atFlags &= ~AT_ON; } else if (Animation_OnFrame(&this->skelAnime, 11.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_ATTACK); } else if (this->skelAnime.curFrame < 7.0f) { func_8089AE00(this, play); } @@ -994,7 +994,7 @@ void func_8089C87C(EnDinofos* this, s32 arg1) { this->actor.velocity.y = 0.0f; } this->unk_28E = 0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_DAMAGE); this->colliderJntSph.base.acFlags &= ~AC_ON; Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 18); this->actionFunc = func_8089C938; @@ -1129,7 +1129,7 @@ void func_8089CF70(EnDinofos* this, PlayState* play) { void func_8089CFAC(EnDinofos* this) { Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_00ABD0); this->actor.flags &= ~ACTOR_FLAG_1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_DEAD); this->actor.speedXZ = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = func_8089D018; @@ -1157,7 +1157,7 @@ void func_8089D018(EnDinofos* this, PlayState* play) { this->actor.shape.shadowAlpha = this->unk_288; } else if (Animation_OnFrame(&this->skelAnime, 26.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GERUDOFT_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_DOWN); } } @@ -1191,7 +1191,7 @@ void func_8089D1E0(EnDinofos* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 5.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_WALK); } } @@ -1304,7 +1304,7 @@ s32 func_8089D60C(EnDinofos* this, PlayState* play) { if (this->actor.colChkInfo.damageEffect == 1) { this->unk_290 = 40; Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); func_8089C784(this); return true; } @@ -1315,7 +1315,7 @@ s32 func_8089D60C(EnDinofos* this, PlayState* play) { this->drawDmgEffScale = 0.55f; this->drawDmgEffAlpha = 2.0f; this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_MEDIUM; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); func_8089C784(this); return true; } 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 ee035f06b1..fd60eca757 100644 --- a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c +++ b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c @@ -433,11 +433,11 @@ void func_80A52074(EnDnk* this, PlayState* play) { break; case 438: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKNUTS_DANCE_BIG); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKNUTS_DANCE_BIG); break; case 493: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_APPEAR); break; } 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 15a34821ad..c7f3ee2dc4 100644 --- a/src/overlays/actors/ovl_En_Dno/z_en_dno.c +++ b/src/overlays/actors/ovl_En_Dno/z_en_dno.c @@ -637,7 +637,7 @@ void func_80A725F8(EnDno* this, PlayState* play) { if (this->skelAnime.curFrame <= 23.0f) { this->unk_452 = 3; if (Animation_OnFrame(&this->skelAnime, 23.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OPEN_AMBRELLA); + Actor_PlaySfx(&this->actor, NA_SE_EV_OPEN_AMBRELLA); } } else if (this->skelAnime.curFrame <= 24.0f) { this->unk_452 = 4; @@ -903,7 +903,7 @@ void func_80A732C8(EnDno* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 4.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOSE_AMBRELLA); + Actor_PlaySfx(&this->actor, NA_SE_EV_CLOSE_AMBRELLA); this->unk_452 = 4; } else if (Animation_OnFrame(&this->skelAnime, 5.0f)) { this->unk_452 = 3; 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 b504e9a115..f067c3988c 100644 --- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c +++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c @@ -133,37 +133,37 @@ s32 func_80B3CA20(EnDnp* this) { 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); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_TURN); } } 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); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_TURN); } } else if (this->animIndex == EN_DNP_ANIM_GREETING) { if (Animation_OnFrame(&this->skelAnime, 7.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_GREET); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_GREET); } if (Animation_OnFrame(&this->skelAnime, 22.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_GREET2); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_GREET2); } } else if (this->animIndex == EN_DNP_ANIM_BOW) { if (Animation_OnFrame(&this->skelAnime, 9.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_GREET); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_GREET); } if (Animation_OnFrame(&this->skelAnime, 18.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_GREET2); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_GREET2); } } 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); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_WALK); } } else if (this->animIndex == EN_DNP_ANIM_JUMP) { if (Animation_OnFrame(&this->skelAnime, 17.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_WALK); } } 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); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_WALK); } } @@ -311,7 +311,7 @@ void func_80B3D11C(EnDnp* this, PlayState* play) { } if (this->animIndex == EN_DNP_ANIM_ANGRY_START) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_DHVO04); + Actor_PlaySfx(&this->actor, NA_SE_VO_DHVO04); } if (this->animIndex == EN_DNP_ANIM_GLARE_START) { 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 4b1087311c..131a27d74a 100644 --- a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c +++ b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c @@ -403,7 +403,7 @@ void func_80A53038(EnDnq* this, PlayState* play) { } if ((this->unk_398 == 4) && Animation_OnFrame(&this->skelAnime, 2.0f)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_KINGNUTS_DAMAGE); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_KINGNUTS_DAMAGE); } if (((this->unk_398 == 3) || (this->unk_398 == 6)) && 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 a8a94d9a4e..7210e4cc6c 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -92,7 +92,7 @@ void func_8092C5C0(EnDns* this) { if (((this->animIndex == EN_DNS_ANIM_WALK_1) || (this->animIndex == EN_DNS_ANIM_WALK_2) || (this->animIndex == EN_DNS_ANIM_RUN_START) || (this->animIndex == EN_DNS_ANIM_RUN_LOOP)) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 3.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); } } @@ -315,7 +315,7 @@ s32 func_8092CE38(EnDns* this) { this->unk_2C6 &= ~0x200; this->skelAnime.curFrame = 0.0f; if (this->unk_2D2 == 2) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_JUMP); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_JUMP); } this->unk_2D2++; if (this->unk_2D2 >= 3) { @@ -328,7 +328,7 @@ s32 func_8092CE38(EnDns* this) { this->actor.world.rot.y = BINANG_ROT180(this->actor.world.rot.y); this->unk_2E4 = 0.0f; this->actor.shape.rot.y = this->actor.world.rot.y; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_JUMP); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_JUMP); } else if (this->skelAnime.curFrame < 13.0f) { frame = this->skelAnime.curFrame; this->actor.shape.rot.y = this->actor.world.rot.y; @@ -339,7 +339,7 @@ s32 func_8092CE38(EnDns* this) { } else { if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 6.0f) || Animation_OnFrame(&this->skelAnime, 13.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); } if (this->skelAnime.curFrame > 7.0f) { 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 e883a6f507..81044f5da5 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -568,13 +568,13 @@ void func_80877500(EnDodongo* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 19.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_WALK); sp30.x = this->collider1Elements[2].dim.worldSphere.center.x; sp30.y = this->collider1Elements[2].dim.worldSphere.center.y; sp30.z = this->collider1Elements[2].dim.worldSphere.center.z; func_80876930(this, play, &sp30); } else if (Animation_OnFrame(&this->skelAnime, 39.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_WALK); sp30.x = this->collider1Elements[1].dim.worldSphere.center.x; sp30.y = this->collider1Elements[1].dim.worldSphere.center.y; sp30.z = this->collider1Elements[1].dim.worldSphere.center.z; @@ -641,7 +641,7 @@ void func_8087784C(EnDodongo* this, PlayState* play) { f32 temp_f12; if (Animation_OnFrame(&this->skelAnime, 24.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_CRY); } if (func_8087721C(this)) { @@ -728,7 +728,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); + Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_EAT); if (this->actor.child != NULL) { Actor_Kill(this->actor.child); this->actor.child = NULL; @@ -751,7 +751,7 @@ void func_80877E60(EnDodongo* this, PlayState* play) { this->unk_334 * 10.0f, 10); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); + Actor_PlaySfx(&this->actor, NA_SE_IT_BOMB_EXPLOSION); if (this->actor.colChkInfo.health <= 4) { this->actor.colChkInfo.health = 0; Enemy_StartFinishingBlow(play, &this->actor); @@ -810,7 +810,7 @@ void func_80878354(EnDodongo* this) { sp18 = &object_dodongo_Anim_003B14; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_TAIL); + Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_TAIL); Animation_PlayOnceSetSpeed(&this->skelAnime, sp18, 2.0f); this->timer = 0; this->collider1.base.atFlags |= AT_ON; @@ -871,7 +871,7 @@ void func_808785B0(EnDodongo* this, PlayState* play) { void func_8087864C(EnDodongo* this) { Animation_MorphToPlayOnce(&this->skelAnime, &object_dodongo_Anim_001A44, -4.0f); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_DAMAGE); this->timer = 0; this->unk_304 = 0; this->actor.speedXZ = 0.0f; @@ -893,7 +893,7 @@ void func_80878724(EnDodongo* this) { Animation_MorphToPlayOnce(&this->skelAnime, &object_dodongo_Anim_0013C4, -8.0f); this->timer = 0; this->unk_304 = 0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_DEAD); this->actor.flags &= ~ACTOR_FLAG_1; this->actor.speedXZ = 0.0f; Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); @@ -921,7 +921,7 @@ void func_808787B0(EnDodongo* this, PlayState* play) { this->timer = 8; } } else if (Animation_OnFrame(&this->skelAnime, 52.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GERUDOFT_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_DOWN); } if (this->timer != 0) { @@ -995,12 +995,12 @@ void EnDodongo_UpdateDamage(EnDodongo* this, PlayState* play) { } else if (this->actor.colChkInfo.damageEffect == 1) { this->timer = 40; Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); func_80878594(this); } else if (this->actor.colChkInfo.damageEffect == 5) { this->timer = 40; Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_SMALL; this->drawDmgEffScale = 0.75f; this->drawDmgEffAlpha = 2.0f; @@ -1026,7 +1026,7 @@ void EnDodongo_Update(Actor* thisx, PlayState* play2) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 60.0f, 70.0f, 0x1D); if (this->actor.bgCheckFlags & 2) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GERUDOFT_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_DOWN); } CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider1.base); 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 0df2b693eb..bb0b1d37ff 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -484,11 +484,11 @@ void func_80866B20(EnDoor* this, PlayState* play) { if (this->unk_1A6 != 0) { gSaveContext.save.inventory.dungeonKeys[gSaveContext.mapIndex]--; Flags_SetSwitch(play, this->switchFlag); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK); } } else if (this->unk_1A7 != 0) { this->actionFunc = func_80866F94; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_DOOR_OPEN); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_DOOR_OPEN); } else if (!Player_InCsMode(play)) { Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &playerPosRelToDoor, &player->actor.world.pos); if (D_80867BC0 || ((fabsf(playerPosRelToDoor.y) < 20.0f) && (fabsf(playerPosRelToDoor.x) < 20.0f) && @@ -545,7 +545,7 @@ void func_80866B20(EnDoor* this, PlayState* play) { func_80122F28(player); } } else if ((this->unk_1A4 == 4) && (this->dyna.actor.xzDistToPlayer > 240.0f)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_DOOR_OPEN); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_DOOR_OPEN); this->actionFunc = func_80867080; } } @@ -566,7 +566,7 @@ void func_80866F94(EnDoor* this, PlayState* play) { } else { if (Math_ScaledStepToS(&this->dyna.actor.world.rot.y, 0, 0x7D0)) { this->actionFunc = func_80866B20; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_AUTO_DOOR_CLOSE); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_AUTO_DOOR_CLOSE); } } } @@ -587,7 +587,7 @@ void func_80867080(EnDoor* this, PlayState* play) { void func_808670F0(EnDoor* this, PlayState* play) { if (Math_ScaledStepToS(&this->dyna.actor.world.rot.y, 0, 0x700)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_DOOR_CLOSE); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_DOOR_CLOSE); this->actionFunc = func_80866B20; } } @@ -601,7 +601,7 @@ void func_80867144(EnDoor* this, PlayState* play) { this->actionFunc = func_80866B20; this->unk_1A1 = 0; } else if (Animation_OnFrame(&this->skelAnime, sAnimOpenFrames[this->animIndex])) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_OC_DOOR_OPEN); + Actor_PlaySfx(&this->dyna.actor, NA_SE_OC_DOOR_OPEN); if (this->skelAnime.playSpeed < 1.5f) { numEffects = (s32)(Rand_ZeroOne() * 30.0f) + 50; for (i = 0; i < numEffects; i++) { @@ -609,7 +609,7 @@ void func_80867144(EnDoor* this, PlayState* play) { } } } else if (Animation_OnFrame(&this->skelAnime, sAnimCloseFrames[this->animIndex])) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_DOOR_CLOSE); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_DOOR_CLOSE); } } } 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 83b93cf529..4ff68de3e7 100644 --- a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c +++ b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c @@ -362,7 +362,7 @@ void EnDragon_RetreatOrIdle(EnDragon* this, PlayState* play) { void EnDragon_SetupExtend(EnDragon* this) { this->state = 0; this->behindJawRetreatTimer = this->state; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_UTSUBO_APPEAR_TRG); + Actor_PlaySfx(&this->actor, NA_SE_EN_UTSUBO_APPEAR_TRG); this->retreatTimer = 250; this->actionFunc = EnDragon_Extend; } @@ -375,17 +375,17 @@ void EnDragon_Extend(EnDragon* this, PlayState* play) { EnDragon_SpawnBubbles(this, play, this->jawPos); if (this->action >= DEEP_PYTHON_ACTION_DAMAGE) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_UTSUBO_BACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_UTSUBO_BACK); EnDragon_SetupRetreatOrIdle(this); } else if (this->retreatTimer == 0) { this->action = DEEP_PYTHON_ACTION_RETREAT; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_UTSUBO_BACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_UTSUBO_BACK); EnDragon_SetupRetreatOrIdle(this); } else if (this->state == DEEP_PYTHON_EXTEND_STATE_NOT_FULLY_EXTENDED) { Vec3f extendedPos; Math_Vec3f_Copy(&extendedPos, &this->burrowEntrancePos); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_UTSUBO_APPEAR - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_UTSUBO_APPEAR - SFX_FLAG); extendedPos.x += Math_SinS(this->actor.world.rot.y) * -530.0f; extendedPos.z += Math_CosS(this->actor.world.rot.y) * -530.0f; this->actor.speedXZ = 40.0f; @@ -439,7 +439,7 @@ void EnDragon_Extend(EnDragon* this, PlayState* play) { this->behindJawRetreatTimer++; if (this->behindJawRetreatTimer > 60) { this->action = DEEP_PYTHON_ACTION_RETREAT; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_UTSUBO_BACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_UTSUBO_BACK); EnDragon_SetupRetreatOrIdle(this); } } @@ -543,7 +543,7 @@ void EnDragon_Grab(EnDragon* this, PlayState* play) { player->actor.parent = &this->actor; player->unk_AE8 = 50; this->action = DEEP_PYTHON_ACTION_GRAB; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_UTSUBO_EAT); + Actor_PlaySfx(&this->actor, NA_SE_EN_UTSUBO_EAT); EnDragon_SetupAttack(this); } } @@ -572,8 +572,8 @@ void EnDragon_Attack(EnDragon* this, PlayState* play) { //! @bug: This function should only pass Player*: it uses *(this + 0x153), which is meant to be //! player->currentMask, but in this case is garbage in the skelAnime - func_800B8E58((Player*)this, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_DAMAGE_S); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_UTSUBO_BITE); + Player_PlaySfx((Player*)&this->actor, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_DAMAGE_S); + Actor_PlaySfx(&this->actor, NA_SE_EN_UTSUBO_BITE); CollisionCheck_GreenBlood(play, NULL, &player->actor.world.pos); } @@ -603,7 +603,7 @@ void EnDragon_Attack(EnDragon* this, PlayState* play) { Math_ApproachF(&this->actor.world.pos.z, pos.z, 0.3f, 200.0f); if ((this->state <= DEEP_PYTHON_ATTACK_STATE_START) && (this->endFrame <= currentFrame)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_UTSUBO_BITE); + Actor_PlaySfx(&this->actor, NA_SE_EN_UTSUBO_BITE); if (this->animIndex != DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY) { EnDragon_ChangeAnim(this, DEEP_PYTHON_ANIM_LARGE_SIDE_SWAY); } @@ -737,11 +737,11 @@ void EnDragon_UpdateDamage(EnDragon* this, PlayState* play) { Actor_ApplyDamage(&this->actor); Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 25); if (this->actor.colChkInfo.health > 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_UTSUBO_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_UTSUBO_DAMAGE); this->action = DEEP_PYTHON_ACTION_DAMAGE; } else { Enemy_StartFinishingBlow(play, &this->actor); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_UTSUBO_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_UTSUBO_DEAD); this->actor.flags |= ACTOR_FLAG_8000000; this->actor.flags &= ~ACTOR_FLAG_1; this->actor.flags |= ACTOR_FLAG_100000; 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 dfd97196a9..b25e4eb474 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 @@ -80,7 +80,7 @@ void EnDyExtra_Update(Actor* thisx, PlayState* play) { EnDyExtra* this = THIS; DECR(this->unk14C); - Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_SPIRAL_HEAL_BEAM - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_PL_SPIRAL_HEAL_BEAM - SFX_FLAG); this->actionFunc(this, play); Actor_MoveWithGravity(&this->actor); } 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 f115ada7c4..816be30338 100644 --- a/src/overlays/actors/ovl_En_Egol/z_en_egol.c +++ b/src/overlays/actors/ovl_En_Egol/z_en_egol.c @@ -331,7 +331,7 @@ void EnEgol_FootstepEffects(EnEgol* this, PlayState* play, f32 leftFootFrame, f3 s32 quakeSize; s32 pad; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_WALK); quakeSize = 4 - (s32)(fabsf(player->actor.world.pos.y - this->actor.world.pos.y) * 0.02f); if (quakeSize > 4) { quakeSize = 4; @@ -384,7 +384,7 @@ void EnEgol_DestroyBlocks(EnEgol* this, PlayState* play, Vec3f pos1, Vec3f pos2) dist2 = sqrtf(SQ(blockTo2.y)); if ((dist1 < 40.0f) || (dist2 < 40.0f)) { prop->colChkInfo.health = 0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WALL_BROKEN); + Actor_PlaySfx(&this->actor, NA_SE_EV_WALL_BROKEN); break; } } @@ -495,7 +495,7 @@ void EnEgol_SetupStand(EnEgol* this) { EnEgol_ChangeAnim(this, EYEGORE_ANIM_STAND); this->actor.flags &= ~ACTOR_FLAG_8000000; this->action = EYEGORE_ACTION_STAND; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_STAND); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_STAND); this->actionFunc = EnEgol_Stand; } @@ -741,7 +741,7 @@ void EnEgol_Laser(EnEgol* this, PlayState* play) { this->laserCount++; } } else if (this->laserState >= EYEGORE_LASER_FIRE) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_BEAM - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_BEAM - SFX_FLAG); if (this->laserState != EYEGORE_LASER_OFF) { EnEgol_DestroyBlocks(this, play, this->laserCollider.dim.quad[0], this->laserCollider.dim.quad[1]); } @@ -782,7 +782,7 @@ void EnEgol_Laser(EnEgol* this, PlayState* play) { if (player->stateFlags3 != PLAYER_STATE3_1000000) { func_800BC848(&this->actor, play, quakeSize, 2); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_EXPLOSION); + Actor_PlaySfx(&this->actor, NA_SE_EV_EXPLOSION); func_800B31BC(play, &hitPos, 40, -2, 255, 20); func_800BBFB0(play, &hitPos, 6.0f, 2, 120, 20, true); @@ -855,7 +855,7 @@ void EnEgol_Stop(EnEgol* this, PlayState* play) { this->isRetreating ^= true; if (!this->isRetreating) { EnEgol_ChangeAnim(this, EYEGORE_ANIM_SIT); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_SIT); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_SIT); this->laserCount = 0; this->actionFunc = EnEgol_Wait; } else { @@ -882,7 +882,7 @@ void EnEgol_Slam(EnEgol* this, PlayState* play) { f32 dyToPlayer = fabsf(player->actor.world.pos.y - this->actor.world.pos.y); s32 quakeSize; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_EXPLOSION); + Actor_PlaySfx(&this->actor, NA_SE_EV_EXPLOSION); quakeSize = 4 - (s32)(dyToPlayer * 0.02f); if (quakeSize > 4) { quakeSize = 4; @@ -1033,7 +1033,7 @@ void EnEgol_Damaged(EnEgol* this, PlayState* play) { EnEgol_SetupWalk(this); } else { Enemy_StartFinishingBlow(play, &this->actor); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_DEAD); this->actor.flags |= ACTOR_FLAG_8000000; this->actor.flags &= ~ACTOR_FLAG_1; this->actor.flags |= ACTOR_FLAG_100000; @@ -1079,7 +1079,7 @@ void EnEgol_Death(EnEgol* this, PlayState* play) { Actor_Kill(&this->actor); } else { if (Animation_OnFrame(&this->skelAnime, 46.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_EXPLOSION); + Actor_PlaySfx(&this->actor, NA_SE_EV_EXPLOSION); func_800BC848(&this->actor, play, 10, 5); } if ((curFrame >= this->animEndFrame) && (this->action != EYEGORE_ACTION_DEAD)) { @@ -1088,7 +1088,7 @@ void EnEgol_Death(EnEgol* 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); this->waitTimer = 30; - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); + Actor_PlaySfx(&this->actor, NA_SE_IT_BOMB_EXPLOSION); this->action = EYEGORE_ACTION_DEAD; for (i = 0; i < 20; i++) { EnEgol_SpawnEffect(this, &this->actor.world.pos, &gZeroVec3s, 10.0f + Rand_ZeroFloat(20.0f), @@ -1146,7 +1146,7 @@ void EnEgol_CollisionCheck(EnEgol* this, PlayState* play) { Math_Vec3f_Copy(&this->laserCollider.dim.quad[0], &this->laserBase); Math_Vec3f_Copy(&this->laserCollider.dim.quad[2], &this->laserBase); Actor_SetColorFilter(&this->actor, 0, 120, false, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); EnEgol_SetupStunned(this); } } @@ -1168,7 +1168,7 @@ void EnEgol_CollisionCheck(EnEgol* this, PlayState* play) { CollisionCheck_BlueBlood(play, NULL, &this->eyePos); CollisionCheck_BlueBlood(play, NULL, &this->eyePos); Actor_SetColorFilter(&this->actor, 0x4000, 255, false, 25); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_DAMAGE); EnEgol_SetupDamaged(this); } else if (reaction == EYEGORE_HIT_IMMUNE) { Vec3f hitPos; @@ -1176,7 +1176,7 @@ void EnEgol_CollisionCheck(EnEgol* this, PlayState* play) { hitPos.x = this->eyeCollider.elements[0].info.bumper.hitPos.x; hitPos.y = this->eyeCollider.elements[0].info.bumper.hitPos.y; hitPos.z = this->eyeCollider.elements[0].info.bumper.hitPos.z; - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_SHIELD_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_IT_SHIELD_BOUND); EffectSsHitmark_SpawnFixedScale(play, EFFECT_HITMARK_METAL, &hitPos); CollisionCheck_SpawnShieldParticlesMetal(play, &hitPos); } 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 54d5c3210b..406d3bd9d1 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -768,7 +768,7 @@ void func_8088E0F0(EnElf* this, PlayState* play) { this->unk_258 = Math_Atan2S_XY(this->actor.velocity.z, this->actor.velocity.x); func_8088F5F4(this, play, 32); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG); } void func_8088E304(EnElf* this, PlayState* play) { @@ -802,7 +802,7 @@ void func_8088E304(EnElf* this, PlayState* play) { func_8088D7F8(this, &player->bodyPartsPos[PLAYER_BODYPART_WAIST]); this->unk_258 = Math_Atan2S_XY(this->actor.velocity.z, this->actor.velocity.x); func_8088F5F4(this, play, 0x20); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG); } void func_8088E484(EnElf* this, PlayState* play) { @@ -827,7 +827,7 @@ void func_8088E484(EnElf* this, PlayState* play) { Actor_SetScale(&this->actor, (1.0f - (SQ(this->unk_250) * SQ(1.0f / 9.0f))) * 0.008f); this->unk_258 = Math_Atan2S_XY(this->actor.velocity.z, this->actor.velocity.x); func_8088F5F4(this, play, 32); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG); } void func_8088E5A8(EnElf* this, PlayState* play) { @@ -906,12 +906,12 @@ void func_8088E850(EnElf* this, PlayState* play) { if ((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 0) && ((play->csCtx.frames == 149) || (play->csCtx.frames == 381) || (play->csCtx.frames == 591))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); } if ((play->sceneId == SCENE_SECOM) && (gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 4) && (play->csCtx.frames == 95)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); } } else { this->actor.shape.rot.x = 0; @@ -994,7 +994,7 @@ void func_8088E850(EnElf* this, PlayState* play) { if (distFromLinksHead > 100.0f) { this->fairyFlags |= 2; if (this->unk_269 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_DASH_NORMAL); + Actor_PlaySfx(&this->actor, NA_SE_EV_BELL_DASH_NORMAL); } this->unk_25C = 100; } @@ -1064,7 +1064,7 @@ void func_8088EFA4(EnElf* this, PlayState* play) { this->unk_268 = 0; this->unk_238 = 1.0f; if (!this->unk_269) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_DASH_NORMAL); + Actor_PlaySfx(&this->actor, NA_SE_EV_BELL_DASH_NORMAL); } } else if (this->unk_268 == 0) { if ((arrayPointerActor == NULL) || @@ -1093,7 +1093,7 @@ void func_8088EFA4(EnElf* this, PlayState* play) { u16 targetSfxId = this->unk_269 == 0 ? NA_SE_PL_WALK_GROUND - SFX_FLAG : NA_SE_PL_WALK_GROUND - SFX_FLAG; if (!temp) { - Actor_PlaySfxAtPos(&this->actor, targetSfxId); + Actor_PlaySfx(&this->actor, targetSfxId); } this->fairyFlags |= 1; } @@ -1149,7 +1149,7 @@ void func_8088F214(EnElf* this, PlayState* play) { sp34 = 0; } else if (!(player->stateFlags1 & PLAYER_STATE1_40)) { if (this->unk_269 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_NAVY_VANISH); + Actor_PlaySfx(&this->actor, NA_SE_EV_NAVY_VANISH); } sp34 = 5; } else { @@ -1198,7 +1198,7 @@ void func_8088F214(EnElf* this, PlayState* play) { if (!(player->stateFlags2 & PLAYER_STATE2_100000)) { sp34 = 5; if (this->unk_269 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_NAVY_VANISH); + Actor_PlaySfx(&this->actor, NA_SE_EV_NAVY_VANISH); } } break; @@ -1208,7 +1208,7 @@ void func_8088F214(EnElf* this, PlayState* play) { sp34 = 9; this->unk_25C = 0x2A; if (this->unk_269 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_DASH_NORMAL); + Actor_PlaySfx(&this->actor, NA_SE_EV_BELL_DASH_NORMAL); } } else if (player->stateFlags1 & PLAYER_STATE1_40) { player->stateFlags2 |= PLAYER_STATE2_100000; 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 169d56fddc..2189bba99d 100644 --- a/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c +++ b/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c @@ -486,7 +486,7 @@ void func_80A3A610(EnElfgrp* this, PlayState* play) { if (this->unk_144 > 0) { player->actor.freezeTimer = 100; player->stateFlags1 |= PLAYER_STATE1_20000000; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_GROUP_HEAL - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_GROUP_HEAL - SFX_FLAG); } else { player->actor.freezeTimer = 0; player->stateFlags1 &= ~PLAYER_STATE1_20000000; @@ -579,7 +579,7 @@ void EnElfgrp_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (this->unk_14A & 8) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_GROUP_FRY - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_GROUP_FRY - SFX_FLAG); } if (this->unk_144 != 0) { 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 803a66ac4f..366f86f6c0 100644 --- a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c +++ b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c @@ -539,7 +539,7 @@ void EnElforg_TrappedByEnemy(EnElforg* this, PlayState* play) { EnElforg_InitializeParams(this); this->actionFunc = EnElforg_FreeFloating; this->actor.draw = EnElforg_Draw; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHIBI_FAIRY_SAVED); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHIBI_FAIRY_SAVED); } else { // The enemy is still alive, so have the Stray Fairy // track the enemy in case it's moving around. @@ -573,7 +573,7 @@ void EnElforg_HiddenByCollider(EnElforg* this, PlayState* play) { this->actor.draw = EnElforg_Draw; this->actor.world.pos.y += 40.0f; this->actor.home.pos.y += 40.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHIBI_FAIRY_SAVED); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHIBI_FAIRY_SAVED); } else { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } 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 656ec7936f..c93c8e005c 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -171,7 +171,7 @@ void EnEncount2_Popped(EnEncount2* this, PlayState* play) { EnEncount2_InitEffects(this, &curPos, 10); } - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_MUJURA_BALLOON_BROKEN); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_MUJURA_BALLOON_BROKEN); this->deathTimer = 30; this->actionFunc = EnEncount2_Die; } 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 c55ab52720..2338e1c0c0 100644 --- a/src/overlays/actors/ovl_En_Estone/z_en_estone.c +++ b/src/overlays/actors/ovl_En_Estone/z_en_estone.c @@ -143,7 +143,7 @@ void EnEstone_Active(EnEstone* this, PlayState* play) { this->actor.shape.shadowScale = 0.0f; this->inactive = true; this->timer = 50; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WALL_BROKEN); + Actor_PlaySfx(&this->actor, NA_SE_EV_WALL_BROKEN); this->actionFunc = EnEstone_Inactive; } else { //! FAKE: https://decomp.me/scratch/YiPVN 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 f64001b84a..93c9ebb414 100644 --- a/src/overlays/actors/ovl_En_Fall/z_en_fall.c +++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.c @@ -380,7 +380,7 @@ void EnFall_StoppedOpenMouthMoon_PerformCutsceneActions(EnFall* this, PlayState* switch (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 133)]->action) { case 3: if (this->eyeGlowIntensity == 0.0f) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MOON_EYE_FLASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_MOON_EYE_FLASH); } this->eyeGlowIntensity += 1 / 30.0f; if (this->eyeGlowIntensity > 1.0f) { @@ -413,15 +413,15 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, PlayStat case 0: switch (play->csCtx.frames) { case 1060: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MOON_SCREAM1); + Actor_PlaySfx(&this->actor, NA_SE_EN_MOON_SCREAM1); break; case 1089: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MOON_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EV_MOON_CRY); break; case 1303: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SLIP_MOON); + Actor_PlaySfx(&this->actor, NA_SE_EV_SLIP_MOON); break; } if (play->csCtx.frames >= 1145) { @@ -432,15 +432,15 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, PlayStat case 1: switch (play->csCtx.frames) { case 561: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MOON_SCREAM1); + Actor_PlaySfx(&this->actor, NA_SE_EN_MOON_SCREAM1); break; case 590: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MOON_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EV_MOON_CRY); break; case 737: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SLIP_MOON); + Actor_PlaySfx(&this->actor, NA_SE_EV_SLIP_MOON); break; } if (play->csCtx.frames >= 650) { @@ -517,7 +517,7 @@ void EnFall_MoonsTear_Fall(EnFall* this, PlayState* play) { if (this->actor.draw != NULL) { if (Math_Vec3f_StepTo(&this->actor.world.pos, &this->actor.home.pos, this->actor.speedXZ) <= 0.0f) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_GORON_BOUND_1); + Actor_PlaySfx(&this->actor, NA_SE_EV_GORON_BOUND_1); SET_WEEKEVENTREG(WEEKEVENTREG_74_80); SET_WEEKEVENTREG(WEEKEVENTREG_74_20); Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_TEST, this->actor.world.pos.x, @@ -702,7 +702,7 @@ void EnFall_FireRing_Update(Actor* thisx, PlayState* play) { if (Cutscene_CheckActorAction(play, 450) && play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 450)]->action == 5) { if (!(this->flags & FLAG_FIRE_RING_APPEARS)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_DM_RING_EXPLOSION); + Actor_PlaySfx(&this->actor, NA_SE_IT_DM_RING_EXPLOSION); } this->flags |= FLAG_FIRE_RING_APPEARS; } 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 fd45368985..dd6ba07cb1 100644 --- a/src/overlays/actors/ovl_En_Famos/z_en_famos.c +++ b/src/overlays/actors/ovl_En_Famos/z_en_famos.c @@ -308,12 +308,12 @@ void EnFamos_UpdateFlipStatus(EnFamos* this) { if (this->hasFinishedRotating == true) { if (this->animatedMaterialIndex != FAMOS_ANIMATED_MAT_NORMAL) { this->animatedMaterialIndex = FAMOS_ANIMATED_MAT_NORMAL; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FAMOS_REVERSE2); + Actor_PlaySfx(&this->actor, NA_SE_EN_FAMOS_REVERSE2); } else { this->animatedMaterialIndex = FAMOS_ANIMATED_MAT_FLIPPED; this->flippedTimer = 100; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FAMOS_REVERSE1); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_FAMOS_REVERSE1); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_DAMAGE); } this->hasFinishedRotating = false; } @@ -322,7 +322,7 @@ void EnFamos_UpdateFlipStatus(EnFamos* this) { this->flippedTimer--; if (this->flippedTimer == 0) { if (this->animatedMaterialIndex != FAMOS_ANIMATED_MAT_NORMAL) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FAMOS_REVERSE2); + Actor_PlaySfx(&this->actor, NA_SE_EN_FAMOS_REVERSE2); } this->animatedMaterialIndex = FAMOS_ANIMATED_MAT_NORMAL; @@ -515,7 +515,7 @@ void EnFamos_Chase(EnFamos* this, PlayState* play) { void EnFamos_SetupAttackAim(EnFamos* this) { Animation_PlayOnce(&this->skelAnime, &gFamosShakeAnim); this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AMOS_VOICE); + Actor_PlaySfx(&this->actor, NA_SE_EN_AMOS_VOICE); this->actionFunc = EnFamos_AttackAim; } @@ -586,7 +586,7 @@ void EnFamos_SetupFinishAttack(EnFamos* this) { this->emblemCollider.base.acFlags |= AC_ON; this->stateTimer = 3; this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_EXPLOSION); + Actor_PlaySfx(&this->actor, NA_SE_EV_EXPLOSION); this->actionFunc = EnFamos_FinishAttack; } @@ -655,7 +655,7 @@ void EnFamos_SetupDeathSlam(EnFamos* this) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20); this->flippedTimer = -1; this->actor.world.pos.y = this->actor.floorHeight - 60.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_DEAD); this->actionFunc = EnFamos_DeathSlam; } 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 6a4c357d9b..cc06fe2e12 100644 --- a/src/overlays/actors/ovl_En_Fg/z_en_fg.c +++ b/src/overlays/actors/ovl_En_Fg/z_en_fg.c @@ -178,7 +178,7 @@ void EnFg_Idle(EnFg* this, PlayState* play) { switch (EnFg_GetDamageEffect(this)) { case FG_DMGEFFECT_DEKUSTICK: this->actor.flags &= ~ACTOR_FLAG_1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_CRY_1); + Actor_PlaySfx(&this->actor, NA_SE_EV_FROG_CRY_1); this->skelAnime.playSpeed = 0.0f; this->actor.shape.shadowDraw = NULL; this->actor.scale.x *= 1.5f; @@ -204,7 +204,7 @@ void EnFg_Idle(EnFg* this, PlayState* play) { break; case FG_DMGEFFECT_EXPLOSION: this->actor.flags &= ~ACTOR_FLAG_1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_CRY_0); + Actor_PlaySfx(&this->actor, NA_SE_EV_FROG_CRY_0); if (1) {} this->actor.params = FG_BLACK; this->skelAnime.playSpeed = 0.0f; @@ -220,7 +220,7 @@ void EnFg_Idle(EnFg* this, PlayState* play) { break; default: if (DECR(this->timer) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_JUMP); + Actor_PlaySfx(&this->actor, NA_SE_EV_FROG_JUMP); EnFg_ChangeAnim(&this->skelAnime, 3); this->actor.velocity.y = 10.0f; this->timer = Rand_S16Offset(30, 30); @@ -255,7 +255,7 @@ void EnFg_Jump(EnFg* this, PlayState* play) { break; case FG_DMGEFFECT_EXPLOSION: this->actor.flags &= ~ACTOR_FLAG_1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_CRY_0); + Actor_PlaySfx(&this->actor, NA_SE_EV_FROG_CRY_0); EnFg_ChangeAnim(&this->skelAnime, 0); this->actor.params = FG_BLACK; this->skelAnime.playSpeed = 0.0f; 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 226874c816..4f5de6c914 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -340,7 +340,7 @@ void EnFirefly_SetupFall(EnFirefly* this, PlayState* play) { this->timer = 40; this->actor.velocity.y = 0.0f; Animation_Change(&this->skelAnime, &object_firefly_Anim_00017C, 0.0f, 6.0f, 6.0f, ANIMMODE_ONCE, 0.0f); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FFLY_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_FFLY_DEAD); this->actor.flags |= ACTOR_FLAG_10; if (this->isInvisible) { @@ -554,7 +554,7 @@ void EnFirefly_SetupStunned(EnFirefly* this) { } this->auraType = KEESE_AURA_NONE; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->actionFunc = EnFirefly_Stunned; } @@ -676,7 +676,7 @@ void EnFirefly_Update(Actor* thisx, PlayState* play2) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FFLY_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_FFLY_ATTACK); if (this->currentType != KEESE_NORMAL) { EnFirefly_Extinguish(this); @@ -716,7 +716,7 @@ void EnFirefly_Update(Actor* thisx, PlayState* play2) { this->actor.world.rot.y = this->actor.shape.rot.y; if (Animation_OnFrame(&this->skelAnime, 5.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FFLY_FLY); + Actor_PlaySfx(&this->actor, NA_SE_EN_FFLY_FLY); } } 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 5f9bbb2daa..d164bf0703 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -511,7 +511,7 @@ void func_8091E880(Actor* thisx, PlayState* play) { this->unk_240 = 400; func_8091E9A4(this); } else if (this->actor.bgCheckFlags & 0x20) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DIVE_INTO_WATER_L); + Actor_PlaySfx(&this->actor, NA_SE_EV_DIVE_INTO_WATER_L); func_8091D840(thisx, play, 10, 15.0f); if (func_8091DA14(this, play)) { func_8091EF30(this); @@ -554,7 +554,7 @@ void func_8091E9A4(EnFish* this) { this->unk_248 = 5; this->unk_24C = 0.0f; if (sp24 && (this->actor.draw != NULL)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FISH_LEAP); + Actor_PlaySfx(&this->actor, NA_SE_EV_FISH_LEAP); } } 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 c7dd18369b..110a596b0b 100644 --- a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c +++ b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c @@ -530,7 +530,7 @@ void func_80B2951C(EnFish2* this) { Actor_Kill(this->unk_350); this->unk_350 = NULL; D_80B2B2F4 = &this->actor; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_M_EAT); + Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_M_EAT); this->actionFunc = func_80B295A4; } @@ -638,7 +638,7 @@ void func_80B297FC(EnFish2* this, PlayState* play) { } this->unk_2B6 = 4; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FISH_GROW_UP); + Actor_PlaySfx(&this->actor, NA_SE_EV_FISH_GROW_UP); this->unk_2C4++; } break; @@ -889,7 +889,7 @@ void func_80B2A498(EnFish2* this, PlayState* play) { if (temp_v0 != NULL) { temp_v0->speedXZ = 4.0f; temp_v0->velocity.y = 15.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_PIECE_OF_HEART); + Actor_PlaySfx(&this->actor, NA_SE_SY_PIECE_OF_HEART); CLEAR_WEEKEVENTREG(WEEKEVENTREG_81_10); CLEAR_WEEKEVENTREG(WEEKEVENTREG_81_20); CLEAR_WEEKEVENTREG(WEEKEVENTREG_81_40); 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 aac1cb6374..79ca3a14b8 100644 --- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c +++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c @@ -2789,7 +2789,7 @@ void func_80903C60(EnFishing* this, u8 arg1) { } } - Actor_PlaySfxAtPos(&this->actor, sfxId); + Actor_PlaySfx(&this->actor, sfxId); } void EnFishing_HandleAquariumDialog(EnFishing* this, PlayState* play) { @@ -3202,7 +3202,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { EnFishing_SpawnRipple(&this->actor.projectedPos, play->specialEffects, &spB8, 30.0f, 400.0f, 150, 90); - Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_CATCH_BOOMERANG); + Actor_PlaySfx(&this->actor, NA_SE_PL_CATCH_BOOMERANG); break; } } @@ -3478,7 +3478,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { this->unk_18C = 2000.0f; } else if (sp124 < 10.0f) { if (sLurePos.y > (WATER_SURFACE_Y(play) - 10.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_JUMP_OUT_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_JUMP_OUT_WATER); play_sound(NA_SE_PL_CATCH_BOOMERANG); } @@ -4114,7 +4114,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { this->actor.velocity.x = this->actor.world.pos.x * -0.003f; this->actor.velocity.z = this->actor.world.pos.z * -0.003f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FISH_LEAP); + Actor_PlaySfx(&this->actor, NA_SE_EV_FISH_LEAP); func_809036BC(this, play); if (Rand_ZeroOne() < 0.5f) { 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 94fc2dfc16..04e9631388 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -224,7 +224,7 @@ void func_808D0930(EnFloormas* this, PlayState* play) { func_808D19D4((EnFloormas*)this->actor.child); func_808D19D4((EnFloormas*)this->actor.parent); func_808D19D4(this); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUSAMUSHI_HIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_KUSAMUSHI_HIDE); } else { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x90); func_808D1ED4(this, play); @@ -316,7 +316,7 @@ void func_808D0D70(EnFloormas* this, PlayState* play) { if ((temp_v0 != 0) || Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 24.0f) || Animation_OnFrame(&this->skelAnime, 36.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_WALK); } if ((this->actor.xzDistToPlayer < 320.0f) && Actor_IsFacingPlayer(&this->actor, 0x4000)) { @@ -355,7 +355,7 @@ void func_808D0F80(EnFloormas* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 24.0f) || Animation_OnFrame(&this->skelAnime, 36.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_WALK); } Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x71C); @@ -400,9 +400,9 @@ void func_808D11BC(EnFloormas* this, PlayState* play) { if (((this->skelAnime.playSpeed > 0.0f) && Animation_OnFrame(&this->skelAnime, 21.0f)) || ((this->skelAnime.playSpeed < 0.0f) && Animation_OnFrame(&this->skelAnime, 6.0f))) { if (this->actor.scale.x > 0.009f) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_WALK); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK); } } @@ -423,7 +423,7 @@ void func_808D1380(EnFloormas* this, PlayState* play) { this->actor.gravity = 0.0f; func_808D08D0(this); Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 15.0f, 6, 20.0f, 300, 100, 1); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_ATTACK); this->actionFunc = func_808D1458; } @@ -511,9 +511,9 @@ void func_808D17EC(EnFloormas* this, PlayState* play) { if (this->actor.velocity.y < -4.0f) { if (this->actor.scale.x > 0.009f) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_LAND); + Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_LAND); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); + Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); } } } @@ -590,7 +590,7 @@ void func_808D1B44(EnFloormas* this, PlayState* play) { Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f); } if (this->actor.bgCheckFlags & 2) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); + Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); } } @@ -607,7 +607,7 @@ void func_808D1C1C(EnFloormas* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK); } if (this->unk_194 == 0) { @@ -634,7 +634,7 @@ void func_808D1D6C(EnFloormas* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK); } flags = this->actor.bgCheckFlags & 8; @@ -702,7 +702,7 @@ void func_808D2040(EnFloormas* this, PlayState* play) { } else if (this->actor.bgCheckFlags & 2) { this->unk_18E = 50; this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); + Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); func_808D1740(this); } else if ((this->actor.playerHeightRel < -10.0f) && (this->collider.base.ocFlags1 & OC1_HIT) && (&player->actor == this->collider.base.oc)) { @@ -762,10 +762,10 @@ void func_808D22C8(EnFloormas* this, PlayState* play) { this->actor.speedXZ = -3.0f; func_808D1740(this); } else if ((this->unk_190 % 20) == 0) { - func_800B8E58(player, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->voiceSfxIdOffset); + Player_PlaySfx(player, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->voiceSfxIdOffset); play->damagePlayer(play, -4); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_STICK - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_STICK - SFX_FLAG); } void func_808D2484(EnFloormas* this) { @@ -802,7 +802,7 @@ void func_808D24F0(EnFloormas* this, PlayState* play) { this->collider.base.ocFlags1 |= OC1_ON; } else if (this->actor.bgCheckFlags & 2) { this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); + Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); func_808D1740(this); } @@ -862,7 +862,7 @@ void func_808D2764(EnFloormas* this, PlayState* play) { this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; if (((temp_f2 == 0.007f) || (temp_f2 == 0.004f)) && (temp_f2 != this->actor.scale.x)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_EXPAND); + Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_EXPAND); } this->collider.dim.radius = sCylinderInit.dim.radius * 100.0f * this->actor.scale.x; @@ -954,9 +954,9 @@ void func_808D2C08(EnFloormas* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 13.0f)) { if (this->actor.scale.x > 0.009f) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } } @@ -1022,14 +1022,14 @@ void func_808D2E34(EnFloormas* this, PlayState* play) { if (this->collider.base.colType != COLTYPE_HARD) { if (!Actor_ApplyDamage(&this->actor)) { if (this->actor.scale.x > 0.009f) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIOCTA_REVERSE); + Actor_PlaySfx(&this->actor, NA_SE_EN_DAIOCTA_REVERSE); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_DEAD); } Enemy_StartFinishingBlow(play, &this->actor); this->actor.flags &= ~ACTOR_FLAG_1; } else if (this->actor.colChkInfo.damage != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_DAMAGE); } func_808D0A48(this, play); @@ -1045,12 +1045,12 @@ void func_808D2E34(EnFloormas* this, PlayState* play) { } else if (this->actor.colChkInfo.damageEffect == 1) { this->unk_18E = 40; Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); func_808D2D6C(this); } else if (this->actor.colChkInfo.damageEffect == 5) { this->unk_18E = 40; Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->drawDmgEffScale = 0.55f; this->drawDmgEffAlpha = 2.0f; this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_MEDIUM; 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 0fa23e71a7..dda8764e3c 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -766,7 +766,7 @@ void EnFsn_Haggle(EnFsn* this, PlayState* play) { SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } else { if (this->animIndex == FSN_ANIM_SLAM_COUNTER_LOOP && Animation_OnFrame(&this->skelAnime, 18.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); + Actor_PlaySfx(&this->actor, NA_SE_EV_HANKO); } if (this->flags & ENFSN_CALM_DOWN) { this->flags &= ~ENFSN_CALM_DOWN; @@ -783,7 +783,7 @@ void EnFsn_Haggle(EnFsn* this, PlayState* play) { SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } else { if (Animation_OnFrame(&this->skelAnime, 28.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); + Actor_PlaySfx(&this->actor, NA_SE_EV_HANKO); } return; } 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 b232210f50..e793483660 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 @@ -136,7 +136,7 @@ s32 func_80ACF8B8(EnFuKago* this, PlayState* play) { return false; } - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_SY_TRE_BOX_APPEAR); + Actor_PlaySfx(&this->dyna.actor, NA_SE_SY_TRE_BOX_APPEAR); return true; } else { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); @@ -227,7 +227,7 @@ void func_80ACFA78(EnFuKago* this, PlayState* play) { this->unk_338 = 60; this->unk_33A = 1; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WOODBOX_BREAK); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WOODBOX_BREAK); func_800C62BC(play, &play->colCtx.dyna, this->dyna.bgId); this->actionFunc = func_80AD0028; } 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 6f9706a2ba..0fa4927a97 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 @@ -174,7 +174,7 @@ void func_80ACE680(EnFuMato* this) { this->unk_2FC.y = Rand_Next() & 0xFFF; this->unk_2FC.z = Rand_Next() & 0xFFF; this->unk_302 = 3; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WOODPLATE_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WOODPLATE_BOUND); this->actionFunc = func_80ACE718; } @@ -241,7 +241,7 @@ void func_80ACE850(EnFuMato* this, PlayState* play) { this->dyna.actor.freezeTimer = 2; EffectSsHahen_SpawnBurst(play, &this->dyna.actor.world.pos, 13.0f, 0, 7, 8, 20, HAHEN_OBJECT_DEFAULT, 10, NULL); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WOODPLATE_BROKEN); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WOODPLATE_BROKEN); this->actionFunc = func_80ACECFC; } @@ -368,7 +368,7 @@ s32 func_80ACF04C(EnFuMato* this, PlayState* play) { this->collider.base.acFlags &= ~AC_HIT; this->collider.base.ocFlags1 &= ~OC1_HIT; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_SY_TRE_BOX_APPEAR); + Actor_PlaySfx(&this->dyna.actor, NA_SE_SY_TRE_BOX_APPEAR); fu->unk_548++; if ((fu->unk_542 == 2) || (gSaveContext.save.playerForm == PLAYER_FORM_DEKU)) { 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 f7d1d7cd13..171c6a397c 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -375,8 +375,8 @@ void func_80932C98(EnFz* this, PlayState* play) { if ((parent->update == NULL) || (parent->colChkInfo.health <= 0)) { this->actor.colChkInfo.health = 0; this->unk_BC4 = 5; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FREEZAD_DEAD); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_BROKEN); + Actor_PlaySfx(&this->actor, NA_SE_EN_FREEZAD_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_BROKEN); sp3C.x = this->actor.world.pos.x; sp3C.y = this->actor.world.pos.y; sp3C.z = this->actor.world.pos.z; @@ -388,8 +388,8 @@ void func_80932C98(EnFz* this, PlayState* play) { if ((this->actor.colChkInfo.health != 0) && (this->unk_BC4 == 1)) { this->actor.colChkInfo.health = 0; this->unk_BC4 = 5; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FREEZAD_DEAD); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_BROKEN); + Actor_PlaySfx(&this->actor, NA_SE_EN_FREEZAD_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_BROKEN); sp3C.x = this->actor.world.pos.x; sp3C.y = this->actor.world.pos.y; sp3C.z = this->actor.world.pos.z; @@ -422,7 +422,7 @@ void func_80932C98(EnFz* this, PlayState* play) { Actor_ApplyDamage(&this->actor); Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 8); if (this->actor.colChkInfo.health != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FREEZAD_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_FREEZAD_DAMAGE); sp3C.x = this->actor.world.pos.x; sp3C.y = this->actor.world.pos.y; sp3C.z = this->actor.world.pos.z; @@ -430,8 +430,8 @@ void func_80932C98(EnFz* this, PlayState* play) { this->unk_BCF++; break; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FREEZAD_DEAD); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_BROKEN); + Actor_PlaySfx(&this->actor, NA_SE_EN_FREEZAD_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_BROKEN); sp3C.x = this->actor.world.pos.x; sp3C.y = this->actor.world.pos.y; sp3C.z = this->actor.world.pos.z; @@ -440,7 +440,7 @@ void func_80932C98(EnFz* this, PlayState* play) { break; case 2: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FREEZAD_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_FREEZAD_DEAD); func_80933790(this); break; } 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 40c3d5c05f..3ad6c77352 100644 --- a/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c +++ b/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c @@ -140,7 +140,7 @@ void func_80AF69A8(EnGamelupy* this, PlayState* play) { void func_80AF6A38(EnGamelupy* this) { this->unk_19C = 0; this->actor.gravity = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_GET_RUPY); + Actor_PlaySfx(&this->actor, NA_SE_SY_GET_RUPY); this->actionFunc = func_80AF6A78; } 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 7007e7ed9c..b9c81ebad5 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -243,9 +243,9 @@ s32 EnGe1_FollowPath(EnGe1* this) { void EnGe1_Scream(EnGe1* this) { if ((s32)Rand_ZeroFloat(2.0f) == 0) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_VO_FPVO00); + Actor_PlaySfx(&this->picto.actor, NA_SE_VO_FPVO00); } else { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_VO_FPVO01); + Actor_PlaySfx(&this->picto.actor, NA_SE_VO_FPVO01); } } @@ -330,11 +330,11 @@ void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play) { if ((this->animIndex == GERUDO_WHITE_ANIM_TRUDGING_OFF) && (Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 25.0f))) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EV_PIRATE_WALK); + Actor_PlaySfx(&this->picto.actor, NA_SE_EV_PIRATE_WALK); } if ((this->animIndex == GERUDO_WHITE_ANIM_SALUTE) && Animation_OnFrame(&this->skelAnime, 14.0f)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EV_PIRATE_WALK); + Actor_PlaySfx(&this->picto.actor, NA_SE_EV_PIRATE_WALK); } } else { this->picto.actor.draw = NULL; 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 a4b28fa85f..bcbed04115 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -358,9 +358,9 @@ void EnGe2_SpawnEffects(EnGe2* this, PlayState* play) { void EnGe2_Scream(EnGe2* this) { if ((s32)Rand_ZeroFloat(2.0f) == 0) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_VO_FPVO00); + Actor_PlaySfx(&this->picto.actor, NA_SE_VO_FPVO00); } else { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_VO_FPVO01); + Actor_PlaySfx(&this->picto.actor, NA_SE_VO_FPVO01); } } @@ -417,7 +417,7 @@ void EnGe2_Charge(EnGe2* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EV_PIRATE_WALK); + Actor_PlaySfx(&this->picto.actor, NA_SE_EV_PIRATE_WALK); } } @@ -513,7 +513,7 @@ void EnGe2_PatrolDuties(EnGe2* this, PlayState* play) { this->timer = 200; this->picto.actor.speedXZ = 0.0f; this->actionFunc = EnGe2_KnockedOut; - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_PIRATE_DEAD); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_DEAD); this->picto.actor.flags &= ~ACTOR_FLAG_1; this->stateFlags |= GERUDO_PURPLE_STATE_KO; } @@ -637,7 +637,7 @@ void EnGe2_PerformCutsceneActions(EnGe2* this, PlayState* play) { this->picto.actor.speedXZ = 5.0f; if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EV_PIRATE_WALK); + Actor_PlaySfx(&this->picto.actor, NA_SE_EV_PIRATE_WALK); } if (this->screamTimer > 0) { 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 1da6c1a612..2d0b819152 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.c +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.c @@ -716,7 +716,7 @@ void func_80BB2E00(EnGeg* this, PlayState* play) { func_80BB2020(this, play); this->actionFunc = func_80BB30B4; } else if (Animation_OnFrame(&this->skelAnime, 24.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_STAND_IMT); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_STAND_IMT); } } else if (this->unk_4AC == 4) { if (Animation_OnFrame(&this->skelAnime, 0.0f)) { @@ -729,7 +729,7 @@ void func_80BB2E00(EnGeg* this, PlayState* play) { this->actionFunc = func_80BB3318; } } else if (Animation_OnFrame(&this->skelAnime, 24.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_SIT_IMT); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_SIT_IMT); } } } @@ -756,7 +756,7 @@ void func_80BB2F7C(EnGeg* this, PlayState* play) { func_800B9010(&this->actor, NA_SE_EN_GOLON_SIRLOIN_ROLL - SFX_FLAG); } else { this->unk_230 |= 0x80; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } } } 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 dbd1803591..078c136b95 100644 --- a/src/overlays/actors/ovl_En_Giant/z_en_giant.c +++ b/src/overlays/actors/ovl_En_Giant/z_en_giant.c @@ -371,10 +371,10 @@ void EnGiant_PlaySound(EnGiant* this) { if (this->actor.draw != NULL && this->alpha > 0) { if (this->animIndex == GIANT_ANIM_WALKING_LOOP && (Animation_OnFrame(&this->skelAnime, 40.0f) || Animation_OnFrame(&this->skelAnime, 100.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_KYOJIN_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_KYOJIN_WALK); } if (this->animIndex == GIANT_ANIM_FALLING_OVER && Animation_OnFrame(&this->skelAnime, 40.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_KYOJIN_VOICE_FAIL); + Actor_PlaySfx(&this->actor, NA_SE_EV_KYOJIN_VOICE_FAIL); } if (this->sfxId != 0xFFFF && ((this->animIndex == GIANT_ANIM_BIG_CALL_START && this->skelAnime.curFrame >= 18.0f) || 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 88d55dc14c..c660ec04eb 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 @@ -510,7 +510,7 @@ void EnGinkoMan_Dialogue(EnGinkoMan* this, PlayState* play) { if ((this->skelAnime.animation == &object_boj_Anim_0008C0) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BANK_MAN_HAND_HIT); + Actor_PlaySfx(&this->actor, NA_SE_EV_BANK_MAN_HAND_HIT); } } @@ -579,7 +579,7 @@ void EnGinkoMan_SetupStamp(EnGinkoMan* this) { void EnGinkoMan_Stamp(EnGinkoMan* this, PlayState* play) { if ((this->curTextId == 0x464) // "Hey, relax! It doesn't leave any marks, and it's not gonna hurt." && (Animation_OnFrame(&this->skelAnime, 10.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); // "stamp" + Actor_PlaySfx(&this->actor, NA_SE_EV_HANKO); // "stamp" } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { 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 9704d62049..7312cbbc86 100644 --- a/src/overlays/actors/ovl_En_Gk/z_en_gk.c +++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.c @@ -268,7 +268,7 @@ s32 func_80B50854(EnGk* this, PlayState* play) { void func_80B50954(EnGk* this) { if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 4.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLONKID_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLONKID_WALK); } } @@ -511,7 +511,7 @@ void func_80B51410(EnGk* this, PlayState* play) { } if (ActorCutscene_GetCanPlayNext(this->unk_318)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLONKID_SOB_TALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLONKID_SOB_TALK); ActorCutscene_Start(this->unk_318, &this->actor); this->unk_1E4 &= ~0x20; return; @@ -897,7 +897,7 @@ void func_80B5227C(EnGk* this, PlayState* play) { if (!(this->unk_1E4 & 0x80)) { SET_WEEKEVENTREG(WEEKEVENTREG_22_04); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_SIT_IMT); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_SIT_IMT); this->unk_350 = 0x4000; this->actionFunc = func_80B52654; } @@ -993,7 +993,7 @@ void func_80B52654(EnGk* this, PlayState* play) { this->actor.scale.z = 0.006f - this->unk_354; this->actor.scale.x = 0.006f + this->unk_354; if (this->unk_350 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLONKID_SNORE); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLONKID_SNORE); } } 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 01146c0cf1..763e353113 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -500,7 +500,7 @@ s32 func_8094E69C(EnGm* this, PlayState* play) { switch (this->unk_3E0) { case 0: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIR_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIR_ROLL); func_8094E054(this, play, 2); this->unk_3E2 = 0; this->unk_3E0++; @@ -552,7 +552,7 @@ s32 func_8094E69C(EnGm* this, PlayState* play) { break; case 8: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIR_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIR_ROLL); ActorCutscene_Stop(sp4A); this->unk_3E2 = 0; this->unk_3E0++; @@ -637,7 +637,7 @@ s32 func_8094EB1C(EnGm* this, PlayState* play) { ret = true; break; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIR_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIR_ROLL); func_8094E054(this, play, 2); this->unk_3E2 = 0; this->unk_3E0++; @@ -657,7 +657,7 @@ s32 func_8094EB1C(EnGm* this, PlayState* play) { break; case 2: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIR_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIR_ROLL); this->unk_3E2 = 0; this->unk_3E0++; @@ -965,7 +965,7 @@ s32 func_8094F53C(EnGm* this, PlayState* play) { if ((this->unk_3E8 == 6) && !(play->actorCtx.flags & ACTORCTX_FLAG_5) && Animation_OnFrame(&this->skelAnime, 20.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); + Actor_PlaySfx(&this->actor, NA_SE_EV_HANKO); } return false; @@ -1427,7 +1427,7 @@ s32 func_80950690(EnGm* this, PlayState* play) { case 7: this->unk_3D0 += 992; if (DECR(this->unk_3B8) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_GO_SLEEP); + Actor_PlaySfx(&this->actor, NA_SE_VO_GO_SLEEP); this->unk_3B8 = 30; } break; @@ -1465,7 +1465,7 @@ s32 func_80950804(EnGm* this, PlayState* play) { Lib_Vec3f_TranslateAndRotateY(&this->unk_278, this->actor.world.rot.y, &sp38, &this->actor.world.pos); this->unk_3BA += this->timePathTimeSpeed; if (Animation_OnFrame(&this->skelAnime, 3.0f) || Animation_OnFrame(&this->skelAnime, 13.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PIRATE_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_PIRATE_WALK); } } @@ -1521,7 +1521,7 @@ s32 func_8095097C(EnGm* this, PlayState* play) { this->timePathWaypoint = sp50; this->timePathTargetPos = timePathTargetPos; } else if (Animation_OnFrame(&this->skelAnime, 3.0f) || Animation_OnFrame(&this->skelAnime, 13.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PIRATE_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_PIRATE_WALK); } return false; } @@ -1641,7 +1641,7 @@ void func_80950F2C(EnGm* this, PlayState* play) { sp2C = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 526)]->action; if (this->unk_259 != (sp2C & 0xFF)) { if (sp2C == 3) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIR_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIR_ROLL); } this->unk_259 = sp2C; func_8094E054(this, play, sp50[sp2C]); 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 e1250dbc67..f5f36e5240 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -759,19 +759,19 @@ s32 func_80A12B78(EnGo* this, PlayState* play) { if (play->csCtx.state == 0) { if (this->unk_3DC == 4) { if (Animation_OnFrame(&this->skelAnime, 2.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_CIRCLE); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_CIRCLE); } if (Animation_OnFrame(&this->skelAnime, 22.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_SIT_IMT); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_SIT_IMT); } } else if ((this->unk_3DC == 2) || (this->unk_3DC == 3)) { if (Animation_OnFrame(&this->skelAnime, 2.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_CIRCLE_OFF); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_CIRCLE_OFF); } if (Animation_OnFrame(&this->skelAnime, 24.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_STAND_IMT); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_STAND_IMT); } } } @@ -1165,7 +1165,7 @@ s32 func_80A13B1C(EnGo* this, PlayState* play) { case 3: this->unk_3C2++; if (this->unk_3C2 >= 10) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_JUMP); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_JUMP); this->actor.velocity.y = 10.0f; this->actor.gravity = -1.0f; this->unk_3C4++; @@ -1174,7 +1174,7 @@ s32 func_80A13B1C(EnGo* this, PlayState* play) { case 4: if (func_80A13564(this, 10.0f, 0.004f, 6)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_LAND_BIG); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_LAND_BIG); func_80A13728(this, play); this->unk_3C4++; this->unk_3C2 = 0; @@ -1242,7 +1242,7 @@ s32 func_80A13E80(EnGo* this, PlayState* play) { case 2: if (Animation_OnFrame(&this->skelAnime, 16.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_GORON_HAND_HIT); + Actor_PlaySfx(&this->actor, NA_SE_EV_GORON_HAND_HIT); } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { @@ -1515,7 +1515,7 @@ void func_80A149B0(EnGo* this, PlayState* play) { s16 sp26 = this->actor.world.rot.y; if ((ENGO_GET_F(&this->actor) == ENGO_F_2) && (gSaveContext.save.entrance == ENTRANCE(GORON_RACETRACK, 1))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_GORON_CHEER - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_GORON_CHEER - SFX_FLAG); } else if (ENGO_GET_F(&this->actor) != ENGO_F_8) { if (func_80A1222C(this, play)) { SubS_UpdateFlags(&this->unk_390, 0, 7); @@ -1582,7 +1582,7 @@ void func_80A14B30(EnGo* this, PlayState* play) { } else { sfxId = NA_SE_EN_GOLON_SNORE2; } - Actor_PlaySfxAtPos(&this->actor, sfxId); + Actor_PlaySfx(&this->actor, sfxId); } this->unk_3AE += 0x400; this->actor.shape.yOffset = (this->actor.scale.y / this->unk_3A4) * 14.0f; @@ -1620,7 +1620,7 @@ void func_80A14EB0(EnGo* this, PlayState* play) { EnGo* sp24 = (EnGo*)this->actor.child; if ((s32)(this->unk_39C * 3.0f) != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_MELT_LEVEL - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_MELT_LEVEL - SFX_FLAG); Math_ApproachF(&this->unk_39C, 0.0f, 0.02f, 1.0f); this->unk_3A0 = (this->unk_39C / 0.9f) * 100.0f; func_80A139E4(this); @@ -1696,7 +1696,7 @@ void func_80A14FC8(EnGo* this, PlayState* play) { case 6: if ((s32)(this->unk_39C * 3.0f) != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_MELT_LEVEL - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_MELT_LEVEL - SFX_FLAG); Math_ApproachF(&this->unk_39C, 0.0f, 0.02f, 1.0f); this->unk_3A0 = (this->unk_39C / 0.9f) * 100.0f; func_80A139E4(this); @@ -1711,42 +1711,42 @@ void func_80A14FC8(EnGo* this, PlayState* play) { case 55: case 100: case 130: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_COLD); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_COLD); break; case 185: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_WAKE_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_WAKE_UP); break; case 250: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_EYE_BIG); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_EYE_BIG); break; case 465: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IWAIGORON_SOLO); + Actor_PlaySfx(&this->actor, NA_SE_EN_IWAIGORON_SOLO); break; case 490: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_VOICE_EATFULL); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_VOICE_EATFULL); break; } } else if (actorActionCmd == 129) { switch (play->csCtx.frames) { case 360: case 390: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_COLD); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_COLD); break; case 430: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_WAKE_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_WAKE_UP); break; case 450: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_EYE_BIG); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_EYE_BIG); break; case 480: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_VOICE_EATFULL); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_VOICE_EATFULL); break; } } @@ -1763,7 +1763,7 @@ void func_80A153FC(EnGo* this, PlayState* play) { Vec3f sp44; if ((this->unk_390 & 0x1000) && (this->actor.colChkInfo.damageEffect == 0xF)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SNOWBALL_BROKEN); + Actor_PlaySfx(&this->actor, NA_SE_EV_SNOWBALL_BROKEN); this->actor.flags &= ~ACTOR_FLAG_10; this->actor.flags |= ACTOR_FLAG_2000000; @@ -1772,7 +1772,7 @@ void func_80A153FC(EnGo* this, PlayState* play) { this->actor.shape.rot.x = 0; this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_COLD); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_COLD); if (gSaveContext.save.day == 3) { func_80A141D4(this, play); @@ -1783,7 +1783,7 @@ void func_80A153FC(EnGo* this, PlayState* play) { } } else if (this->unk_284 != NULL) { if (this->unk_390 & 0x800) { - func_800B8E58(GET_PLAYER(play), NA_SE_PL_BODY_HIT); + Player_PlaySfx(GET_PLAYER(play), NA_SE_PL_BODY_HIT); func_800B8D50(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 0); } @@ -1802,7 +1802,7 @@ void func_80A153FC(EnGo* this, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; if (this->actor.bgCheckFlags & 1) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BIGBALL_ROLL - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_BIGBALL_ROLL - SFX_FLAG); func_800AE930(&play->colCtx, Effect_GetByIndex(this->unk_3E8), &this->actor.world.pos, 18.0f, this->actor.shape.rot.y, this->actor.floorPoly, this->actor.floorBgId); } else { 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 98d27f735c..a081c68edc 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -483,7 +483,7 @@ s32 func_8093F6F8(EnGoroiwa* this, PlayState* play) { func_8093EF54(play, &sp48, &D_80942E30[ENGOROIWA_GET_C000(&this->actor)], &D_80942E3C[ENGOROIWA_GET_C000(&this->actor)], this->actor.scale.x); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BIGBALL_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EV_BIGBALL_BOUND); } } } @@ -1168,7 +1168,7 @@ void func_80941A10(EnGoroiwa* this, PlayState* play) { func_80941DB4(this); } - func_800B8E58(player, NA_SE_PL_BODY_HIT); + Player_PlaySfx(player, NA_SE_PL_BODY_HIT); if ((sp34 == 1) || (sp34 == 2)) { this->unk_1CC = 50; @@ -1208,7 +1208,7 @@ void func_80941A10(EnGoroiwa* this, PlayState* play) { } if (this->actor.bgCheckFlags & 1) { - Actor_PlaySfxAtPos(&this->actor, D_80942E9C[this->unk_1E4][this->actor.home.rot.x & 1]); + Actor_PlaySfx(&this->actor, D_80942E9C[this->unk_1E4][this->actor.home.rot.x & 1]); } } } @@ -1266,7 +1266,7 @@ void func_80941FA4(EnGoroiwa* this, PlayState* play) { if (func_8094156C(this, play) == 0) { 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); + Player_PlaySfx(player, NA_SE_PL_BODY_HIT); if (((this->actor.home.rot.z & 3) == 1) || ((this->actor.home.rot.z & 3) == 2)) { this->unk_1CC = 50; } @@ -1294,7 +1294,7 @@ void func_809420F0(EnGoroiwa* this, PlayState* play) { if (func_8094156C(this, play) == 0) { 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); + Player_PlaySfx(player, NA_SE_PL_BODY_HIT); if (((this->actor.home.rot.z & 3) == 1) || ((this->actor.home.rot.z & 3) == 2)) { this->unk_1CC = 50; } 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 eb7948ffb2..6600aa2bbb 100644 --- a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c +++ b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c @@ -354,7 +354,7 @@ void EnGrasshopper_Fly(EnGrasshopper* this, PlayState* play) { f32 targetSpeed; Vec3f collisionCheckPos; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG); diffX = this->flyingHomePos.x - this->actor.world.pos.x; diffZ = this->flyingHomePos.z - this->actor.world.pos.z; if ((this->type != EN_GRASSHOPPER_TYPE_WOODFALL_TEMPLE_FINAL_ROOM) && @@ -430,7 +430,7 @@ void EnGrasshopper_RoamInCircles(EnGrasshopper* this, PlayState* play) { Vec3f collisionCheckPos; Player* player = GET_PLAYER(play); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG); if (Player_GetMask(play) == PLAYER_MASK_STONE) { EnGrasshopper_SetupFly(this); } else { @@ -474,7 +474,7 @@ void EnGrasshopper_RoamInCircles(EnGrasshopper* this, PlayState* play) { * Unused in the final game. */ void EnGrasshopper_SetupBank(EnGrasshopper* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG); this->targetBankRot.y = this->actor.world.rot.y + 0x8000; this->action = EN_GRASSHOPPER_ACTION_BANK; this->bankState = EN_GRASSHOPPER_BANK_STATE_BANKING; @@ -487,7 +487,7 @@ void EnGrasshopper_SetupBank(EnGrasshopper* this) { * it flies forward for 100 frames. */ void EnGrasshopper_Bank(EnGrasshopper* this, PlayState* play) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG); switch (this->bankState) { case EN_GRASSHOPPER_BANK_STATE_BANKING: Math_SmoothStepToS(&this->actor.world.rot.y, this->targetBankRot.y, 0x64, 0x3E8, 0x3E8); @@ -529,7 +529,7 @@ void EnGrasshopper_SetupBounced(EnGrasshopper* this) { void EnGrasshopper_Bounced(EnGrasshopper* this, PlayState* play) { f32 targetSpeed; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG); targetSpeed = (this->index * 0.05f) + 7.0f; Math_ApproachF(&this->actor.speedXZ, targetSpeed, 0.4f, 0.8f); Math_SmoothStepToS(&this->actor.world.rot.z, this->targetRot.z, 5, 0x3E8, 5); @@ -564,7 +564,7 @@ void EnGrasshopper_ApproachPlayer(EnGrasshopper* this, PlayState* play) { WaterBox* waterBox; Vec3f splashPos; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG); this->bobPhase += 0xAF0; this->targetApproachPos.y = (Math_SinS(this->bobPhase) * 10.0f) + (player->actor.world.pos.y + 120.0f); @@ -607,7 +607,7 @@ void EnGrasshopper_SetupAttack(EnGrasshopper* this) { this->baseFlyHeight = this->actor.world.pos.y; this->collider.elements[0].info.toucherFlags &= ~(TOUCH_ON | TOUCH_SFX_WOOD); this->collider.elements[1].info.toucherFlags |= (TOUCH_ON | TOUCH_SFX_WOOD); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BATTA_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_BATTA_ATTACK); this->action = EN_GRASSHOPPER_ACTION_ATTACK; this->actionFunc = EnGrasshopper_Attack; } @@ -739,7 +739,7 @@ void EnGrasshopper_SetupDead(EnGrasshopper* this, PlayState* play) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 25); Enemy_StartFinishingBlow(play, &this->actor); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BATTA_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_BATTA_DEAD); this->action = EN_GRASSHOPPER_ACTION_DEAD; this->actionFunc = EnGrasshopper_Dead; } @@ -887,7 +887,7 @@ void EnGrasshopper_UpdateDamage(EnGrasshopper* this, PlayState* play) { if (attackDealsDamage) { Actor_ApplyDamage(&this->actor); if (this->actor.colChkInfo.health > 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BATTA_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_BATTA_DAMAGE); EnGrasshopper_SetupDamaged(this, play); } else { EnGrasshopper_SetupDead(this, play); 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 08133cc63b..4ff4c1d1b4 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -281,7 +281,7 @@ void func_8099807C(EnGs* this, PlayState* play) { if (!Flags_GetSwitch(play, this->unk_196)) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, this->actor.world.pos.x, this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0, 2); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); + Actor_PlaySfx(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); Flags_SetSwitch(play, this->unk_196); } break; @@ -290,7 +290,7 @@ void func_8099807C(EnGs* this, PlayState* play) { if (!Flags_GetSwitch(play, this->unk_196)) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, this->actor.world.pos.x, this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0, 7); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); + Actor_PlaySfx(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); Flags_SetSwitch(play, this->unk_196); } break; @@ -411,7 +411,7 @@ void func_809985B8(EnGs* this, PlayState* play) { void func_80998704(EnGs* this, PlayState* play) { this->unk_19D = 0; this->unk_19A &= ~(0x100 | 0x4); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_G_STONE_CHANGE_COLOR); + Actor_PlaySfx(&this->actor, NA_SE_EV_G_STONE_CHANGE_COLOR); this->actionFunc = func_8099874C; } @@ -518,7 +518,7 @@ s32 func_80998A48(EnGs* this, PlayState* play) { if (this->unk_19D == 0) { this->unk_216 = 200; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK); this->unk_1D4 = 0; this->unk_19A |= 1; @@ -536,7 +536,7 @@ s32 func_80998A48(EnGs* this, PlayState* play) { if ((this->actor.params != ENGS_0) && !Play_InCsMode(play) && (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE)) { this->unk_216 = 0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIVE_LUPY_COUNT); + Actor_PlaySfx(&this->actor, NA_SE_EV_FAIVE_LUPY_COUNT); Message_StartTextbox(play, 0x20D2, NULL); } this->unk_19A &= ~1; @@ -551,7 +551,7 @@ s32 func_80998BBC(EnGs* this, PlayState* play) { if (this->unk_19D == 0) { this->unk_216 = 200; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK); this->unk_1DC = 0.3f; this->unk_1E0 = 0.0f; @@ -582,7 +582,7 @@ s32 func_80998D44(EnGs* this, PlayState* play) { this->unk_216 = 200; this->unk_1DC = this->unk_1B0[0].y - 1.0f; this->unk_1E0 = -0.8f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_G_STONE_CRUSH); + Actor_PlaySfx(&this->actor, NA_SE_EV_G_STONE_CRUSH); this->unk_19A |= 1; this->unk_21C = 40; this->unk_21E = 11; @@ -613,7 +613,7 @@ s32 func_80998D44(EnGs* this, PlayState* play) { this->unk_21C = 10; this->unk_21E = 10; this->unk_1DC = 0.5f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK); this->unk_19D += 1; } } else if ((this->unk_19D == 4) && (func_80998334(this, play, &this->unk_1DC, &this->unk_1E0, &this->unk_1D4, 1.0f, @@ -662,7 +662,7 @@ s32 func_80998F9C(EnGs* this, PlayState* play) { this->unk_1E0 = 1.5f; this->unk_1E4 = this->unk_1B0[1].y - 1.0f; this->unk_1E8 = -0.3f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_STONE_GROW_UP); + Actor_PlaySfx(&this->actor, NA_SE_EV_STONE_GROW_UP); this->unk_19D = 3; } } @@ -712,7 +712,7 @@ s32 func_80998F9C(EnGs* this, PlayState* play) { this->unk_1E8 = 0.0f; this->unk_1F0 = 0.0f; this->unk_1EC = 0.5f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK); this->unk_21C = 20; this->unk_21E = 2; this->unk_19D = 6; @@ -735,7 +735,7 @@ s32 func_80998F9C(EnGs* this, PlayState* play) { } if ((u16)this->unk_19E[0].y < sp3A) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_STONE_ROLLING); + Actor_PlaySfx(&this->actor, NA_SE_EV_STONE_ROLLING); } return sp4C; @@ -849,7 +849,7 @@ s32 func_809995A4(EnGs* this, PlayState* play) { sp54.x = this->actor.world.pos.x; sp54.y = this->actor.world.pos.y; sp54.z = this->actor.world.pos.z; - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); + Actor_PlaySfx(&this->actor, NA_SE_IT_BOMB_EXPLOSION); EffectSsBomb2_SpawnLayered(play, &sp54, &bomb2Velocity, &bomb2Accel, 100, 20); this->unk_1D4 = 10; this->unk_19A |= 8; 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 b13bca1dd5..2fef196bf6 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 @@ -278,8 +278,8 @@ void EnGuardNuts_Burrow(EnGuardNuts* this, PlayState* play) { this->targetHeadPos.y = 0; this->actor.flags |= ACTOR_FLAG_8000000; this->targetHeadPos.x = this->targetHeadPos.y; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_UP); this->actionFunc = EnGuardNuts_SetupUnburrow; } @@ -306,7 +306,7 @@ void EnGuardNuts_Unburrow(EnGuardNuts* this, PlayState* play) { Math_Vec3f_Copy(&digPos, &this->actor.world.pos); digPos.y = this->actor.floorHeight; EffectSsHahen_SpawnBurst(play, &digPos, 4.0f, 0, 10, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_UP); D_80ABBE20 = 0; if (this->guardTextIndex == 9) { this->hasCompletedConversation = true; @@ -329,7 +329,7 @@ void EnGuardNuts_Update(Actor* thisx, PlayState* play) { } if ((this->animIndex == WALK_ANIM) && ((Animation_OnFrame(&this->skelAnime, 1.0f)) || (Animation_OnFrame(&this->skelAnime, 5.0f)))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); } this->actionFunc(this, play); 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 0e1d2f050d..7703520523 100644 --- a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c +++ b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c @@ -211,7 +211,7 @@ void func_80B221E8(EnHakurock* this, PlayState* play) { if ((this->collider.base.atFlags & AT_HIT) || ((this->counter == 0) && (this->collider.base.ocFlags1 & OC1_HIT)) || ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROCK_BROKEN); + Actor_PlaySfx(&this->actor, NA_SE_EV_ROCK_BROKEN); func_80B21EA4(this, 0); func_80B21FFC(this); } @@ -246,7 +246,7 @@ void func_80B2242C(EnHakurock* this, PlayState* play) { func_80B21FFC(this); } else if ((this->actor.bgCheckFlags & 1)) { func_80B21EA4(this, 2); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OBJECT_STICK); + Actor_PlaySfx(&this->actor, NA_SE_EV_OBJECT_STICK); func_80B224C0(this); } } 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 507bf9deb9..8eaa6b4448 100644 --- a/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c +++ b/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c @@ -297,7 +297,7 @@ void func_80B236C8(EnHanabi* this, PlayState* play) { this->actor.home.rot.y += (s16)((Rand_ZeroFloat(40.0f) + 80.0f) * 256.0f); this->unk_144 = (s32)Rand_ZeroFloat(5.0f) + 20; - Actor_PlaySfxAtPos(&this->actor, NA_SE_OC_FIREWORKS); + Actor_PlaySfx(&this->actor, NA_SE_OC_FIREWORKS); func_80B235CC(this, &sp34, sp28); } } @@ -332,7 +332,7 @@ void func_80B23934(EnHanabi* this, PlayState* play) { if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 7) && (play->csCtx.currentCsIndex == 0) && (play->csCtx.frames == 610)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_KYOJIN_GROAN); + Actor_PlaySfx(&this->actor, NA_SE_EV_KYOJIN_GROAN); } } 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 e100a2de30..a576cc8f4a 100644 --- a/src/overlays/actors/ovl_En_Hg/z_en_hg.c +++ b/src/overlays/actors/ovl_En_Hg/z_en_hg.c @@ -177,7 +177,7 @@ void EnHg_Wait(EnHg* this, PlayState* play) { } if ((gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 0) && ((play->csCtx.frames == 20) || (play->csCtx.frames == 60))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HALF_REDEAD_SURPRISE); + Actor_PlaySfx(&this->actor, NA_SE_EN_HALF_REDEAD_SURPRISE); } } } 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 f7a9df82ab..d165c46e01 100644 --- a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c +++ b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c @@ -322,7 +322,7 @@ s32 EnHgo_HandleCsAction(EnHgo* this, PlayState* play) { this->isInCutscene = true; if ((gSaveContext.sceneLayer == 0) && ((play->csCtx.currentCsIndex == 2) || (play->csCtx.currentCsIndex == 4))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_GBVO02); + Actor_PlaySfx(&this->actor, NA_SE_VO_GBVO02); } } break; 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 d8df99887b..67637d532d 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 @@ -145,7 +145,7 @@ void func_80BDB2B8(EnHiddenNuts* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 i; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NEMURI_SLEEP - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_NEMURI_SLEEP - SFX_FLAG); if (player->stateFlags2 & PLAYER_STATE2_8000000) { if (this->unk_20A == 0) { @@ -202,7 +202,7 @@ void func_80BDB580(EnHiddenNuts* this) { void func_80BDB59C(EnHiddenNuts* this, PlayState* play) { s32 i; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NEMURI_SLEEP - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_NEMURI_SLEEP - SFX_FLAG); if (this->unk_218 == 0) { Vec3f sp98 = { 0.0f, 0.0f, 0.0f }; @@ -234,8 +234,8 @@ void func_80BDB59C(EnHiddenNuts* this, PlayState* play) { void func_80BDB788(EnHiddenNuts* this) { this->actor.flags |= ACTOR_FLAG_10; this->actor.flags |= ACTOR_FLAG_8000000; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DEAD); this->unk_21A = 2; this->actionFunc = func_80BDB7E8; } @@ -262,7 +262,7 @@ void func_80BDB7E8(EnHiddenNuts* this, PlayState* play) { EffectSsHahen_SpawnBurst(play, &sp3C, 4.0f, 0, 10, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_UP); func_80BDB1B4(this, 7); this->actionFunc = func_80BDB8F4; } @@ -287,7 +287,7 @@ void func_80BDB978(EnHiddenNuts* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUT_FAINT); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUT_FAINT); } if (this->unk_22C <= curFrame) { @@ -309,7 +309,7 @@ void func_80BDBA28(EnHiddenNuts* this, PlayState* play) { EffectSsHahen_SpawnBurst(play, &sp44, 4.0f, 0, 10, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_UP); this->unk_208 = 1; if ((this->path != NULL) && !SubS_CopyPointFromPath(this->path, this->unk_208, &this->unk_20C)) { @@ -345,14 +345,14 @@ void func_80BDBB48(EnHiddenNuts* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 5.0f) || Animation_OnFrame(&this->skelAnime, 10.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WALK_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_WALK_WATER); sp4E = 1; } } if ((sp4E != 0) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 5.0f) || Animation_OnFrame(&this->skelAnime, 10.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); } Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_20C), 1, 0x1388, 0); @@ -400,7 +400,7 @@ void func_80BDBED4(EnHiddenNuts* this, PlayState* play) { Math_Vec3f_Copy(&sp38, &this->actor.world.pos); sp38.y = this->actor.floorHeight; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DOWN); EffectSsHahen_SpawnBurst(play, &sp38, 4.0f, 0, 10, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); Actor_Kill(&this->actor); } 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 c07bbc5da1..10e3138f42 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 @@ -188,7 +188,7 @@ void func_80C1FE30(EnHintSkb* this) { void func_80C1FE80(EnHintSkb* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 15.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_WALK); } Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 750, 0); this->actor.world.rot.y = this->actor.shape.rot.y; @@ -211,7 +211,7 @@ void func_80C1FF88(EnHintSkb* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 3.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK); } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { @@ -244,7 +244,7 @@ void func_80C2011C(EnHintSkb* this) { if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = 0.0f; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->actionFunc = func_80C2016C; } @@ -284,7 +284,7 @@ void func_80C20274(EnHintSkb* this) { this->actor.speedXZ = -4.0f; } } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->actionFunc = func_80C20334; } @@ -337,7 +337,7 @@ void func_80C20540(EnHintSkb* this) { if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = 0.0f; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->actionFunc = func_80C20590; } @@ -349,7 +349,7 @@ void func_80C20590(EnHintSkb* this, PlayState* play) { if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_3E8 |= 1; func_80C20274(this); } else { @@ -376,7 +376,7 @@ void func_80C2069C(EnHintSkb* this, PlayState* play) { if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_3E8 |= 1; func_80C20274(this); } else { @@ -676,13 +676,13 @@ void func_80C20E90(EnHintSkb* this, PlayState* play) { this->drawDmgEffAlpha = 1.0f; this->drawDmgEffScale = 0.0f; Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_3E8 |= 1; func_80C20274(this); break; case 3: if (this->actor.colChkInfo.health != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->drawDmgEffTimer = 80; } else { this->drawDmgEffTimer = 3; @@ -699,7 +699,7 @@ void func_80C20E90(EnHintSkb* this, PlayState* play) { this->drawDmgEffAlpha = 1.0f; this->drawDmgEffScale = 0.5f; Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); func_80C2066C(this); break; @@ -718,7 +718,7 @@ void func_80C20E90(EnHintSkb* this, PlayState* play) { case 13: Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); func_80C20274(this); break; 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 101751b19f..1c17e4058b 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -408,7 +408,7 @@ void func_8087B7C0(EnHorse* this, PlayState* play, Path* path) { } else if (this->unk_590 > 0) { if (this->unk_590 == 0x1F4) { if (this->rider != NULL) { - Actor_PlaySfxAtPos(&this->rider->actor, NA_SE_VO_IN_CRY_0); + Actor_PlaySfx(&this->rider->actor, NA_SE_VO_IN_CRY_0); } } this->unk_590--; @@ -3383,12 +3383,12 @@ void func_80884A40(EnHorse* this, PlayState* play) { } if ((this->unk_538 == OBJ_UM_ANIM_TROT) || (this->unk_538 == OBJ_UM_ANIM_GALLOP)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HORSE_RUN); + Actor_PlaySfx(&this->actor, NA_SE_EV_HORSE_RUN); } else if (this->unk_538 == OBJ_UM_ANIM_IDLE) { if (this->animIndex == ENHORSE_ANIM_IDLE) { EnHorse_IdleAnimSounds(this, play); } else if (this->animIndex == ENHORSE_ANIM_WHINNY) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HORSE_GROAN); + Actor_PlaySfx(&this->actor, NA_SE_EV_HORSE_GROAN); } } } @@ -3400,7 +3400,7 @@ void func_80884D04(EnHorse* this, PlayState* play) { this->actor.speedXZ = 10.0f; this->action = ENHORSE_ACTION_25; this->unk_540 = this->actor.world.pos; - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_INGO_HORSE_NEIGH); + Actor_PlaySfx(&this->actor, NA_SE_IT_INGO_HORSE_NEIGH); this->animIndex = ENHORSE_ANIM_GALLOP; playSpeed = this->actor.speedXZ * 0.2f; Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 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 2468e5961f..43f39a4b9a 100644 --- a/src/overlays/actors/ovl_En_Ig/z_en_ig.c +++ b/src/overlays/actors/ovl_En_Ig/z_en_ig.c @@ -750,7 +750,7 @@ s32 func_80BF2470(EnIg* this, PlayState* play) { Lib_Vec3f_TranslateAndRotateY(&this->unk_2B0, this->actor.world.rot.y, &sp38, &this->actor.world.pos); this->unk_3E2 += this->timePathTimeSpeed; if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 13.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PIRATE_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_PIRATE_WALK); } } return false; @@ -804,7 +804,7 @@ s32 func_80BF25E8(EnIg* this, PlayState* play) { this->timePathWaypoint = sp50; this->timePathTargetPos = timePathTargetPos; } else if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 13.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PIRATE_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_PIRATE_WALK); } return false; } @@ -816,9 +816,9 @@ s32 func_80BF2890(EnIg* this, PlayState* play) { if (!(this->unk_3D0 & 0x100) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (this->unk_408 != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_SNORE1); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_SNORE1); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_SNORE2); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_SNORE2); } this->unk_408 ^= 1; } 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 4188f44c4b..7c22aa4111 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -386,7 +386,7 @@ void EnIk_Idle(EnIk* this, PlayState* play) { EnIk_CheckActions(this, play); } } else if (this->colliderCylinder.base.acFlags & AC_HIT) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IRONNACK_ARMOR_HIT); + Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_ARMOR_HIT); Audio_PlayBgm_StorePrevBgm(NA_BGM_MINI_BOSS); this->actor.hintId = TATL_HINT_ID_IRON_KNUCKLE; this->colliderCylinder.base.acFlags &= ~AC_HIT; @@ -407,7 +407,7 @@ void EnIk_WalkTowardsPlayer(EnIk* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 16.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IRONNACK_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_WALK); } yawDiff = this->actor.wallYaw - this->actor.shape.rot.y; if ((this->actor.bgCheckFlags & 8) && (ABS_ALT(yawDiff) >= 0x4000)) { @@ -424,7 +424,7 @@ void EnIk_WalkTowardsPlayer(EnIk* this, PlayState* play) { void EnIk_SetupRun(EnIk* this) { Animation_MorphToLoop(&this->skelAnime, &gIronKnuckleRunAnim, -4.0f); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TWINROBA_SHOOT_VOICE); + Actor_PlaySfx(&this->actor, NA_SE_EN_TWINROBA_SHOOT_VOICE); this->actor.speedXZ = 2.5f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnIk_RunTowardsPlayer; @@ -435,7 +435,7 @@ void EnIk_RunTowardsPlayer(EnIk* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 9.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IRONNACK_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_WALK); } yawDiff = this->actor.wallYaw - this->actor.shape.rot.y; if ((this->actor.bgCheckFlags & 8) && (ABS_ALT(yawDiff) >= 0x4000)) { @@ -473,13 +473,13 @@ void EnIk_VerticalAttack(EnIk* this, PlayState* play) { this->timer++; if (!(this->skelAnime.curFrame < 7.0f) || !EnIk_IsChangingAction(this, play)) { if (Animation_OnFrame(&this->skelAnime, 15.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IRONNACK_SWING_AXE); + Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_SWING_AXE); } else if (Animation_OnFrame(&this->skelAnime, 21.0f)) { particlePos.x = (Math_SinS((this->actor.shape.rot.y + 0x6A4)) * 70.0f) + this->actor.world.pos.x; particlePos.z = (Math_CosS((this->actor.shape.rot.y + 0x6A4)) * 70.0f) + this->actor.world.pos.z; particlePos.y = this->actor.world.pos.y; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IRONNACK_HIT_GND); + Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_HIT_GND); Camera_AddQuake(GET_ACTIVE_CAM(play), 2, 25, 5); Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100); CollisionCheck_SpawnShieldParticles(play, &particlePos); @@ -508,7 +508,7 @@ void EnIk_VerticalAttack(EnIk* this, PlayState* play) { void EnIk_SetupTakeOutAxe(EnIk* this) { Animation_PlayOnce(&this->skelAnime, &gIronKnuckleEndVerticalAttackAnim); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IRONNACK_PULLOUT); + Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_PULLOUT); this->actionFunc = EnIk_TakeOutAxe; } @@ -539,7 +539,7 @@ void EnIk_HorizontalDoubleAttack(EnIk* this, PlayState* play) { this->timer++; if ((Animation_OnFrame(&this->skelAnime, 1.0f)) || (Animation_OnFrame(&this->skelAnime, 13.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IRONNACK_SWING_AXE); + Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_SWING_AXE); } if (((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 9.0f)) || ((this->skelAnime.curFrame > 12.0f) && (this->skelAnime.curFrame < 20.0f))) { @@ -584,7 +584,7 @@ void EnIk_SetupSingleHorizontalAttack(EnIk* this) { void EnIk_SingleHorizontalAttack(EnIk* this, PlayState* play) { this->timer++; if (Animation_OnFrame(&this->skelAnime, 13.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IRONNACK_SWING_AXE); + Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_SWING_AXE); } if ((this->skelAnime.curFrame > 12.0f) && (this->skelAnime.curFrame < 20.0f)) { this->colliderQuad.base.atFlags |= AT_ON; @@ -667,7 +667,7 @@ void EnIk_SetupDie(EnIk* this) { this->actor.speedXZ = 0.0f; Animation_MorphToPlayOnce(&this->skelAnime, &gIronKnuckleDeathAnim, -4.0f); this->timer = 24; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IRONNACK_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_DEAD); this->actionFunc = EnIk_Die; } @@ -698,7 +698,7 @@ void EnIk_Die(EnIk* this, PlayState* play) { } } } else if (Animation_OnFrame(&this->skelAnime, 23.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IRONNACK_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_WALK); } } @@ -793,7 +793,7 @@ void EnIk_UpdateDamage(EnIk* this, PlayState* play) { this->drawArmorFlags = 1; this->colliderCylinder.base.colType = 3; this->actor.colChkInfo.damageTable = &sDamageTableNoArmor; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IRONNACK_ARMOR_OFF_DEMO); + Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_ARMOR_OFF_DEMO); EnIk_SetupCutscene(this); } else if (this->drawArmorFlags) { if (this->actor.colChkInfo.damageEffect == DMG_EFF_ICE) { @@ -811,7 +811,7 @@ void EnIk_UpdateDamage(EnIk* this, PlayState* play) { } else if (this->actor.colChkInfo.damageEffect == DMG_EFF_LIGHT_SPARKS) { EnIk_HitArmor(this, play); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IRONNACK_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_DAMAGE); if (this->actor.colChkInfo.health != 0) { EnIk_SetupReactToAttack(this, true); } else { @@ -819,8 +819,8 @@ void EnIk_UpdateDamage(EnIk* this, PlayState* play) { } } } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IRONNACK_ARMOR_HIT); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IRONNACK_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_ARMOR_HIT); + Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_DAMAGE); if (this->actor.colChkInfo.damageEffect == 4) { EnIk_HitArmor(this, play); } diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index 3a83564e56..df5c41b029 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -170,11 +170,11 @@ s32 func_808F3178(EnIn* this, PlayState* play) { this->unk260 = tmp = SubS_IsFloorAbove(play, &this->unk248, -6.0f); if (this->unk260 != 0 && prevUnk260 == 0 && tmp) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_WALK_CONCRETE); + Actor_PlaySfx(&this->actor, NA_SE_PL_WALK_CONCRETE); } this->unk261 = tmp = SubS_IsFloorAbove(play, &this->unk254, -6.0f); if (this->unk261 != 0 && prevUnk261 == 0 && tmp) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_WALK_CONCRETE); + Actor_PlaySfx(&this->actor, NA_SE_PL_WALK_CONCRETE); } return 0; @@ -214,7 +214,7 @@ s32 func_808F3334(EnIn* this, PlayState* play) { if (this->colliderJntSph.base.atFlags & AT_BOUNCED) { return 0; } - Actor_PlaySfxAtPos(&player->actor, NA_SE_PL_BODY_HIT); + Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT); func_800B8D98(play, &this->actor, 3.0f, this->actor.yawTowardsPlayer, 6.0f); } return 1; @@ -313,7 +313,7 @@ void func_808F374C(EnIn* this, PlayState* play) { } } if (this->skelAnime.animation == &object_in_Anim_0198A8 && Animation_OnFrame(&this->skelAnime, 20.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_IN_CRY_0); + Actor_PlaySfx(&this->actor, NA_SE_VO_IN_CRY_0); } if (SkelAnime_Update(&this->skelAnime)) { this->unk488 %= ARRAY_COUNT(sAnimations); @@ -376,9 +376,9 @@ void func_808F39DC(EnIn* this, PlayState* play) { this->actor.textId = textId; this->actionFunc = func_808F395C; if (this->unk4B0 == WEEKEVENTREG_RACE_FLAG_2) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_IN_LOST); + Actor_PlaySfx(&this->actor, NA_SE_VO_IN_LOST); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_IN_JOY0); + Actor_PlaySfx(&this->actor, NA_SE_VO_IN_JOY0); } } @@ -1335,9 +1335,9 @@ void func_808F5C98(EnIn* this, PlayState* play) { } if (this->unk4A8 == 2) { if (this->unk4B0 == WEEKEVENTREG_RACE_FLAG_2) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_IN_LOST); + Actor_PlaySfx(&this->actor, NA_SE_VO_IN_LOST); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_IN_JOY0); + Actor_PlaySfx(&this->actor, NA_SE_VO_IN_JOY0); } this->unk4A8 = 3; } else if (this->unk4A8 < 3) { 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 9eae19437c..9031e9ed34 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -112,7 +112,7 @@ void func_8091A9E4(EnInsect* this) { return; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MUSI_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_MUSI_WALK); this->unk_316 = 3.0f / CLAMP_MIN(this->skelAnime.playSpeed, 0.1f); if (this->unk_316 < 2) { @@ -325,7 +325,7 @@ void func_8091B2D8(EnInsect* this, PlayState* play) { void func_8091B3D0(EnInsect* this) { this->unk_312 = 60; this->skelAnime.playSpeed = 1.9f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTURA_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALTURA_BOUND); Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); this->actionFunc = func_8091B440; this->unk_30C &= ~0x100; 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 42104bd589..5d16c1fcde 100644 --- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c +++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c @@ -2575,7 +2575,7 @@ void func_80B48848(EnInvadepoh* this, PlayState* play) { func_80B43E6C(this, 6, this->behaviorInfo.unk4C, 0x46); if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 7.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_ROMANI_WALK); } if (this->actionTimer > 0) { this->actionTimer--; @@ -3028,7 +3028,7 @@ void func_80B49C38(EnInvadepoh* this, PlayState* play) { if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 7.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_ROMANI_WALK); } if (this->clockTime >= 0.9999f) { Actor_Kill(&this->actor); @@ -3254,7 +3254,7 @@ void func_80B4A67C(EnInvadepoh* this, PlayState* play) { } if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 7.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_ROMANI_WALK); } if (this->pathIndex == this->endPoint) { func_80B4A2C0(this); @@ -3528,7 +3528,7 @@ void func_80B4B3DC(EnInvadepoh* this) { s32 pad; if (Animation_OnFrame(&this->skelAnime, 1.0f) || Animation_OnFrame(&this->skelAnime, 7.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MONKEY_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_MONKEY_WALK); } } @@ -3591,7 +3591,7 @@ void func_80B4B564(EnInvadepoh* this, PlayState* play) { this->actionTimer--; } else if (this->unk3BC >= 0) { if ((D_80B50348 == 0) && (Rand_ZeroOne() < 0.4f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_GROAN); + Actor_PlaySfx(&this->actor, NA_SE_EV_SMALL_DOG_GROAN); } func_80B4B724(this); } else { @@ -3612,7 +3612,7 @@ void func_80B4B768(EnInvadepoh* this, PlayState* play) { 0x64); func_80B44E90(this, play); if (Animation_OnFrame(&this->skelAnime, 13.0f) || Animation_OnFrame(&this->skelAnime, 19.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_ANG_BARK); + Actor_PlaySfx(&this->actor, NA_SE_EV_SMALL_DOG_ANG_BARK); } if (this->animPlayFlag) { func_80B4B510(this); @@ -3786,7 +3786,7 @@ void func_80B4BC4C(EnInvadepoh* this, PlayState* play) { if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_ROMANI_WALK); } if (gSaveContext.save.time > CLOCK_TIME(20, 15)) { Actor_Kill(&this->actor); @@ -4000,7 +4000,7 @@ void func_80B4C730(EnInvadepoh* this, PlayState* play) { if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 7.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_ROMANI_WALK); } if (this->clockTime >= 0.9999f) { 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 03cc41f20e..05855bb204 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 @@ -93,7 +93,7 @@ s32 EnJcMato_CheckForHit(EnJcMato* this, PlayState* play) { this->collider.dim.worldSphere.center.z = this->pos.z; if ((this->collider.base.acFlags & AC_HIT) && !this->hitFlag && (this->actor.colChkInfo.damageEffect == 0xF)) { this->collider.base.acFlags &= ~AC_HIT; - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); play->interfaceCtx.minigamePoints = 1; this->hitFlag = true; return 1; 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 2db753d01e..59e860c200 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 @@ -561,19 +561,19 @@ s32 func_80C14BCC(EnJgameTsn* this, PlayState* play) { } if (phi_s3 == this->unk_218) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); *this->unk_208[phi_s3] |= OBJLUPYGAMELIFT_DISPLAY_CORRECT; play->interfaceCtx.minigamePoints = 1; return true; } if (*this->unk_208[phi_s3] & OBJLUPYGAMELIFT_IGNITE_FIRE) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); *this->unk_208[phi_s3] |= OBJLUPYGAMELIFT_DISPLAY_CORRECT; play->interfaceCtx.minigamePoints = 1; } else { *this->unk_208[phi_s3] |= OBJLUPYGAMELIFT_DISPLAY_INCORRECT; - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_ERROR); + Actor_PlaySfx(&this->actor, NA_SE_SY_ERROR); } } 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 81415caf5e..fbe97b109c 100644 --- a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c +++ b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c @@ -539,7 +539,7 @@ void func_80B85FA8(EnKaizoku* this, PlayState* play) { func_800B7298(play, &this->picto.actor, 4); Actor_SpawnFloorDustRing(play, &this->picto.actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0); Actor_SpawnFloorDustRing(play, &this->picto.actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0); - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_PIRATE_ONGND); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_ONGND); } if (curFrame >= 11.0f) { @@ -583,7 +583,7 @@ void func_80B85FA8(EnKaizoku* this, PlayState* play) { case 5: Math_ApproachF(&this->unk_5E0, 2.0f, 0.2f, 1.0f); if (Animation_OnFrame(&this->skelAnime, 20.0f)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_BOSU_SWORD); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_BOSU_SWORD); } if (curFrame >= 30.0f) { this->unk_598 = 0; @@ -713,7 +713,7 @@ void func_80B868B8(EnKaizoku* this, PlayState* play) { EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_15); textId = this->unk_2CA * 4 + this->unk_2C8; Message_StartTextbox(play, D_80B8A8D0[textId], &this->picto.actor); - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_LAST2_SHOUT); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_LAST2_SHOUT); this->unk_598 = 0; this->unk_59C++; } @@ -785,10 +785,10 @@ void func_80B86B74(EnKaizoku* this, PlayState* play) { case 1: if (this->frameCount <= curFrame) { if (this->unk_2D9 == 0) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_PIRATE_DAMM_BREATH); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_DAMM_BREATH); this->unk_2D9 = 1; } else { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_PIRATE_BREATH); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_BREATH); } } @@ -820,7 +820,7 @@ void func_80B86B74(EnKaizoku* this, PlayState* play) { if (this->unk_5A0 == 0x12) { Actor* temp_v0_2; - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_PIRATE_SHOUT); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_SHOUT); temp_v0_2 = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ARROW, this->picto.actor.world.pos.x, this->picto.actor.world.pos.y + 10.0f, this->picto.actor.world.pos.z, this->picto.actor.shape.rot.x, this->picto.actor.shape.rot.y, @@ -989,11 +989,11 @@ void func_80B8760C(EnKaizoku* this, PlayState* play) { temp_ft0 = this->skelAnime.curFrame - this->skelAnime.playSpeed; temp_ft1 = this->skelAnime.curFrame + this->skelAnime.playSpeed; if (this->skelAnime.curFrame != 0.0f && ((temp_ft0 < 0 && temp_ft1 > 0) || (temp_ft0 < 5 && temp_ft1 >= 6))) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_GERUDOFT_WALK); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_GERUDOFT_WALK); } if (!(play->gameplayFrames & 0x5F)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_PIRATE_BREATH); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_BREATH); } if (this->unk_2B2 == 0) { @@ -1091,7 +1091,7 @@ void func_80B87C7C(EnKaizoku* this) { EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_8); this->picto.actor.speedXZ = 6.5f; this->picto.actor.velocity.y = 15.0f; - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_TEKU_JUMP); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_TEKU_JUMP); this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y; this->bodyCollider.info.elemType = ELEMTYPE_UNK4; this->bodyCollider.base.colType = COLTYPE_NONE; @@ -1136,7 +1136,7 @@ void func_80B87D3C(EnKaizoku* this, PlayState* play) { void func_80B87E28(EnKaizoku* this) { EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_8); this->picto.actor.speedXZ = -8.0f; - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_TEKU_JUMP); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_TEKU_JUMP); this->bodyCollider.info.elemType = ELEMTYPE_UNK4; this->bodyCollider.base.colType = COLTYPE_NONE; this->swordCollider.info.elemType = ELEMTYPE_UNK4; @@ -1158,7 +1158,7 @@ void func_80B87E9C(EnKaizoku* this, PlayState* play) { } } if (!(play->state.frames & 0x5F)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_PIRATE_BREATH); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_BREATH); } } @@ -1185,7 +1185,7 @@ void func_80B87FDC(EnKaizoku* this, PlayState* play2) { this->picto.actor.speedXZ = 0.0f; if (Animation_OnFrame(&this->skelAnime, 1.0f)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_PIRATE_ATTACK); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_ATTACK); this->swordState = 1; } else if (Animation_OnFrame(&this->skelAnime, 6.0f)) { this->swordState = -1; @@ -1235,7 +1235,7 @@ void func_80B88214(EnKaizoku* this) { this->unk_2B2 = 0; this->picto.actor.speedXZ = 10.0f; this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y = this->picto.actor.yawTowardsPlayer; - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_TEKU_JUMP); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_TEKU_JUMP); this->action = KAIZOKU_ACTION_5; this->actionFunc = func_80B88278; } @@ -1254,7 +1254,7 @@ void func_80B88278(EnKaizoku* this, PlayState* play) { } } if (!(play->gameplayFrames & 0x5F)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_PIRATE_BREATH); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_BREATH); } } @@ -1325,11 +1325,11 @@ void func_80B88378(EnKaizoku* this, PlayState* play) { } if (!(play->gameplayFrames & 0x5F)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_PIRATE_BREATH); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_BREATH); } if ((this->skelAnime.curFrame != 0.0f) && ((sp30 < 0 && sp2C > 0) || (sp30 < 4 && sp2C >= 5))) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_GERUDOFT_WALK); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_GERUDOFT_WALK); } } } @@ -1364,7 +1364,7 @@ void func_80B887AC(EnKaizoku* this, PlayState* play) { } } if (!(play->gameplayFrames & 0x5F)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_PIRATE_BREATH); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_BREATH); } } } @@ -1401,7 +1401,7 @@ void func_80B88964(EnKaizoku* this, PlayState* play) { Actor_SpawnFloorDustRing(play, &this->picto.actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0); this->swordState = 1; this->picto.actor.speedXZ = 10.0f; - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_PIRATE_ATTACK); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_ATTACK); } else if (Animation_OnFrame(&this->skelAnime, 21.0f)) { this->picto.actor.speedXZ = 0.0f; } else if (Animation_OnFrame(&this->skelAnime, 24.0f)) { @@ -1528,12 +1528,12 @@ void func_80B88D6C(EnKaizoku* this, PlayState* play) { temp_ft5 = this->skelAnime.curFrame + this->skelAnime.playSpeed; if (this->skelAnime.curFrame != 0.0f) { if (((temp_ft4 < 0 && temp_ft5 > 0) || (temp_ft4 < 5 && temp_ft5 > 5))) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_GERUDOFT_WALK); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_GERUDOFT_WALK); } } if (!(play->gameplayFrames & 0x5F)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_PIRATE_BREATH); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_BREATH); } if (this->picto.actor.xzDistToPlayer <= 65.0f) { @@ -1565,7 +1565,7 @@ void func_80B891B8(EnKaizoku* this) { this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE; } - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_COMMON_FREEZE); this->unk_2D8 = 1; if ((this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_SFX) && @@ -1632,7 +1632,7 @@ void func_80B893CC(EnKaizoku* this, PlayState* play) { this->picto.actor.flags |= ACTOR_FLAG_400; } - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_PIRATE_DAMAGE); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_DAMAGE); this->action = KAIZOKU_ACTION_14; this->actionFunc = func_80B894C0; } @@ -1678,7 +1678,7 @@ void func_80B8960C(EnKaizoku* this, PlayState* play) { this->unk_2D8 = 1; func_800B7298(play, &this->picto.actor, 0x7B); Enemy_StartFinishingBlow(play, &this->picto.actor); - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_PIRATE_DEAD); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_DEAD); this->picto.actor.flags |= ACTOR_FLAG_8000000; this->picto.actor.flags &= ~ACTOR_FLAG_1; this->picto.actor.flags &= ~ACTOR_FLAG_400; @@ -1753,7 +1753,7 @@ void func_80B8971C(EnKaizoku* this, PlayState* play) { this->unk_2D8 = 0; func_80B86B58(this); } else if (Animation_OnFrame(&this->skelAnime, 10.0f)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_GERUDOFT_DOWN); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_GERUDOFT_DOWN); } } @@ -1940,7 +1940,7 @@ void func_80B89A08(EnKaizoku* this, PlayState* play) { } this->bodyCollider.base.acFlags &= ~AC_HIT; - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_IT_SHIELD_BOUND); + Actor_PlaySfx(&this->picto.actor, NA_SE_IT_SHIELD_BOUND); EffectSsHitmark_SpawnFixedScale(play, 3, &pos); CollisionCheck_SpawnShieldParticlesMetal(play, &pos); } 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 3ef617aec1..e60efdf6b5 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -210,24 +210,24 @@ s32 EnKakasi_ValidatePictograph(PlayState* play, Actor* thisx) { void EnKakasi_CheckAnimationSfx(EnKakasi* this) { if (this->animIndex == ENKAKASI_ANIM_SIDEWAYS_SHAKING || this->animIndex == ENKAKASI_ANIM_ARMS_CROSSED_STILL) { if (Animation_OnFrame(&this->skelanime, 1.0f) || Animation_OnFrame(&this->skelanime, 8.0f)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EV_KAKASHI_SWING); + Actor_PlaySfx(&this->picto.actor, NA_SE_EV_KAKASHI_SWING); } } if (this->animIndex == ENKAKASI_ANIM_HOPPING_REGULAR || this->animIndex == ENKAKASI_ANIM_SLOWROLL) { if (Animation_OnFrame(&this->skelanime, 4.0f) || Animation_OnFrame(&this->skelanime, 8.0f)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EV_KAKASHI_SWING); + Actor_PlaySfx(&this->picto.actor, NA_SE_EV_KAKASHI_SWING); } if (Animation_OnFrame(&this->skelanime, 1.0f) || Animation_OnFrame(&this->skelanime, 9.0f) || Animation_OnFrame(&this->skelanime, 16.0f)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_IT_KAKASHI_JUMP); + Actor_PlaySfx(&this->picto.actor, NA_SE_IT_KAKASHI_JUMP); } if (Animation_OnFrame(&this->skelanime, 18.0f)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EV_KAKASHI_ROLL); + Actor_PlaySfx(&this->picto.actor, NA_SE_EV_KAKASHI_ROLL); } } if (this->animIndex == ENKAKASI_ANIM_SPIN_REACH_OFFER || this->animIndex == ENKAKASI_ANIM_TWIRL) { if (Animation_OnFrame(&this->skelanime, 1.0f)) { - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EV_KAKASH_LONGI_ROLL); + Actor_PlaySfx(&this->picto.actor, NA_SE_EV_KAKASH_LONGI_ROLL); } } } @@ -620,7 +620,7 @@ void EnKakasi_TeachingSong(EnKakasi* this, PlayState* play) { this->unk190 = 0; this->unkCounter1A4 = 0; ActorCutscene_Stop(this->actorCutscenes[0]); - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_YASE_DEAD); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_YASE_DEAD); if (this) {} this->unkState196 = 2; this->subCamId = SUB_CAM_ID_DONE; @@ -1007,7 +1007,7 @@ void EnKakasi_DiggingAway(EnKakasi* this, PlayState* play) { } else { Actor_SpawnFloorDustRing(play, &this->picto.actor, &this->picto.actor.world.pos, this->picto.actor.shape.shadowScale - 20.0f, 5, 4.0f, 200, 10, 1); - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_AKINDONUTS_HIDE); } } @@ -1056,7 +1056,7 @@ void EnKakasi_SetupRiseOutOfGround(EnKakasi* this, PlayState* play) { } else { ActorCutscene_StartAndSetUnkLinkFields(this->actorCutscenes[cutsceneIndex], &this->picto.actor); - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_AKINDONUTS_HIDE); this->picto.actor.draw = EnKakasi_Draw; this->unkState196 = 6; this->actionFunc = EnKakasi_RisingOutOfGround; @@ -1073,7 +1073,7 @@ void EnKakasi_RisingOutOfGround(EnKakasi* this, PlayState* play) { if ((play->gameplayFrames % 8) == 0) { Actor_SpawnFloorDustRing(play, &this->picto.actor, &this->picto.actor.world.pos, this->picto.actor.shape.shadowScale - 20.0f, 10, 8.0f, 500, 10, 1); - Actor_PlaySfxAtPos(&this->picto.actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfx(&this->picto.actor, NA_SE_EN_AKINDONUTS_HIDE); } Math_ApproachF(&this->picto.actor.shape.yOffset, 0.0f, 0.5f, 200.0f); } else { 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 e9139c9346..a54bfdc2da 100644 --- a/src/overlays/actors/ovl_En_Kame/z_en_kame.c +++ b/src/overlays/actors/ovl_En_Kame/z_en_kame.c @@ -193,7 +193,7 @@ void func_80AD70EC(EnKame* this, PlayState* play) { Player* player = GET_PLAYER(play); if (Animation_OnFrame(&this->skelAnime1, 10.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_VOICE); + Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_VOICE); this->unk_2A0 = 40; } @@ -237,7 +237,7 @@ void func_80AD7254(EnKame* this, PlayState* play) { if (this->unk_29E == 0) { func_80AD70A0(this); } else if (Animation_OnFrame(&this->skelAnime1, 0.0f) || Animation_OnFrame(&this->skelAnime1, 15.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_WALK); } } @@ -248,7 +248,7 @@ void func_80AD73A8(EnKame* this) { this->unk_2A8 = 1.0f; this->actor.speedXZ = 0.0f; if (this->unk_2A0 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_VOICE); + Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_VOICE); } this->actionFunc = func_80AD7424; } @@ -313,7 +313,7 @@ void func_80AD76CC(EnKame* this) { func_80AD7568(this); this->unk_29E = 15; this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_CUTTER_ON); + Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_CUTTER_ON); this->unk_2BC.y = this->actor.home.pos.y - 100.0f; } else { this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); @@ -383,7 +383,7 @@ void func_80AD7948(EnKame* this, PlayState* play) { if (Math_ScaledStepToS(&this->unk_2A6, this->unk_29E, (s32)(this->unk_2A6 * 0.09f) + 45)) { if (this->unk_29E == 0) { if (this->unk_2AC >= 1.0f) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_CUTTER_OFF); + Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_CUTTER_OFF); } this->unk_2AC -= 0.1f; this->collider.base.atFlags &= ~AT_ON; @@ -440,7 +440,7 @@ void func_80AD7C54(EnKame* this) { this->collider.base.atFlags &= ~(AT_BOUNCED | AT_HIT); this->actor.flags &= ~ACTOR_FLAG_10; this->actor.shape.rot.z = 0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_REVERSE); + Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_REVERSE); this->actionFunc = func_80AD7D40; } @@ -472,7 +472,7 @@ void func_80AD7E0C(EnKame* this, PlayState* play) { Animation_PlayOnce(&this->skelAnime1, &object_tl_Anim_0027D8); } else { Animation_PlayOnce(&this->skelAnime1, &object_tl_Anim_002F88); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_ROAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_ROAR); } } } else { @@ -482,7 +482,7 @@ void func_80AD7E0C(EnKame* this, PlayState* play) { void func_80AD7EC0(EnKame* this) { Animation_MorphToPlayOnce(&this->skelAnime1, &object_tl_Anim_002510, -3.0f); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_WAKEUP); + Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_WAKEUP); this->actionFunc = func_80AD7F10; } @@ -527,7 +527,7 @@ void func_80AD8060(EnKame* this) { Animation_Change(&this->skelAnime1, &object_tl_Anim_0008B4, 1.0f, 0.0f, sp36, ANIMMODE_ONCE, -3.0f); Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, sp36); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_DAMAGE); this->collider.base.acFlags &= ~AC_ON; this->actionFunc = func_80AD810C; } @@ -557,7 +557,7 @@ void func_80AD8148(EnKame* this, PlayState* play) { this->actor.bgCheckFlags &= ~0x1; this->actor.flags &= ~ACTOR_FLAG_1; this->actor.flags |= ACTOR_FLAG_10; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_DEAD); this->unk_29E = 0; this->actionFunc = func_80AD825C; } @@ -565,7 +565,7 @@ void func_80AD8148(EnKame* this, PlayState* play) { void func_80AD825C(EnKame* this, PlayState* play) { SkelAnime_Update(&this->skelAnime1); if ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HIPLOOP_LAND); + Actor_PlaySfx(&this->actor, NA_SE_EN_HIPLOOP_LAND); func_80AD8364(this); } else { if (this->unk_29E == 1) { @@ -644,7 +644,7 @@ void func_80AD84C0(EnKame* this, PlayState* play) { if (this->actor.colChkInfo.damageEffect == 5) { this->unk_2A2 = 40; Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->drawDmgEffScale = 0.6f; this->drawDmgEffAlpha = 2.0f; this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_SMALL; @@ -652,7 +652,7 @@ void func_80AD84C0(EnKame* this, PlayState* play) { } else if (this->actor.colChkInfo.damageEffect == 1) { this->unk_2A2 = 40; Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); func_80AD7FA4(this); } else if (this->actor.colChkInfo.damageEffect == 3) { func_80AD6F9C(this); 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 54df1bcd70..a718d141f5 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -384,7 +384,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { piece->actor.flags &= ~ACTOR_FLAG_1; piece->actor.flags |= ACTOR_FLAG_2000000; this->cutMarkTimer = 5; - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_SWORD_STRIKE); + Actor_PlaySfx(&this->actor, NA_SE_IT_SWORD_STRIKE); } } } @@ -497,14 +497,14 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { if (this->actor.bgCheckFlags & 8) { if (!(this->actor.bgCheckFlags & 1)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WOODPLATE_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EV_WOODPLATE_BOUND); } this->actor.speedXZ *= -0.5f; } if (this->actor.bgCheckFlags & 0x40) { this->actionState = ENKANBAN_WATER; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMB_DROP_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_DROP_WATER); this->bounceX = this->bounceZ = 0; this->actor.world.pos.y += this->actor.depthInWater; EffectSsGSplash_Spawn(play, &this->actor.world.pos, NULL, NULL, 0, (this->partCount * 20) + 300); @@ -622,9 +622,9 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { if (bounced) { if (this->unk_197 > 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_WALK_SNOW); + Actor_PlaySfx(&this->actor, NA_SE_PL_WALK_SNOW); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WOODPLATE_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EV_WOODPLATE_BOUND); } } 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 dd8d513e49..354bcb630f 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -260,7 +260,7 @@ void EnKarebaba_Idle(EnKarebaba* this, PlayState* play) { void EnKarebaba_SetupAwaken(EnKarebaba* this) { Animation_Change(&this->skelAnime, &gDekuBabaFastChompAnim, 4.0f, 0.0f, Animation_GetLastFrame(&gDekuBabaFastChompAnim), ANIMMODE_LOOP, -3.0f); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_WAKEUP); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKU_WAKEUP); this->actionFunc = EnKarebaba_Awaken; } @@ -313,7 +313,7 @@ void EnKarebaba_Upright(EnKarebaba* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIZUBABA1_MOUTH); + Actor_PlaySfx(&this->actor, NA_SE_EN_MIZUBABA1_MOUTH); } if (this->hurtCollider.base.acFlags & AC_HIT) { @@ -347,7 +347,7 @@ void EnKarebaba_Spin(EnKarebaba* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIZUBABA1_MOUTH); + Actor_PlaySfx(&this->actor, NA_SE_EN_MIZUBABA1_MOUTH); } temp = 20 - this->timer; @@ -385,7 +385,7 @@ void EnKarebaba_SetupDying(EnKarebaba* this) { this->timer = 3; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_JR_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKU_JR_DEAD); this->actor.flags |= (ACTOR_FLAG_10 | ACTOR_FLAG_20); this->actionFunc = EnKarebaba_Dying; } @@ -424,7 +424,7 @@ void EnKarebaba_Dying(EnKarebaba* this, PlayState* play) { } if (this->actor.bgCheckFlags & 2) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); this->timer = 1; } } else if (this->timer == 1) { @@ -448,7 +448,7 @@ void EnKarebaba_Dying(EnKarebaba* this, PlayState* play) { } void EnKarebaba_SetupShrinkDie(EnKarebaba* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_JR_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEKU_JR_DEAD); this->actor.flags |= (ACTOR_FLAG_10 | ACTOR_FLAG_20); this->actor.flags &= ~ACTOR_FLAG_1; if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { 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 c02b00b5aa..ce98bfdc38 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 @@ -534,13 +534,13 @@ void func_80B27188(EnKendoJs* this, PlayState* play) { switch (func_80B26BF8(this, play)) { case 0: this->unk_286 = 0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); player->stateFlags1 |= PLAYER_STATE1_20; func_80B26EB4(this, play); break; case 1: - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_ERROR); + Actor_PlaySfx(&this->actor, NA_SE_SY_ERROR); this->unk_286 = 0; player->stateFlags1 |= PLAYER_STATE1_20; Message_StartTextbox(play, 0x2729, &this->actor); @@ -634,7 +634,7 @@ void func_80B274BC(EnKendoJs* this, PlayState* play) { } else { play->interfaceCtx.minigamePoints = 1; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); this->unk_28E = 0; } func_80B2783C(this, play); 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 f2733c3c1c..a15d4d128e 100644 --- a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c +++ b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c @@ -443,7 +443,7 @@ void func_80B4163C(EnKgy* this, PlayState* play) { this->lightInfo.params.point.y = this->unk_2C0.y; this->lightInfo.params.point.z = this->unk_2C0.z; this->unk_300 = 200; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SWORD_FORGE); + Actor_PlaySfx(&this->actor, NA_SE_EV_SWORD_FORGE); break; } 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 468368cd59..910bf49c3b 100644 --- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c +++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c @@ -981,7 +981,7 @@ void func_80A5D7C4(EnKusa2* this, PlayState* play) { } this->unk_1C8 = Rand_S16Offset(72, 16); this->actor.velocity.y = 8.8f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); func_80A5DC70(this); } @@ -1055,7 +1055,7 @@ void func_80A5D9C8(EnKusa2* this, PlayState* play) { this->unk_1D0--; if (this->unk_1D0 <= 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); + Actor_PlaySfx(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); this->unk_1D0 = (Rand_Next() >> 0x1D) + 14; } @@ -1090,7 +1090,7 @@ void func_80A5DC98(EnKusa2* this, PlayState* play) { if (this->actor.bgCheckFlags & 1) { func_80A5CD0C(this); func_80A5BB40(this, play, 1); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); func_80A5DE18(this); } else if (this->actor.bgCheckFlags & 0x20) { func_80A5BDB0(this, play); @@ -1122,14 +1122,14 @@ void func_80A5DEB4(EnKusa2* this, PlayState* play) { if (this->unk_1D0 > 0) { this->unk_1D0--; if (this->unk_1D0 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); + Actor_PlaySfx(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); } } if (this->unk_1D1 > 0) { this->unk_1D1--; if (this->unk_1D1 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); + Actor_PlaySfx(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); } } 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 aafc12b516..9c0eafeb15 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 @@ -284,7 +284,7 @@ void func_80AE9FC8(EnLiftNuts* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80AEA044; } @@ -301,7 +301,7 @@ void func_80AEA0B4(EnLiftNuts* this) { this->actionFunc = func_80AEA1A0; } else { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80AEA128; } } @@ -598,7 +598,7 @@ void func_80AEABF0(EnLiftNuts* this) { if (this->actionFunc != func_80AEB698) { if (func_80AE9B4C(0, 0)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); } Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 16); } @@ -743,7 +743,7 @@ void func_80AEB148(EnLiftNuts* this, PlayState* play) { SET_EVENTINF(EVENTINF_34); Interface_StartTimer(4, 0); func_80AE9B4C(1, 2); - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_FOUND); + Actor_PlaySfx(&this->actor, NA_SE_SY_FOUND); func_80AEB280(this); } } 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 b988fcce32..b1aa2f76b4 100644 --- a/src/overlays/actors/ovl_En_Light/z_en_light.c +++ b/src/overlays/actors/ovl_En_Light/z_en_light.c @@ -112,7 +112,7 @@ void EnLight_Update(Actor* thisx, PlayState* play) { func_80865BF8(this, play); if ((this->actor.params >= 0) && !ENLIGHT_GET_4000(&this->actor)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_TORCH - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_TORCH - SFX_FLAG); } } @@ -156,7 +156,7 @@ void func_80865F38(Actor* thisx, PlayState* play) { func_80865BF8(this, play); if ((this->actor.params >= 0) && (sp2C == true)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_TORCH - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_TORCH - SFX_FLAG); } } 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 ac376bb166..1be03e655b 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 @@ -157,7 +157,7 @@ void EnLookNuts_Patrol(EnLookNuts* this, PlayState* play) { this->actor.speedXZ = 2.0f; if (Animation_OnFrame(&this->skelAnime, 1.0f) || Animation_OnFrame(&this->skelAnime, 5.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); } if (D_80A6862C != 0) { @@ -273,7 +273,7 @@ void EnLookNuts_DetectedPlayer(EnLookNuts* this, PlayState* play) { void EnLookNuts_RunToPlayer(EnLookNuts* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 1.0f) || Animation_OnFrame(&this->skelAnime, 5.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); } this->actor.speedXZ = 4.0f; 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 973e915531..62d848dd9a 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c @@ -267,7 +267,7 @@ void EnMa4_RunInCircles(EnMa4* this, PlayState* play) { } if (sAnimIndex == 13 && Animation_OnFrame(&this->skelAnime, 37.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROMANI_BOW_FLICK); + Actor_PlaySfx(&this->actor, NA_SE_EV_ROMANI_BOW_FLICK); } sp34.x = this->pathPoints[this->pathIndex].x; @@ -300,7 +300,7 @@ void EnMa4_RunInCircles(EnMa4* this, PlayState* play) { Actor_MoveWithGravity(&this->actor); if (this->skelAnime.animation == &gRomaniRunAnim) { if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 4.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_ROMANI_WALK); } } } 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 65e3d8b387..95890455cf 100644 --- a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c +++ b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c @@ -525,7 +525,7 @@ void func_80B37CA0(EnMaruta* this, PlayState* play) { ((this->actionFunc == func_80B37428) && !(this->actor.world.pos.y < (this->actor.floorHeight - 20.0f)))) { if ((this->collider.base.acFlags & AC_HIT) && (this->actionFunc == func_80B372CC)) { this->collider.base.acFlags &= ~AC_HIT; - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_SWORD_STRIKE); + Actor_PlaySfx(&this->actor, NA_SE_IT_SWORD_STRIKE); if (D_80B386CC[player->meleeWeaponAnimation] != 0) { s32 temp = D_80B386CC[player->meleeWeaponAnimation] + 1; @@ -587,7 +587,7 @@ void func_80B37EC0(EnMaruta* this, PlayState* play) { if (this->actor.velocity.y < -this->actor.gravity) { func_80B382E4(play, sp34); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_LOG_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EV_LOG_BOUND); this->actor.velocity.y *= -0.6f; func_80B38060(this, &sp34); } 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 a8a059c1ff..9eed098866 100644 --- a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c +++ b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c @@ -189,7 +189,7 @@ void EnMinifrog_Jump(EnMinifrog* this) { if (Animation_OnFrame(&this->skelAnime, 4.0f)) { this->actor.bgCheckFlags &= ~1; this->actor.velocity.y = 6.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_JUMP); + Actor_PlaySfx(&this->actor, NA_SE_EV_FROG_JUMP); this->jumpState = MINIFROG_STATE_AIR; } break; 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 bf585ff61a..a18f712476 100644 --- a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c +++ b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c @@ -202,7 +202,7 @@ void EnMinislime_AddIceShardEffect(EnMinislime* this) { } this->frozenAlpha = 0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_BROKEN); + Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_BROKEN); } void EnMinislime_AddIceSmokeEffect(EnMinislime* this, PlayState* play) { @@ -391,7 +391,7 @@ void EnMinislime_SetupGrowAndShrink(EnMinislime* this) { this->actor.scale.x = 0.19f; this->actor.scale.y = 0.044999998f; this->actor.scale.z = 0.19f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_SLIME_JUMP2); + Actor_PlaySfx(&this->actor, NA_SE_EN_SLIME_JUMP2); this->actionFunc = EnMinislime_GrowAndShrink; } @@ -453,7 +453,7 @@ void EnMinislime_Idle(EnMinislime* this, PlayState* play) { void EnMinislime_SetupBounce(EnMinislime* this) { this->actor.speedXZ = 0.0f; this->bounceTimer = (this->actionFunc == EnMinislime_GrowAndShrink) ? 1 : 4; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_SLIME_JUMP1); + Actor_PlaySfx(&this->actor, NA_SE_EN_SLIME_JUMP1); this->actionFunc = EnMinislime_Bounce; } 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 c89fdcdfaa..612e0d3db4 100644 --- a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c +++ b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c @@ -291,7 +291,7 @@ void func_80A4E58C(EnMkk* this) { this->unk_14B |= 1; this->actor.speedXZ = 3.0f; this->actor.velocity.y = 5.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUROSUKE_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_KUROSUKE_ATTACK); this->collider.base.atFlags |= AT_ON; Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x800); this->actionFunc = func_80A4E60C; @@ -313,7 +313,7 @@ void func_80A4E67C(EnMkk* this) { this->actor.flags &= ~ACTOR_FLAG_1; this->collider.base.acFlags &= ~AC_ON; this->actor.flags |= ACTOR_FLAG_10; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DEAD); this->alpha = 254; func_800BE568(&this->actor, &this->collider); this->actor.speedXZ = 7.0f; @@ -334,7 +334,7 @@ void func_80A4E72C(EnMkk* this, PlayState* play) { temp.z = this->actor.world.pos.z; EffectSsDeadDb_Spawn(play, &temp, &gZeroVec3f, &gZeroVec3f, &sEffPrimColors[this->actor.params], &sEffEnvColors[this->actor.params], 0x46, 4, 0xC); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EXTINCT); + Actor_PlaySfx(&this->actor, NA_SE_EN_EXTINCT); if (this->unk_14C != 0) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, this->unk_14C * 0x10); } 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 d9b0bf5076..0cc91d53dc 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -124,7 +124,7 @@ void func_80965DB4(EnMm* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { func_80965BBC(this); - Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_PULL_UP_ROCK); + Actor_PlaySfx(&this->actor, NA_SE_PL_PULL_UP_ROCK); } else { if ((this->actor.velocity.y > 0.0f) && (this->actor.bgCheckFlags & 0x10)) { this->actor.velocity.y = 0.0f; @@ -135,7 +135,7 @@ void func_80965DB4(EnMm* this, PlayState* play) { this->actor.world.rot.y += BINANG_SUB(0x8000, (s16)(angle * 2)); this->actor.speedXZ *= 0.5f; CollisionCheck_SpawnShieldParticles(play, &this->actor.world.pos); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HUMAN_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EV_HUMAN_BOUND); } if (!(this->actor.bgCheckFlags & 1)) { @@ -169,7 +169,7 @@ void func_80965DB4(EnMm* this, PlayState* play) { this->actor.bgCheckFlags &= ~1; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HUMAN_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EV_HUMAN_BOUND); } else { Actor_PickUp(&this->actor, play, GI_NONE, 50.0f, 30.0f); } 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 3e58691cc7..a94ade409e 100644 --- a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c +++ b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c @@ -365,7 +365,7 @@ void func_80A6F9DC(EnMm3* this, PlayState* play) { if (((this->unk_2B4 == 0x279D) || (this->unk_2B4 == 0x27A0) || (this->unk_2B4 == 0x278B)) && Animation_OnFrame(&this->skelAnime, 8.0f) && (this->unk_2AE == 0)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_LIE_DOWN_ON_BED); + Actor_PlaySfx(&this->actor, NA_SE_EV_LIE_DOWN_ON_BED); this->unk_2AE = 1; } } 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 c10244e552..30e87a669d 100644 --- a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c +++ b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c @@ -204,7 +204,7 @@ void func_80A68BC8(EnMushi2* this) { if (this->unk_36C > 0) { this->unk_36C--; } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MUSI_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_MUSI_WALK); this->unk_36C = 3.0f / CLAMP_MIN(this->skelAnime.playSpeed, 0.12f); if (this->unk_36C < 2) { @@ -823,7 +823,7 @@ void func_80A6A36C(EnMushi2* this, PlayState* play) { if (this->actor.bgCheckFlags & 0x20) { func_80A6AAA4(this); } else if (this->actor.bgCheckFlags & 1) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GERUDOFT_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_WALK); func_80A68F24(this); func_80A691EC(this, this->actor.floorPoly, -1.0f); func_80A69388(this); @@ -1049,7 +1049,7 @@ void func_80A6B078(EnMushi2* this) { this->unk_30C &= ~1; this->unk_368 = 50; this->skelAnime.playSpeed = 1.9f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTURA_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALTURA_BOUND); func_80A68B6C(this); this->actionFunc = func_80A6B0D8; } 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 483d58c3d8..c1fb5ebe67 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 @@ -224,7 +224,7 @@ void EnNeoReeba_ChooseAction(EnNeoReeba* this, PlayState* play) { void EnNeoReeba_SetupSink(EnNeoReeba* this) { this->sinkRiseRate = 0.0f; this->skelAnime.playSpeed = 2.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = EnNeoReeba_Sink; } @@ -247,7 +247,7 @@ void EnNeoReeba_SetupRise(EnNeoReeba* this) { this->actor.draw = EnNeoReeba_Draw; this->sinkRiseRate = 300.0f; this->skelAnime.playSpeed = 2.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_APPEAR); this->actor.flags |= ACTOR_FLAG_1; this->actionFunc = EnNeoReeba_RiseOutOfGround; } @@ -268,7 +268,7 @@ void EnNeoReeba_RiseOutOfGround(EnNeoReeba* this, PlayState* play) { } void EnNeoReeba_SetupMove(EnNeoReeba* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIVA_MOVE); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIVA_MOVE); this->sfxTimer = 10; this->actionTimer = 60; this->actionFunc = EnNeoReeba_Move; @@ -289,7 +289,7 @@ void EnNeoReeba_Move(EnNeoReeba* this, PlayState* play) { } if (this->sfxTimer == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIVA_MOVE); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIVA_MOVE); this->sfxTimer = 10; } else { this->sfxTimer--; @@ -345,7 +345,7 @@ void EnNeoReeba_Bounce(EnNeoReeba* this, PlayState* play) { } void EnNeoReeba_SetupStun(EnNeoReeba* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->actionFunc = EnNeoReeba_Stunned; } @@ -378,7 +378,7 @@ void EnNeoReeba_SetupFrozen(EnNeoReeba* this) { this->stunTimer = 12; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->actionFunc = EnNeoReeba_Frozen; } @@ -408,7 +408,7 @@ void EnNeoReeba_SetupDamageAnim(EnNeoReeba* this) { this->velToTarget.z = Math_CosS(this->actor.yawTowardsPlayer) * -12.0f; this->rotationSpeed = 4551.0f; Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 25); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIVA_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIVA_DAMAGE); this->actionFunc = EnNeoReeba_DamageAnim; } @@ -448,7 +448,7 @@ void EnNeoReeba_SetupDeathEffects(EnNeoReeba* this) { this->actor.flags |= ACTOR_FLAG_8000000; this->actor.flags &= ~ACTOR_FLAG_1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIVA_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIVA_DEAD); this->actionFunc = EnNeoReeba_PlayDeathEffects; } 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 1c9212a63a..105d4d735d 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -154,7 +154,7 @@ void EnNiw_Init(Actor* thisx, PlayState* play) { } if (this->niwType == NIW_TYPE_HELD) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_M); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHICKEN_CRY_M); this->sfxTimer1 = 30; this->heldTimer = 30; this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF @@ -366,8 +366,8 @@ void EnNiw_Idle(EnNiw* this, PlayState* play) { s16 nextAnimIndex; if (this->niwType == NIW_TYPE_REGULAR) { - if (Actor_HasParent(&this->actor, play)) { // picked up - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow + if (Actor_HasParent(&this->actor, play)) { // picked up + Actor_PlaySfx(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow this->sfxTimer1 = 30; this->heldTimer = 30; this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF @@ -519,7 +519,7 @@ void EnNiw_Thrown(EnNiw* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { // picked up again before could run off - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow + Actor_PlaySfx(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow this->sfxTimer1 = 30; this->unk2EC = 0; this->heldTimer = 30; @@ -629,7 +629,7 @@ void EnNiw_SetupCuccoStorm(EnNiw* this, PlayState* play) { this->targetLimbRots[1] = 0.0f; this->targetLimbRots[2] = 0.0f; this->unkTimer24C = 10; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_M); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHICKEN_CRY_M); } if (this->cuccoStormTimer == 0) { @@ -715,7 +715,7 @@ void EnNiw_CheckRage(EnNiw* this, PlayState* play) { this->iframeTimer = 10; this->sfxTimer1 = 30; this->unk29E = 1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow + Actor_PlaySfx(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow this->runAwayTimer = 100; this->unk2EC = 0; EnNiw_SetupRunAway(this); @@ -752,7 +752,7 @@ void EnNiw_CheckRage(EnNiw* this, PlayState* play) { this->iframeTimer = 10; this->sfxTimer1 = 30; this->unk29E = 1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow + Actor_PlaySfx(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow this->runAwayTimer = 100; this->unk2EC = 0; EnNiw_SetupRunAway(this); @@ -911,16 +911,16 @@ void EnNiw_Update(Actor* thisx, PlayState* play) { EnNiw_CheckRage(this, play); if (this->flutterSfxTimer == 0 && this->niwState == NIW_STATE_HELD) { this->flutterSfxTimer = 7; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_CHICKEN_FLUTTER); + Actor_PlaySfx(&this->actor, NA_SE_EN_CHICKEN_FLUTTER); } if (this->sfxTimer1 == 0) { if (this->niwState != NIW_STATE_IDLE) { this->sfxTimer1 = 30; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_A); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHICKEN_CRY_A); } else { this->sfxTimer1 = 300; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_N); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHICKEN_CRY_N); } } 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 74ac78b5f4..ee22e9abf5 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c @@ -293,7 +293,7 @@ void EnNwc_Follow(EnNwc* this, PlayState* play) { this->actor.velocity.y = 2.0f; // hop up and down } if ((this->stateTimer & 0x1B) == 24) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICK_SONG); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHICK_SONG); } } @@ -306,7 +306,7 @@ void EnNwc_Follow(EnNwc* this, PlayState* play) { this->grog->actor.home.rot.x += 2; // increment grog's adult tranformation counter EnNwc_SpawnDust(this, play); Actor_SetScale(&this->actor, 0.002f); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICK_TO_CHICKEN); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHICK_TO_CHICKEN); } } @@ -356,7 +356,7 @@ void EnNwc_Follow(EnNwc* this, PlayState* play) { } if (this->grog->actor.home.rot.x >= 20) { // all chicks have turned into adult cucco, stop and crow - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_M); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHICKEN_CRY_M); this->actionFunc = EnNwc_CrowAtTheEnd; this->actor.speedXZ = 0.0f; Actor_SetScale(&this->actor, 0.01f); @@ -378,7 +378,7 @@ void EnNwc_HopForward(EnNwc* this, PlayState* play) { this->actor.velocity.y = 2.0f; // hop up and down } if ((this->stateTimer & 0xB) == 8) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICK_SONG); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHICK_SONG); } // they only move forward while off the ground, which gives the visual of them hopping to move @@ -404,7 +404,7 @@ void EnNwc_RunAway(EnNwc* this, PlayState* play) { this->actor.velocity.y = 2.0f; // hop up and down } if ((this->stateTimer & 0xB) == 8) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICK_SONG); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHICK_SONG); } this->actor.speedXZ = 2.0f; @@ -429,7 +429,7 @@ void EnNwc_Turn(EnNwc* this, PlayState* play) { } if ((this->stateTimer & 0xB) == 8) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICK_SONG); + Actor_PlaySfx(&this->actor, NA_SE_EV_CHICK_SONG); } // they only rotate when off the ground, giving the visual that they turn by hopping 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 ac3c5ef6b2..2b938a35f2 100644 --- a/src/overlays/actors/ovl_En_Osk/z_en_osk.c +++ b/src/overlays/actors/ovl_En_Osk/z_en_osk.c @@ -181,20 +181,20 @@ void func_80BF609C(EnOsk* this, PlayState* play) { case 0: if (Animation_OnFrame(&this->skelAnime, this->unk_25C) || Animation_OnFrame(&this->skelAnime, this->unk_25C + 8.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BOSU_TALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_BOSU_TALK); } break; case 1: if (Animation_OnFrame(&this->skelAnime, this->unk_25C)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BOSU_TALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_BOSU_TALK); } break; case 2: if (Animation_OnFrame(&this->skelAnime, this->unk_25C) || Animation_OnFrame(&this->skelAnime, this->unk_25C + 6.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BOSU_TALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_BOSU_TALK); } break; } @@ -280,19 +280,19 @@ void func_80BF6478(EnOsk* this) { case 1: if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 6.0f) || Animation_OnFrame(&this->skelAnime, 11.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEBU_HEAD_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEBU_HEAD_UP); } break; case 3: if (Animation_OnFrame(&this->skelAnime, 11.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEBU_HEAD_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEBU_HEAD_UP); } break; case 4: if (Animation_OnFrame(&this->skelAnime, 5.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEBU_HEAD_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEBU_HEAD_UP); } break; @@ -406,31 +406,31 @@ void func_80BF68E0(EnOsk* this) { case 7: if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 6.0f) || Animation_OnFrame(&this->skelAnime, 11.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEBU_HEAD_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEBU_HEAD_UP); } break; case 2: if (Animation_OnFrame(&this->skelAnime, 4.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEBU_HEAD_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEBU_HEAD_UP); } break; case 4: if (Animation_OnFrame(&this->skelAnime, 5.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEBU_HEAD_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEBU_HEAD_UP); } break; case 5: if ((Animation_OnFrame(&this->skelAnime, 6.0f)) || Animation_OnFrame(&this->skelAnime, 11.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEBU_HEAD_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEBU_HEAD_UP); } break; case 8: if (Animation_OnFrame(&this->skelAnime, 13.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEBU_HEAD_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_DEBU_HEAD_UP); } break; } 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 7df9d843d5..e9e12e311e 100644 --- a/src/overlays/actors/ovl_En_Osn/z_en_osn.c +++ b/src/overlays/actors/ovl_En_Osn/z_en_osn.c @@ -851,7 +851,7 @@ void EnOsn_HandleCsAction(EnOsn* this, PlayState* play) { 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); + Actor_PlaySfx(&this->actor, NA_SE_VO_OMVO00); } if (this->animIndex == OSN_ANIM_TURN_AROUND_START) { @@ -870,7 +870,7 @@ void EnOsn_HandleCsAction(EnOsn* this, PlayState* play) { (((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)))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OMENYA_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_OMENYA_WALK); } Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); } else { 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 d1f7dbec9e..071d311872 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -586,7 +586,7 @@ void EnOssan_Hello(EnOssan* this, PlayState* play) { SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, ANI_ANIM_APOLOGY_LOOP); } if ((this->animIndex == FSN_ANIM_SLAM_COUNTER_LOOP) && Animation_OnFrame(&this->skelAnime, 18.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); + Actor_PlaySfx(&this->actor, NA_SE_EV_HANKO); } } 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 c2abc359a9..193c246fa8 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -554,7 +554,7 @@ void func_80B5C910(EnOt* this, PlayState* play) { void func_80B5C950(EnOt* this, PlayState* play) { if (this->unk_32C & 8) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SEAHORSE_OUT_BOTTLE); + Actor_PlaySfx(&this->actor, NA_SE_EV_SEAHORSE_OUT_BOTTLE); SET_WEEKEVENTREG(WEEKEVENTREG_25_04); func_80B5CAD0(this, play); } @@ -575,7 +575,7 @@ void func_80B5C9D0(EnOt* this, PlayState* play) { this->actor.world.rot.x = this->actor.world.rot.x; this->actor.world.rot.y = this->actor.world.rot.y; this->actor.world.rot.z = this->actor.world.rot.z; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SEAHORSE_OUT_BOTTLE); + Actor_PlaySfx(&this->actor, NA_SE_EV_SEAHORSE_OUT_BOTTLE); this->actionFunc = func_80B5CA30; } @@ -929,7 +929,7 @@ void EnOt_Update(Actor* thisx, PlayState* play) { EnOt* this = THIS; if ((this->animIndex == 1) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SEAHORSE_SWIM); + Actor_PlaySfx(&this->actor, NA_SE_EV_SEAHORSE_SWIM); } this->actionFunc(this, play); 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 8d7b92b69e..361f7fdec9 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -419,7 +419,7 @@ void func_8095B158(EnOwl* this) { if (Animation_OnFrame(&this->skelAnime1, 2.0f) || Animation_OnFrame(&this->skelAnime1, 9.0f) || Animation_OnFrame(&this->skelAnime1, 23.0f) || Animation_OnFrame(&this->skelAnime1, 40.0f) || Animation_OnFrame(&this->skelAnime1, 58.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_OWL_FLUTTER); + Actor_PlaySfx(&this->actor, NA_SE_EN_OWL_FLUTTER); } } @@ -899,7 +899,7 @@ void EnOwl_Update(Actor* thisx, PlayState* play) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); if (this->actor.update != NULL) { if ((this->skelAnime1.animation == &object_owl_Anim_001ADC) && Animation_OnFrame(&this->skelAnime1, 4.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_OWL_FLUTTER); + Actor_PlaySfx(&this->actor, NA_SE_EN_OWL_FLUTTER); } if (this->actionFlags & 2) { 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 bcbb787166..c99c5c9d82 100644 --- a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c +++ b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c @@ -501,11 +501,11 @@ void func_80BD93F4(EnPamera* this, PlayState* play) { (this->actionFunc == func_80BD8964) || (this->actionFunc == func_80BD8A7C)) { if (this->skelAnime.animation == &object_pamera_Anim_008AE0) { if (Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_PAMERA_WALK); } } else if ((this->skelAnime.animation == &object_pamera_Anim_008E38) && (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_PAMERA_WALK); } } } @@ -772,7 +772,7 @@ void func_80BD9F3C(EnPamera* this, PlayState* play) { Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 14.0f) || Animation_OnFrame(&this->skelAnime, 18.0f) || Animation_OnFrame(&this->skelAnime, 22.0f) || Animation_OnFrame(&this->skelAnime, 25.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_PAMERA_WALK); } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->unk_31E = 0; @@ -820,7 +820,7 @@ void func_80BDA1C8(EnPamera* this, PlayState* play) { if (this->unk_31E == 1) { if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f) || Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 14.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_PAMERA_WALK); } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->unk_31E = 0; 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 9eeae341dc..201172cf9a 100644 --- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c +++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c @@ -376,10 +376,10 @@ void EnPametfrog_PlaceSnapper(EnPametfrog* this, PlayState* play) { void EnPametfrog_JumpOnGround(EnPametfrog* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 1.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_JUMP); + Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_JUMP); } else if (Animation_OnFrame(&this->skelAnime, 11.0f)) { EnPametfrog_JumpWaterEffects(this, play); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WALK_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_WALK_WATER); } } @@ -402,7 +402,7 @@ void EnPametfrog_ApplyMagicArrowEffects(EnPametfrog* this, PlayState* play) { void EnPametfrog_ApplyElectricStun(EnPametfrog* this) { this->freezeTimer = 40; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_SMALL; this->drawDmgEffScale = 0.75f; @@ -411,7 +411,7 @@ void EnPametfrog_ApplyElectricStun(EnPametfrog* this) { void EnPametfrog_ApplyStun(EnPametfrog* this) { this->freezeTimer = 40; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); } @@ -509,7 +509,7 @@ void EnPametfrog_SetupFallOffSnapper(EnPametfrog* this, PlayState* play) { subCamEye.y = this->actor.focus.pos.y + 100.0f; subCamEye.z = (Math_CosS(yaw) * 300.0f) + this->actor.focus.pos.z; Play_SetCameraAtEye(play, this->subCamId, &this->actor.focus.pos, &subCamEye); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_DAMAGE); this->actionFunc = EnPametfrog_FallOffSnapper; } @@ -536,7 +536,7 @@ void EnPametfrog_SetupJumpToWall(EnPametfrog* this) { this->actor.shape.rot.x = 0; this->actor.shape.rot.z = 0; this->actor.bgCheckFlags &= ~8; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_VOICE2); + Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_VOICE2); this->actionFunc = EnPametfrog_JumpToWall; } @@ -579,7 +579,7 @@ void EnPametfrog_SetupWallCrawl(EnPametfrog* this) { this->skelAnime.playSpeed = 1.0f; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_RUNAWAY); + Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_RUNAWAY); this->actor.speedXZ = 8.0f; this->timer = Rand_S16Offset(35, 15); this->actionFunc = EnPametfrog_WallCrawl; @@ -636,11 +636,11 @@ void EnPametfrog_WallCrawl(EnPametfrog* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 15.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BOMCHU_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_BOMCHU_WALK); } if (((play->gameplayFrames % 60) == 0) && (Rand_ZeroOne() < 0.8f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_REAL); + Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_REAL); } if ((this->timer == 0) || @@ -668,7 +668,7 @@ void EnPametfrog_SetupWallPause(EnPametfrog* this) { this->wallRotation = (Rand_ZeroOne() < 0.5f ? -1 : 1) * (0x1000 + randFloat) * (M_PI / (15 * 0x8000)); } this->timer = 15; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_RUNAWAY2); + Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_RUNAWAY2); this->actionFunc = EnPametfrog_WallPause; } @@ -686,7 +686,7 @@ void EnPametfrog_WallPause(EnPametfrog* this, PlayState* play) { Math3D_CrossProduct(&this->unk_2DC, &this->unk_2D0, &this->unk_2E8); func_8086A238(this); if (((play->gameplayFrames % 60) == 0) && (Rand_ZeroOne() < 0.8f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_REAL); + Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_REAL); } if (this->timer == 0) { @@ -765,7 +765,7 @@ void EnPametfrog_SetupJumpOnSnapper(EnPametfrog* this) { this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, this->actor.child); this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.params = GEKKO_JUMP_ON_SNAPPER; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_GREET); + Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_GREET); this->actionFunc = EnPametfrog_JumpOnSnapper; } @@ -816,9 +816,9 @@ void EnPametfrog_SetupFallInAir(EnPametfrog* this, PlayState* play) { this->collider.base.acFlags &= ~AC_ON; this->timer = 10; if (this->actor.colChkInfo.health == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_DEAD); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_DAMAGE); } Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 16); @@ -875,7 +875,7 @@ void EnPametfrog_SetupFallOnGround(EnPametfrog* this, PlayState* play) { this->timer = 5; EnPametfrog_Thaw(this, play); EnPametfrog_JumpWaterEffects(this, play); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WALK_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_WALK_WATER); this->actionFunc = EnPametfrog_FallOnGround; } @@ -1099,9 +1099,9 @@ void EnPametfrog_MeleeAttack(EnPametfrog* this, PlayState* play) { ((this->skelAnime.animation == &gGekkoWindupPunchAnim) && Animation_OnFrame(&this->skelAnime, 27.0f))) { this->collider.base.atFlags |= AT_ON; if (this->skelAnime.animation == &gGekkoKickAnim) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_KICK); + Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_KICK); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_PUNCH1); + Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_PUNCH1); } } else { this->collider.base.atFlags &= ~AT_ON; @@ -1114,7 +1114,7 @@ void EnPametfrog_SetupDamage(EnPametfrog* this) { this->collider.base.atFlags &= ~AT_ON; this->collider.base.acFlags &= ~AC_ON; this->actor.speedXZ = 10.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_DAMAGE); Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20); func_800BE5CC(&this->actor, &this->collider, 0); this->actor.shape.rot.y = BINANG_ROT180(this->actor.world.rot.y); @@ -1168,7 +1168,7 @@ void EnPametfrog_SetupCallSnapper(EnPametfrog* this, PlayState* play) { s16 yawDiff; Animation_MorphToPlayOnce(&this->skelAnime, &gGekkoCallAnim, 3.0f); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_GREET); + Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_GREET); this->actor.flags &= ~ACTOR_FLAG_1; this->actor.colChkInfo.health = 6; this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); 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 d2a1458f35..fe63efd4ef 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -283,7 +283,7 @@ void func_80897390(EnPeehat* this, PlayState* play) { } this->unk_2B0 = 8; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIHAT_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_PIHAT_DAMAGE); } void func_80897498(EnPeehat* this) { @@ -327,7 +327,7 @@ void func_80897648(EnPeehat* this) { Animation_GetLastFrame(&object_ph_Anim_0009C4), ANIMMODE_ONCE, 0.0f); } this->unk_2B0 = 16; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIHAT_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_PIHAT_UP); this->actionFunc = func_808976DC; } @@ -474,7 +474,7 @@ void func_80897D48(EnPeehat* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { func_80897498(this); this->actor.world.pos.y = this->actor.floorHeight; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIHAT_LAND); + Actor_PlaySfx(&this->actor, NA_SE_EN_PIHAT_LAND); } else if (this->actor.floorHeight < this->actor.world.pos.y) { Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.floorHeight, 0.3f, 3.5f, 0.25f); if ((this->actor.world.pos.y - this->actor.floorHeight) < 60.0f) { @@ -622,7 +622,7 @@ void func_80898454(EnPeehat* this, PlayState* play) { void func_808984E0(EnPeehat* this) { Animation_MorphToPlayOnce(&this->skelAnime, &object_ph_Anim_000844, -4.0f); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIHAT_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_PIHAT_DAMAGE); this->unk_2B2 = 4000; this->unk_2B0 = 14; this->actor.speedXZ = 10.0f; @@ -698,7 +698,7 @@ void func_8089874C(EnPeehat* this, PlayState* play) { if (this->actor.colChkInfo.damageEffect == 5) { this->unk_2B0 = 40; Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->drawDmgEffScale = 1.1f; this->drawDmgEffAlpha = 2.0f; this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_LARGE; @@ -706,7 +706,7 @@ void func_8089874C(EnPeehat* this, PlayState* play) { } else if (this->actor.colChkInfo.damageEffect == 1) { this->unk_2B0 = 40; Actor_SetColorFilter(&this->actor, 0, 200, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); func_80898414(this); } else if (this->actor.colChkInfo.damageEffect == 3) { func_80897170(this); 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 c2846a26b8..f612a7927a 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c @@ -1311,7 +1311,7 @@ s32 func_80AF91E8(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) { this->unk_356 &= ~8; this->unk_356 &= ~0x10; if (this->unk_258 == 27) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROOM_CARTAIN); + Actor_PlaySfx(&this->actor, NA_SE_EV_ROOM_CARTAIN); Flags_UnsetSwitch(play, 0); } @@ -1431,7 +1431,7 @@ s32 func_80AF95E8(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) { switch (scheduleOutput->result) { case 27: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROOM_CARTAIN); + Actor_PlaySfx(&this->actor, NA_SE_EV_ROOM_CARTAIN); Flags_SetSwitch(play, 0); this->unk_36C = 20; SubS_UpdateFlags(&this->unk_356, 3, 7); @@ -1717,7 +1717,7 @@ s32 func_80AF9D04(EnPm* this, PlayState* play) { Lib_Vec3f_TranslateAndRotateY(&this->unk_26C, this->actor.world.rot.y, &sp38, &this->actor.world.pos); this->unk_36E += this->timePathTimeSpeed; if (Animation_OnFrame(&this->skelAnime, 3.0f) || Animation_OnFrame(&this->skelAnime, 8.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_POSTMAN_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_POSTMAN_WALK); } } return false; @@ -1774,7 +1774,7 @@ s32 func_80AF9E7C(EnPm* this, PlayState* play) { this->timePathTargetPos = timePathTargetPos; } else if ((this->unk_258 != 91) && (Animation_OnFrame(&this->skelAnime, 3.0f) || Animation_OnFrame(&this->skelAnime, 8.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_POSTMAN_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_POSTMAN_WALK); } if ((this->unk_356 & 0x10) && (this->unk_258 == 90)) { @@ -1820,7 +1820,7 @@ s32 func_80AFA170(EnPm* this, PlayState* play) { } if ((this->unk_384 == 11) && Animation_OnFrame(&this->skelAnime, 8.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_POSTMACHINE_HIT_OPEN); + Actor_PlaySfx(&this->actor, NA_SE_EV_POSTMACHINE_HIT_OPEN); } if (this->unk_258 == 19) { @@ -1865,7 +1865,7 @@ s32 func_80AFA334(EnPm* this, PlayState* play) { case 21: case 22: if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_NP_SLEEP_OUT); + Actor_PlaySfx(&this->actor, NA_SE_VO_NP_SLEEP_OUT); } break; @@ -2044,7 +2044,7 @@ void func_80AFA724(EnPm* this, PlayState* play) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, 4); if (Animation_OnFrame(&this->skelAnime, 3.0f) || Animation_OnFrame(&this->skelAnime, 8.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_POSTMAN_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_POSTMAN_WALK); } } 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 e7a2ae6071..809c738a44 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 @@ -240,7 +240,7 @@ void EnPoFusen_IncrementRomaniPop(EnPoFusen* this) { 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_PlaySfx(&this->actor, NA_SE_IT_BOMB_EXPLOSION); Actor_Kill(&this->actor); } 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 4928fd05b3..365930cd5d 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 @@ -318,7 +318,7 @@ void EnPoSisters_ObserverIdle(EnPoSisters* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (DECR(this->laughTimer) == 0) { this->laughTimer = Rand_S16Offset(100, 50); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH2); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH2); } } @@ -433,7 +433,7 @@ void EnPoSisters_SpinUp(EnPoSisters* this, PlayState* play) { DECR(this->spinupTimer); this->actor.shape.rot.y += ((s32)((this->skelAnime.endFrame + 1.0f) * 3.0f) - this->spinupTimer) * 0x180; if ((this->spinupTimer == 18) || (this->spinupTimer == 7)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_ROLL); } else if (this->spinupTimer == 0) { EnPoSisters_SetupSpinAttack(this); } @@ -470,14 +470,14 @@ void EnPoSisters_SpinAttack(EnPoSisters* this, PlayState* play) { this->collider.base.acFlags &= ~AC_HARD; EnPoSisters_SetupAimlessIdleFlying(this); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH2); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH2); EnPoSisters_MegCloneVanish(this, play); } } } if (Animation_OnFrame(&this->skelAnime, 1.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_ROLL); } } @@ -504,7 +504,7 @@ void EnPoSisters_AttackConnectDrift(EnPoSisters* this, PlayState* play) { if (this->type != POE_SISTERS_TYPE_MEG) { EnPoSisters_SetupAimlessIdleFlying(this); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH2); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH2); EnPoSisters_MegCloneVanish(this, play); } } @@ -590,8 +590,8 @@ void EnPoSisters_SetupSpinToInvis(EnPoSisters* this) { this->actor.speedXZ = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->poSisterFlags &= ~(POE_SISTERS_FLAG_CHECK_Z_TARGET | POE_SISTERS_FLAG_CHECK_AC); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DISAPPEAR); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH2); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DISAPPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH2); this->actionFunc = EnPoSisters_SpinToInvis; } @@ -621,7 +621,7 @@ void EnPoSisters_SetupSpinBackToVisible(EnPoSisters* this, PlayState* play) { this->spinInvisibleTimer = 15; this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_APPEAR); this->poSisterFlags &= ~POE_SISTERS_FLAG_CHECK_AC; this->actionFunc = EnPoSisters_SpinBackToVisible; } @@ -699,7 +699,7 @@ void EnPoSisters_DeathStage1(EnPoSisters* this, PlayState* play) { } if (this->deathTimer == 16) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_DISAPPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_DISAPPEAR); } } @@ -876,7 +876,7 @@ void EnPoSisters_MegSurroundPlayer(EnPoSisters* this, PlayState* play) { */ void EnPoSisters_SetupSpawnPo(EnPoSisters* this) { Animation_PlayOnce(&this->skelAnime, &gPoeSistersAppearDisappearAnim); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_APPEAR); this->color.a = 0; this->poSisterFlags = POE_SISTERS_FLAG_UPDATE_FIRES; this->actionFunc = EnPoSisters_PoeSpawn; @@ -909,7 +909,7 @@ void EnPoSisters_CheckCollision(EnPoSisters* this, PlayState* play) { if (this->megCloneId != POE_SISTERS_MEG_REAL) { ((EnPoSisters*)this->actor.parent)->megClonesRemaining--; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH2); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH2); EnPoSisters_MegCloneVanish(this, play); if (Rand_ZeroOne() < 0.2f) { pos.x = this->actor.world.pos.x; @@ -932,10 +932,10 @@ void EnPoSisters_CheckCollision(EnPoSisters* this, PlayState* play) { } } else { if (Actor_ApplyDamage(&this->actor)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DAMAGE); } else { Enemy_StartFinishingBlow(play, &this->actor); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_SISTER_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_SISTER_DEAD); } if (this->actor.colChkInfo.damageEffect == POE_SISTERS_DMGEFF_LIGHTARROWS) { 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 0984506d6e..21cd9d8c44 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -316,14 +316,14 @@ void func_80B2CEC8(EnPoh* this) { Animation_MorphToLoop(&this->skelAnime, &object_po_Anim_0001A8, -6.0f); this->unk_18E = 12; this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH); this->actionFunc = func_80B2CF28; } void func_80B2CF28(EnPoh* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_KANTERA); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_KANTERA); if (this->unk_18E != 0) { this->unk_18E--; } @@ -379,7 +379,7 @@ void func_80B2D140(EnPoh* this, PlayState* play) { } if ((this->skelAnime.playSpeed < 0.5f) && (this->actor.xzDistToPlayer < 280.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_APPEAR); this->skelAnime.playSpeed = 1.0f; } } @@ -438,7 +438,7 @@ void func_80B2D300(EnPoh* this, PlayState* play) { } if (this->unk_18E == 18) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_DISAPPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_DISAPPEAR); } } @@ -484,8 +484,8 @@ void func_80B2D76C(EnPoh* this) { this->unk_192 = 0x2000; this->actor.speedXZ = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DISAPPEAR); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DISAPPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH); this->colliderCylinder.base.acFlags &= ~AC_ON; this->actionFunc = func_80B2D7D4; } @@ -514,8 +514,8 @@ void func_80B2D924(EnPoh* this) { this->unk_18C = 0; this->unk_192 = 0x2000; this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH); this->colliderCylinder.base.acFlags &= ~AC_ON; this->actionFunc = func_80B2D980; } @@ -629,7 +629,7 @@ void func_80B2E0B0(EnPoh* this) { this->actor.home.pos.y = this->actor.world.pos.y; this->actor.scale.x = 0.0f; this->actor.scale.y = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_METAL_BOX_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EV_METAL_BOX_BOUND); this->actionFunc = func_80B2E180; } @@ -680,7 +680,7 @@ void func_80B2E230(EnPoh* this, PlayState* play) { void func_80B2E3B0(EnPoh* this) { AudioSfx_StopByPosAndId(&this->actor.projectedPos, NA_SE_EN_PO_BIG_CRY - SFX_FLAG); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH); this->actionFunc = func_80B2E3F8; } @@ -696,9 +696,9 @@ void func_80B2E438(EnPoh* this, PlayState* play) { this->colliderCylinder.base.acFlags &= ~AC_HIT; if (!Actor_ApplyDamage(&this->actor)) { Enemy_StartFinishingBlow(play, &this->actor); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DEAD); } else if (this->actor.colChkInfo.damage != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DAMAGE); } if (this->actor.colChkInfo.damageEffect != 14) { 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 fad487e621..be4f1e3c30 100644 --- a/src/overlays/actors/ovl_En_Pp/z_en_pp.c +++ b/src/overlays/actors/ovl_En_Pp/z_en_pp.c @@ -446,27 +446,27 @@ void EnPp_PlaySfxForAnimation(EnPp* this) { case EN_PP_ANIM_WALK: case EN_PP_ANIM_TURN_TO_FACE_PLAYER: if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HIPLOOP_FOOTSTEP); + Actor_PlaySfx(&this->actor, NA_SE_EN_HIPLOOP_FOOTSTEP); } break; case EN_PP_ANIM_WIND_UP: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HIPLOOP_FOOT - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_HIPLOOP_FOOT - SFX_FLAG); break; case EN_PP_ANIM_CHARGE: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HIPLOOP_RUN - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_HIPLOOP_RUN - SFX_FLAG); break; case EN_PP_ANIM_ATTACK: if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HIPLOOP_PAUSE); + Actor_PlaySfx(&this->actor, NA_SE_EN_HIPLOOP_PAUSE); } break; case EN_PP_ANIM_ROAR: if (Animation_OnFrame(&this->skelAnime, 6.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HIPLOOP_PAUSE); + Actor_PlaySfx(&this->actor, NA_SE_EN_HIPLOOP_PAUSE); } break; @@ -925,7 +925,7 @@ void EnPp_SetupDamaged(EnPp* this, PlayState* play) { this->actor.speedXZ = 0.0f; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HIPLOOP_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_HIPLOOP_DAMAGE); this->actionFunc = EnPp_Damaged; } @@ -1117,7 +1117,7 @@ void EnPp_Mask_Detach(EnPp* this, PlayState* play) { this->maskAccelY = 50.0f; this->maskVelocity.y = -230.0f; this->maskVelocity.x = -150.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HIPLOOP_MASC_OFF); + Actor_PlaySfx(&this->actor, NA_SE_EN_HIPLOOP_MASC_OFF); this->actionVar.maskDetachState = EN_PP_MASK_DETACH_STATE_FALL; break; @@ -1276,7 +1276,7 @@ void EnPp_UpdateDamage(EnPp* this, PlayState* play) { (this->drawDmgEffTimer == 0)) { this->drawDmgEffTimer = 40; this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_SMALL; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); EnPp_SetupStunnedOrFrozen(this); } @@ -1285,7 +1285,7 @@ void EnPp_UpdateDamage(EnPp* this, PlayState* play) { if (((this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_SFX) && (this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX)) || (this->drawDmgEffTimer == 0)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); this->secondaryTimer = 40; EnPp_SetupStunnedOrFrozen(this); @@ -1359,7 +1359,7 @@ void EnPp_UpdateDamage(EnPp* this, PlayState* play) { this->targetRotY = this->actor.yawTowardsPlayer; if (EN_PP_GET_TYPE(&this->actor) == EN_PP_TYPE_MASKED) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_SHIELD_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_IT_SHIELD_BOUND); } } } 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 5068c96ee8..703d7a90b6 100644 --- a/src/overlays/actors/ovl_En_Pr/z_en_pr.c +++ b/src/overlays/actors/ovl_En_Pr/z_en_pr.c @@ -410,7 +410,7 @@ void func_80A32EA4(EnPr* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_8000000; this->unk_2C4 = 0.0f; Enemy_StartFinishingBlow(play, &this->actor); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLEWALK_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLEWALK_DEAD); this->unk_216 = 0; this->actionFunc = func_80A32F48; } else { @@ -471,7 +471,7 @@ void func_80A33098(EnPr* this, PlayState* play) { if ((this->unk_206 != 6) && (this->unk_206 != 7)) { Actor_ApplyDamage(&this->actor); Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLEWALK_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLEWALK_DAMAGE); func_80A32E60(this); } } 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 0cc6dc1340..3f0b3ee86d 100644 --- a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c +++ b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c @@ -267,7 +267,7 @@ void func_80A745FC(EnPr2* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIRANHA_EXIST - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_PIRANHA_EXIST - SFX_FLAG); Math_ApproachF(&this->unk_204, 0.02f, 0.1f, 0.005f); if (this->path->unk2 < this->unk_1D0) { @@ -326,7 +326,7 @@ void func_80A748E8(EnPr2* this, PlayState* play) { Vec3f sp3C; Math_ApproachF(&this->unk_204, 0.02f, 0.1f, 0.005f); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIRANHA_EXIST - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_PIRANHA_EXIST - SFX_FLAG); if (fabsf(this->actor.world.rot.y - this->unk_1EE) < 200.0f) { sp48 = true; @@ -430,7 +430,7 @@ void func_80A74DEC(EnPr2* this, PlayState* play) { this->unk_1F0 = 0; func_80A74510(this, 1); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIRANHA_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_PIRANHA_ATTACK); Math_Vec3f_Copy(&this->unk_21C, &player->actor.world.pos); this->unk_1EE = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_21C); @@ -615,7 +615,7 @@ void func_80A755D8(EnPr2* this, PlayState* play) { if ((this->actor.colChkInfo.health <= 0) && (this->unk_1D4 != 3)) { Enemy_StartFinishingBlow(play, &this->actor); this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIRANHA_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_PIRANHA_DEAD); if (this->unk_218 >= 0) { Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, D_80A75C3C[this->unk_218]); 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 dad8fc1263..d0e40b1a55 100644 --- a/src/overlays/actors/ovl_En_Prz/z_en_prz.c +++ b/src/overlays/actors/ovl_En_Prz/z_en_prz.c @@ -363,7 +363,7 @@ void func_80A76A1C(EnPrz* this) { this->actor.flags |= ACTOR_FLAG_8000000; this->actor.flags &= ~ACTOR_FLAG_1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLEWALK_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLEWALK_DEAD); this->unk_1EE = Rand_S16Offset(100, 30); this->unk_1FC = 0x4000; 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 0caa2f8caf..c6e33345d5 100644 --- a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c +++ b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c @@ -675,7 +675,7 @@ void EnRacedog_PlaySfxWalk(EnRacedog* this) { s16 curFrame = this->skelAnime.curFrame; if ((curFrame == 1) || (curFrame == 7)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MONKEY_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_MONKEY_WALK); } } 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 8421b20ac5..b72d6d41a8 100644 --- a/src/overlays/actors/ovl_En_Raf/z_en_raf.c +++ b/src/overlays/actors/ovl_En_Raf/z_en_raf.c @@ -360,7 +360,7 @@ void EnRaf_Idle(EnRaf* this, PlayState* play) { void EnRaf_SetupGrab(EnRaf* this) { EnRaf_ChangeAnim(this, EN_RAF_ANIM_CLOSE); this->petalScaleType = EN_RAF_PETAL_SCALE_TYPE_GRAB; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_SUISEN_DRINK); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EN_SUISEN_DRINK); this->action = EN_RAF_ACTION_GRAB; this->actionFunc = EnRaf_Grab; } @@ -426,11 +426,15 @@ void EnRaf_Chew(EnRaf* this, PlayState* play) { this->chewCount++; } - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_SUISEN_EAT); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EN_SUISEN_EAT); switch (this->grabTarget) { case EN_RAF_GRAB_TARGET_PLAYER: play->damagePlayer(play, -2); - func_800B8E58((Player*)this, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_DAMAGE_S); + + //! @bug: This function should only pass Player*: it uses *(this + 0x153), which is meant to be + //! player->currentMask, but in this case is padding in `DynaPolyActor` + Player_PlaySfx((Player*)&this->dyna.actor, + player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_DAMAGE_S); CollisionCheck_GreenBlood(play, NULL, &player->actor.world.pos); if ((this->chewCount > (BREG(53) + 5)) || !(player->stateFlags2 & PLAYER_STATE2_80)) { player->actor.freezeTimer = 10; @@ -478,7 +482,7 @@ void EnRaf_Throw(EnRaf* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 10.0f)) { player->actor.freezeTimer = 0; player->actor.parent = NULL; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_SUISEN_THROW); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EN_SUISEN_THROW); func_800B8D50(play, &this->dyna.actor, BREG(55) + 3.0f, this->playerRotYWhenGrabbed + 0x8000, BREG(56) + 10.0f, 0); } else if (curFrame < 10.0f) { @@ -508,8 +512,8 @@ void EnRaf_Explode(EnRaf* this, PlayState* play) { explosionPos.y += 10.0f; Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, explosionPos.x, explosionPos.y, explosionPos.z, 0, 0, 0, CLEAR_TAG_SMALL_EXPLOSION); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_IT_BOMB_EXPLOSION); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_SUISEN_DEAD); + Actor_PlaySfx(&this->dyna.actor, NA_SE_IT_BOMB_EXPLOSION); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EN_SUISEN_DEAD); if (this->switchFlag >= 0) { Flags_SetSwitch(play, this->switchFlag); } @@ -710,7 +714,7 @@ void EnRaf_Update(Actor* thisx, PlayState* play) { if ((this->heightDiffFromPlayer > -0.1f) && !this->isCurrentlyInRidingMovingState) { this->heightDiffFromPlayer = -20.0f; this->isCurrentlyInRidingMovingState = true; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_COMMON_WATER_MID); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EN_COMMON_WATER_MID); } } else { this->isCurrentlyInRidingMovingState = false; 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 073f2045af..6b114dff5f 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 @@ -334,7 +334,7 @@ void func_80B70FF8(EnRailSkb* this, PlayState* play) { } void func_80B710AC(EnRailSkb* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->actionFunc = func_80B710E4; } @@ -345,7 +345,7 @@ void func_80B710E4(EnRailSkb* this, PlayState* play) { } void func_80B71114(EnRailSkb* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->actionFunc = func_80B7114C; } @@ -357,7 +357,7 @@ void func_80B7114C(EnRailSkb* this, PlayState* play) { if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_402 |= 1; func_80B712FC(this); } else { @@ -381,7 +381,7 @@ void func_80B7123C(EnRailSkb* this, PlayState* play) { if (this->actor.colChkInfo.health != 0) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_402 |= 1; func_80B712FC(this); } else { @@ -405,7 +405,7 @@ void func_80B71314(EnRailSkb* this, PlayState* play) { } void func_80B71354(EnRailSkb* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); this->actionFunc = func_80B713A4; } @@ -452,7 +452,7 @@ void func_80B7151C(EnRailSkb* this) { this->actor.colChkInfo.health = 2; this->unk_402 = 0; this->actor.flags |= ACTOR_FLAG_1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_APPEAR); this->actor.draw = EnRailSkb_Draw; this->actor.shape.shadowAlpha = 0; this->actor.shape.rot.y = this->actor.world.rot.y; @@ -575,7 +575,7 @@ void func_80B71954(EnRailSkb* this, PlayState* play) { } void func_80B71A08(EnRailSkb* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); this->actionFunc = func_80B71A58; } @@ -584,7 +584,7 @@ void func_80B71A58(EnRailSkb* this, PlayState* play) { s16 sp36 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_22C->dyna.actor.world.pos); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); if (this->unk_2E8 < this->unk_22C->dyna.actor.colChkInfo.health) { this->unk_22C->dyna.actor.colChkInfo.health--; @@ -640,7 +640,7 @@ void func_80B71BB8(EnRailSkb* this, PlayState* play) { } if ((sp34 < 50.0f) && (this->actor.bgCheckFlags & 1)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9); this->actor.velocity.y = 10.0f; @@ -773,7 +773,7 @@ void func_80B72190(EnRailSkb* this, PlayState* play) { if ((this->actionFunc != func_80B714D8) && (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 15.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_WALK); } if (this->actor.parent == NULL) { @@ -999,7 +999,7 @@ void func_80B72970(EnRailSkb* this, PlayState* play) { this->drawDmgEffAlpha = 1.0f; this->drawDmgEffScale = 0.0f; Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); this->unk_402 |= 1; func_80B712FC(this); @@ -1007,7 +1007,7 @@ void func_80B72970(EnRailSkb* this, PlayState* play) { case 3: if (this->actor.colChkInfo.health != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->drawDmgEffTimer = 80; } else { this->drawDmgEffTimer = 3; @@ -1025,7 +1025,7 @@ void func_80B72970(EnRailSkb* this, PlayState* play) { this->drawDmgEffAlpha = 1.0f; this->drawDmgEffScale = 0.5f; Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); func_80B71228(this); break; @@ -1044,7 +1044,7 @@ void func_80B72970(EnRailSkb* this, PlayState* play) { case 13: Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); func_80B712FC(this); break; 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 6c5980f4f3..c5a13412d5 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c @@ -350,7 +350,7 @@ void EnRailgibud_AttemptPlayerFreeze(EnRailgibud* this, PlayState* play) { player->actor.freezeTimer = 60; Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150); func_80123E90(play, &this->actor); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_AIM); EnRailgibud_SetupWalkToPlayer(this); } @@ -396,7 +396,7 @@ void EnRailgibud_WalkToPlayer(EnRailgibud* this, PlayState* play) { this->playerStunWaitTimer = 60; Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150); func_80123E90(play, &this->actor); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_AIM); } else { this->playerStunWaitTimer--; } @@ -412,9 +412,9 @@ void EnRailgibud_WalkToPlayer(EnRailgibud* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 22.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_WALK); } else if (!(play->gameplayFrames & 95)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_CRY); } } @@ -452,7 +452,7 @@ void EnRailgibud_Grab(EnRailgibud* this, PlayState* play) { damageSfxId = player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_DAMAGE_S; play->damagePlayer(play, -8); - func_800B8E58(player, damageSfxId); + Player_PlaySfx(player, damageSfxId); Rumble_Request(this->actor.xzDistToPlayer, 240, 1, 12); this->grabDamageTimer = 0; } else { @@ -460,7 +460,7 @@ void EnRailgibud_Grab(EnRailgibud* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_ATTACK); } if (!(player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B62 != 0)) { @@ -490,7 +490,7 @@ void EnRailgibud_Grab(EnRailgibud* this, PlayState* play) { void EnRailgibud_SetupGrabFail(EnRailgibud* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_DAMAGE); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->actor.speedXZ = -2.0f; this->actionFunc = EnRailgibud_GrabFail; } @@ -564,7 +564,7 @@ void EnRailgibud_WalkToHome(EnRailgibud* this, PlayState* play) { void EnRailgibud_SetupDamage(EnRailgibud* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_DAMAGE); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->stunTimer = 0; this->grabWaitTimer = 0; this->actor.world.rot.y = this->actor.yawTowardsPlayer; @@ -622,7 +622,7 @@ void EnRailgibud_Stunned(EnRailgibud* this, PlayState* play) { void EnRailgibud_SetupDead(EnRailgibud* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_DEATH); this->actor.flags &= ~ACTOR_FLAG_1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_DEAD); this->deathTimer = 0; this->actionFunc = EnRailgibud_Dead; } @@ -963,7 +963,7 @@ void EnRailgibud_CheckIfTalkingToPlayer(EnRailgibud* this, PlayState* play) { this->isInvincible = true; Message_StartTextbox(play, 0x13B2, &this->actor); this->textId = 0x13B2; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_AIM); this->actor.speedXZ = 0.0f; } else if (CHECK_FLAG_ALL(this->actor.flags, (ACTOR_FLAG_1 | ACTOR_FLAG_8)) && !(this->collider.base.acFlags & AC_HIT)) { @@ -1189,7 +1189,7 @@ s32 EnRailgibud_PerformCutsceneActions(EnRailgibud* this, PlayState* play) { case 2: this->cutsceneAnimIndex = EN_RAILGIBUD_ANIM_SLUMP_START; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_WEAKENED2); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_WEAKENED2); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_SLUMP_START); break; @@ -1232,9 +1232,9 @@ s32 EnRailgibud_PerformCutsceneActions(EnRailgibud* this, PlayState* play) { case 5: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (play->csCtx.frames < 280) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_CRY); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_WEAKENED1); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_WEAKENED1); } } break; 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 017cd765ae..353f221fad 100644 --- a/src/overlays/actors/ovl_En_Rat/z_en_rat.c +++ b/src/overlays/actors/ovl_En_Rat/z_en_rat.c @@ -585,14 +585,14 @@ void EnRat_Idle(EnRat* this, PlayState* play) { this->actor.speedXZ = 2.0f; if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BOMCHU_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_BOMCHU_WALK); if (this->animLoopCounter != 0) { this->animLoopCounter--; } } if ((this->animLoopCounter == 0) && (Rand_ZeroOne() < 0.05f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BOMCHU_VOICE); + Actor_PlaySfx(&this->actor, NA_SE_EN_BOMCHU_VOICE); this->animLoopCounter = 5; } @@ -615,7 +615,7 @@ void EnRat_SetupSpottedPlayer(EnRat* this) { */ void EnRat_SpottedPlayer(EnRat* this, PlayState* play) { if ((this->animLoopCounter == 3) && Animation_OnFrame(&this->skelAnime, 5.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BOMCHU_AIM); + Actor_PlaySfx(&this->actor, NA_SE_EN_BOMCHU_AIM); } if (Animation_OnFrame(&this->skelAnime, 0.0f)) { @@ -674,7 +674,7 @@ void EnRat_ChasePlayer(EnRat* this, PlayState* play) { this->animLoopCounter--; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BOMCHU_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_BOMCHU_WALK); } DECR(this->timer); @@ -704,7 +704,7 @@ void EnRat_ChasePlayer(EnRat* this, PlayState* play) { } if ((this->animLoopCounter == 0) && (Rand_ZeroOne() < 0.05f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BOMCHU_AIM); + Actor_PlaySfx(&this->actor, NA_SE_EN_BOMCHU_AIM); this->animLoopCounter = 5; } @@ -790,7 +790,7 @@ void EnRat_Update(Actor* thisx, PlayState* play) { if (this->actor.colChkInfo.damageEffect == EN_RAT_DMGEFF_HOOKSHOT) { this->damageReaction.hookedState = EN_RAT_HOOK_STARTED; } else if (this->actor.colChkInfo.damageEffect == EN_RAT_DMGEFF_STUN) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); Actor_SetColorFilter(&this->actor, 0, 120, 0, 40); if (this->actionFunc == EnRat_Bounced) { this->actor.speedXZ = 0.0f; diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 40ed111f47..8d73d5de1e 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -410,7 +410,7 @@ void EnRd_Idle(EnRd* this, PlayState* play) { } if ((play->gameplayFrames & 0x5F) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_CRY); } } @@ -454,7 +454,7 @@ void EnRd_SquattingDance(EnRd* this, PlayState* play) { } if ((play->gameplayFrames & 0x5F) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_CRY); } } @@ -498,14 +498,14 @@ void EnRd_ClappingDance(EnRd* this, PlayState* play) { } if ((play->gameplayFrames & 0x5F) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_CRY); } } void EnRd_EndClappingOrSquattingDanceWhenPlayerIsClose(EnRd* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if ((play->gameplayFrames & 0x5F) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_CRY); } this->danceEndTimer++; @@ -558,7 +558,7 @@ void EnRd_Pirouette(EnRd* this, PlayState* play) { } if ((play->gameplayFrames & 0x5F) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_CRY); } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { @@ -574,7 +574,7 @@ void EnRd_Pirouette(EnRd* this, PlayState* play) { void EnRd_EndPirouetteWhenPlayerIsClose(EnRd* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if ((play->gameplayFrames & 0x5F) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_CRY); } this->actor.world.rot.y -= this->pirouetteRotationalVelocity; @@ -613,7 +613,7 @@ void EnRd_RiseFromCoffin(EnRd* this, PlayState* play) { } } else { if (this->actor.world.pos.y == this->actor.home.pos.y) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_CRY); } if (Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 50.0f, 0.3f, 2.0f, 0.3f) == 0.0f) { @@ -665,7 +665,7 @@ void EnRd_WalkToPlayer(EnRd* this, PlayState* play) { Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150); } this->playerStunWaitTimer = 60; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_AIM); } } else { EnRd_SetupWalkToHome(this, play); @@ -700,9 +700,9 @@ void EnRd_WalkToPlayer(EnRd* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 22.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_WALK); } else if ((play->gameplayFrames & 0x5F) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_CRY); } } @@ -751,9 +751,9 @@ void EnRd_WalkToHome(EnRd* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 22.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_WALK); } else if ((play->gameplayFrames & 0x5F) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_CRY); } } @@ -802,9 +802,9 @@ void EnRd_WalkToParent(EnRd* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 22.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_WALK); } else if ((play->gameplayFrames & 0x5F) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_CRY); } } @@ -873,7 +873,7 @@ void EnRd_Grab(EnRd* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, player->actor.shape.rot.y, 1, 6000, 0); if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_ATTACK); } this->grabDamageTimer--; @@ -881,7 +881,7 @@ void EnRd_Grab(EnRd* this, PlayState* play) { play->damagePlayer(play, -8); Rumble_Request(this->actor.xzDistToPlayer, 240, 1, 12); this->grabDamageTimer = 20; - func_800B8E58(player, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_DAMAGE_S); + Player_PlaySfx(player, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_DAMAGE_S); } break; @@ -922,7 +922,7 @@ void EnRd_AttemptPlayerFreeze(EnRd* this, PlayState* play) { Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150); func_80123E90(play, &this->actor); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_AIM); EnRd_SetupWalkToPlayer(this, play); } } @@ -931,7 +931,7 @@ void EnRd_SetupGrabFail(EnRd* this) { this->action = EN_RD_ACTION_FAILING_GRAB; Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadDamageAnim, -6.0f); this->actor.speedXZ = -2.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->action = EN_RD_ACTION_FAILING_GRAB; this->actionFunc = EnRd_GrabFail; } @@ -1009,7 +1009,7 @@ void EnRd_SetupDamage(EnRd* this) { } this->actor.flags |= ACTOR_FLAG_1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->action = EN_RD_ACTION_DAMAGE; this->actionFunc = EnRd_Damage; } @@ -1044,7 +1044,7 @@ void EnRd_SetupDead(EnRd* this) { this->deathTimer = 300; this->actor.flags &= ~ACTOR_FLAG_1; this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_DEAD); this->actionFunc = EnRd_Dead; } @@ -1075,7 +1075,7 @@ void EnRd_Dead(EnRd* this, PlayState* play) { this->deathTimer--; } } else if (Animation_OnFrame(&this->skelAnime, 33.0f) || Animation_OnFrame(&this->skelAnime, 40.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GERUDOFT_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_DOWN); } } @@ -1087,7 +1087,7 @@ void EnRd_SetupStunned(EnRd* this) { if (gSaveContext.sunsSongState != SUNSSONG_INACTIVE) { this->stunnedBySunsSong = true; this->sunsSongStunTimer = 600; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LIGHT_ARROW_HIT); + Actor_PlaySfx(&this->actor, NA_SE_EN_LIGHT_ARROW_HIT); Actor_SetColorFilter(&this->actor, 0x8000, 0x80C8, 0, 255); } else if (this->damageEffect == EN_RD_DMGEFF_STUN) { Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 40); 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 9e6e22098b..5cd8c78bc9 100644 --- a/src/overlays/actors/ovl_En_Rg/z_en_rg.c +++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.c @@ -285,11 +285,11 @@ void func_80BF3FF8(EnRg* this) { s32 func_80BF4024(EnRg* this, PlayState* play) { if ((play->csCtx.state == 0) && (this->unk_334 == 1)) { if (Animation_OnFrame(&this->skelAnime, 2.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_CIRCLE); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_CIRCLE); } if (Animation_OnFrame(&this->skelAnime, 22.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_SIT_IMT); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_SIT_IMT); } } @@ -319,7 +319,7 @@ void func_80BF40F4(EnRg* this) { s32 func_80BF416C(EnRg* this, PlayState* play) { if ((this->actor.bgCheckFlags & 1) && (this->actor.speedXZ >= 0.01f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_ROLLING - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_ROLLING - SFX_FLAG); func_800AE930(&play->colCtx, Effect_GetByIndex(this->unk_340), &this->actor.world.pos, 18.0f, this->actor.shape.rot.y, this->actor.floorPoly, this->actor.floorBgId); } else { @@ -501,7 +501,7 @@ s32 func_80BF47AC(EnRg* this, PlayState* play) { void func_80BF4934(EnRg* this) { if (this->unk_318 == 1) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_DASH); } } 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 0fd1007d0d..ae7da7d1ba 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 @@ -86,7 +86,7 @@ void EnRiverSound_Draw(Actor* thisx, PlayState* play) { s16 params = this->actor.params; if (params < RS_RIVER_DEFAULT_LOW_FREQ) { - Actor_PlaySfxAtPos(&this->actor, gAudioEnvironmentalSfx[params]); + Actor_PlaySfx(&this->actor, gAudioEnvironmentalSfx[params]); } else { Audio_PlaySfxForRiver(&this->actor.projectedPos, freqScale[this->soundFreqIndex]); } 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 6c7ac273c0..10706fa9a5 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -215,7 +215,7 @@ void func_808FA19C(EnRr* this, PlayState* play) { void func_808FA238(EnRr* this, f32 arg1) { this->actor.speedXZ = arg1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LIKE_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_LIKE_WALK); } void func_808FA260(EnRr* this) { @@ -236,7 +236,7 @@ void func_808FA260(EnRr* this) { this->actionFunc = func_808FB088; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LIKE_UNARI); + Actor_PlaySfx(&this->actor, NA_SE_EN_LIKE_UNARI); } void func_808FA344(EnRr* this) { @@ -286,7 +286,7 @@ void func_808FA3F8(EnRr* this, Player* player) { } this->actionFunc = func_808FB1C0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_SUISEN_DRINK); + Actor_PlaySfx(&this->actor, NA_SE_EN_SUISEN_DRINK); } void func_808FA4F4(EnRr* this, PlayState* play) { @@ -331,7 +331,7 @@ void func_808FA4F4(EnRr* this, PlayState* play) { player->actor.world.pos.z += sp30 * Math_CosS(this->actor.shape.rot.y); func_800B8D50(play, &this->actor, sp30, this->actor.shape.rot.y, sp2C, sp38); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_SUISEN_THROW); + Actor_PlaySfx(&this->actor, NA_SE_EN_SUISEN_THROW); } } @@ -360,7 +360,7 @@ void func_808FA6B8(EnRr* this) { } this->actionFunc = func_808FB398; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LIKE_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_LIKE_DAMAGE); } void func_808FA7AC(EnRr* this) { @@ -415,7 +415,7 @@ void func_808FA910(EnRr* this) { } this->actionFunc = func_808FB42C; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LIKE_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_LIKE_DEAD); this->actor.flags &= ~ACTOR_FLAG_1; } @@ -482,7 +482,7 @@ s32 func_808FAA94(EnRr* this, PlayState* play) { func_808FA910(this); } } else if (this->actor.colChkInfo.damageEffect == 1) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); Actor_SetColorFilter(&this->actor, 0, 255, 0, 80); this->unk_1EE = 80; func_808FA9CC(this); @@ -632,7 +632,7 @@ void func_808FB1C0(EnRr* this, PlayState* play) { Rumble_Request(this->actor.xyzDistToPlayerSq, 120, 2, 120); if (!(this->unk_1E4 & 7)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_DEMO_EYE); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_DEMO_EYE); } player->unk_AE8 = 0; 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 042f2e46f8..fabf053597 100644 --- a/src/overlays/actors/ovl_En_Ru/z_en_ru.c +++ b/src/overlays/actors/ovl_En_Ru/z_en_ru.c @@ -161,12 +161,12 @@ s32 EnRu_PlayWalkingSound(EnRu* this, PlayState* play) { this->isLeftFootGrounded = isFootGrounded = SubS_IsFloorAbove(play, &this->leftFootPos, -6.0f); if (this->isLeftFootGrounded && !leftWasGrounded && isFootGrounded) { - Actor_PlaySfxAtPos(&this->actor, sfxId); + Actor_PlaySfx(&this->actor, sfxId); } this->isRightFootGrounded = isFootGrounded = SubS_IsFloorAbove(play, &this->rightFootPos, -6.0f); if (this->isRightFootGrounded && !rightWasGrounded && isFootGrounded) { - Actor_PlaySfxAtPos(&this->actor, sfxId); + Actor_PlaySfx(&this->actor, sfxId); } return false; 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 f77993e5d6..6bb60af551 100644 --- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c +++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c @@ -282,7 +282,7 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, PlayState* play) { this->rupees[rupeeIndex] = rupee; this->rupees[rupeeIndex]->actor.gravity = -5.0f; this->rupees[rupeeIndex]->actor.velocity.y = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_RUPY_FALL); + Actor_PlaySfx(&this->actor, NA_SE_EV_RUPY_FALL); rupee = this->rupees[rupeeIndex]; rupee->unk152 = 60; this->rupees[rupeeIndex]->actor.flags |= ACTOR_FLAG_10; @@ -293,7 +293,7 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, PlayState* play) { this->rupees[rupeeIndex] = rupee; this->rupees[rupeeIndex]->actor.gravity = -5.0f; this->rupees[rupeeIndex]->actor.velocity.y = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_RUPY_FALL); + Actor_PlaySfx(&this->actor, NA_SE_EV_RUPY_FALL); rupee = this->rupees[rupeeIndex]; rupee->unk152 = 60; this->rupees[rupeeIndex]->actor.flags |= ACTOR_FLAG_10; @@ -305,7 +305,7 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, PlayState* play) { this->rupees[rupeeIndex] = rupee; this->rupees[rupeeIndex]->actor.gravity = -5.0f; this->rupees[rupeeIndex]->actor.velocity.y = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_RUPY_FALL); + Actor_PlaySfx(&this->actor, NA_SE_EV_RUPY_FALL); rupee = this->rupees[rupeeIndex]; rupee->unk152 = 60; this->rupees[rupeeIndex]->actor.flags |= ACTOR_FLAG_10; @@ -316,7 +316,7 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, PlayState* play) { this->rupees[rupeeIndex] = rupee; this->rupees[rupeeIndex]->actor.gravity = -5.0f; this->rupees[rupeeIndex]->actor.velocity.y = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_RUPY_FALL); + Actor_PlaySfx(&this->actor, NA_SE_EV_RUPY_FALL); rupee = this->rupees[rupeeIndex]; rupee->unk152 = 60; this->rupees[rupeeIndex]->actor.flags |= ACTOR_FLAG_10; @@ -449,7 +449,7 @@ void EnRuppecrow_HandleDeath(EnRuppecrow* this) { scale = this->actor.scale.x * 100.0f; this->actor.world.pos.y += 20.0f * scale; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_DEAD); this->unk_2CC = 0.5f; if (this->actor.colChkInfo.damageEffect == 0x3) { @@ -518,7 +518,7 @@ void EnRuppecrow_HandleSong(EnRuppecrow* this, PlayState* play) { this->actor.shape.yOffset = Math_SinS(this->yOffset) * 500.0f; if ((play->state.frames % 43) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_CRY); } } @@ -563,7 +563,7 @@ void EnRuppecrow_FlyWhileDroppingRupees(EnRuppecrow* this, PlayState* play) { this->actor.shape.yOffset = Math_SinS(this->yOffset) * 500.0f; if ((play->state.frames % 43) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_CRY); } } } @@ -585,7 +585,7 @@ void EnRuppecrow_FlyToDespawn(EnRuppecrow* this, PlayState* play) { Actor_MoveWithGravity(&this->actor); if ((play->state.frames % 43) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_CRY); } } } 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 cc3cd2455d..a9485b6a87 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 @@ -765,10 +765,10 @@ void EnSGoro_UpdateSleeping(EnSGoro* this, PlayState* play) { if (this->snorePhase == 0) { if (this->actionFlags & EN_S_GORO_ACTIONFLAG_SNOREPHASE) { this->actionFlags &= ~EN_S_GORO_ACTIONFLAG_SNOREPHASE; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_SNORE2); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_SNORE2); } else { this->actionFlags |= EN_S_GORO_ACTIONFLAG_SNOREPHASE; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_SNORE1); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_SNORE1); } } } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_22_04)) { 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 868b489230..cae39cdae2 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -155,7 +155,7 @@ void EnSb_SetupOpen(EnSb* this) { ANIMMODE_ONCE, 0.0f); this->state = SHELLBLADE_OPEN; this->actionFunc = EnSb_Open; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); + Actor_PlaySfx(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); } void EnSb_SetupWaitOpen(EnSb* this) { @@ -172,7 +172,7 @@ void EnSb_SetupLunge(EnSb* this) { Animation_Change(&this->skelAnime, &object_sb_Anim_000124, playbackSpeed, 0.0f, frameCount, ANIMMODE_ONCE, 0); this->state = SHELLBLADE_LUNGE; this->actionFunc = EnSb_Lunge; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); + Actor_PlaySfx(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); } void EnSb_SetupBounce(EnSb* this) { @@ -270,7 +270,7 @@ void EnSb_Lunge(EnSb* this, PlayState* play) { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f); if (this->actor.velocity.y <= -0.1f || this->actor.bgCheckFlags & 2) { if (!(this->actor.depthInWater > 0.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } this->actor.bgCheckFlags &= ~2; EnSb_SetupBounce(this); 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 fa017af877..41c7a3e640 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 @@ -116,7 +116,7 @@ void func_80BD6A8C(EnScRuppe* this, PlayState* play) { if (this->collider.base.ocFlags1 & OC1_HIT) { this->ruppeDisplayTime = 0; this->actor.gravity = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_GET_RUPY); + Actor_PlaySfx(&this->actor, NA_SE_SY_GET_RUPY); Rupees_ChangeBy(sRupeeInfo[this->ruppeIndex].amount); this->actionFunc = func_80BD6B18; } 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 4f82070461..3d5a774cc3 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c @@ -252,7 +252,7 @@ void func_80BCB230(EnScopenuts* this, PlayState* play) { if ((((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false) && ((this->actor.xzDistToPlayer < 200.0f) ? true : false)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80BCB4DC; this->unk_348 = 3; this->collider.dim.height = 64; @@ -262,12 +262,12 @@ void func_80BCB230(EnScopenuts* this, PlayState* play) { if ((this->unk_348 == 4) || (this->unk_348 == 18)) { this->unk_348 = 17; this->collider.dim.height = 0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DOWN); SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 17); } else if (this->unk_348 == 2) { this->unk_348 = 16; this->collider.dim.height = 32; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_UP); SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 16); } else if (this->unk_348 == 17) { if (DECR(this->unk_34E) == 0) { @@ -464,7 +464,7 @@ void func_80BCBA00(EnScopenuts* this, PlayState* play) { this->unk_35A = 3; this->unk_348 = 19; SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 19); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DOWN); this->unk_328 &= ~2; this->unk_34E = 50; this->unk_328 |= 8; @@ -528,7 +528,7 @@ void func_80BCBD28(EnScopenuts* this, PlayState* play) { this->unk_368 = 0.3f; this->unk_348 = 9; SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 9); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); func_80BCAC40(this, play); this->actionFunc = func_80BCBF0C; } 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 b16153a53d..893ca400be 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c @@ -294,7 +294,7 @@ void func_80ADB254(EnSellnuts* this, PlayState* play) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); if (((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f) ? true : false) && ((this->actor.xzDistToPlayer < 200.0f) ? true : false)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80ADB4F4; this->unk_34C = 3; this->collider.dim.height = 64; @@ -303,12 +303,12 @@ void func_80ADB254(EnSellnuts* this, PlayState* play) { if ((this->unk_34C == 4) || (this->unk_34C == 18)) { this->unk_34C = 17; this->collider.dim.height = 0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DOWN); SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 17); } else if (this->unk_34C == 2) { this->unk_34C = 16; this->collider.dim.height = 32; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_UP); SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 16); } else if (this->unk_34C == 17) { if (DECR(this->unk_34E) == 0) { @@ -548,7 +548,7 @@ void func_80ADBE80(EnSellnuts* this, PlayState* play) { this->unk_350 = 4; this->unk_34C = 19; SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 19); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DOWN); this->unk_338 &= ~1; this->unk_338 |= 8; this->unk_32C = this->actor.world.pos.y; @@ -617,7 +617,7 @@ void func_80ADC118(EnSellnuts* this, PlayState* play) { this->unk_34C = 9; this->unk_360 = 0.3f; SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 9); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80ADC034; } } @@ -823,7 +823,7 @@ void func_80ADCA64(EnSellnuts* this, PlayState* play) { this->unk_34C = 19; this->actor.velocity.y = 0.0f; SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DOWN); } return; } @@ -884,7 +884,7 @@ void func_80ADCD3C(EnSellnuts* this, PlayState* play) { this->collider.dim.height = 64; this->unk_34C = 3; this->unk_350 = 4; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); this->actionFunc = func_80ADCC04; } else if (D_80ADD940 != 0) { 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 bb1fb7e0bb..5b08cfaa77 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -289,7 +289,7 @@ void func_80994DA8(EnSkb* this, PlayState* play) { void func_80994E2C(EnSkb* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); this->actor.flags &= ~ACTOR_FLAG_1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_APPEAR); this->unk_3D0 = 0; this->unk_3DE = 0; this->actionFunc = func_80994E94; @@ -495,7 +495,7 @@ void func_8099556C(EnSkb* this, PlayState* play) { } void func_8099571C(EnSkb* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK); this->unk_3DC = 0; this->actor.shape.shadowScale = 0.0f; if (this->unk_3DE == 9) { @@ -540,7 +540,7 @@ void func_809958F4(EnSkb* this) { this->unk_3E4 = 0; this->actor.flags &= ~ACTOR_FLAG_1; this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->unk_3DE = 1; this->actionFunc = func_8099599C; } @@ -585,7 +585,7 @@ void func_80995A8C(EnSkb* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + this->unk_3DA, 1, 0x2EE, 0); this->actor.world.rot.y = this->actor.shape.rot.y; if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 15.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_WALK); } if ((this->actor.xzDistToPlayer > 800.0f) || func_80996594(this, play)) { @@ -605,7 +605,7 @@ void func_80995C24(EnSkb* this) { void func_80995C84(EnSkb* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 3.0f) && (this->unk_3E4 == 0)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK); this->unk_3E4 = 1; } else if (Animation_OnFrame(&this->skelAnime, 6.0f)) { this->unk_3E4 = 0; @@ -638,7 +638,7 @@ void func_80995E08(EnSkb* this) { if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = 0.0f; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->unk_3E4 = 0; this->unk_3DE = 5; this->actionFunc = func_80995E64; @@ -697,7 +697,7 @@ void func_80995F98(EnSkb* this) { this->actor.speedXZ = -4.0f; } } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_3DE = 6; this->actionFunc = func_809960AC; } @@ -749,7 +749,7 @@ void func_80996284(EnSkb* this, PlayState* play) { } void func_809962D4(EnSkb* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->actionFunc = func_8099630C; } @@ -934,7 +934,7 @@ void func_8099672C(EnSkb* this, PlayState* play) { case 3: if (this->actor.colChkInfo.health != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->drawDmgEffTimer = 80; } else { this->drawDmgEffTimer = 3; @@ -952,7 +952,7 @@ void func_8099672C(EnSkb* this, PlayState* play) { this->drawDmgEffAlpha = 1.0f; this->drawDmgEffScale = 0.5f; Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); func_809963C4(this); break; 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 d8ffd854e6..68f6f1606b 100644 --- a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c +++ b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c @@ -415,7 +415,7 @@ void EnSnowman_MoveSnowPile(EnSnowman* this, PlayState* play) { void EnSnowman_SetupEmerge(EnSnowman* this, PlayState* play) { Animation_PlayOnce(&this->skelAnime, &gEenoEmergeAnim); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_YMAJIN_SURFACE); + Actor_PlaySfx(&this->actor, NA_SE_EN_YMAJIN_SURFACE); this->collider.dim.radius = this->eenoScale * 40.0f; this->collider.dim.height = this->eenoScale * 25.0f; this->actor.draw = EnSnowman_Draw; @@ -495,9 +495,9 @@ void EnSnowman_ReadySnowball(EnSnowman* this, PlayState* play) { EnSnowman_SetupThrowSnowball(this); } else if (Animation_OnFrame(&this->skelAnime, this->fwork.frameToStartHoldingSnowball)) { if (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_LARGE) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_YMAJIN_HOLD_SNOW); + Actor_PlaySfx(&this->actor, NA_SE_EN_YMAJIN_HOLD_SNOW); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_YMAJIN_MINI_HOLD); + Actor_PlaySfx(&this->actor, NA_SE_EN_YMAJIN_MINI_HOLD); } this->isHoldingSnowball = true; @@ -540,10 +540,10 @@ void EnSnowman_ThrowSnowball(EnSnowman* this, PlayState* play) { this->isHoldingSnowball = false; if (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_LARGE) { params = EN_SNOWMAN_TYPE_LARGE_SNOWBALL; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_YMAJIN_THROW); + Actor_PlaySfx(&this->actor, NA_SE_EN_YMAJIN_THROW); } else { params = EN_SNOWMAN_TYPE_SMALL_SNOWBALL; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_YMAJIN_MINI_THROW); + Actor_PlaySfx(&this->actor, NA_SE_EN_YMAJIN_MINI_THROW); } Actor_Spawn(&play->actorCtx, play, ACTOR_EN_SNOWMAN, this->snowballPos.x, this->snowballPos.y, @@ -573,7 +573,7 @@ void EnSnowman_SetupSubmerge(EnSnowman* this, PlayState* play) { Animation_Change(&this->skelAnime, &gEenoEmergeAnim, -1.0f, Animation_GetLastFrame(&gEenoEmergeAnim), 0.0f, ANIMMODE_ONCE, -3.0f); EnSnowman_SpawnCircularDustEffect(this, play); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_YMAJIN_HIDE); + Actor_PlaySfx(&this->actor, NA_SE_EN_YMAJIN_HIDE); this->actionFunc = EnSnowman_Submerge; } @@ -677,9 +677,9 @@ void EnSnowman_SetupDamaged(EnSnowman* this) { func_800BE504(&this->actor, &this->collider); if (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_LARGE) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_YMAJIN_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_YMAJIN_DAMAGE); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_YMAJIN_MINI_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_YMAJIN_MINI_DAMAGE); } this->actionFunc = EnSnowman_Damaged; @@ -707,7 +707,7 @@ void EnSnowman_Damaged(EnSnowman* this, PlayState* play) { if (this->work.timer > 0) { this->work.timer--; } else if (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_LARGE) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_YMAJIN_SPLIT); + Actor_PlaySfx(&this->actor, NA_SE_EN_YMAJIN_SPLIT); EnSnowman_SpawnCircularDustEffect(this, play); this->drawDmgEffAlpha = 0.0f; EnSnowman_CreateSplitEeno((EnSnowman*)this->actor.parent, &this->actor.world.pos, @@ -845,7 +845,7 @@ void EnSnowman_CreateSplitEeno(EnSnowman* this, Vec3f* basePos, s32 yRot) { * target scale increases. */ void EnSnowman_AbsorbEeno(EnSnowman* smallerEeno, EnSnowman* largerEeno) { - Actor_PlaySfxAtPos(&largerEeno->actor, NA_SE_EN_YMAJIN_UNITE); + Actor_PlaySfx(&largerEeno->actor, NA_SE_EN_YMAJIN_UNITE); largerEeno->fwork.targetScaleDuringCombine += 0.005f; smallerEeno->combineState = EN_SNOWMAN_COMBINE_STATE_BEING_ABSORBED_OR_DONE; smallerEeno->collider.base.ocFlags1 &= ~OC1_HIT; @@ -978,14 +978,14 @@ void EnSnowman_UpdateDamage(EnSnowman* this, PlayState* play) { EnSnowman_SetupEmerge(this, play); } else if (this->actor.colChkInfo.damageEffect == EN_SNOWMAN_DMGEFF_STUN) { Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); EnSnowman_SetupStun(this); } else if (this->actor.colChkInfo.damageEffect == EN_SNOWMAN_DMGEFF_ELECTRIC_STUN) { Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); this->drawDmgEffScale = 0.55f; this->drawDmgEffAlpha = 2.0f; this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_LARGE; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); EnSnowman_SetupStun(this); } else if (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_LARGE) { if (this->isHoldingSnowball == true) { 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 233c6c8114..d47d665886 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -228,7 +228,7 @@ void EnSsh_SetWaitAnimation(EnSsh* this) { } void EnSsh_SetReturnAnimation(EnSsh* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALTU_UP); EnSsh_ChangeAnim(this, SSH_ANIM_UP); } @@ -297,8 +297,8 @@ s32 EnSsh_Damaged(EnSsh* this) { this->spinTimer = 30; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_ROLL); - Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_ST_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALTU_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_VO_ST_ATTACK); return true; } @@ -477,8 +477,8 @@ s32 EnSsh_CheckHitPlayer(EnSsh* this, PlayState* play) { this->spinTimer = this->hitTimer; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_ROLL); - Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_ST_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALTU_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_VO_ST_ATTACK); play->damagePlayer(play, -8); @@ -532,8 +532,8 @@ s32 EnSsh_CheckHitBack(EnSsh* this, PlayState* play) { } if (this->stunTimer == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); - Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_ST_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_VO_ST_DAMAGE); } EnSsh_SetStunned(this); @@ -553,8 +553,8 @@ s32 EnSsh_CollisionCheck(EnSsh* this, PlayState* play) { if (play->actorCtx.unk2 != 0) { this->invincibilityTimer = 8; if (this->stunTimer == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); - Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_ST_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_VO_ST_DAMAGE); } EnSsh_SetStunned(this); this->stateFlags |= SSH_STATE_STUNNED; @@ -739,7 +739,7 @@ void EnSsh_Idle(EnSsh* this, PlayState* play) { } if (DECR(this->sfxTimer) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_LAUGH); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALTU_LAUGH); this->sfxTimer = 64; } @@ -780,7 +780,7 @@ void EnSsh_Drop(EnSsh* this, PlayState* play) { EnSsh_SetLandAnimation(this); EnSsh_SetupAction(this, EnSsh_Land); } else if (DECR(this->sfxTimer) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_DOWN); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALTU_DOWN); this->sfxTimer = 3; } } 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 c5cc3232c6..66dbfca21f 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -348,7 +348,7 @@ s16 func_808A5BEC(EnSt* this) { } else { ret = this->actor.yawTowardsPlayer; if (DECR(this->unk_30E) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALTU_ROLL); this->unk_18C ^= 2; this->unk_310 = 8; if (this->unk_18C & 1) { @@ -456,7 +456,7 @@ void func_808A60E0(EnSt* this) { if (sp1C == 1.0f) { SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); - Actor_PlaySfxAtPos(&this->actor, sfxId); + Actor_PlaySfx(&this->actor, sfxId); } this->unk_2D4 = (1.0f - sp1C) * sp20 * this->unk_2C8; @@ -587,7 +587,7 @@ s32 func_808A6580(EnSt* this, PlayState* play) { } else if (func_808A61F4(this)) { switch (this->actor.colChkInfo.damageEffect) { case 1: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->unk_312 = 40; Actor_SetColorFilter(&this->actor, 0, 200, 0, this->unk_312); break; @@ -600,7 +600,7 @@ s32 func_808A6580(EnSt* this, PlayState* play) { break; default: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALTU_DAMAGE); this->unk_314 = 20; this->unk_312 = 0; Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, this->unk_314); @@ -663,7 +663,7 @@ s32 func_808A6580(EnSt* this, PlayState* play) { if ((this->unk_316 == 0) && (this->unk_314 == 0) && (this->unk_312 == 0) && !(this->collider1.base.atFlags & AT_BOUNCED) && (this->actor.colChkInfo.health != 0)) { play->damagePlayer(play, -8); - Actor_PlaySfxAtPos(&sp3C->actor, NA_SE_PL_BODY_HIT); + Actor_PlaySfx(&sp3C->actor, NA_SE_PL_BODY_HIT); func_800B8D98(play, &this->actor, 4.0f, this->actor.yawTowardsPlayer, 6.0f); this->unk_316 = 10; this->unk_18C |= 1; @@ -784,7 +784,7 @@ void func_808A6E24(EnSt* this, PlayState* play) { this->actor.speedXZ = 0.0f; if ((s32)this->unk_2D0 != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } else { this->actor.velocity.y = 0.0f; this->actionFunc = func_808A701C; 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 69efb56761..556b997fd9 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 @@ -346,7 +346,7 @@ void EnStoneheishi_DrinkBottleProcess(EnStoneheishi* this, PlayState* play) { if (this->timer != 0) { if ((this->timer < 10) && (this->bottleDisplay != EN_STONE_BOTTLE_EMPTY)) { this->bottleDisplay = EN_STONE_BOTTLE_EMPTY; - Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_NP_DRINK); + Actor_PlaySfx(&this->actor, NA_SE_VO_NP_DRINK); Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE); } } else { 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 6d214b4fd5..089cb3ebaf 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 @@ -365,7 +365,7 @@ void func_80AE7F34(EnStopheishi* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if ((this->currentAnim == SOLDIER_ANIM_5) && (((s16)this->skelAnime.curFrame % 2) != 0)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SOLDIER_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_SOLDIER_WALK); } if (gSaveContext.save.day != 3) { EnStopheishi_UpdateHeadNormal(this, play); 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 93c93eef92..4016052baf 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -1488,11 +1488,11 @@ void EnSuttari_Update(Actor* thisx, PlayState* play) { if (this->unk428 != 0) { if (this->animIndex == 2 || this->animIndex == 6) { if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 16.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_PAMERA_WALK); } } else if (this->animIndex == 0 || this->animIndex == 5) { if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 17.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_PAMERA_WALK); } } } 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 bbc010a2aa..0d0e75a092 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -524,9 +524,9 @@ s32 func_808D9A70(EnSw* this, PlayState* play) { } else { if (this->unk_456 != 0) { if (!ENSW_GET_3(&this->actor)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALWALL_ROLL); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALGOLD_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALGOLD_ROLL); } this->unk_456--; this->skelAnime.curFrame = 0.0f; @@ -575,7 +575,7 @@ s32 func_808D9C18(EnSw* this) { this->actor.world.rot.y = Math_Vec3f_Yaw(&sp3C, &sp30); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTURA_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALTURA_APPEAR); if (ENSW_GET_3(&this->actor) == 1) { Actor_SetScale(&this->actor, 0.0f); @@ -721,12 +721,12 @@ s32 func_808DA08C(EnSw* this, PlayState* play) { ret = true; } else if (this->actor.colChkInfo.damageEffect == 1) { if (this->unk_45A == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->unk_45A = 40; Actor_SetColorFilter(&this->actor, 0, 200, 0, this->unk_45A); } } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALTU_DAMAGE); this->unk_458 = 20; this->unk_45A = 0; Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, this->unk_458); @@ -739,7 +739,7 @@ void func_808DA350(EnSw* this, PlayState* play) { Player* player = GET_PLAYER(play); if ((player->stateFlags1 & PLAYER_STATE1_200000) && (this->actor.xyzDistToPlayerSq < 8000.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_LAUGH); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALWALL_LAUGH); Math_Vec3f_Copy(&this->unk_374, &player->actor.world.pos); this->unk_410 &= ~0x20; this->unk_414 = 0.0f; @@ -764,7 +764,7 @@ void func_808DA3F4(EnSw* this, PlayState* play) { temp_v0 = Math_Atan2S_XY(sp38.z, sp38.x); if (ABS_ALT(temp_v0) < temp_s1) { this->skelAnime.curFrame = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALWALL_DASH); this->unk_414 = 0.0f; if (this->unk_410 & 0x20) { this->actionFunc = func_808DA6FC; @@ -775,7 +775,7 @@ void func_808DA3F4(EnSw* this, PlayState* play) { } temp_s1 *= (temp_v0 < 0) ? -1 : 1; } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALWALL_ROLL); this->skelAnime.curFrame = 0.0f; } func_808D94D0(this, play, 0, 0, temp_s1); @@ -801,7 +801,7 @@ void func_808DA578(EnSw* this, PlayState* play) { Math_Vec3f_Copy(&this->unk_374, &this->actor.home.pos); this->actionFunc = func_808DA3F4; } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALWALL_DASH); this->skelAnime.curFrame = 0.0f; } @@ -829,7 +829,7 @@ void func_808DA6FC(EnSw* this, PlayState* play) { func_808D94D0(this, play, 0, 0, temp2); } } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALWALL_DASH); this->skelAnime.curFrame = 0.0f; } @@ -882,7 +882,7 @@ void func_808DA89C(EnSw* this, PlayState* play) { this->unk_448 = temp_f2; this->actor.speedXZ = 0.0f; if ((s32)temp_f2 != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTURA_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALTURA_BOUND); } else { this->actionFunc = func_808DAEB4; this->actor.velocity.y = 0.0f; @@ -919,7 +919,7 @@ void func_808DAA60(EnSw* this, PlayState* play) { temp_v0 = Math_Atan2S_XY(sp34.z, sp34.x); if (ABS_ALT(temp_v0) < sp40) { this->skelAnime.curFrame = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALWALL_DASH); Math_Vec3s_ToVec3f(&this->unk_374, &sp44[this->unk_4A0]); this->actionFunc = func_808DACF4; this->unk_414 = 0.0f; @@ -929,7 +929,7 @@ void func_808DAA60(EnSw* this, PlayState* play) { } } else { if (this->unk_456 != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALGOLD_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALGOLD_ROLL); this->unk_456--; this->skelAnime.curFrame = 0.0f; } else { @@ -971,7 +971,7 @@ void func_808DACF4(EnSw* this, PlayState* play) { func_808D94D0(this, play, 0, 0, temp_f6); } } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_DASH); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALWALL_DASH); this->skelAnime.curFrame = 0.0f; } @@ -1075,9 +1075,9 @@ void func_808DB100(EnSw* this, PlayState* play) { if ((DECR(this->unk_454) == 0) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (this->unk_456 != 0) { if (!ENSW_GET_3(&this->actor)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALWALL_ROLL); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALGOLD_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALGOLD_ROLL); } this->unk_456--; this->skelAnime.curFrame = 0.0f; @@ -1112,7 +1112,7 @@ void func_808DB2E0(EnSw* this, PlayState* play) { this->actor.velocity.z *= 0.5f; if ((s32)temp_f2 != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTURA_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALTURA_BOUND); } else { func_800BC154(play, &play->actorCtx, &this->actor, 5); Math_Vec3f_Copy(&this->actor.velocity, &gZeroVec3f); 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 6f533b3a3a..aac4a27f6c 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 @@ -169,7 +169,7 @@ void EnSyatekiCrow_SetupWaitToMove(EnSyatekiCrow* this) { */ void EnSyatekiCrow_WaitToMove(EnSyatekiCrow* this, PlayState* play) { if (((EN_SYATEKI_CROW_GET_WAIT_MOD(&this->actor) * 20) + 20) < this->waitTimer) { - Actor_PlaySfxAtPos(this->actor.parent, NA_SE_EN_KAICHO_CRY); + Actor_PlaySfx(this->actor.parent, NA_SE_EN_KAICHO_CRY); this->waitTimer = 0; this->actor.speedXZ = EN_SYATEKI_CROW_GET_SPEED_MOD(&this->actor) + 6.0f; this->actor.gravity = -0.5f; @@ -213,7 +213,7 @@ void EnSyatekiCrow_Fly(EnSyatekiCrow* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); this->actor.shape.yOffset = (fabsf(this->skelAnime.curFrame - 3.0f) * 150.0f) + 1700.0f; if ((syatekiMan->perGameVar1.guaySpawnTimer % 90) == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_CRY); } } @@ -226,7 +226,7 @@ void EnSyatekiCrow_SetupDead(EnSyatekiCrow* this) { this->actor.velocity.y = 0.0f; Animation_Change(&this->skelAnime, &gGuayFlyAnim, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -3.0f); this->actor.bgCheckFlags &= ~1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_DEAD); Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40); this->actionFunc = EnSyatekiCrow_Dead; } 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 c21eb61157..c678f37307 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 @@ -232,7 +232,7 @@ void EnSyatekiDekunuts_WaitToStart(EnSyatekiDekunuts* this, PlayState* play) { if (this->waitTimer > 20) { syatekiMan = (EnSyatekiMan*)this->actor.parent; - Actor_PlaySfxAtPos(&syatekiMan->actor, NA_SE_EN_NUTS_DAMAGE); + Actor_PlaySfx(&syatekiMan->actor, NA_SE_EN_NUTS_DAMAGE); this->waitTimer = 0; EnSyatekiDekunuts_SetupWaitToEmerge(this); } else { @@ -258,7 +258,7 @@ void EnSyatekiDekunuts_WaitToEmerge(EnSyatekiDekunuts* this, PlayState* play) { } void EnSyatekiDekunuts_SetupEmerge(EnSyatekiDekunuts* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_UP); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_DEKUNUTS_ANIM_UP); this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer; @@ -379,7 +379,7 @@ void EnSyatekiDekunuts_SetupDead(EnSyatekiDekunuts* this, PlayState* play) { syatekiMan->dekuScrubHitCounter++; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DAMAGE); this->isAlive = false; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_DEKUNUTS_ANIM_DAMAGE); this->timer = 160; @@ -394,7 +394,7 @@ void EnSyatekiDekunuts_Dead(EnSyatekiDekunuts* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (this->timer == 160) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_DEKUNUTS_ANIM_DIE); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DEAD); this->timer--; } else if (this->timer < 160) { Vec3f pos; 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 759e97206c..2066525fff 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 @@ -1012,7 +1012,7 @@ void EnSyatekiMan_Swamp_StartGame(EnSyatekiMan* this, PlayState* play) { this->flagsIndex = 0; this->score = 0; player->stateFlags1 &= ~PLAYER_STATE1_20; - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_FOUND); + Actor_PlaySfx(&this->actor, NA_SE_SY_FOUND); this->dekuScrubFlags = (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) | (1 << 0); this->guayFlags = 0; this->wolfosFlags = 0; @@ -1036,7 +1036,7 @@ void EnSyatekiMan_Swamp_RunGame(EnSyatekiMan* this, PlayState* play) { // Spawn three guays after the player has killed all Deku Scrubs, or after 140 frames. sHasSpawnedGuaysForThisWave = true; this->perGameVar1.guaySpawnTimer = 0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_FOUND); + Actor_PlaySfx(&this->actor, NA_SE_SY_FOUND); this->guayFlags = sGuayFlagsPerWave[this->flagsIndex]; if (this->flagsIndex == 3) { this->flagsIndex = 0; @@ -1168,7 +1168,7 @@ void EnSyatekiMan_Swamp_AddBonusPoints(EnSyatekiMan* this, PlayState* play) { gSaveContext.timerStopTimes[TIMER_ID_MINIGAME_1] += SECONDS_TO_TIMER(1); play->interfaceCtx.minigamePoints += 10; this->score += 10; - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); sBonusTimer = 0; } else { sBonusTimer++; @@ -1342,7 +1342,7 @@ void EnSyatekiMan_Town_RunGame(EnSyatekiMan* this, PlayState* play) { if ((sModFromLosingTime == (timer % 50)) && (this->perGameVar1.octorokState >= SG_OCTO_STATE_INITIAL)) { if (this->flagsIndex < 15) { this->octorokFlags = sOctorokFlagsPerWave[this->flagsIndex++]; - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_FOUND); + Actor_PlaySfx(&this->actor, NA_SE_SY_FOUND); this->perGameVar1.octorokState = SG_OCTO_STATE_SPAWNING; } } 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 162a6d7182..9aa5fbc9fc 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 @@ -195,7 +195,7 @@ void func_80A363B4(EnSyatekiOkuta* this, PlayState* play) { return; } else { func_80A361B0(this, play); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_OCTAROCK_JUMP); + Actor_PlaySfx(&this->actor, NA_SE_EN_OCTAROCK_JUMP); } } @@ -225,7 +225,7 @@ void func_80A364C0(EnSyatekiOkuta* this) { void func_80A36504(EnSyatekiOkuta* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 4.0f)) { func_80A361B0(this, play); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIOCTA_LAND); + Actor_PlaySfx(&this->actor, NA_SE_EN_DAIOCTA_LAND); } else if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { func_80A362F8(this); } @@ -235,7 +235,7 @@ void func_80A3657C(EnSyatekiOkuta* this) { this->unk_2A4 = 0; this->unk_2AA = 300; if (this->unk_2A6 == 1) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_OCTAROCK_DEAD1); + Actor_PlaySfx(&this->actor, NA_SE_EN_OCTAROCK_DEAD1); } Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); @@ -261,7 +261,7 @@ void func_80A365EC(EnSyatekiOkuta* this, PlayState* play) { sp84.y = -0.5f; sp84.z = 0.0f; func_80A36148(&sp78, &sp84, -20, play); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_OCTAROCK_DEAD2); + Actor_PlaySfx(&this->actor, NA_SE_EN_OCTAROCK_DEAD2); } this->unk_2A4++; @@ -369,12 +369,12 @@ void EnSyatekiOkuta_Update(Actor* thisx, PlayState* play) { if (func_80A36A90(this, play)) { syatekiMan = (EnSyatekiMan*)this->actor.parent; if (this->unk_2A6 == 1) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); play->interfaceCtx.minigamePoints++; syatekiMan->score++; syatekiMan->perGameVar2.octorokHitType = SG_OCTO_HIT_TYPE_RED; } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_ERROR); + Actor_PlaySfx(&this->actor, NA_SE_SY_ERROR); syatekiMan->perGameVar2.octorokHitType = SG_OCTO_HIT_TYPE_BLUE; } 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 9f35d8bc72..ce044256a8 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 @@ -254,7 +254,7 @@ void EnSyatekiWf_SetupWaitToMove(EnSyatekiWf* this) { */ void EnSyatekiWf_WaitToMove(EnSyatekiWf* this, PlayState* play) { if (this->waitTimer >= 11) { - Actor_PlaySfxAtPos(this->actor.parent, NA_SE_EN_WOLFOS_APPEAR); + Actor_PlaySfx(this->actor.parent, NA_SE_EN_WOLFOS_APPEAR); this->waitTimer = 0; EnSyatekiWf_SetupRun(this); } else { @@ -337,7 +337,7 @@ void EnSyatekiWf_Run(EnSyatekiWf* this, PlayState* play) { } void EnSyatekiWf_SetupJump(EnSyatekiWf* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_JUMP); this->actor.velocity.y = 20.0f; this->actor.speedXZ = 5.0f; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_WF_ANIM_JUMP); @@ -368,7 +368,7 @@ void EnSyatekiWf_Land(EnSyatekiWf* this, PlayState* play) { void EnSyatekiWf_SetupHowl(EnSyatekiWf* this) { this->timer = 40; this->actor.speedXZ = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_APPEAR); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_WF_ANIM_DAMAGED); this->actionFunc = EnSyatekiWf_Howl; } @@ -391,7 +391,7 @@ void EnSyatekiWf_SetupDead(EnSyatekiWf* this, PlayState* play) { this->isActive = false; this->actor.speedXZ = 0.0f; EffectSsExtra_Spawn(play, &this->actor.world.pos, &sVelocity, &sAccel, 5, 2); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_DEAD); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_WF_ANIM_REAR_UP_FALL_OVER); syatekiMan->score += 100; this->actionFunc = EnSyatekiWf_Dead; 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 4391140174..ab86647aaa 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 @@ -313,7 +313,7 @@ void EnTalkGibud_AttemptPlayerFreeze(EnTalkGibud* this, PlayState* play) { player->actor.freezeTimer = 60; Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150); func_80123E90(play, &this->actor); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_AIM); EnTalkGibud_SetupWalkToPlayer(this); } @@ -358,7 +358,7 @@ void EnTalkGibud_WalkToPlayer(EnTalkGibud* this, PlayState* play) { this->playerStunWaitTimer = 60; Rumble_Request(this->actor.xzDistToPlayer, 255, 20, 150); func_80123E90(play, &this->actor); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_AIM); } else { this->playerStunWaitTimer--; } @@ -374,9 +374,9 @@ void EnTalkGibud_WalkToPlayer(EnTalkGibud* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 22.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_WALK); } else if (!(play->gameplayFrames & 95)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_CRY); } } @@ -409,7 +409,7 @@ void EnTalkGibud_Grab(EnTalkGibud* this, PlayState* play) { damageSfxId = player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_DAMAGE_S; play->damagePlayer(play, -8); - func_800B8E58(player, damageSfxId); + Player_PlaySfx(player, damageSfxId); Rumble_Request(this->actor.xzDistToPlayer, 240, 1, 12); this->grabDamageTimer = 0; } else { @@ -417,7 +417,7 @@ void EnTalkGibud_Grab(EnTalkGibud* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_ATTACK); } if (!(player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B62 != 0)) { @@ -447,7 +447,7 @@ void EnTalkGibud_Grab(EnTalkGibud* this, PlayState* play) { void EnTalkGibud_SetupGrabFail(EnTalkGibud* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_DAMAGE); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->actor.speedXZ = -2.0f; this->actionFunc = EnTalkGibud_GrabFail; } @@ -549,7 +549,7 @@ void EnTalkGibud_Stunned(EnTalkGibud* this, PlayState* play) { void EnTalkGibud_SetupDamage(EnTalkGibud* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_DAMAGE); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->stunTimer = 0; this->grabWaitTimer = 0; this->actor.world.rot.y = this->actor.yawTowardsPlayer; @@ -586,7 +586,7 @@ void EnTalkGibud_Damage(EnTalkGibud* this, PlayState* play) { void EnTalkGibud_SetupDead(EnTalkGibud* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_DEATH); this->actor.flags &= ~ACTOR_FLAG_1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_DEAD); this->deathTimer = 0; this->actionFunc = EnTalkGibud_Dead; } @@ -612,7 +612,7 @@ void EnTalkGibud_SetupRevive(EnTalkGibud* this) { Animation_Change(&this->skelAnime, &gGibdoRedeadDeathAnim, -1.0f, Animation_GetLastFrame(&gGibdoRedeadDeathAnim), 0.0f, ANIMMODE_ONCE, -8.0f); this->actor.flags |= ACTOR_FLAG_1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_REVERSE); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_REVERSE); this->deathTimer = 0; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnTalkGibud_Revive; @@ -777,7 +777,7 @@ void EnTalkGibud_PassiveIdle(EnTalkGibud* this, PlayState* play) { this->isTalking = true; Message_StartTextbox(play, 0x1388, &this->actor); this->textId = 0x1388; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM); + Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_AIM); EnTalkGibud_SetupTalk(this); } else if (this->actor.xzDistToPlayer < 100.0f && !(this->collider.base.acFlags & AC_HIT)) { Actor_TrackPlayer(play, &this->actor, &this->headRotation, &this->upperBodyRotation, this->actor.focus.pos); 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 3325604033..f6b0b2f31f 100644 --- a/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c +++ b/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c @@ -188,7 +188,7 @@ void func_80BB69FC(EnTanron2* this, PlayState* play) { if ((this->unk_158 == 0) && ((sp34 + sp30 + sp2C) < 2.0f)) { this->unk_158 = 1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_SLIME_EAT); + Actor_PlaySfx(&this->actor, NA_SE_EN_B_SLIME_EAT); } Math_ApproachF(&this->unk_15C, 1.0f, 1.0f, 0.02f); @@ -228,7 +228,7 @@ void func_80BB6BD8(EnTanron2* this, PlayState* play) { if (this->actor.world.pos.y <= this->actor.floorHeight) { this->actor.world.pos.y = this->actor.floorHeight; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IKURA_JUMP2); + Actor_PlaySfx(&this->actor, NA_SE_EN_IKURA_JUMP2); sp2C = D_80BB8450->unk_6BC.x - this->actor.world.pos.x; sp28 = D_80BB8450->unk_6BC.z - this->actor.world.pos.z; @@ -285,7 +285,7 @@ void func_80BB6BD8(EnTanron2* this, PlayState* play) { func_80BB69C0(this); } else { this->unk_150 = 10; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IKURA_JUMP1); + Actor_PlaySfx(&this->actor, NA_SE_EN_IKURA_JUMP1); } } } @@ -318,9 +318,9 @@ void func_80BB6F78(EnTanron2* this, PlayState* play) { if (this->actor.world.pos.y <= this->actor.floorHeight) { this->actor.world.pos.y = this->actor.floorHeight; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IKURA_JUMP2); + Actor_PlaySfx(&this->actor, NA_SE_EN_IKURA_JUMP2); if (D_80BB8450->unk_6F8 > 0.1f) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OUT_OF_WATER_L); + Actor_PlaySfx(&this->actor, NA_SE_EV_OUT_OF_WATER_L); } this->actor.velocity.y = Rand_ZeroFloat(5.0f) + 12.0f; this->unk_14E = 5; @@ -344,7 +344,7 @@ void func_80BB6F78(EnTanron2* this, PlayState* play) { this->unk_159 = 0; } else { this->unk_150 = 0xA; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IKURA_JUMP1); + Actor_PlaySfx(&this->actor, NA_SE_EN_IKURA_JUMP1); } } } @@ -381,7 +381,7 @@ void func_80BB7398(EnTanron2* this, PlayState* play) { Enemy_StartFinishingBlow(play, &this->actor); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 30, NA_SE_EN_IKURA_DEAD); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IKURA_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_IKURA_DAMAGE); } } @@ -427,7 +427,7 @@ void func_80BB7578(EnTanron2* this, PlayState* play) { if (acHitInfo->toucher.dmgFlags & 0x80) { func_80BB6B80(this); this->unk_158 = 1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IKURA_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_IKURA_DAMAGE); if ((player->targetedActor != NULL) && (&this->actor != player->targetedActor)) { player->targetedActor = &this->actor; play->actorCtx.targetContext.arrowPointedActor = &this->actor; @@ -448,7 +448,7 @@ void func_80BB7578(EnTanron2* this, PlayState* play) { func_80BB7398(this, play); } } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IKURA_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_IKURA_DAMAGE); goto block_18; } } 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 0e7be15f36..4de900cc4c 100644 --- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c +++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c @@ -205,7 +205,7 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) { Math_Vec3f_Copy(&this->targetPos, &player->actor.world.pos); if (!(this->timer & 0xF)) { if (Rand_ZeroOne() < 0.5f && this->actor.xzDistToPlayer <= 200.0f) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIRANHA_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_PIRANHA_ATTACK); } } @@ -347,7 +347,7 @@ void EnTanron3_SetupDie(EnTanron3* this, PlayState* play) { this->actor.world.rot.y = Math_Atan2S_XY(zDistance, xDistance); this->workTimer[WORK_TIMER_DIE] = 6; this->actor.speedXZ = 10.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KONB_MINI_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_KONB_MINI_DEAD); } void EnTanron3_Die(EnTanron3* this, PlayState* play) { @@ -413,7 +413,7 @@ void EnTanron3_Update(Actor* thisx, PlayState* play) { splashPos.y = this->waterSurfaceYPos + 10.0f; splashPos.z = this->actor.world.pos.z; EffectSsGSplash_Spawn(play, &splashPos, NULL, NULL, 1, 500); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OUT_OF_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_OUT_OF_WATER); } } 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 c052c33090..6893b30217 100644 --- a/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c +++ b/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c @@ -349,7 +349,7 @@ void EnTanron5_Update(Actor* thisx, PlayState* play2) { } this->actor.shape.rot.y += phi_v0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BIG_BOMB_EXPLOSION); + Actor_PlaySfx(&this->actor, NA_SE_IT_BIG_BOMB_EXPLOSION); func_800BC848(&this->actor, play, 4, 4); this->unk_1A0++; } else { @@ -360,7 +360,7 @@ void EnTanron5_Update(Actor* thisx, PlayState* play2) { sp90.y = info->bumper.hitPos.y; sp90.z = info->bumper.hitPos.z; - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_SHIELD_REFLECT_SW); + Actor_PlaySfx(&this->actor, NA_SE_IT_SHIELD_REFLECT_SW); CollisionCheck_SpawnShieldParticlesMetal(play, &sp90); } } 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 e08739547e..8b24fc38b5 100644 --- a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c +++ b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c @@ -501,7 +501,7 @@ void func_80C11590(EnThiefbird* this, PlayState* play) { } else { this->unk_192 -= Rand_S16Offset(4096, 4096); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_THIEFBIRD_VOICE); + Actor_PlaySfx(&this->actor, NA_SE_EN_THIEFBIRD_VOICE); } if ((this->actor.depthInWater > -40.0f) || (this->actor.bgCheckFlags & 1)) { @@ -547,7 +547,7 @@ void func_80C1193C(EnThiefbird* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 1.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_FLUTTER); + Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_FLUTTER); } if (this->unk_18E != 0) { @@ -577,7 +577,7 @@ void func_80C1193C(EnThiefbird* this, PlayState* play) { (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); + Actor_PlaySfx(&this->actor, NA_SE_EN_THIEFBIRD_VOICE); if (!(this->collider.base.atFlags & AT_BOUNCED)) { if ((D_80C1392C != 0) && CUR_UPG_VALUE(UPG_QUIVER) && ((STOLEN_ITEM_1 == STOLEN_ITEM_NONE) || (STOLEN_ITEM_2 == STOLEN_ITEM_NONE)) && @@ -606,7 +606,7 @@ void func_80C11C60(EnThiefbird* this) { this->actor.shape.rot.x = 0; this->unk_18E = 40; this->actor.velocity.y = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_THIEFBIRD_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_THIEFBIRD_DEAD); Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40); this->collider.base.acFlags &= ~AC_ON; this->actor.flags |= ACTOR_FLAG_10; @@ -683,13 +683,13 @@ void func_80C11F6C(EnThiefbird* this, PlayState* play) { if (this->actor.colChkInfo.damageEffect == 5) { Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); } else if (this->actor.colChkInfo.damageEffect == 1) { Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); } else { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_THIEFBIRD_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_THIEFBIRD_DAMAGE); } this->collider.base.acFlags &= ~AC_ON; @@ -1043,7 +1043,7 @@ void EnThiefbird_Update(Actor* thisx, PlayState* play2) { func_80C12D00(this); if (((this->skelAnime.animation == &gTakkuriFlyAnim) && Animation_OnFrame(&this->skelAnime, 13.0f)) || ((this->skelAnime.animation == &gTakkuriFlyWithItemAnim) && Animation_OnFrame(&this->skelAnime, 1.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_FLUTTER); + Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_FLUTTER); } } 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 4e09f01a9a..0683008647 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 @@ -266,7 +266,7 @@ void func_80ACA724(EnTimeTag* this, PlayState* play) { play->nextEntrance = play->setupExitList[ENTIMETAG_GET_1F(&this->actor)]; play->transitionTrigger = TRANS_TRIGGER_START; if (!ENTIMETAG_GET_E000(&this->actor)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_OC_DOOR_OPEN); + Actor_PlaySfx(&this->actor, NA_SE_OC_DOOR_OPEN); } this->actionFunc = func_80ACA714; } 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 2fe8752c29..6d25e639ea 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -259,7 +259,7 @@ void func_80893BCC(EnTite* this, PlayState* play) { } } } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } } @@ -323,10 +323,10 @@ void func_80894024(EnTite* this, PlayState* play) { void func_8089408C(EnTite* this, PlayState* play) { Animation_PlayOnce(&this->skelAnime, &object_tite_Anim_0004F8); if (!func_80893ADC(this)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_JUMP); } else { this->actor.world.pos.y += this->actor.depthInWater; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_JUMP_WATER); } if (this->actor.shape.yOffset < 0.0f) { @@ -377,7 +377,7 @@ void func_808942B4(EnTite* this, PlayState* play) { func_8089452C(this, play); } else { this->actor.velocity.y = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); func_80894414(this); } } @@ -418,7 +418,7 @@ void func_8089452C(EnTite* this, PlayState* play) { sp2C.y += this->actor.depthInWater; this->actor.velocity.y *= 0.75f; EffectSsGRipple_Spawn(play, &sp2C, 0, 500, 0); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_LAND_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_LAND_WATER); this->actionFunc = func_808945B4; } @@ -454,9 +454,9 @@ void func_80894638(EnTite* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 7.0f)) { if (func_80893ADC(this)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_WALK_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_WALK_WATER); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_WALK); } } @@ -483,9 +483,9 @@ void func_8089484C(EnTite* this) { this->actor.speedXZ = 4.0f; if (func_80893ADC(this)) { this->actor.world.pos.y += this->actor.depthInWater; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_JUMP_WATER); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_JUMP); } this->actionFunc = func_80894910; } @@ -496,7 +496,7 @@ void func_80894910(EnTite* this, PlayState* play) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 1.0f, 0.0f); SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & 0x40) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_LAND_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_LAND_WATER); if (func_80893ADC(this)) { Math_Vec3f_Copy(&sp34, &this->actor.world.pos); @@ -557,7 +557,7 @@ void func_80894BC8(EnTite* this, PlayState* play) { } if (this->actor.bgCheckFlags & 0x40) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); } else { func_80893BCC(this, play); } @@ -599,7 +599,7 @@ void func_80894E0C(EnTite* this, PlayState* play) { } if (this->actor.bgCheckFlags & 0x40) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); } else { func_80893BCC(this, play); } @@ -680,7 +680,7 @@ void func_808951B8(EnTite* this, PlayState* play) { void func_808952EC(EnTite* this) { Animation_PlayLoopSetSpeed(&this->skelAnime, &object_tite_Anim_000A14, 1.5f); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_GROW_HEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_LAST1_GROW_HEAD); this->collider.base.acFlags &= ~AC_ON; func_80893A18(this); this->unk_2B9 = 1; @@ -708,7 +708,7 @@ void func_80895424(EnTite* this, PlayState* play) { this->collider.base.acFlags |= AC_ON; if (this->actor.bgCheckFlags & 2) { Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 20.0f, 11, 4.0f, 0, 0, 0); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } if (this->unk_2BC == 0) { @@ -724,7 +724,7 @@ void func_80895424(EnTite* this, PlayState* play) { void func_808955E4(EnTite* this) { this->unk_2B9 = 0; this->actor.velocity.y = 13.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_GROW_HEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_LAST1_GROW_HEAD); this->actor.bgCheckFlags &= ~1; this->collider.base.acFlags &= ~AC_ON; this->actionFunc = func_80895640; @@ -828,7 +828,7 @@ void func_80895AC0(EnTite* this, PlayState* play) { if (Rand_ZeroOne() < 0.25f) { func_8089595C(this, play); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_WALK); } if ((this->unk_2BC == 1) || (this->unk_2BC == -1)) { @@ -874,7 +874,7 @@ void func_80895D08(EnTite* this, PlayState* play) { if (Rand_ZeroOne() < 0.5f) { func_8089595C(this, play); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_WALK); } if ((this->actor.xzDistToPlayer < 240.0f) && (Player_GetMask(play) != PLAYER_MASK_STONE)) { func_8089408C(this, play); @@ -957,7 +957,7 @@ void func_80895FF8(EnTite* this, PlayState* play) { if (this->actor.colChkInfo.damageEffect == 5) { this->unk_2BC = 40; Actor_SetColorFilter(&this->actor, 0, 200, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_LARGE; this->drawDmgEffScale = 0.5f; this->drawDmgEffAlpha = 2.0f; @@ -968,7 +968,7 @@ void func_80895FF8(EnTite* this, PlayState* play) { if (this->actor.colChkInfo.damageEffect == 1) { this->unk_2BC = 40; Actor_SetColorFilter(&this->actor, 0, 200, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); func_80894DD0(this); return; } @@ -1001,7 +1001,7 @@ void func_80895FF8(EnTite* this, PlayState* play) { if (this->actor.colChkInfo.health == 0) { func_80895020(this, play); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_DAMAGE); if (this->unk_2B9 == 0) { func_80894B2C(this); 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 dcc2403b8f..d73045928a 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -958,7 +958,7 @@ void func_80AEE4D0(EnTk* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 33.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DIG_UP); + Actor_PlaySfx(&this->actor, NA_SE_EV_DIG_UP); } if (!(this->unk_2CA & 0x20)) { @@ -1264,7 +1264,7 @@ void func_80AEF2D8(Actor* thisx, PlayState* play) { if ((this->actor.draw != NULL) && ((this->unk_2D4 == 0) || (this->unk_2D4 == 1)) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 24.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_WALK); } this->actionFunc(this, play); @@ -1286,7 +1286,7 @@ void EnTk_Update(Actor* thisx, PlayState* play) { if (((this->unk_2D4 == 0) || (this->unk_2D4 == 1)) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 24.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_WALK); } this->unk_2CA &= ~1; @@ -1324,7 +1324,7 @@ void EnTk_Update(Actor* thisx, PlayState* play) { if (!(this->actor.bgCheckFlags & 1)) { func_800B9010(&this->actor, NA_SE_EV_HONEYCOMB_FALL - SFX_FLAG); } else if (this->actor.bgCheckFlags & 2) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HUMAN_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EV_HUMAN_BOUND); } } } 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 caceb62bd9..30ec220eb3 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.c +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.c @@ -880,7 +880,7 @@ void EnTrt_BeginInteraction(EnTrt* this, PlayState* play) { this->blinkFunc = EnTrt_OpenEyesThenSetToBlink; this->timer = 10; this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOTAKE_SURPRISED2); + Actor_PlaySfx(&this->actor, NA_SE_EN_KOTAKE_SURPRISED2); } } else { this->blinkFunc = EnTrt_OpenEyesThenSetToBlink; @@ -934,7 +934,7 @@ void EnTrt_Surprised(EnTrt* this, PlayState* play) { EnTrt_ChangeAnim(&this->skelAnime, sAnimationInfo, TRT_ANIM_SURPRISED); this->animIndex = TRT_ANIM_SURPRISED; this->blinkFunc = EnTrt_OpenEyes2; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOTAKE_SURPRISED); + Actor_PlaySfx(&this->actor, NA_SE_EN_KOTAKE_SURPRISED); this->timer = 30; this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING; } 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 4018a5021c..bad027d349 100644 --- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c +++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c @@ -229,7 +229,7 @@ void func_80AD36EC(EnTrt2* this, PlayState* play) { Actor_MoveWithGravity(&this->actor); func_800B9010(&this->actor, NA_SE_EN_KOTAKE_FLY - SFX_FLAG); if ((this->actor.shape.rot.y >= 0x2800) && (this->actor.shape.rot.y < 0x3800)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOTAKE_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EN_KOTAKE_ROLL); } } @@ -514,7 +514,7 @@ void func_80AD434C(EnTrt2* this, PlayState* play) { Actor_MoveWithGravity(&this->actor); if ((this->actor.shape.rot.y >= 0x2800) && (this->actor.shape.rot.y < 0x3800)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOTAKE_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EN_KOTAKE_ROLL); } } 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 733ea0c576..f9654349e2 100644 --- a/src/overlays/actors/ovl_En_Tru/z_en_tru.c +++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.c @@ -915,9 +915,9 @@ s32 func_80A87880(Actor* thisx, PlayState* play) { this->unk_34E &= ~0x400; Player_UpdateBottleHeld(play, player, ITEM_BOTTLE, PLAYER_IA_BOTTLE); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOUME_DRINK); + Actor_PlaySfx(&this->actor, NA_SE_EN_KOUME_DRINK); } else if (Animation_OnFrame(&this->skelAnime, 90.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOUME_REGAIN); + Actor_PlaySfx(&this->actor, NA_SE_EN_KOUME_REGAIN); } if ((this->skelAnime.curFrame > 90.0f) && (this->skelAnime.curFrame < 95.0f)) { @@ -961,7 +961,7 @@ s32 func_80A87B48(Actor* thisx, PlayState* play) { this->unk_372 = 10; this->unk_364++; } else if (Animation_OnFrame(&this->skelAnime, 22.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOUME_MAGIC); + Actor_PlaySfx(&this->actor, NA_SE_EN_KOUME_MAGIC); func_80A85AA4(this->unk_394, &this->unk_1F8, 1.0f, 0.1f, 40.0f); } break; @@ -1017,8 +1017,8 @@ s32 func_80A87DC0(Actor* thisx, PlayState* play) { case 2: AudioSfx_StopById(NA_SE_EN_KOUME_MAGIC); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOUME_AWAY); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOUME_LAUGH); + Actor_PlaySfx(&this->actor, NA_SE_EN_KOUME_AWAY); + Actor_PlaySfx(&this->actor, NA_SE_EN_KOUME_LAUGH); EnTru_ChangeAnim(this, KOUME_ANIM_TAKE_OFF); this->skelAnime.baseTransl.y = 0; this->skelAnime.moveFlags = 2; 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 e5ff4350f2..504fffffaf 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 @@ -180,10 +180,10 @@ s32 func_80B761FC(EnTruMt* this, PlayState* play) { this->collider.base.acFlags &= ~AC_HIT; if (this->unk_3A4 == 0) { this->unk_3A4 = 1; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOUME_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_KOUME_DAMAGE); } else { this->unk_3A4 = 0; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOUME_DAMAGE2); + Actor_PlaySfx(&this->actor, NA_SE_EN_KOUME_DAMAGE2); } play->interfaceCtx.minigameHiddenPoints = 1; Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 25); 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 4f7b8b720a..c14e478d62 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 @@ -246,7 +246,7 @@ void EnTuboTrap_Idle(EnTuboTrap* this, PlayState* play) { this->targetHeight += transformationHeight; } this->originPos = this->actor.world.pos; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_POT_MOVE_START); + Actor_PlaySfx(&this->actor, NA_SE_EV_POT_MOVE_START); this->actionFunc = EnTuboTrap_Levitate; } } @@ -273,7 +273,7 @@ void EnTuboTrap_FlyAtPlayer(EnTuboTrap* this, PlayState* play) { // But in MM, certain sfxIds got reordered and devs forgot to update: // In MM, NA_SE_EN_MIZUBABA2_ATTACK is the old value 0x3837 // In MM, NA_SE_EN_TUBOOCK_FLY is the new value 0x3AE0 - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIZUBABA2_ATTACK - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_MIZUBABA2_ATTACK - SFX_FLAG); if ((SQ(dX) + SQ(dY) + SQ(dZ) > SQ(240.0f))) { Math_ApproachF(&this->actor.gravity, -3.0f, 0.2f, 0.5f); 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 50109f8879..e5479a1d7d 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -265,7 +265,7 @@ void func_808CC610(EnVm* this, PlayState* play) { } void func_808CC788(EnVm* this) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BIMOS_AIM); + Actor_PlaySfx(&this->actor, NA_SE_EN_BIMOS_AIM); Animation_Change(&this->skelAnime, &object_vm_Anim_000068, 3.0f, 3.0f, 7.0f, ANIMMODE_ONCE, 0.0f); this->unk_214 = 305; this->unk_220 = 0.06f; @@ -328,7 +328,7 @@ void func_808CCA10(EnVm* this) { this->unk_210 = 0; this->unk_224 = 0.0f; this->unk_220 = 0.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->actionFunc = func_808CCAA4; } @@ -440,7 +440,7 @@ void EnVm_Update(Actor* thisx, PlayState* play) { if ((play->gameplayFrames % 2) != 0) { func_800BBFB0(play, &this->unk_234, 6.0f, 1, 120, 20, 1); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BIMOS_LAZER_GND - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_BIMOS_LAZER_GND - SFX_FLAG); } if (this->unk_224 > 0.0f) { 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 74bd4fec6b..910c03cc44 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -253,7 +253,7 @@ void EnWallmas_WaitToDrop(EnWallmas* this, PlayState* play) { } if (this->timer == 80) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_AIM); + Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_AIM); } if (this->timer == 0) { @@ -298,7 +298,7 @@ void EnWallmas_SetupLand(EnWallmas* this, PlayState* play) { ANIMMODE_ONCE, -3.0f); Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 15.0f, 6, 20.0f, 300, 100, true); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_LAND); + Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_LAND); this->actionFunc = EnWallmas_Land; } @@ -337,7 +337,7 @@ void EnWallmas_Walk(EnWallmas* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 24.0f) || Animation_OnFrame(&this->skelAnime, 36.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_WALK); } } @@ -372,7 +372,7 @@ void EnWallmas_ReturnToCeiling(EnWallmas* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 20.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_UP); } if (this->actor.playerHeightRel < -900.0f) { @@ -413,7 +413,7 @@ void EnWallmas_Damage(EnWallmas* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 13.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f); @@ -466,8 +466,8 @@ void EnWallmas_TakePlayer(EnWallmas* this, PlayState* play) { Player* player = GET_PLAYER(play); if (Animation_OnFrame(&this->skelAnime, 1.0f)) { - func_800B8E58(player, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_DAMAGE_S); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_CATCH); + Player_PlaySfx(player, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_DAMAGE_S); + Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_CATCH); } if (SkelAnime_Update(&this->skelAnime)) { @@ -482,11 +482,11 @@ void EnWallmas_TakePlayer(EnWallmas* this, PlayState* play) { player->actor.world.pos.y = this->actor.world.pos.y - sYOffsetPerForm[GET_PLAYER_FORM]; if (this->timer == -30) { - func_800B8E58(player, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_TAKEN_AWAY); + Player_PlaySfx(player, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_TAKEN_AWAY); } if (this->timer == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_UP); + Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_UP); } this->timer += 2; @@ -564,10 +564,10 @@ void EnWallmas_UpdateDamage(EnWallmas* this, PlayState* play) { (!(this->collider.info.acHitInfo->toucher.dmgFlags & 0xDB0B3))) { if (Actor_ApplyDamage(&this->actor) == 0) { Enemy_StartFinishingBlow(play, &this->actor); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIOCTA_REVERSE); + Actor_PlaySfx(&this->actor, NA_SE_EN_DAIOCTA_REVERSE); this->actor.flags &= ~ACTOR_FLAG_1; } else if (this->actor.colChkInfo.damage != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_FALL_DAMAGE); } EnWallmas_ThawIfFrozen(this, play); @@ -584,12 +584,12 @@ void EnWallmas_UpdateDamage(EnWallmas* this, PlayState* play) { } else if (this->actor.colChkInfo.damageEffect == WALLMASTER_DMGEFF_STUN) { this->timer = 40; Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); EnWallmas_SetupStun(this); } else if (this->actor.colChkInfo.damageEffect == WALLMASTER_DMGEFF_ZORA_MAGIC) { this->timer = 40; Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->drawDmgEffScale = 0.55f; this->drawDmgEffAlpha = 2.0f; this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_MEDIUM; 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 ef1ae15bc1..6ffda6bf06 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 @@ -156,7 +156,7 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) { } else { ActorCutscene_StartAndSetUnkLinkFields(play->playerActorCsIds[4], &this->dyna.actor); - func_800B8E58(player, NA_SE_PL_WARP_PLATE); + Player_PlaySfx(player, NA_SE_PL_WARP_PLATE); Play_EnableMotionBlur(0); } 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 9831040010..f1400d69ba 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 @@ -482,7 +482,7 @@ void func_80A59C04(Actor* thisx, PlayState* play2) { player->flameTimers[j] = Rand_S16Offset(0, 200); } player->isBurning = true; - func_800B8E58(player, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_DEMO_DAMAGE); + Player_PlaySfx(player, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_DEMO_DAMAGE); } } 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 b3841a887c..021212ebaa 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -501,7 +501,7 @@ void func_80990C6C(EnWf* this, PlayState* play, s32 arg2) { void func_80990E4C(EnWf* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 1.0f) && (this->actor.bgCheckFlags & 1)) { func_80990C6C(this, play, 2); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_WALK); } } @@ -517,7 +517,7 @@ s32 func_80990EAC(EnWf* this) { void func_80990ED4(EnWf* this) { this->actor.child = NULL; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_APPEAR); func_80991438(this); } @@ -561,7 +561,7 @@ void func_80991040(EnWf* this, PlayState* play) { Math_StepToF(&this->actor.shape.shadowScale, 70.0f, 14.0f); this->unk_2A0--; if (this->unk_2A0 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_APPEAR); } } else if (SkelAnime_Update(&this->skelAnime)) { this->actor.scale.y = this->actor.scale.x; @@ -633,7 +633,7 @@ void func_80991280(EnWf* this, PlayState* play) { } if (this->unk_2A2 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_CRY); } } } @@ -694,7 +694,7 @@ void func_8099149C(EnWf* this, PlayState* play) { } if (this->unk_2A2 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_CRY); } func_80990E4C(this, play); @@ -748,7 +748,7 @@ void func_8099177C(EnWf* this, PlayState* play) { } } if (this->unk_2A2 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_CRY); } } } @@ -787,7 +787,7 @@ void func_809919F4(EnWf* this, PlayState* play) { func_80990E4C(this, play); if (this->unk_2A2 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_CRY); } if ((Math_CosS(sp26 - this->actor.shape.rot.y) < -0.85f) && !Actor_OtherIsTargeted(play, &this->actor) && @@ -831,7 +831,7 @@ void func_80991C80(EnWf* this, PlayState* play) { if (((this->skelAnime.curFrame >= 9.0f) && (this->skelAnime.curFrame < 13.0f)) || ((this->skelAnime.curFrame >= 17.0f) && (this->skelAnime.curFrame < 20.0f))) { if (!(this->collider1.base.atFlags & AT_ON)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_ATTACK); } this->collider1.base.atFlags |= AT_ON; } else { @@ -928,7 +928,7 @@ void func_8099223C(EnWf* this) { this->actor.speedXZ = -6.0f; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_JUMP); this->actionFunc = func_809922B4; } @@ -944,7 +944,7 @@ void func_809922B4(EnWf* this, PlayState* play) { } } if (this->unk_2A2 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_CRY); } } @@ -979,7 +979,7 @@ void func_8099245C(EnWf* this) { } this->unk_298 = 0; this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_DAMAGE); this->actionFunc = func_809924EC; } @@ -1026,7 +1026,7 @@ void func_809926D0(EnWf* this) { this->unk_2A0 = 0; this->actor.speedXZ = 6.5f; this->actor.velocity.y = 15.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP); + Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_JUMP); this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = func_80992784; } @@ -1146,7 +1146,7 @@ void func_80992B8C(EnWf* this, PlayState* play) { func_80990E4C(this, play); if (this->unk_2A2 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_CRY); } } } @@ -1160,7 +1160,7 @@ void func_80992D6C(EnWf* this) { } this->actor.flags &= ~ACTOR_FLAG_1; this->unk_2A0 = 25; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_DEAD); this->actionFunc = func_80992E0C; } @@ -1272,13 +1272,13 @@ void func_80993194(EnWf* this, PlayState* play) { } if (this->unk_2A2 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_CRY); } } void func_80993350(EnWf* this) { Animation_MorphToLoop(&this->skelAnime, &gWolfosRunAnim, -4.0f); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_APPEAR); this->actionFunc = func_809933A0; } @@ -1312,7 +1312,7 @@ void func_809933A0(EnWf* this, PlayState* play) { func_80990ED4(this); } if (this->unk_2A2 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_CRY); } } @@ -1365,7 +1365,7 @@ void func_8099357C(EnWf* this, PlayState* play) { } if (this->unk_2A2 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_CRY); } } @@ -1423,7 +1423,7 @@ void func_8099386C(EnWf* this, PlayState* play) { if (this->actor.colChkInfo.damageEffect == 1) { this->unk_2A0 = 40; Actor_SetColorFilter(&this->actor, 0, 0x78, 0, 40); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); func_809923B0(this); } else if (this->actor.colChkInfo.damageEffect == 5) { this->unk_2A0 = 40; @@ -1431,7 +1431,7 @@ void func_8099386C(EnWf* this, PlayState* play) { this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_SMALL; this->drawDmgEffScale = 0.75f; this->drawDmgEffAlpha = 2.0f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); func_809923B0(this); } else if (this->actor.colChkInfo.damageEffect == 3) { func_809907D4(this); 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 353fe01ab0..e769bcf905 100644 --- a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c +++ b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c @@ -456,9 +456,9 @@ void EnWiz_HandleIntroCutscene(EnWiz* this, PlayState* play) { this->targetPlatformLightAlpha = 255; Math_Vec3f_Copy(&this->platformLightPos, &this->actor.world.pos); if (this->fightState == EN_WIZ_FIGHT_STATE_FIRST_PHASE) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_UNARI); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_UNARI); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_VOICE - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_VOICE - SFX_FLAG); } this->introCutsceneTimer = 40; @@ -504,7 +504,7 @@ void EnWiz_HandleIntroCutscene(EnWiz* this, PlayState* play) { break; case EN_WIZ_INTRO_CS_RUN_IN_CIRCLES: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_RUN - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_RUN - SFX_FLAG); if (this->introCutsceneTimer == 0) { this->animLoopCounter = this->introCutsceneCameraAngle = 0; this->introCutsceneState = EN_WIZ_INTRO_CS_DISAPPEAR; @@ -663,7 +663,7 @@ void EnWiz_MoveGhosts(EnWiz* this) { } if (playSfx) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_RUN - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_RUN - SFX_FLAG); } } @@ -702,9 +702,9 @@ void EnWiz_SetupAppear(EnWiz* this, PlayState* play) { Math_Vec3f_Copy(&this->platformLightPos, &this->actor.world.pos); if (this->fightState == EN_WIZ_FIGHT_STATE_FIRST_PHASE) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_UNARI); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_UNARI); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_VOICE - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_VOICE - SFX_FLAG); } } @@ -744,7 +744,7 @@ void EnWiz_Appear(EnWiz* this, PlayState* play) { this->shouldStartTimer = true; } } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_VOICE - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_VOICE - SFX_FLAG); } if (this->timer == 0) { @@ -803,7 +803,7 @@ void EnWiz_Dance(EnWiz* this, PlayState* play) { Math_SmoothStepToS(&this->alpha, 255, 1, 5, 0); Math_ApproachF(&this->scale, 0.015f, 0.05f, 0.001f); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_RUN - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_RUN - SFX_FLAG); this->actor.world.rot.y += this->rotationalVelocity; if (this->fightState >= EN_WIZ_FIGHT_STATE_SECOND_PHASE_GHOSTS_RUN_AROUND) { EnWiz_MoveGhosts(this); @@ -856,7 +856,7 @@ void EnWiz_SecondPhaseCutscene(EnWiz* this, PlayState* play) { Math_SmoothStepToS(&this->alpha, 255, 1, 5, 0); subCam = Play_GetCamera(play, this->subCamId); Math_Vec3f_Copy(&subCam->at, &this->actor.focus.pos); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_RUN - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_RUN - SFX_FLAG); if (this->platforms[this->nextPlatformIndex] != NULL) { f32 diffX = this->actor.world.pos.x - this->platforms[this->nextPlatformIndex]->world.pos.x; f32 diffZ = this->actor.world.pos.z - this->platforms[this->nextPlatformIndex]->world.pos.z; @@ -976,8 +976,8 @@ void EnWiz_Attack(EnWiz* this, PlayState* play) { Math_Vec3f_Pitch(&pos, &player->actor.world.pos), Math_Vec3f_Yaw(&pos, &player->actor.world.pos), 0, type * 4); this->hasActiveProjectile = true; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_ATTACK); - Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_MAGIC_FIRE); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_ATTACK); + Actor_PlaySfx(&this->actor, NA_SE_PL_MAGIC_FIRE); } if ((curFrame >= 8.0f) && !this->shouldStartTimer) { @@ -1004,7 +1004,7 @@ void EnWiz_SetupDisappear(EnWiz* this) { this->targetPlatformLightAlpha = 0; this->actor.flags |= ACTOR_FLAG_8000000; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_DISAPPEAR); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_DISAPPEAR); Math_SmoothStepToS(&this->rotationalVelocity, 0x1388, 0x64, 0x3E8, 0x3E8); this->actor.world.rot.y += this->rotationalVelocity; this->actor.flags &= ~ACTOR_FLAG_1; @@ -1060,11 +1060,11 @@ void EnWiz_SetupDamaged(EnWiz* this, PlayState* play) { if ((this->fightState != EN_WIZ_FIGHT_STATE_FIRST_PHASE) && (this->actor.colChkInfo.health <= 0)) { Enemy_StartFinishingBlow(play, &this->actor); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_DEAD); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_DEAD); this->timer = 0; this->actor.flags &= ~ACTOR_FLAG_1; } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_DAMAGE); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_DAMAGE); } this->scale = 0.015f; 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 4ed3333fdb..daa71ac7b5 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 @@ -260,13 +260,13 @@ void EnWiz_MoveMagicProjectile(EnWizFire* this, PlayState* play) { arcingProjectileRotY += BINANG_ADD((s32)randPlusMinusPoint5Scaled(0x1000), 0x3333); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); + Actor_PlaySfx(&this->actor, NA_SE_IT_BOMB_EXPLOSION); this->poolTimer = Rand_S16Offset(70, 30); if (this->poolTimer != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_EXP - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_EXP - SFX_FLAG); } } else if (this->poolTimer != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); } Math_Vec3f_Copy(&this->actor.velocity, &gZeroVec3f); @@ -291,7 +291,7 @@ void EnWiz_MoveMagicProjectile(EnWizFire* this, PlayState* play) { } if (Player_HasMirrorShieldEquipped(play) && (this->collider.base.atFlags & AT_BOUNCED)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_SHIELD_REFLECT_MG); + Actor_PlaySfx(&this->actor, NA_SE_IT_SHIELD_REFLECT_MG); this->collider.base.atFlags &= ~(AT_TYPE_ENEMY | AT_BOUNCED | AT_HIT); this->collider.base.atFlags |= AT_TYPE_PLAYER; this->collider.info.toucher.dmgFlags = 0x20; @@ -351,7 +351,7 @@ void EnWiz_SmallFlame(EnWizFire* this, PlayState* play) { } if (this->timer != 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BURN_OUT - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_BURN_OUT - SFX_FLAG); } } @@ -392,7 +392,7 @@ void EnWiz_Pool(EnWizFire* this, PlayState* play) { this->collider.dim.height = 30; this->collider.dim.yShift = 15; EnWizFire_InitializeEffect(this, &pos, &accel); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); return; } @@ -426,7 +426,7 @@ void EnWiz_Pool(EnWizFire* this, PlayState* play) { if (this->isIceType == true) { Math_ApproachZeroF(&this->poolScale, 0.046f, 0.001f); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); + Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); if (!this->shouldPoolFadeOut) { if ((this->actor.parent != NULL) && (this->actor.parent->id == ACTOR_EN_WIZ) && (this->poolScale < 0.05f)) { @@ -625,7 +625,7 @@ void EnWizFire_Update(Actor* thisx, PlayState* play2) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; if (this->type == EN_WIZ_FIRE_TYPE_MAGIC_PROJECTILE) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_LAUGH2); + Actor_PlaySfx(&this->actor, NA_SE_EN_WIZ_LAUGH2); if (player->invincibilityTimer > 0) { player->invincibilityTimer += 40; if (this->isIceType) { 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 ba63b30212..5b207816ba 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -385,7 +385,7 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { if ((thisx->params < WOOD_BUSH_GREEN_SMALL) || (thisx->params == WOOD_TREE_SPECIAL)) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - Actor_PlaySfxAtPos(thisx, NA_SE_IT_REFLECTION_WOOD); + Actor_PlaySfx(thisx, NA_SE_IT_REFLECTION_WOOD); } if (thisx->home.rot.y != 0) { @@ -404,7 +404,7 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { (thisx->params == WOOD_TREE_OVAL_YELLOW_SPAWNED)) { leavesParams = WOOD_LEAF_YELLOW; } - Actor_PlaySfxAtPos(thisx, NA_SE_EV_TREE_SWING); + Actor_PlaySfx(thisx, NA_SE_EV_TREE_SWING); for (i = 3; i >= 0; i--) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WOOD02, dropsSpawnPt.x, dropsSpawnPt.y, dropsSpawnPt.z, @@ -439,7 +439,7 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { (player->rideActor->speedXZ != 0.0f)))) { func_808C4458(this, play, &thisx->world.pos, 1); this->unk_146 = -0x15; - Actor_PlaySfxAtPos(thisx, NA_SE_EV_TREE_SWING); + Actor_PlaySfx(thisx, NA_SE_EV_TREE_SWING); } } else { // Leaves this->unk_146++; 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 2310a2eef3..f0c0d22387 100644 --- a/src/overlays/actors/ovl_En_Yb/z_en_yb.c +++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.c @@ -377,7 +377,7 @@ void EnYb_Idle(EnYb* this, PlayState* play) { } 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); + Actor_PlaySfx(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); } EnYb_EnableProximityMusic(this); 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 a16b828f9e..06591b3cd3 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -142,12 +142,12 @@ s32 EnZo_PlayWalkingSound(EnZo* this, PlayState* play) { this->isLeftFootGrounded = isFootGrounded = SubS_IsFloorAbove(play, &this->leftFootPos, -6.0f); if ((this->isLeftFootGrounded) && (!leftWasGrounded) && (isFootGrounded)) { - Actor_PlaySfxAtPos(&this->actor, sfxId); + Actor_PlaySfx(&this->actor, sfxId); } this->isRightFootGrounded = isFootGrounded = SubS_IsFloorAbove(play, &this->rightFootPos, -6.0f); if ((this->isRightFootGrounded) && (!rightWasGrounded) && (isFootGrounded)) { - Actor_PlaySfxAtPos(&this->actor, sfxId); + Actor_PlaySfx(&this->actor, sfxId); } return 0; 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 a165d91feb..d2de680676 100644 --- a/src/overlays/actors/ovl_En_Zog/z_en_zog.c +++ b/src/overlays/actors/ovl_En_Zog/z_en_zog.c @@ -465,7 +465,7 @@ s32 func_80B93EA0(EnZog* this, PlayState* play) { switch (this->unk_306) { case 2: if (play->csCtx.frames == 60) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_JUMP_SAND); + Actor_PlaySfx(&this->actor, NA_SE_EV_JUMP_SAND); } break; @@ -606,7 +606,7 @@ void func_80B943EC(EnZog* this, PlayState* play) { } } 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); + Actor_PlaySfx(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); } } @@ -781,15 +781,15 @@ void func_80B94A00(EnZog* this, PlayState* play) { if ((this->unk_304 == 4) && (Animation_OnFrame(&this->skelAnime, 136.0f) || Animation_OnFrame(&this->skelAnime, 155.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_WALK_WATER0); + Actor_PlaySfx(&this->actor, NA_SE_PL_WALK_WATER0); } if ((this->unk_304 == 5) && (Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 37.0f))) { if (this->actor.depthInWater > 0.0f) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_WALK_WATER0); + Actor_PlaySfx(&this->actor, NA_SE_PL_WALK_WATER0); } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_WALK_SAND); + Actor_PlaySfx(&this->actor, NA_SE_PL_WALK_SAND); } } } @@ -876,7 +876,7 @@ void func_80B94E34(EnZog* this, PlayState* play) { if ((player->actor.speedXZ > 3.0f) && (this->unk_324 == 0)) { this->unk_324 = 25; - func_800B8E58(player, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_PUSH); + Player_PlaySfx(player, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_PUSH); } } this->actor.speedXZ *= 0.3f; @@ -966,7 +966,7 @@ void EnZog_Update(Actor* thisx, PlayState* play) { if (((this->unk_304 == 6) && Animation_OnFrame(&this->skelAnime, 43.0f)) || ((this->unk_304 == 17) && Animation_OnFrame(&this->skelAnime, 14.0f))) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_LAND_SAND); + Actor_PlaySfx(&this->actor, NA_SE_EV_LAND_SAND); } if (this->unk_30A & 1) { 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 2f6f0e7917..6dd9103707 100644 --- a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c +++ b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c @@ -318,7 +318,7 @@ void func_80B31E00(EnZoraegg* this) { } if ((this->unk_1E8 == 111) || (this->unk_1E8 == 32)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ZORA_KIDS_BORN); + Actor_PlaySfx(&this->actor, NA_SE_EV_ZORA_KIDS_BORN); } } @@ -437,7 +437,7 @@ void func_80B324B0(EnZoraegg* this, PlayState* play) { Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->actorActionCmd)); if ((this->unk_1EA & 4) && Animation_OnFrame(&this->skelAnime, this->unk_1E4)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_1); + Actor_PlaySfx(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_1); this->unk_1E4 = Rand_ZeroFloat(5.0f); } } else if (this->unk_1EA & 4) { @@ -478,13 +478,13 @@ void func_80B326F4(EnZoraegg* this, PlayState* play) { SET_WEEKEVENTREG(WEEKEVENTREG_19_40); this->unk_1EC = 2; this->unk_1EE = 100; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_2); + Actor_PlaySfx(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_2); } Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->actorActionCmd)); if (Animation_OnFrame(&this->skelAnime, 4.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_1); + Actor_PlaySfx(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_1); } } @@ -507,7 +507,7 @@ void func_80B32820(EnZoraegg* this, PlayState* play) { Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->actorActionCmd)); if (Animation_OnFrame(&this->skelAnime, 16.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_0); + Actor_PlaySfx(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_0); } } @@ -542,7 +542,7 @@ void func_80B32928(EnZoraegg* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 97.0f) || Animation_OnFrame(&this->skelAnime, 101.0f) || Animation_OnFrame(&this->skelAnime, 105.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_1); + Actor_PlaySfx(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_1); } } @@ -627,7 +627,7 @@ void func_80B32D08(EnZoraegg* this, PlayState* play) { EffectSsGRipple_Spawn(play, &sp34, 150, 500, 0); EffectSsGSplash_Spawn(play, &sp34, NULL, NULL, 0, 200); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DIVE_INTO_WATER_L); + Actor_PlaySfx(&this->actor, NA_SE_EV_DIVE_INTO_WATER_L); this->actionFunc = func_80B32C34; this->actor.velocity.y = -1.0f; 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 331a153df4..288424f7e4 100644 --- a/src/overlays/actors/ovl_En_Zot/z_en_zot.c +++ b/src/overlays/actors/ovl_En_Zot/z_en_zot.c @@ -744,7 +744,7 @@ void func_80B97D6C(EnZot* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 5.0f)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ZORA_WALK); + Actor_PlaySfx(&this->actor, NA_SE_EV_ZORA_WALK); } } 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 7e37091623..c4ef1aaffc 100644 --- a/src/overlays/actors/ovl_En_Zow/z_en_zow.c +++ b/src/overlays/actors/ovl_En_Zow/z_en_zow.c @@ -405,7 +405,7 @@ void func_80BDD1E0(EnZow* this, PlayState* play) { void func_80BDD350(EnZow* this, PlayState* play) { if (this->unk_2CA & 2) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DIVE_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_DIVE_WATER); func_80BDCDA8(this, this->unk_2D0); this->actor.flags &= ~ACTOR_FLAG_1; this->skelAnime.playSpeed = 0.0f; @@ -511,7 +511,7 @@ void func_80BDD6BC(EnZow* this, PlayState* play) { } if (this->actor.depthInWater < 54.0f) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OUT_OF_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_OUT_OF_WATER); func_80BDCDA8(this, this->unk_2D0); func_80BDD04C(this, 1, ANIMMODE_ONCE); this->actor.flags |= ACTOR_FLAG_1; 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 acea3daf10..b5a335d920 100644 --- a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c +++ b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c @@ -179,7 +179,7 @@ void func_80ACBC8C(ObjAqua* this, PlayState* play) { if (this->actor.bgCheckFlags & 1) { func_80ACB7F4(this, play); func_80ACBA10(this); - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOTTLE_WATERING); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOTTLE_WATERING); func_80ACBD34(this); } else { func_80ACB6A0(this, play); 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 565c995046..5f46b6596f 100644 --- a/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c +++ b/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c @@ -277,14 +277,14 @@ void func_809A562C(ObjArmos* this, PlayState* play) { if ((temp == OBJARMOS_ROT_7_4) || (temp == OBJARMOS_ROT_7_5) || (temp == OBJARMOS_ROT_7_6)) { if (!func_809A500C(this, this->unk_264) || func_809A4E00(this, play, 0x5A)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } } else if (func_809A500C(this, this->unk_264)) { if (func_809A4E00(this, play, 0x5A)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } } else { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); Flags_SetSwitch(play, OBJARMOS_GET_7F(&this->dyna.actor)); sp20 = true; } 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 35f37d5d8a..349521b26e 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -847,7 +847,7 @@ void func_80938AD8(ObjBean* this, PlayState* play) { func_80937160(this); if (this->unk_1B2 == 25) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_PL_PLANT_GROW_BIG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_PL_PLANT_GROW_BIG); } if (sp30 != 0) { 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 f8534afea7..fb7f1466c8 100644 --- a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c +++ b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c @@ -188,11 +188,11 @@ s32 func_80A357A8(ObjBell* this, PlayState* play) { this->unk_20E = 10; switch (this->dyna.actor.colChkInfo.damageEffect) { case 15: - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BIGBELL); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BIGBELL); func_80A35510(this, 1); break; case 14: - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BIGBELL); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BIGBELL); func_80A35510(this, 2); break; default: 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 b033447080..6e0e7b6acb 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -406,7 +406,7 @@ void func_8098DC60(ObjComb* this, PlayState* play) { } else { if (this->unk_1B8 >= 0) { if (this->unk_1B8 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALGOLD_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALGOLD_ROLL); if (Rand_ZeroOne() < 0.1f) { this->unk_1B8 = Rand_S16Offset(40, 80); } else { 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 fce6d99ece..4a0c5194fd 100644 --- a/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.c +++ b/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.c @@ -436,7 +436,7 @@ void func_80B13940(ObjDhouse* this, PlayState* play2) { if (Flags_GetSwitch(play, OBJDHOUSE_GET_7F(&this->dyna.actor))) { sp20 = true; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_EXPLSION_LONG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_EXPLSION_LONG); } if (sp20) { 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 509f285fe7..bdff9b3bc0 100644 --- a/src/overlays/actors/ovl_Obj_Dora/z_obj_dora.c +++ b/src/overlays/actors/ovl_Obj_Dora/z_obj_dora.c @@ -274,10 +274,10 @@ void ObjDora_UpdateCollision(ObjDora* this, PlayState* play) { case DORA_DMGEFF_STRONG: case DORA_DMGEFF_LIGHT: if (this->actor.colChkInfo.damageEffect == DORA_DMGEFF_LIGHT) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DORA_S); + Actor_PlaySfx(&this->actor, NA_SE_EV_DORA_S); this->lastGongHitType = DORA_HIT_LIGHT; } else { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DORA_L); + Actor_PlaySfx(&this->actor, NA_SE_EV_DORA_L); this->lastGongHitType = DORA_HIT_STRONG; } @@ -285,7 +285,7 @@ void ObjDora_UpdateCollision(ObjDora* this, PlayState* play) { ObjDora_SetupMoveGong(this); if ((ObjDora_IsHalfHour(time) == true) && (this->rupeeDropTimer == 0)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); + Actor_PlaySfx(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); itemDrop = Item_DropCollectible(play, &this->actor.world.pos, ITEM00_RUPEE_BLUE); itemDrop->world.rot.y = this->actor.world.rot.y; itemDrop->world.rot.y += (s32)(Rand_Centered() * 90.0f * (0x10000 / 360.0f)); 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 49e8ac9342..973c40b972 100644 --- a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c +++ b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c @@ -454,7 +454,7 @@ void func_80A1C838(ObjFlowerpot* this, PlayState* play) { //! @bug: This function should only pass Player*: it uses *(this + 0x153), which is meant to be //! player->currentMask, but in this case is garbage in the collider - func_800B8E58((Player*)this, NA_SE_PL_PULL_UP_POT); + Player_PlaySfx((Player*)&this->actor, NA_SE_PL_PULL_UP_POT); } else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 19.0f)) { if (!(this->unk_1EA & 2)) { func_80A1B914(this, play); @@ -539,7 +539,7 @@ void func_80A1CC0C(ObjFlowerpot* this, PlayState* play) { this->actor.room = play->roomCtx.curRoom.num; if (fabsf(this->actor.speedXZ) < 0.1f) { func_80A1C818(this); - func_800B8E58(GET_PLAYER(play), NA_SE_PL_PUT_DOWN_POT); + Player_PlaySfx(GET_PLAYER(play), NA_SE_PL_PUT_DOWN_POT); this->collider.base.ocFlags1 &= ~OC1_TYPE_PLAYER; } else { Actor_MoveWithGravity(&this->actor); 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 9c38849c9a..9d390b2ab0 100644 --- a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c +++ b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c @@ -209,7 +209,7 @@ void func_80B145F4(ObjHakaisi* this) { this->unk_19A = 0; this->dyna.actor.flags |= ACTOR_FLAG_8000000; this->dyna.actor.flags &= ~ACTOR_FLAG_1; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); this->actionFunc = func_80B14648; } @@ -281,7 +281,7 @@ void func_80B14B6C(ObjHakaisi* this, PlayState* play, Vec3f vec, s16 arg3) { s16 temp_s1; Vec3f sp6C; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); for (i = 0; i < 5; i++) { temp_s1 = Rand_Next(); 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 e3972be180..fa39be7df2 100644 --- a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c +++ b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c @@ -134,7 +134,7 @@ void ObjHgdoor_HandleCsAction(ObjHgdoor* this, PlayState* play) { this->csAction = play->csCtx.actorActions[actionIndex]->action; switch (play->csCtx.actorActions[actionIndex]->action) { case 1: - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WOOD_DOOR_OPEN_SPEEDY); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WOOD_DOOR_OPEN_SPEEDY); if ((this->dyna.actor.parent != NULL) && (this->dyna.actor.parent->id == ACTOR_EN_HG)) { this->dyna.actor.parent->colChkInfo.health = 1; } 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 13f49fd1f8..dc95eec27d 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 @@ -274,7 +274,7 @@ void func_80931E58(ObjIcePoly* this, PlayState* play) { } this->unk_14A = 40; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_MELT); + Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_MELT); this->actionFunc = func_80931EEC; } else { ActorCutscene_SetIntentToPlay(this->actor.cutscene); 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 8c88c35eee..1e7b8c7679 100644 --- a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c +++ b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c @@ -1096,13 +1096,13 @@ void func_80A25BBC(ObjIceblock* this, PlayState* play) { func_80A23690(this); if (func_80A23F90(this, play)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } if (func_80A24954(this, play)) { func_80A2491C(this); if (this->unk_2B0 == 3) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_DIVE_INTO_WATER_L); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_DIVE_INTO_WATER_L); } } } @@ -1175,7 +1175,7 @@ void func_80A25E50(ObjIceblock* this, PlayState* play) { func_80A25BA0(this); } else if (sp38) { if (func_80A24118(this, play, 59.9f, &sp28)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } func_80A2541C(this, play); func_80A25CF4(this); @@ -1262,7 +1262,7 @@ void func_80A26144(ObjIceblock* this, PlayState* play) { func_80A23B88(this); func_80A25BA0(this); } else if (sp28) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); func_80A23B88(this); func_80A25FA0(this); } else { 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 3942fff76e..f3860b960e 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 @@ -403,7 +403,7 @@ void ObjKendoKanban_HandlePhysics(ObjKendoKanban* this, PlayState* play) { if (this->actor.bgCheckFlags & 2) { // Upon touching the ground... - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WOODPLATE_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EV_WOODPLATE_BOUND); this->hasNewRootCornerPos = false; this->actor.velocity.y *= 0.5f; } else if (this->actor.bgCheckFlags & 1) { @@ -412,7 +412,7 @@ void ObjKendoKanban_HandlePhysics(ObjKendoKanban* this, PlayState* play) { this->hasNewRootCornerPos = false; this->actor.velocity.x *= 0.3f; this->actor.velocity.z *= 0.3f; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WOODPLATE_BOUND); + Actor_PlaySfx(&this->actor, NA_SE_EV_WOODPLATE_BOUND); // Adjust and (potentially) reverse rotation depending on the current // facing of the board and the direction in which it is rotating. 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 36927b2629..e0c642131a 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -278,7 +278,7 @@ void ObjKibako_Idle(ObjKibako* this, PlayState* play) { //! @bug: This function should only pass Player*: it uses *(this + 0x153), which is meant to be //! player->currentMask, but in this case is garbage in the collider - func_800B8E58((Player*)this, NA_SE_PL_PULL_UP_WOODBOX); + Player_PlaySfx((Player*)&this->actor, NA_SE_PL_PULL_UP_WOODBOX); } else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 19.0f)) { ObjKibako_WaterBreak(this, play); ObjKibako_SpawnCollectible(this, play); @@ -343,7 +343,7 @@ void ObjKibako_Held(ObjKibako* this, PlayState* play) { if (fabsf(this->actor.speedXZ) < 0.1f) { ObjKibako_SetupIdle(this); this->collider.base.ocFlags1 &= ~OC1_TYPE_PLAYER; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PUT_DOWN_WOODBOX); + Actor_PlaySfx(&this->actor, NA_SE_EV_PUT_DOWN_WOODBOX); } else { Actor_MoveWithGravity(&this->actor); ObjKibako_SetupThrown(this); 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 06af2a8e31..2f092a4f9f 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -233,7 +233,7 @@ void ObjKibako2_Update(Actor* thisx, PlayState* play) { if (this->skulltulaNoiseTimer >= 0) { if (this->skulltulaNoiseTimer == 0) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_STALGOLD_ROLL); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EN_STALGOLD_ROLL); if (Rand_ZeroOne() < 0.1f) { this->skulltulaNoiseTimer = Rand_S16Offset(40, 80); } else { 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 f2946d5362..4518e4e29f 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -231,7 +231,7 @@ void ObjLightSwitch_SetupAsleep(ObjLightswitch* this) { void ObjLightSwitch_Asleep(ObjLightswitch* this, PlayState* play) { if (this->colorShiftTimer == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SUN_MARK_FLASH); + Actor_PlaySfx(&this->actor, NA_SE_EV_SUN_MARK_FLASH); } this->colorShiftTimer++; @@ -244,7 +244,7 @@ void ObjLightSwitch_Asleep(ObjLightswitch* this, PlayState* play) { ObjLightSwitch_SetupEnabled(this); } else if (this->colorShiftTimer == 15) { this->faceState = LIGHTSWITCH_FACE_WAKING; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FOOT_SWITCH); + Actor_PlaySfx(&this->actor, NA_SE_EV_FOOT_SWITCH); } } @@ -302,7 +302,7 @@ void ObjLightSwitch_Disabled(ObjLightswitch* this, PlayState* play) { ObjLightswitch_SetupIdle(this); } else if (this->colorShiftTimer == 15) { this->faceState = LIGHTSWITCH_FACE_ASLEEP; - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FOOT_SWITCH); + Actor_PlaySfx(&this->actor, NA_SE_EV_FOOT_SWITCH); } } 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 c46821ac15..5fea12dd0e 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -113,7 +113,7 @@ void ObjMakekinsuta_Update(Actor* thisx, PlayState* play) { } else { if (this->unk144 >= 0) { if (this->unk144 == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALGOLD_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALGOLD_ROLL); if (Rand_ZeroOne() < 0.1f) { this->unk144 = Rand_S16Offset(0x28, 0x50); } else { 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 933ea06d26..a0d1b85a66 100644 --- a/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c +++ b/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c @@ -199,7 +199,7 @@ void func_80BA27C4(ObjNozoki* this, PlayState* play) { void func_80BA28DC(ObjNozoki* this, PlayState* play) { if (this->unk_15E != 0) { if (DECR(this->unk_15E) == 0) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN); } return; } @@ -239,7 +239,7 @@ void func_80BA28DC(ObjNozoki* this, PlayState* play) { ObjNozoki_SetupAction(this, func_80BA2AB4); this->dyna.actor.velocity.y = 0.0f; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE); } void func_80BA2AB4(ObjNozoki* this, PlayState* play) { @@ -393,10 +393,10 @@ void func_80BA311C(ObjNozoki* this, PlayState* play) { } else if (this->unk_15D == 1) { if (D_80BA36B8 > 40.0f) { this->unk_15D = 2; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_PL_SIT_ON_HORSE); + Actor_PlaySfx(&this->dyna.actor, NA_SE_PL_SIT_ON_HORSE); } else if (this->unk_15E != 0) { if (DECR(this->unk_15E) == 0) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_CONVEYOR_SHUTTER_OPEN); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_CONVEYOR_SHUTTER_OPEN); } } else { Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 50.0f, 4.0f); 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 1d7762c445..582d43f023 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -503,7 +503,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, PlayState* play) { player = GET_PLAYER(play); if (ObjOshihiki_CheckWall(play, this->dyna.yRotation, this->dyna.pushForce, this)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x; @@ -521,7 +521,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, PlayState* play) { } } - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); } void ObjOshihiki_SetupFall(ObjOshihiki* this, PlayState* play) { @@ -553,10 +553,10 @@ void ObjOshihiki_Fall(ObjOshihiki* this, PlayState* play) { } else { ObjOshihiki_SetupOnActor(this, play); } - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); - Actor_PlaySfxAtPos(&this->dyna.actor, SurfaceType_GetSfx(&play->colCtx, this->floorPolys[this->highestFloor], - this->floorBgIds[this->highestFloor]) + - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfx(&this->dyna.actor, SurfaceType_GetSfx(&play->colCtx, this->floorPolys[this->highestFloor], + this->floorBgIds[this->highestFloor]) + + SFX_FLAG); } } 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 3aca23bcad..e2b17e48f8 100644 --- a/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c +++ b/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c @@ -287,14 +287,14 @@ void func_809A3BC0(ObjPzlblock* this, PlayState* play) { if ((params == 4) || (params == 5) || (params == 6)) { if (!func_809A35EC(this, this->unk_16C) || func_809A33E0(this, play, 0x5A)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } } else if (func_809A35EC(this, this->unk_16C)) { if (func_809A33E0(this, play, 0x5A)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } } else { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); Flags_SetSwitch(play, OBJPZLBLOCK_GET_7F(&this->dyna.actor)); sp20 = 1; } 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 6a469eea02..374a2f520e 100644 --- a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c +++ b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c @@ -563,7 +563,7 @@ void func_80A224A4(ObjSkateblock* this, PlayState* play) { *this->unk_16C += this->unk_164; if (func_80A21934(this, play)) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); func_80A21D1C(this); sp28 = true; } else { 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 068be3ea07..d38adaa7e4 100644 --- a/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c +++ b/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c @@ -440,7 +440,7 @@ void func_80B03FF8(ObjSnowball* this, PlayState* play) { sp18->unk_04(this, play); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SNOWBALL_BROKEN); + Actor_PlaySfx(&this->actor, NA_SE_EV_SNOWBALL_BROKEN); if (rotY == 5) { Flags_SetSwitch(play, OBJSNOWBALL_GET_3F(&this->actor)); @@ -571,7 +571,7 @@ void func_80B04350(ObjSnowball* this, PlayState* play) { } else { this->unk_209 = 10; } - Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_REFLECTION_SNOW); + Actor_PlaySfx(&this->actor, NA_SE_IT_REFLECTION_SNOW); } } 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 d62002e731..de220e7a8d 100644 --- a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c +++ b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c @@ -356,7 +356,7 @@ void func_80B39C9C(ObjSnowball2* this, PlayState* play) { func_80B38E88(this, play); } func_80B38EFC(this, play); - func_800B8E58(GET_PLAYER(play), NA_SE_PL_PULL_UP_SNOWBALL); + Player_PlaySfx(GET_PLAYER(play), NA_SE_PL_PULL_UP_SNOWBALL); func_80B39F60(this); } else if ((this->actor.bgCheckFlags & 0x20) && ((this->actor.shape.yOffset * this->actor.scale.y) < this->actor.depthInWater)) { @@ -476,7 +476,7 @@ void func_80B3A13C(ObjSnowball2* this, PlayState* play) { func_80B395EC(&this->actor, play); } if (this->actor.bgCheckFlags & 0x40) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMB_DROP_WATER); + Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_DROP_WATER); } } else if ((((play->gameplayFrames % 16) == 0) || ((Rand_Next() >> 0x10) == 0)) && (this->actor.depthInWater < (1200.0f * this->actor.scale.y))) { 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 4708062da4..13e127c73e 100644 --- a/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c +++ b/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c @@ -762,7 +762,7 @@ void func_80B30AF8(ObjSpidertent* this, PlayState* play) { if (this->unk_3C7 > 0) { this->unk_3C7--; } else if (this->unk_3C1 > 50) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_EXTINCT); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EN_EXTINCT); this->unk_3C7 = Rand_S16Offset(2, 2); } else { SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 11, NA_SE_EN_EXTINCT); 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 83959e1680..b4f3c3d98b 100644 --- a/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c +++ b/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c @@ -149,7 +149,7 @@ void func_80A1DA50(PlayState* play, ObjSpinyroll* this, Vec3f* arg2, Vec3f* arg3 Math_Vec3f_Sum(arg2, arg3, &sp1C); Math_Vec3f_Scale(&sp1C, 0.5f); EffectSsHitmark_SpawnFixedScale(play, 3, &sp1C); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_IT_SHIELD_REFLECT_SW); + Actor_PlaySfx(&this->dyna.actor, NA_SE_IT_SHIELD_REFLECT_SW); } void func_80A1DAAC(Vec3f* arg0, Vec3f* arg1, s16 arg2) { 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 ada5eadd31..76f5bc8727 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -273,13 +273,13 @@ void ObjSwitch_StopCutscene(ObjSwitch* this) { void ObjSwitch_PlayFootSwitchSfx(ObjSwitch* this) { if (this->sfxTimer <= 0) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); } } void ObjSwitch_PlayDiamondSwitchSfx(ObjSwitch* this) { if (this->sfxTimer <= 0) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_DIAMOND_SWITCH); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_DIAMOND_SWITCH); } } 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 791564b579..6b1058e105 100644 --- a/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c +++ b/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c @@ -316,7 +316,7 @@ void ObjTaru_Update(Actor* thisx, PlayState* play) { if (this->unk_1AD >= 0) { switch (this->unk_1AD) { case 0: - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_STALGOLD_ROLL); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EN_STALGOLD_ROLL); if (Rand_ZeroOne() < 0.1f) { this->unk_1AD = Rand_S16Offset(40, 80); } else { 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 306ca70292..d9e899a134 100644 --- a/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c +++ b/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c @@ -254,7 +254,7 @@ void func_809A48AC(ObjToge* this, PlayState* play) { } else { func_809A4744(this); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SPINE_TRAP_MOVE); + Actor_PlaySfx(&this->actor, NA_SE_EV_SPINE_TRAP_MOVE); } else { s16 yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_198[sp30]) - this->actor.world.rot.y; @@ -267,7 +267,7 @@ void func_809A48AC(ObjToge* this, PlayState* play) { } else { func_809A4744(this); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SPINE_TRAP_MOVE); + Actor_PlaySfx(&this->actor, NA_SE_EV_SPINE_TRAP_MOVE); } } } 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 694a5ac592..4f02a46b25 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 @@ -156,7 +156,7 @@ s32 ObjTokeiStep_OpenProcess(ObjTokeiStep* this, PlayState* play) { if (hasPrevBounced && (panel->numBounces < 3) && (panel->startFallingTimer <= 0)) { finalPosY = sPanelXOffsets[i] + this->dyna.actor.world.pos.y; if (!panel->hasSoundPlayed) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_CLOCK_TOWER_STAIR_MOVE); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_CLOCK_TOWER_STAIR_MOVE); panel->hasSoundPlayed = true; } panel->posChangeY += -2.5f; 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 7d2ed19995..ac238061eb 100644 --- a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c +++ b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c @@ -285,7 +285,7 @@ void ObjTokeidai_RotateOnMinuteChange(ObjTokeidai* this, s32 playSfx) { if (currentClockMinute != this->clockMinute) { if (this->minuteRingOrExteriorGearRotationTimer == 8 && playSfx) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_SECOND_HAND); + Actor_PlaySfx(&this->actor, NA_SE_EV_CLOCK_TOWER_SECOND_HAND); } if (this->minuteRingOrExteriorGearRotationTimer > 8) { @@ -505,15 +505,15 @@ void ObjTokeidai_TowerOpening_DropCounterweight(ObjTokeidai* this, PlayState* pl this->xRotation = 0x4000; switch (this->boundCount) { case 0: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_0); + Actor_PlaySfx(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_0); break; case 1: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_1); + Actor_PlaySfx(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_1); break; case 2: - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_2); + Actor_PlaySfx(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_2); break; } this->boundCount++; @@ -553,7 +553,7 @@ void ObjTokeidai_TowerOpening_FinishRaise(ObjTokeidai* this, PlayState* play) { type = OBJ_TOKEIDAI_TYPE(&this->actor); if ((type == OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_CLOCK_TOWN) || (type == OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_TERMINA_FIELD)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_FALL); + Actor_PlaySfx(&this->actor, NA_SE_EV_CLOCK_TOWER_FALL); } this->yTranslation = 3400; this->actionFunc = ObjTokeidai_TowerOpening_DropCounterweight; @@ -577,7 +577,7 @@ void ObjTokeidai_TowerOpening_RaiseTower(ObjTokeidai* this, PlayState* play) { type = OBJ_TOKEIDAI_TYPE(&this->actor); if ((type == OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_CLOCK_TOWN) || (type == OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_TERMINA_FIELD)) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_STOP); + Actor_PlaySfx(&this->actor, NA_SE_EV_CLOCK_TOWER_STOP); } this->yTranslation = 3400; this->actionFunc = ObjTokeidai_TowerOpening_FinishRaise; 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 4dcfd4f748..6009affe46 100644 --- a/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c +++ b/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c @@ -141,7 +141,7 @@ void ObjTree_SetupSway(ObjTree* this) { this->timer = 0; this->swayAmplitude = 546.0f; this->swayVelocity = 35 * 0x10000 / 360; - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_TREE_SWING); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_TREE_SWING); this->actionFunc = ObjTree_Sway; } 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 33b4932373..115e7d8b27 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -467,7 +467,7 @@ void func_809289E4(ObjTsubo* this, PlayState* play) { func_80927818(this, play, 0); //! @bug: This function should only pass Player*: it uses *(this + 0x153), which is meant to be //! player->currentMask, but in this case is garbage in the collider - func_800B8E58((Player*)&this->actor, NA_SE_PL_PULL_UP_POT); + Player_PlaySfx((Player*)&this->actor, NA_SE_PL_PULL_UP_POT); func_80928D6C(this); } else if ((this->unk_19B != 0) || (acHit && (this->cylinderCollider.info.acHitInfo->toucher.dmgFlags & 0x058BFFBC))) { @@ -673,7 +673,7 @@ void ObjTsubo_Update(Actor* thisx, PlayState* play) { } if (this->unk_19A >= 0) { if (this->unk_19A == 0) { - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALGOLD_ROLL); + Actor_PlaySfx(&this->actor, NA_SE_EN_STALGOLD_ROLL); if (Rand_ZeroOne() < 0.1f) { this->unk_19A = Rand_S16Offset(40, 80); } else { 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 c9ac4899c5..3538a5fabf 100644 --- a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c +++ b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c @@ -1704,7 +1704,7 @@ void ObjUm_ChangeAnim(ObjUm* this, PlayState* play, ObjUmAnimation animIndex) { this->unk_420 = this->wheelRot / 0x199A; //! FAKE if (!&sUmAnims[0]) {} - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_CART_WHEEL); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_CART_WHEEL); } } 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 24e816644a..d527e4937b 100644 --- a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c +++ b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c @@ -139,7 +139,7 @@ void func_80C07F30(ObjUsiyane* this, PlayState* play) { } } - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_HOUSE_BROKEN); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_HOUSE_BROKEN); this->unk_740 = 0; this->unk_744 |= 4; } 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 b7a1e59be5..514a68c5fa 100644 --- a/src/overlays/actors/ovl_Obj_Vspinyroll/z_obj_vspinyroll.c +++ b/src/overlays/actors/ovl_Obj_Vspinyroll/z_obj_vspinyroll.c @@ -208,7 +208,7 @@ s32 func_80A3C8D8(ObjVspinyroll* this, PlayState* play, Vec3f* arg2, s32 arg3) { spB4.z += this->dyna.actor.world.pos.z; EffectSsHitmark_SpawnFixedScale(play, 3, &spB4); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_IT_SHIELD_REFLECT_SW); + Actor_PlaySfx(&this->dyna.actor, NA_SE_IT_SHIELD_REFLECT_SW); } temp_f0 = Math3D_Vec3fDistSq(&spD8, &spC0); 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 3fa3260fdd..a26dd24e39 100644 --- a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c +++ b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c @@ -100,7 +100,7 @@ s32 ObjWarpstone_BeginOpeningCutscene(ObjWarpstone* this, PlayState* play) { if (this->dyna.actor.cutscene < 0 || ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); ObjWarpstone_SetupAction(this, ObjWarpstone_PlayOpeningCutscene); - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_OWL_WARP_SWITCH_ON); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_OWL_WARP_SWITCH_ON); } else { ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); } 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 067618491d..4558a6a75a 100644 --- a/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c +++ b/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c @@ -97,7 +97,7 @@ void func_808A7C04(ObjWturn* this, PlayState* play) { this->actor.world.pos.y += this->actor.playerHeightRel; player->actor.shape.shadowAlpha = 0; func_800B7298(play, &this->actor, PLAYER_CSMODE_84); - func_800B8E58(player, NA_SE_VO_NAVY_ENEMY); + Player_PlaySfx(player, NA_SE_VO_NAVY_ENEMY); this->unk_14A = 0; Play_DisableMotionBlur(); this->actionFunc = func_808A7C78; 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 9d35288c59..1196cb0be0 100644 --- a/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c +++ b/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c @@ -73,7 +73,7 @@ void ObjY2shutter_SetupOpen(ObjY2shutter* this, ShutterInfo* info, ShutterType s this->openTimer = info->openTimer; this->settleTimer = info->openStartSettleTimer; if (shutterType == SHUTTER_BARRED) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_METALDOOR_OPEN); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_METALDOOR_OPEN); } } @@ -134,7 +134,7 @@ void ObjY2shutter_Update(Actor* thisx, PlayState* play) { this->openTimer = 0; this->settleTimer = info->openStartSettleTimer; if (shutterType == SHUTTER_BARRED) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_METALDOOR_CLOSE); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_METALDOOR_CLOSE); } } else { targetPosY = this->dyna.actor.home.pos.y; @@ -153,7 +153,7 @@ void ObjY2shutter_Update(Actor* thisx, PlayState* play) { this->isStationary = true; this->settleTimer = info->openEndAndCloseSettleTimer; if (shutterType != SHUTTER_BARRED) { - Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); } } } else { diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index a2358f653f..81eaf24484 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -800,8 +800,8 @@ 0x800B8D98:("func_800B8D98",), 0x800B8DD4:("func_800B8DD4",), 0x800B8E1C:("func_800B8E1C",), - 0x800B8E58:("func_800B8E58",), - 0x800B8EC8:("Actor_PlaySfxAtPos",), + 0x800B8E58:("Player_PlaySfx",), + 0x800B8EC8:("Actor_PlaySfx",), 0x800B8EF4:("func_800B8EF4",), 0x800B8F98:("func_800B8F98",), 0x800B8FC0:("func_800B8FC0",), diff --git a/tools/namefixer.py b/tools/namefixer.py index 012e6b436c..17c33fc5c1 100755 --- a/tools/namefixer.py +++ b/tools/namefixer.py @@ -301,7 +301,9 @@ wordReplace = { "Actor_ChangeAnimation": "Actor_ChangeAnimationByInfo", "func_80152498": "Message_GetState", "func_800B8898": "Actor_GetScreenPos", - "Audio_PlayActorSound2": "Actor_PlaySfxAtPos", + "Audio_PlayActorSound2": "Actor_PlaySfx", + "Actor_PlaySfxAtPos": "Actor_PlaySfx", + "func_800B8E58": "Player_PlaySfx", "func_800BF7CC": "Actor_SpawnIceEffects", "Actor_IsFacingPlayerAndWithinRange": "Actor_IsFacingAndNearPlayer", "func_800BC8B8": "Actor_DrawDoorLock", diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index ee686ff7d6..4cafa01156 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -314,8 +314,8 @@ asm/non_matchings/code/z_actor/func_800B8D50.s,func_800B8D50,0x800B8D50,0x12 asm/non_matchings/code/z_actor/func_800B8D98.s,func_800B8D98,0x800B8D98,0xF asm/non_matchings/code/z_actor/func_800B8DD4.s,func_800B8DD4,0x800B8DD4,0x12 asm/non_matchings/code/z_actor/func_800B8E1C.s,func_800B8E1C,0x800B8E1C,0xF -asm/non_matchings/code/z_actor/func_800B8E58.s,func_800B8E58,0x800B8E58,0x1C -asm/non_matchings/code/z_actor/Actor_PlaySfxAtPos.s,Actor_PlaySfxAtPos,0x800B8EC8,0xB +asm/non_matchings/code/z_actor/Player_PlaySfx.s,Player_PlaySfx,0x800B8E58,0x1C +asm/non_matchings/code/z_actor/Actor_PlaySfx.s,Actor_PlaySfx,0x800B8EC8,0xB asm/non_matchings/code/z_actor/func_800B8EF4.s,func_800B8EF4,0x800B8EF4,0x29 asm/non_matchings/code/z_actor/func_800B8F98.s,func_800B8F98,0x800B8F98,0xA asm/non_matchings/code/z_actor/func_800B8FC0.s,func_800B8FC0,0x800B8FC0,0xA From e8f3039264ab94af9264f6bcedfab74fe72360cf Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Fri, 3 Mar 2023 09:07:51 -0500 Subject: [PATCH 19/29] speedXZ -> speed (#1186) * speedXZ to speed * brackets --- docs/tutorial/advanced_control_flow.md | 2 +- include/z64actor.h | 2 +- src/code/z_actor.c | 28 +- src/code/z_en_hy_code.c | 8 +- src/code/z_en_item00.c | 16 +- src/code/z_player_lib.c | 2 +- src/code/z_sub_s.c | 2 +- .../actors/ovl_Arms_Hook/z_arms_hook.c | 2 +- .../actors/ovl_Bg_F40_Block/z_bg_f40_block.c | 28 +- .../ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c | 4 +- .../actors/ovl_Bg_Spdweb/z_bg_spdweb.c | 2 +- src/overlays/actors/ovl_Boss_02/z_boss_02.c | 14 +- src/overlays/actors/ovl_Boss_03/z_boss_03.c | 50 +-- src/overlays/actors/ovl_Boss_04/z_boss_04.c | 10 +- .../actors/ovl_Demo_Syoten/z_demo_syoten.c | 2 +- .../actors/ovl_Dm_Char09/z_dm_char09.c | 8 +- src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c | 4 +- .../ovl_En_Akindonuts/z_en_akindonuts.c | 8 +- src/overlays/actors/ovl_En_Am/z_en_am.c | 22 +- src/overlays/actors/ovl_En_Arrow/z_en_arrow.c | 24 +- .../ovl_En_Attack_Niw/z_en_attack_niw.c | 4 +- src/overlays/actors/ovl_En_Az/z_en_az.c | 28 +- src/overlays/actors/ovl_En_Baba/z_en_baba.c | 6 +- src/overlays/actors/ovl_En_Baguo/z_en_baguo.c | 10 +- src/overlays/actors/ovl_En_Bat/z_en_bat.c | 14 +- src/overlays/actors/ovl_En_Bb/z_en_bb.c | 22 +- .../actors/ovl_En_Bbfall/z_en_bbfall.c | 22 +- src/overlays/actors/ovl_En_Bee/z_en_bee.c | 6 +- src/overlays/actors/ovl_En_Bh/z_en_bh.c | 2 +- .../actors/ovl_En_Bigpamet/z_en_bigpamet.c | 20 +- src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c | 16 +- .../actors/ovl_En_Bigslime/z_en_bigslime.c | 38 +- src/overlays/actors/ovl_En_Bom/z_en_bom.c | 24 +- .../actors/ovl_En_Bom_Chu/z_en_bom_chu.c | 16 +- .../actors/ovl_En_Bombers2/z_en_bombers2.c | 2 +- src/overlays/actors/ovl_En_Bombf/z_en_bombf.c | 10 +- .../actors/ovl_En_Bomjimb/z_en_bomjimb.c | 18 +- src/overlays/actors/ovl_En_Butte/z_en_butte.c | 13 +- .../actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 4 +- .../actors/ovl_En_Col_Man/z_en_col_man.c | 6 +- src/overlays/actors/ovl_En_Crow/z_en_crow.c | 12 +- .../actors/ovl_En_Dekubaba/z_en_dekubaba.c | 6 +- .../actors/ovl_En_Dekunuts/z_en_dekunuts.c | 14 +- src/overlays/actors/ovl_En_Dg/z_en_dg.c | 68 +-- .../actors/ovl_En_Dinofos/z_en_dinofos.c | 84 ++-- src/overlays/actors/ovl_En_Dno/z_en_dno.c | 20 +- .../actors/ovl_En_Dodongo/z_en_dodongo.c | 14 +- .../actors/ovl_En_Dragon/z_en_dragon.c | 16 +- src/overlays/actors/ovl_En_Elf/z_en_elf.c | 12 +- .../actors/ovl_En_Elforg/z_en_elforg.c | 20 +- .../actors/ovl_En_Estone/z_en_estone.c | 6 +- src/overlays/actors/ovl_En_Fall/z_en_fall.c | 4 +- src/overlays/actors/ovl_En_Famos/z_en_famos.c | 36 +- src/overlays/actors/ovl_En_Fg/z_en_fg.c | 4 +- .../actors/ovl_En_Firefly/z_en_firefly.c | 26 +- src/overlays/actors/ovl_En_Fish/z_en_fish.c | 50 +-- src/overlays/actors/ovl_En_Fish2/z_en_fish2.c | 50 +-- .../actors/ovl_En_Fishing/z_en_fishing.c | 76 ++-- .../actors/ovl_En_Floormas/z_en_floormas.c | 66 +-- .../actors/ovl_En_Fu_Mato/z_en_fu_mato.c | 2 +- src/overlays/actors/ovl_En_Fz/z_en_fz.c | 14 +- src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 2 +- src/overlays/actors/ovl_En_Ge2/z_en_ge2.c | 30 +- src/overlays/actors/ovl_En_Geg/z_en_geg.c | 10 +- src/overlays/actors/ovl_En_Gg2/z_en_gg2.c | 8 +- src/overlays/actors/ovl_En_Gk/z_en_gk.c | 2 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 6 +- .../actors/ovl_En_Goroiwa/z_en_goroiwa.c | 30 +- .../ovl_En_Grasshopper/z_en_grasshopper.c | 20 +- .../actors/ovl_En_Hakurock/z_en_hakurock.c | 2 +- src/overlays/actors/ovl_En_Hg/z_en_hg.c | 2 +- .../ovl_En_Hidden_Nuts/z_en_hidden_nuts.c | 4 +- .../actors/ovl_En_Hint_Skb/z_en_hint_skb.c | 38 +- src/overlays/actors/ovl_En_Horse/z_en_horse.c | 411 +++++++++--------- .../z_en_horse_link_child.c | 56 +-- src/overlays/actors/ovl_En_Ik/z_en_ik.c | 32 +- src/overlays/actors/ovl_En_In/z_en_in.c | 4 +- .../actors/ovl_En_Insect/z_en_insect.c | 22 +- .../actors/ovl_En_Invadepoh/z_en_invadepoh.c | 68 +-- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 4 +- src/overlays/actors/ovl_En_Jg/z_en_jg.c | 8 +- src/overlays/actors/ovl_En_Js/z_en_js.c | 4 +- .../actors/ovl_En_Kaizoku/z_en_kaizoku.c | 94 ++-- src/overlays/actors/ovl_En_Kame/z_en_kame.c | 24 +- .../actors/ovl_En_Kanban/z_en_kanban.c | 48 +- .../actors/ovl_En_Karebaba/z_en_karebaba.c | 8 +- src/overlays/actors/ovl_En_Kusa/z_en_kusa.c | 4 +- src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c | 16 +- .../actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c | 8 +- .../actors/ovl_En_Look_Nuts/z_en_look_nuts.c | 12 +- src/overlays/actors/ovl_En_Ma4/z_en_ma4.c | 10 +- .../actors/ovl_En_Minifrog/z_en_minifrog.c | 2 +- .../actors/ovl_En_Minislime/z_en_minislime.c | 32 +- src/overlays/actors/ovl_En_Mkk/z_en_mkk.c | 22 +- src/overlays/actors/ovl_En_Mm/z_en_mm.c | 20 +- src/overlays/actors/ovl_En_Ms/z_en_ms.c | 2 +- .../actors/ovl_En_Mushi2/z_en_mushi2.c | 34 +- .../actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c | 22 +- src/overlays/actors/ovl_En_Niw/z_en_niw.c | 30 +- .../actors/ovl_En_Nutsball/z_en_nutsball.c | 2 +- src/overlays/actors/ovl_En_Nwc/z_en_nwc.c | 18 +- src/overlays/actors/ovl_En_Ot/z_en_ot.c | 16 +- src/overlays/actors/ovl_En_Owl/z_en_owl.c | 32 +- .../actors/ovl_En_Pamera/z_en_pamera.c | 20 +- .../actors/ovl_En_Pametfrog/z_en_pametfrog.c | 42 +- src/overlays/actors/ovl_En_Part/z_en_part.c | 2 +- .../actors/ovl_En_Peehat/z_en_peehat.c | 24 +- src/overlays/actors/ovl_En_Pm/z_en_pm.c | 4 +- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 30 +- src/overlays/actors/ovl_En_Poh/z_en_poh.c | 28 +- src/overlays/actors/ovl_En_Pp/z_en_pp.c | 38 +- src/overlays/actors/ovl_En_Pr/z_en_pr.c | 14 +- src/overlays/actors/ovl_En_Pr2/z_en_pr2.c | 22 +- src/overlays/actors/ovl_En_Prz/z_en_prz.c | 8 +- .../actors/ovl_En_Racedog/z_en_racedog.c | 14 +- .../actors/ovl_En_Rail_Skb/z_en_rail_skb.c | 2 +- .../actors/ovl_En_Railgibud/z_en_railgibud.c | 28 +- src/overlays/actors/ovl_En_Rat/z_en_rat.c | 24 +- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 47 +- src/overlays/actors/ovl_En_Rg/z_en_rg.c | 18 +- src/overlays/actors/ovl_En_Rr/z_en_rr.c | 12 +- .../actors/ovl_En_Ruppecrow/z_en_ruppecrow.c | 16 +- src/overlays/actors/ovl_En_Rz/z_en_rz.c | 8 +- src/overlays/actors/ovl_En_Sb/z_en_sb.c | 24 +- .../actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.c | 2 +- .../actors/ovl_En_Scopecrow/z_en_scopecrow.c | 2 +- .../actors/ovl_En_Scopenuts/z_en_scopenuts.c | 20 +- .../actors/ovl_En_Sellnuts/z_en_sellnuts.c | 8 +- src/overlays/actors/ovl_En_Skb/z_en_skb.c | 46 +- .../actors/ovl_En_Snowman/z_en_snowman.c | 24 +- src/overlays/actors/ovl_En_Sob1/z_en_sob1.c | 8 +- src/overlays/actors/ovl_En_St/z_en_st.c | 2 +- .../ovl_En_Stop_heishi/z_en_stop_heishi.c | 2 +- .../actors/ovl_En_Suttari/z_en_suttari.c | 28 +- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 40 +- .../ovl_En_Syateki_Crow/z_en_syateki_crow.c | 8 +- .../z_en_syateki_dekunuts.c | 2 +- .../ovl_En_Syateki_Wf/z_en_syateki_wf.c | 18 +- .../ovl_En_Talk_Gibud/z_en_talk_gibud.c | 24 +- .../actors/ovl_En_Tanron2/z_en_tanron2.c | 14 +- .../actors/ovl_En_Tanron3/z_en_tanron3.c | 14 +- .../actors/ovl_En_Tanron4/z_en_tanron4.c | 2 +- .../actors/ovl_En_Tanron5/z_en_tanron5.c | 6 +- .../actors/ovl_En_Thiefbird/z_en_thiefbird.c | 28 +- src/overlays/actors/ovl_En_Tite/z_en_tite.c | 44 +- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 22 +- src/overlays/actors/ovl_En_Trt2/z_en_trt2.c | 12 +- src/overlays/actors/ovl_En_Tru/z_en_tru.c | 2 +- .../actors/ovl_En_Tru_Mt/z_en_tru_mt.c | 12 +- .../actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c | 2 +- src/overlays/actors/ovl_En_Vm/z_en_vm.c | 2 +- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 18 +- src/overlays/actors/ovl_En_Wf/z_en_wf.c | 42 +- .../actors/ovl_En_Wood02/z_en_wood02.c | 2 +- src/overlays/actors/ovl_En_Zo/z_en_zo.c | 6 +- src/overlays/actors/ovl_En_Zog/z_en_zog.c | 28 +- src/overlays/actors/ovl_En_Zot/z_en_zot.c | 18 +- src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c | 12 +- src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c | 16 +- src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c | 6 +- .../ovl_Obj_Danpeilift/z_obj_danpeilift.c | 10 +- .../actors/ovl_Obj_Driftice/z_obj_driftice.c | 10 +- .../actors/ovl_Obj_Etcetera/z_obj_etcetera.c | 2 +- .../ovl_Obj_Flowerpot/z_obj_flowerpot.c | 2 +- .../ovl_Obj_Grass_Carry/z_obj_grass_carry.c | 4 +- .../actors/ovl_Obj_Iceblock/z_obj_iceblock.c | 6 +- .../actors/ovl_Obj_Kibako/z_obj_kibako.c | 2 +- .../actors/ovl_Obj_Kibako2/z_obj_kibako2.c | 2 +- .../actors/ovl_Obj_Kinoko/z_obj_kinoko.c | 6 +- .../ovl_Obj_Lupygamelift/z_obj_lupygamelift.c | 8 +- .../ovl_Obj_Makekinsuta/z_obj_makekinsuta.c | 4 +- .../actors/ovl_Obj_Nozoki/z_obj_nozoki.c | 10 +- .../ovl_Obj_Ocarinalift/z_obj_ocarinalift.c | 10 +- .../actors/ovl_Obj_Raillift/z_obj_raillift.c | 12 +- .../ovl_Obj_Snowball2/z_obj_snowball2.c | 18 +- .../ovl_Obj_Spinyroll/z_obj_spinyroll.c | 20 +- .../actors/ovl_Obj_Swprize/z_obj_swprize.c | 4 +- src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c | 2 +- src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c | 8 +- .../actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c | 2 +- .../actors/ovl_Obj_Tsubo/z_obj_tsubo.c | 4 +- src/overlays/actors/ovl_Obj_Um/z_obj_um.c | 14 +- .../ovl_Obj_Vspinyroll/z_obj_vspinyroll.c | 16 +- src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c | 2 +- src/overlays/actors/ovl_TG_Sw/z_tg_sw.c | 4 +- .../ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c | 4 +- tools/namefixer.py | 2 + 187 files changed, 1746 insertions(+), 1747 deletions(-) diff --git a/docs/tutorial/advanced_control_flow.md b/docs/tutorial/advanced_control_flow.md index 96ba7a43d1..48ef9661b1 100644 --- a/docs/tutorial/advanced_control_flow.md +++ b/docs/tutorial/advanced_control_flow.md @@ -67,7 +67,7 @@ void EnMs_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.015f); this->actor.colChkInfo.mass = 0xFF; this->actionFunc = func_80952734; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; this->actor.gravity = -1.0f; } diff --git a/include/z64actor.h b/include/z64actor.h index 7c48cd5cfa..249109a448 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -150,7 +150,7 @@ typedef struct Actor { /* 0x054 */ f32 targetArrowOffset; // Height offset of the target arrow relative to `focus` position /* 0x058 */ Vec3f scale; // Scale of the actor in each axis /* 0x064 */ Vec3f velocity; // Velocity of the actor in each axis - /* 0x070 */ f32 speedXZ; // How fast the actor is traveling along the XZ plane + /* 0x070 */ f32 speed; // Context dependent speed value. Can be used for XZ or XYZ depending on which move function is used /* 0x074 */ f32 gravity; // Acceleration due to gravity. Value is added to Y velocity every frame /* 0x078 */ f32 terminalVelocity; // Sets the lower bounds cap on velocity along the Y axis /* 0x07C */ struct CollisionPoly* wallPoly; // Wall polygon the actor is touching diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 6ba05d4f96..644d933b94 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1125,8 +1125,8 @@ void Actor_UpdatePos(Actor* actor) { * It is recommended to not call this function directly and use `Actor_MoveWithGravity` instead */ void Actor_UpdateVelocityWithGravity(Actor* actor) { - actor->velocity.x = actor->speedXZ * Math_SinS(actor->world.rot.y); - actor->velocity.z = actor->speedXZ * Math_CosS(actor->world.rot.y); + actor->velocity.x = actor->speed * Math_SinS(actor->world.rot.y); + actor->velocity.z = actor->speed * Math_CosS(actor->world.rot.y); actor->velocity.y += actor->gravity; if (actor->velocity.y < actor->terminalVelocity) { @@ -1150,11 +1150,11 @@ void Actor_MoveWithGravity(Actor* actor) { * It is recommended to not call this function directly and use `Actor_MoveWithoutGravity` instead */ void Actor_UpdateVelocityWithoutGravity(Actor* actor) { - f32 horizontalSpeed = Math_CosS(actor->world.rot.x) * actor->speedXZ; + f32 speedXZ = Math_CosS(actor->world.rot.x) * actor->speed; - actor->velocity.x = Math_SinS(actor->world.rot.y) * horizontalSpeed; - actor->velocity.y = Math_SinS(actor->world.rot.x) * actor->speedXZ; - actor->velocity.z = Math_CosS(actor->world.rot.y) * horizontalSpeed; + actor->velocity.x = Math_SinS(actor->world.rot.y) * speedXZ; + actor->velocity.y = Math_SinS(actor->world.rot.x) * actor->speed; + actor->velocity.z = Math_CosS(actor->world.rot.y) * speedXZ; } /** @@ -1174,11 +1174,11 @@ void Actor_MoveWithoutGravity(Actor* actor) { * It is recommended to not call this function directly and use `Actor_MoveWithoutGravityReverse` instead */ void Actor_UpdateVelocityWithoutGravityReverse(Actor* actor) { - f32 horizontalSpeed = Math_CosS(-actor->world.rot.x) * actor->speedXZ; + f32 speedXZ = Math_CosS(-actor->world.rot.x) * actor->speed; - actor->velocity.x = Math_SinS(actor->world.rot.y) * horizontalSpeed; - actor->velocity.y = Math_SinS(-actor->world.rot.x) * actor->speedXZ; - actor->velocity.z = Math_CosS(actor->world.rot.y) * horizontalSpeed; + actor->velocity.x = Math_SinS(actor->world.rot.y) * speedXZ; + actor->velocity.y = Math_SinS(-actor->world.rot.x) * actor->speed; + actor->velocity.z = Math_CosS(actor->world.rot.y) * speedXZ; } /** @@ -1193,7 +1193,7 @@ void Actor_MoveWithoutGravityReverse(Actor* actor) { * Sets horizontal speed and Y velocity using the `speed` argument and current pitch */ void Actor_SetSpeeds(Actor* actor, f32 speed) { - actor->speedXZ = Math_CosS(actor->world.rot.x) * speed; + actor->speed = Math_CosS(actor->world.rot.x) * speed; actor->velocity.y = -Math_SinS(actor->world.rot.x) * speed; } @@ -3607,7 +3607,7 @@ Actor* func_800BC270(PlayState* play, Actor* actor, f32 arg2, s32 arg3) { ((itemAction->id == ACTOR_EN_ARROW) && (func_800BC188(itemAction->params) & arg3))) { f32 speedXZ; - if ((itemAction->speedXZ <= 0.0f) && (GET_PLAYER(play)->unk_D57 != 0)) { + if ((itemAction->speed <= 0.0f) && (GET_PLAYER(play)->unk_D57 != 0)) { if (itemAction->id == ACTOR_ARMS_HOOK) { speedXZ = 20.0f; } else if (itemAction->id == ACTOR_EN_BOOM) { @@ -3624,7 +3624,7 @@ Actor* func_800BC270(PlayState* play, Actor* actor, f32 arg2, s32 arg3) { } } } else { - speedXZ = itemAction->speedXZ; + speedXZ = itemAction->speed; } if (func_800BC1B4(actor, itemAction, arg2, speedXZ)) { @@ -3644,7 +3644,7 @@ Actor* func_800BC444(PlayState* play, Actor* actor, f32 arg2) { while (explosive != NULL) { if (((explosive->id == ACTOR_EN_BOM) || (explosive->id == ACTOR_EN_BOM_CHU) || (explosive->id == ACTOR_EN_BOMBF))) { - if (func_800BC1B4(actor, explosive, arg2, explosive->speedXZ)) { + if (func_800BC1B4(actor, explosive, arg2, explosive->speed)) { break; } } diff --git a/src/code/z_en_hy_code.c b/src/code/z_en_hy_code.c index 85a5e7e84f..1affc8df7c 100644 --- a/src/code/z_en_hy_code.c +++ b/src/code/z_en_hy_code.c @@ -207,8 +207,8 @@ s32 EnHy_MoveForwards(EnHy* enHy, f32 speedTarget) { s32 reachedEnd = false; Vec3f curPointPos; - Math_SmoothStepToF(&enHy->actor.speedXZ, speedTarget, 0.4f, 1000.0f, 0.0f); - rotStep = enHy->actor.speedXZ * 400.0f; + Math_SmoothStepToF(&enHy->actor.speed, speedTarget, 0.4f, 1000.0f, 0.0f); + rotStep = enHy->actor.speed * 400.0f; if (SubS_CopyPointFromPath(enHy->path, enHy->curPoint, &curPointPos) && SubS_MoveActorToPoint(&enHy->actor, &curPointPos, rotStep)) { enHy->curPoint++; @@ -225,8 +225,8 @@ s32 EnHy_MoveBackwards(EnHy* enHy, f32 speedTarget) { s32 reachedEnd = false; Vec3f curPointPos; - Math_SmoothStepToF(&enHy->actor.speedXZ, speedTarget, 0.4f, 1000.0f, 0.0f); - rotStep = enHy->actor.speedXZ * 400.0f; + Math_SmoothStepToF(&enHy->actor.speed, speedTarget, 0.4f, 1000.0f, 0.0f); + rotStep = enHy->actor.speed * 400.0f; if (SubS_CopyPointFromPath(enHy->path, enHy->curPoint, &curPointPos) && SubS_MoveActorToPoint(&enHy->actor, &curPointPos, rotStep)) { enHy->curPoint--; diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index f450db0149..987f8b10eb 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -219,7 +219,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) { this->unk152 = 15; this->unk14C = 35; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; @@ -346,7 +346,7 @@ void func_800A640C(EnItem00* this, PlayState* play) { this->actor.shape.yOffset = (Math_SinS(this->actor.shape.rot.y) * 150.0f) + 850.0f; } - Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f); if (this->unk14C == 0) { if ((this->actor.params != ITEM00_SMALL_KEY) && (this->actor.params != ITEM00_HEART_PIECE) && @@ -406,7 +406,7 @@ void func_800A6780(EnItem00* this, PlayState* play) { if (this->actor.params == ITEM00_RECOVERY_HEART) { if (this->actor.velocity.y < 0.0f) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.gravity = -0.4f; if (this->actor.velocity.y < -1.5f) { this->actor.velocity.y = -1.5f; @@ -447,7 +447,7 @@ void func_800A6780(EnItem00* this, PlayState* play) { if (this->actor.bgCheckFlags & 3) { this->actionFunc = func_800A640C; this->actor.shape.rot.z = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } } @@ -684,7 +684,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { this->unk152 = 15; this->unk14C = 35; this->actor.shape.rot.z = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; @@ -951,7 +951,7 @@ Actor* Item_DropCollectible(PlayState* play, Vec3f* spawnPos, u32 params) { } else { spawnedActor->velocity.y = -2.0f; } - spawnedActor->speedXZ = 2.0f; + spawnedActor->speed = 2.0f; spawnedActor->gravity = -0.9f; spawnedActor->world.rot.y = randPlusMinusPoint5Scaled(0x10000); Actor_SetScale(spawnedActor, 0.0f); @@ -1002,7 +1002,7 @@ Actor* Item_DropCollectible2(PlayState* play, Vec3f* spawnPos, s32 params) { if (spawnedActor != NULL) { if (param8000 == 0) { spawnedActor->velocity.y = 0.0f; - spawnedActor->speedXZ = 0.0f; + spawnedActor->speed = 0.0f; if (param10000 != 0) { spawnedActor->gravity = 0.0f; } else { @@ -1195,7 +1195,7 @@ void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnP spawnPos->y, spawnPos->z, 0, 0, 0, dropId); if ((spawnedActor != 0) && (dropId != (u8)ITEM00_NO_DROP)) { spawnedActor->actor.velocity.y = 8.0f; - spawnedActor->actor.speedXZ = 2.0f; + spawnedActor->actor.speed = 2.0f; spawnedActor->actor.gravity = -0.9f; spawnedActor->actor.world.rot.y = Rand_ZeroOne() * 40000.0f; Actor_SetScale(&spawnedActor->actor, 0.0f); diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 51b25268b9..a52a7a5c44 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -492,7 +492,7 @@ s32 Player_IsGoronOrDeku(Player* player) { s32 func_801234D4(PlayState* play) { Player* player = GET_PLAYER(play); - return (player->stateFlags2 & PLAYER_STATE2_8) || player->actor.speedXZ != 0.0f || + return (player->stateFlags2 & PLAYER_STATE2_8) || (player->actor.speed != 0.0f) || ((player->transformation != PLAYER_FORM_ZORA) && (player->stateFlags1 & PLAYER_STATE1_8000000)) || ((player->transformation == PLAYER_FORM_ZORA) && (player->stateFlags1 & PLAYER_STATE1_8000000) && (!(player->actor.bgCheckFlags & 1) || (player->currentBoots < PLAYER_BOOTS_ZORA_UNDERWATER))); diff --git a/src/code/z_sub_s.c b/src/code/z_sub_s.c index a792f3ce2d..e4138269f2 100644 --- a/src/code/z_sub_s.c +++ b/src/code/z_sub_s.c @@ -762,7 +762,7 @@ s32 SubS_WeightPathing_Move(Actor* actor, Path* path, s32* waypoint, f32* progre } while (true) { if (!SubS_WeightPathing_ComputePoint(path, *waypoint, &point, *progress, direction) || - ((s32)(actor->speedXZ * 10000.0f) == 0)) { + ((s32)(actor->speed * 10000.0f) == 0)) { return false; } dist = Math_Vec3f_DistXZ(&actor->world.pos, &point); 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 3607accaf7..60f0ba274c 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -238,7 +238,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { Actor_MoveWithGravity(&this->actor); Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.prevPos, &prevFrameDiff); Math_Vec3f_Sum(&this->unk1E0, &prevFrameDiff, &this->unk1E0); - this->actor.shape.rot.x = Math_Atan2S_XY(this->actor.speedXZ, -this->actor.velocity.y); + this->actor.shape.rot.x = Math_Atan2S_XY(this->actor.speed, -this->actor.velocity.y); sp60.x = this->unk1EC.x - (this->unk1E0.x - this->unk1EC.x); sp60.y = this->unk1EC.y - (this->unk1E0.y - this->unk1EC.y); sp60.z = this->unk1EC.z - (this->unk1E0.z - this->unk1EC.z); 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 b110ba68f1..e6b18c2204 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 @@ -148,7 +148,7 @@ s32 func_80BC3B00(BgF40Block* this) { } } - if (Math_Vec3f_StepTo(&this->dyna.actor.world.pos, &sp28, this->dyna.actor.speedXZ) <= 0.0f) { + if (Math_Vec3f_StepTo(&this->dyna.actor.world.pos, &sp28, this->dyna.actor.speed) <= 0.0f) { this->unk_168 = 6; this->unk_160 = this->unk_164; return true; @@ -182,26 +182,26 @@ s32 func_80BC3D08(BgF40Block* this, PlayState* play, s32 arg2) { if (arg2 != 0) { sp48.x = - (D_80BC4620[this->unk_168].x * ((800.0f * this->dyna.actor.scale.x) - (this->dyna.actor.speedXZ * 0.5f))) + + (D_80BC4620[this->unk_168].x * ((800.0f * this->dyna.actor.scale.x) - (this->dyna.actor.speed * 0.5f))) + this->dyna.actor.world.pos.x; sp48.y = - (D_80BC4620[this->unk_168].y * ((800.0f * this->dyna.actor.scale.y) - (this->dyna.actor.speedXZ * 0.5f))) + + (D_80BC4620[this->unk_168].y * ((800.0f * this->dyna.actor.scale.y) - (this->dyna.actor.speed * 0.5f))) + this->dyna.actor.world.pos.y; sp48.z = - (D_80BC4620[this->unk_168].z * ((800.0f * this->dyna.actor.scale.z) - (this->dyna.actor.speedXZ * 0.5f))) + + (D_80BC4620[this->unk_168].z * ((800.0f * this->dyna.actor.scale.z) - (this->dyna.actor.speed * 0.5f))) + this->dyna.actor.world.pos.z; - sp3C.x = (D_80BC4620[this->unk_168].x * this->dyna.actor.speedXZ) + sp48.x; - sp3C.y = (D_80BC4620[this->unk_168].y * this->dyna.actor.speedXZ) + sp48.y; - sp3C.z = (D_80BC4620[this->unk_168].z * this->dyna.actor.speedXZ) + sp48.z; + sp3C.x = (D_80BC4620[this->unk_168].x * this->dyna.actor.speed) + sp48.x; + sp3C.y = (D_80BC4620[this->unk_168].y * this->dyna.actor.speed) + sp48.y; + sp3C.z = (D_80BC4620[this->unk_168].z * this->dyna.actor.speed) + sp48.z; } else { sp3C.x = (D_80BC4620[this->unk_168].x * 800.0f * this->dyna.actor.scale.x) + this->dyna.actor.world.pos.x; sp3C.y = (D_80BC4620[this->unk_168].y * 800.0f * this->dyna.actor.scale.y) + this->dyna.actor.world.pos.y; sp3C.z = (D_80BC4620[this->unk_168].z * 800.0f * this->dyna.actor.scale.z) + this->dyna.actor.world.pos.z; - sp48.x = sp3C.x - (D_80BC4620[this->unk_168].x * this->dyna.actor.speedXZ * 1.5f); - sp48.y = sp3C.y - (D_80BC4620[this->unk_168].y * this->dyna.actor.speedXZ * 1.5f); - sp48.z = sp3C.z - (D_80BC4620[this->unk_168].z * this->dyna.actor.speedXZ * 1.5f); + sp48.x = sp3C.x - (D_80BC4620[this->unk_168].x * this->dyna.actor.speed * 1.5f); + sp48.y = sp3C.y - (D_80BC4620[this->unk_168].y * this->dyna.actor.speed * 1.5f); + sp48.z = sp3C.z - (D_80BC4620[this->unk_168].z * this->dyna.actor.speed * 1.5f); } if (BgCheck_AnyLineTest1(&play->colCtx, &sp48, &sp3C, &sp30, &sp54, true)) { @@ -240,11 +240,11 @@ void BgF40Block_Init(Actor* thisx, PlayState* play) { if (this->path != NULL) { if (Flags_GetSwitch(play, BGF40BLOCK_GET_SWITCHFLAG(&this->dyna.actor))) { this->actionFunc = func_80BC4530; - this->dyna.actor.speedXZ = 40.0f; + this->dyna.actor.speed = 40.0f; func_80BC3A2C(this, play); } else { this->actionFunc = func_80BC4380; - this->dyna.actor.speedXZ = 20.0f; + this->dyna.actor.speed = 20.0f; func_80BC3980(this, play); } } else { @@ -272,7 +272,7 @@ void func_80BC41AC(BgF40Block* this, PlayState* play) { void func_80BC4228(BgF40Block* this, PlayState* play) { if (func_80BC3B00(this)) { - this->dyna.actor.speedXZ = 20.0f; + this->dyna.actor.speed = 20.0f; if (this->unk_160 < (this->path->count - 1)) { this->unk_164 = this->unk_160 + 1; } else { @@ -332,7 +332,7 @@ void func_80BC43CC(BgF40Block* this, PlayState* play) { void func_80BC4448(BgF40Block* this, PlayState* play) { if (func_80BC3B00(this)) { - this->dyna.actor.speedXZ = 40.0f; + this->dyna.actor.speed = 40.0f; if (this->unk_160 > 0) { this->unk_164 = this->unk_160 - 1; } else { 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 3c31f8846c..18eb983259 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 @@ -137,7 +137,7 @@ void BgIkanaDharma_Destroy(Actor* thisx, PlayState* play) { void BgIkanaDharma_SetupWaitForHit(BgIkanaDharma* this) { this->actionFunc = BgIkanaDharma_WaitForHit; - this->dyna.actor.speedXZ = 0.0f; + this->dyna.actor.speed = 0.0f; } void BgIkanaDharma_WaitForHit(BgIkanaDharma* this, PlayState* play) { @@ -157,7 +157,7 @@ void BgIkanaDharma_WaitForHit(BgIkanaDharma* this, PlayState* play) { tempAngle1 = BINANG_ADD(this->dyna.actor.yawTowardsPlayer, 0x8000); tempAngle2 = (BINANG_SUB(player->actor.shape.rot.y, tempAngle1) >> 1); this->dyna.actor.world.rot.y = tempAngle1 + tempAngle2 + 0xF000; - this->dyna.actor.speedXZ = 20.0f; + this->dyna.actor.speed = 20.0f; Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_DARUMA_VANISH); BgIkanaDharma_SetupStartCutscene(this); } else if ((this->dyna.actor.flags & ACTOR_FLAG_40) == ACTOR_FLAG_40 && sFirstHitBgIkanaDharma == NULL && 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 5a886d5b30..a1bd0d65d9 100644 --- a/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c +++ b/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c @@ -314,7 +314,7 @@ void func_809CE4C8(BgSpdweb* this, PlayState* play) { player->stateFlags1 |= PLAYER_STATE1_20; this->unk_161 = 1; } - } else if (player->actor.speedXZ != 0.0f) { + } else if (player->actor.speed != 0.0f) { this->unk_164 = CLAMP_MIN(this->unk_164, 2.0f); } } 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 7269a61e7e..2ef6227375 100644 --- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c +++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c @@ -710,10 +710,10 @@ void func_809DAB78(Boss02* this, PlayState* play) { this->unk_0168 = 2000.0f; if (this->unk_0195 != 0) { - this->actor.speedXZ = this->unk_01A8 * D_809DF5B0 * 1.25f; + this->actor.speed = this->unk_01A8 * D_809DF5B0 * 1.25f; this->skelAnime.playSpeed = 2.0f; } else { - this->actor.speedXZ = this->unk_01A8 * D_809DF5B0; + this->actor.speed = this->unk_01A8 * D_809DF5B0; } Actor_UpdateVelocityWithoutGravity(&this->actor); @@ -947,7 +947,7 @@ void func_809DAB78(Boss02* this, PlayState* play) { case 21: this->unk_01A8 = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->unk_0146[0] == 0) { this->unk_0146[0] = 3; @@ -969,13 +969,13 @@ void func_809DAB78(Boss02* this, PlayState* play) { spCC = player->actor.world.pos.x - this->actor.world.pos.x; spC4 = player->actor.world.pos.z - this->actor.world.pos.z; if (sqrtf(SQ(spCC) + SQ(spC4)) < (400.0f * D_809DF5B0)) { - this->actor.speedXZ = 15.0f * D_809DF5B0; + this->actor.speed = 15.0f * D_809DF5B0; } spCC = this->actor.world.pos.x; spC4 = this->actor.world.pos.z; if (sqrtf(SQ(spCC) + SQ(spC4)) < (400.0f * D_809DF5B0)) { - this->actor.speedXZ = 15.0f * D_809DF5B0; + this->actor.speed = 15.0f * D_809DF5B0; } if (otherTwinmold->unk_0144 >= 10) { @@ -998,7 +998,7 @@ void func_809DAB78(Boss02* this, PlayState* play) { if (this->actor.bgCheckFlags & 1) { this->unk_0144 = 23; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_0170 = this->unk_017C; this->unk_016C = 30; this->unk_0170.y = this->actor.floorHeight; @@ -1958,7 +1958,7 @@ void func_809DD934(Boss02* this, PlayState* play) { temp_a0_5->world.pos.x *= phi_f0_2; temp_a0_5->world.pos.z *= phi_f0_2; - temp_a0_5->speedXZ *= phi_f0_2; + temp_a0_5->speed *= phi_f0_2; temp_a0_5->velocity.x *= phi_f0_2; temp_a0_5->velocity.y *= phi_f0_2; 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 c5d729729e..fba59ca515 100644 --- a/src/overlays/actors/ovl_Boss_03/z_boss_03.c +++ b/src/overlays/actors/ovl_Boss_03/z_boss_03.c @@ -581,7 +581,7 @@ void func_809E34B8(Boss03* this, PlayState* play) { Math_ApproachS(&this->bodyYRot, bodyYRotTarget, 5, 0x100); Math_ApproachS(&this->unk_274, this->unk_276, 1, 0x100); - Math_ApproachF(&this->actor.speedXZ, this->unk_278, 1.0f, this->unk_27C); + Math_ApproachF(&this->actor.speed, this->unk_278, 1.0f, this->unk_27C); Math_ApproachF(&this->unk_260, sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f); if ((this->workTimer[WORK_TIMER_UNK2_A] == 0) && (this->actor.bgCheckFlags & 8)) { @@ -669,7 +669,7 @@ void Boss03_ChasePlayer(Boss03* this, PlayState* play) { Math_ApproachS(&this->bodyYRot, bodyYRotTarget, 5, 0x100); Math_ApproachS(&this->unk_274, this->unk_276, 1, 0x100); - Math_ApproachF(&this->actor.speedXZ, this->unk_278, 1.0f, this->unk_27C); + Math_ApproachF(&this->actor.speed, this->unk_278, 1.0f, this->unk_27C); Math_ApproachF(&this->unk_260, sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f); Actor_MoveWithoutGravityReverse(&this->actor); @@ -765,7 +765,7 @@ void Boss03_CatchPlayer(Boss03* this, PlayState* play) { -0.5f, 5, 0x100); Math_ApproachS(&this->unk_274, this->unk_276, 1, 0x100); - Math_ApproachF(&this->actor.speedXZ, this->unk_278, 1.0f, this->unk_27C); + Math_ApproachF(&this->actor.speed, this->unk_278, 1.0f, this->unk_27C); Math_ApproachF(&this->unk_260, sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f); Actor_MoveWithoutGravityReverse(&this->actor); Math_ApproachS(&this->actor.shape.rot.x, this->actor.world.rot.x, 2, this->unk_274 * 2); @@ -873,7 +873,7 @@ void Boss03_ChewPlayer(Boss03* this, PlayState* play) { switch (this->unk_242) { case 0: - Math_ApproachF(&this->actor.speedXZ, 10.0f, 1.0f, 1.0f); + Math_ApproachF(&this->actor.speed, 10.0f, 1.0f, 1.0f); if (sqrtf(SQ(xDiff) + SQ(zDiff)) < 100.0f) { this->unk_242 = 1; Animation_MorphToLoop(&this->skelAnime, &gGyorgBackingUpAnim, -15.0f); @@ -881,7 +881,7 @@ void Boss03_ChewPlayer(Boss03* this, PlayState* play) { break; case 1: - Math_ApproachF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f); + Math_ApproachF(&this->actor.speed, 0.0f, 1.0f, 0.5f); Math_ApproachF(&this->actor.world.pos.y, 200.0f, 0.05f, 5.0f); break; } @@ -995,7 +995,7 @@ void Boss03_PrepareCharge(Boss03* this, PlayState* play) { } // Turns back slowly - Math_ApproachF(&this->actor.speedXZ, -3.0f, 1.0f, 0.5f); + Math_ApproachF(&this->actor.speed, -3.0f, 1.0f, 0.5f); Actor_MoveWithoutGravityReverse(&this->actor); } @@ -1032,11 +1032,11 @@ void Boss03_Charge(Boss03* this, PlayState* play) { this->actor.shape.rot = this->actor.world.rot; - Math_ApproachF(&this->actor.speedXZ, 25.0f, 1.0f, 3.0f); + Math_ApproachF(&this->actor.speed, 25.0f, 1.0f, 3.0f); Math_ApproachF(&this->unk_260, sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f); Actor_MoveWithoutGravityReverse(&this->actor); - if (this->actor.speedXZ >= 20.0f) { + if (this->actor.speed >= 20.0f) { // Jump over platform if (this->unk_242 == 1) { if (sqrtf(SQXZ(this->actor.world.pos)) < 700.0f) { @@ -1068,7 +1068,7 @@ void Boss03_SetupJumpOverPlatform(Boss03* this, PlayState* play) { this->actionFunc = Boss03_JumpOverPlatform; this->actor.gravity = -2.0f; this->actor.velocity.y = 30.0f; - this->actor.speedXZ = 25.0f; + this->actor.speed = 25.0f; Boss03_PlayUnderwaterSfx(&this->actor.projectedPos, NA_SE_EN_KONB_JUMP_OLD); } @@ -1171,7 +1171,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) { case 1: player->actor.world.pos.z = 0.0f; player->actor.world.pos.x = 0.0f; - player->actor.speedXZ = 0.0f; + player->actor.speed = 0.0f; this->subCamEye.x = 100.0f; this->subCamEye.y = 540.0f; @@ -1210,7 +1210,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) { } if (this->csTimer > 50) { - Math_ApproachF(&this->actor.speedXZ, this->unk_278, 1.0f, 0.1f); + Math_ApproachF(&this->actor.speed, this->unk_278, 1.0f, 0.1f); } if (this->unk_242 < 2) { @@ -1225,7 +1225,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) { } else { this->unk_278 = 0.0f; bubblesToSpawnNum = 1; - if ((this->actor.speedXZ == 0.0f) && (this->csTimer > 230)) { + if ((this->actor.speed == 0.0f) && (this->csTimer > 230)) { this->csState = 3; this->csTimer = 0; } @@ -1243,7 +1243,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) { case 3: Boss03_PlayUnderwaterSfx(&this->actor.projectedPos, NA_SE_EN_KONB_PREATTACK_OLD - SFX_FLAG); sp5A = 0x1970; - Math_ApproachF(&this->actor.speedXZ, 15.0f, 1.0f, 2.0f); + Math_ApproachF(&this->actor.speed, 15.0f, 1.0f, 2.0f); if (this->csTimer > 20) { this->csState = 4; this->csTimer = 0; @@ -1276,14 +1276,14 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) { this->csState = 5; this->csTimer = 0; this->unk_2D5 = false; - this->actor.speedXZ = -200.0f; + this->actor.speed = -200.0f; Actor_MoveWithoutGravityReverse(&this->actor); this->actor.world.pos.y = this->waterHeight - 150.0f; Play_DisableMotionBlur(); case 5: SkelAnime_Update(&this->skelAnime); - this->actor.speedXZ = 20.0f; + this->actor.speed = 20.0f; Actor_MoveWithoutGravityReverse(&this->actor); player->actor.shape.rot.y = -0x1470; player->actor.world.rot.y = player->actor.shape.rot.y; @@ -1301,7 +1301,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) { this->csState = 6; this->csTimer = 0; this->actor.gravity = -1.5f; - this->actor.speedXZ = 20.0f; + this->actor.speed = 20.0f; Audio_QueueSeqCmd(NA_BGM_BOSS | 0x8000); Actor_PlaySfx(&this->actor, NA_SE_EN_KONB_JUMP_OLD); @@ -1326,7 +1326,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) { this->bubbleEffectSpawnCount = 2; this->actor.gravity = 0.0f; Math_ApproachZeroF(&this->actor.velocity.y, 1.0f, 1.0f); - Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 0.5f); + Math_ApproachZeroF(&this->actor.speed, 1.0f, 0.5f); } else { if (1) {} if (1) {} @@ -1382,7 +1382,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) { if ((this->csState == 2) || (this->csState == 3)) { Actor_MoveWithoutGravityReverse(&this->actor); - phi_f2 = this->actor.speedXZ * 0.02f; + phi_f2 = this->actor.speed * 0.02f; phi_f2 = CLAMP_MAX(phi_f2, 0.12f); sp5C = Math_SinS(this->unk_240 * sp5A) * phi_f2; @@ -1544,7 +1544,7 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) { this->unk_242 = 1; this->actor.gravity = -2.0f; this->actor.velocity.y = 25.0f; - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; this->actor.world.rot.y = this->unk_2BE + 0x8000; this->unk_240 = 0; Actor_PlaySfx(&this->actor, NA_SE_EN_KONB_DEAD_JUMP2_OLD); @@ -1565,7 +1565,7 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) { if (this->actor.world.pos.y < PLATFORM_HEIGHT + (100.0f * sp64)) { this->actor.world.pos.y = PLATFORM_HEIGHT + (100.0f * sp64); this->actor.velocity.y = ((Rand_ZeroFloat(10.0f) + 7.5f) * sp64) + 7.5f; - this->actor.speedXZ = ((Rand_ZeroFloat(5.0f) + 2.5f) * sp64) + 2.5f; + this->actor.speed = ((Rand_ZeroFloat(5.0f) + 2.5f) * sp64) + 2.5f; if (Rand_ZeroOne() < 0.5f) { this->shapeRotTargetX = @@ -1778,7 +1778,7 @@ void Boss03_Stunned(Boss03* this, PlayState* play) { this->actor.shape.rot.x = this->actor.world.rot.x; Math_ApproachF(&this->actor.world.pos.y, 100.0f, 0.05f, 5.0f); - Math_ApproachF(&this->actor.speedXZ, 0.0f, 1.0f, 1.5f); + Math_ApproachF(&this->actor.speed, 0.0f, 1.0f, 1.5f); Actor_MoveWithoutGravityReverse(&this->actor); } @@ -2511,13 +2511,13 @@ void Boss03_SeaweedUpdate(Actor* thisx, PlayState* play) { yDiff = player->actor.world.pos.y - this->seaweedSegmentPositions[i].y; zDiff = player->actor.world.pos.z - this->seaweedSegmentPositions[i].z; distanceBetweenSeaweedAndDisturbance = sqrtf(SQ(xDiff) + SQ(yDiff) + SQ(zDiff)); - disturbanceFactor = player->actor.speedXZ * 3.0f + 70.0f; + disturbanceFactor = player->actor.speed * 3.0f + 70.0f; // Player is standing on ground if (player->actor.bgCheckFlags & 1) { maxBendSpeed = 0; } else { - maxBendSpeed = player->actor.speedXZ * 16.0f; + maxBendSpeed = player->actor.speed * 16.0f; if (maxBendSpeed > 0x1000) { maxBendSpeed = 0x1000; } else if (maxBendSpeed < 0x100) { @@ -2550,8 +2550,8 @@ void Boss03_SeaweedUpdate(Actor* thisx, PlayState* play) { break; } - maxBendSpeed = sGyorgBossInstance->actor.speedXZ * 16.0f; - disturbanceFactor = sGyorgBossInstance->actor.speedXZ * 5.0f + 150.0f; + maxBendSpeed = sGyorgBossInstance->actor.speed * 16.0f; + disturbanceFactor = sGyorgBossInstance->actor.speed * 5.0f + 150.0f; if (maxBendSpeed > 0x1000) { maxBendSpeed = 0x1000; } else if (maxBendSpeed < 0x100) { 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 832466fa7c..a78b7234ec 100644 --- a/src/overlays/actors/ovl_Boss_04/z_boss_04.c +++ b/src/overlays/actors/ovl_Boss_04/z_boss_04.c @@ -431,7 +431,7 @@ void func_809ECD18(Boss04* this, PlayState* play) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 10, 0x200); this->actor.world.pos.y = (this->actor.floorHeight + KREG(17) + 160.0f) + (Math_SinS(this->unk_1F4 * 512) * 10.0f); - Math_ApproachF(&this->actor.speedXZ, this->unk_6D4, 1.0f, 0.5f); + Math_ApproachF(&this->actor.speed, this->unk_6D4, 1.0f, 0.5f); if (this->unk_1F8 == 0) { this->unk_1F8 = Rand_ZeroFloat(100.0f) + 50.0f; @@ -460,7 +460,7 @@ void func_809ECEF4(Boss04* this) { this->unk_1F8 = 0; this->unk_1F6 = 1; this->unk_1FA = 60; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.gravity = -3.0f; } @@ -477,7 +477,7 @@ void func_809ECF58(Boss04* this, PlayState* play) { this->actor.world.rot.y = BINANG_ROT180((s16)Rand_ZeroFloat(8000.0f) + this->actor.world.rot.y); } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.bgCheckFlags & 8) { play_sound(NA_SE_IT_BIG_BOMB_EXPLOSION); @@ -496,7 +496,7 @@ void func_809ECF58(Boss04* this, PlayState* play) { if (this->unk_6F4 == 0) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 5, 0x1000); if (this->unk_1FA == 0) { - Math_ApproachF(&this->actor.speedXZ, 20.0f, 1.0f, 1.0f); + Math_ApproachF(&this->actor.speed, 20.0f, 1.0f, 1.0f); sp3C.x = this->actor.world.pos.x; sp3C.y = this->actor.floorHeight + 2.0f; sp3C.z = this->actor.world.pos.z; @@ -517,7 +517,7 @@ void func_809ED224(Boss04* this) { this->actionFunc = func_809ED2A0; this->unk_1F8 = 60; this->unk_1FA = 100; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_2D0 = 10000.0f; this->unk_2C8 = 200; Actor_PlaySfx(&this->actor, NA_SE_EN_ME_DEAD); 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 a91877288f..b1d5c71282 100644 --- a/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c +++ b/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c @@ -313,7 +313,7 @@ void func_80C16BD4(DemoSyoten* this, PlayState* play) { break; case 4: - this->actor.speedXZ = + this->actor.speed = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_3F0)]->urot.z * 0.005493164f; if (this->unk_3EC < this->unk_3E8->count) { if (func_80C16818(this)) { 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 425bcdcfb1..4420586779 100644 --- a/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.c +++ b/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.c @@ -90,15 +90,15 @@ void func_80AB1FDC(DmChar09* this, PlayState* play) { phi_fv0 = this->speed; phi_fa0 = this->speed * 0.16f; } - Math_StepToF(&thisx->speedXZ, phi_fv0, phi_fa0); - if ((thisx->speedXZ + 0.05f) < sp54) { - Math_Vec3f_Scale(&thisx->velocity, thisx->speedXZ / sp54); + Math_StepToF(&thisx->speed, phi_fv0, phi_fa0); + if ((thisx->speed + 0.05f) < sp54) { + Math_Vec3f_Scale(&thisx->velocity, thisx->speed / sp54); thisx->world.pos.x += thisx->velocity.x; thisx->world.pos.y += thisx->velocity.y; thisx->world.pos.z += thisx->velocity.z; } else { this->unk_21C += this->unk_220; - thisx->speedXZ *= 0.4f; + thisx->speed *= 0.4f; phi_a1 = true; if (((this->unk_21C >= this->unk_218) && (this->unk_220 > 0)) || ((this->unk_21C <= 0) && (this->unk_220 < 0))) { 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 0ffb5c7589..1507da5e26 100644 --- a/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c +++ b/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c @@ -278,7 +278,7 @@ void func_80BA1CF8(ElfMsg6* this, PlayState* play) { if ((this->actor.textId == 0x224) && CHECK_WEEKEVENTREG(WEEKEVENTREG_08_40)) { this->actor.textId = 0x25B; - } else if (func_80BA1C00(this) && (player->actor.speedXZ > 1.0f)) { + } else if (func_80BA1C00(this) && (player->actor.speed > 1.0f)) { player->tatlTextId = -this->actor.textId; ActorCutscene_SetIntentToPlay(0x7C); sp20->elfMsg = &this->actor; @@ -319,7 +319,7 @@ void func_80BA1E30(ElfMsg6* this, PlayState* play) { return; } - if (func_80BA1C00(this) && (player->actor.speedXZ > 1.0f)) { + if (func_80BA1C00(this) && (player->actor.speed > 1.0f)) { player->tatlTextId = -this->actor.textId; ActorCutscene_SetIntentToPlay(0x7C); sp20->elfMsg = &this->actor; 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 6b48c9779e..3ccfd26998 100644 --- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c +++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c @@ -129,10 +129,10 @@ static InitChainEntry sInitChain[] = { }; void func_80BECBE0(EnAkindonuts* this, s16 arg1) { - f32 sp24 = Math_CosS(this->actor.world.rot.x) * this->actor.speedXZ; + f32 sp24 = Math_CosS(this->actor.world.rot.x) * this->actor.speed; this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * sp24; - this->actor.velocity.y = Math_SinS(this->actor.world.rot.x) * this->actor.speedXZ; + this->actor.velocity.y = Math_SinS(this->actor.world.rot.x) * this->actor.speed; this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * sp24; if (arg1) { @@ -1561,9 +1561,9 @@ void func_80BEFAF0(EnAkindonuts* this, PlayState* play) { if (this->unk_334 >= 3) { sp32 = true; } - Math_ApproachF(&this->actor.speedXZ, 1.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 1.5f, 0.2f, 1.0f); } else { - Math_ApproachF(&this->actor.speedXZ, 2.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 2.0f, 0.2f, 1.0f); } func_80BECBE0(this, sp32); 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 79ec20df6f..acefdf5007 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -265,21 +265,21 @@ void EnAm_ApplyEnemyTexture(EnAm* this, PlayState* play) { void func_808B0208(EnAm* this, PlayState* play) { // If the armos is against a wall, rotate and turn away from it - if ((this->actor.speedXZ > 0.0f) && (this->actor.bgCheckFlags & 8)) { + if ((this->actor.speed > 0.0f) && (this->actor.bgCheckFlags & 8)) { this->actor.world.rot.y = (this->actor.wallYaw * 2) - this->actor.world.rot.y; - this->actor.world.pos.x += this->actor.speedXZ * Math_SinS(this->actor.world.rot.y); - this->actor.world.pos.z += this->actor.speedXZ * Math_CosS(this->actor.world.rot.y); + this->actor.world.pos.x += this->actor.speed * Math_SinS(this->actor.world.rot.y); + this->actor.world.pos.z += this->actor.speed * Math_CosS(this->actor.world.rot.y); } SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 8.0f) != 0) { - this->actor.speedXZ = this->speed; + this->actor.speed = this->speed; this->actor.velocity.y = 12.0f; } else if (this->skelAnime.curFrame > 11.0f) { if (!(this->actor.bgCheckFlags & 1)) { this->skelAnime.curFrame = 11.0f; } else { Math_ScaledStepToS(&this->actor.world.rot.y, this->armosYaw, 0x1F40); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.bgCheckFlags & 2) { EnAm_SpawnEffects(this, play); } @@ -293,7 +293,7 @@ void func_808B0208(EnAm* this, PlayState* play) { void func_808B0358(EnAm* this) { Animation_PlayLoopSetSpeed(&this->skelAnime, &gArmosHopAnim, 4.0f); this->explodeTimer = 3; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->speed = 6.0f; this->actionFunc = func_808B03C0; @@ -382,7 +382,7 @@ void EnAm_TakeDamage(EnAm* this, PlayState* play) { Animation_Change(&this->skelAnime, &gArmosTakeDamageAnim, 1.0f, 4.0f, Animation_GetLastFrame(&gArmosTakeDamageAnim) - 6, ANIMMODE_ONCE, 0.0f); func_800BE504(&this->actor, &this->enemyCollider); - this->actor.speedXZ = 6.0f; + this->actor.speed = 6.0f; Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, Animation_GetLastFrame(&gArmosTakeDamageAnim) - 10); Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_DAMAGE); this->enemyCollider.base.acFlags &= ~AC_ON; @@ -391,7 +391,7 @@ void EnAm_TakeDamage(EnAm* this, PlayState* play) { } void func_808B07A8(EnAm* this, PlayState* play) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); if (SkelAnime_Update(&this->skelAnime)) { if (this->actor.colChkInfo.health == 0) { func_808B0820(this); @@ -407,7 +407,7 @@ void func_808B0820(EnAm* this) { this->explodeTimer = 64; this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.flags |= ACTOR_FLAG_10; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->speed = 6.0f; this->actionFunc = func_808B0894; } @@ -451,12 +451,12 @@ void func_808B0894(EnAm* this, PlayState* play) { void func_808B0AD0(EnAm* this, PlayState* play) { Animation_Change(&this->skelAnime, &gArmosPushedBackAnim, 1.0f, 0.0f, 8.0f, ANIMMODE_ONCE, 0.0f); this->actor.world.rot.y = this->actor.yawTowardsPlayer; - this->actor.speedXZ = -6.0f; + this->actor.speed = -6.0f; this->actionFunc = func_808B0B4C; } void func_808B0B4C(EnAm* this, PlayState* play) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); if (SkelAnime_Update(&this->skelAnime)) { func_808B0358(this); } 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 8fe5c121e0..fa6cd3e757 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -225,7 +225,7 @@ void func_8088A7D8(PlayState* play, EnArrow* this) { this->actionFunc = func_8088B6B0; Animation_PlayOnce(&this->arrow.skelAnime, &gameplay_keep_Anim_012860); this->actor.world.rot.y += (s32)(0x6000 * (Rand_ZeroOne() - 0.5f)) + 0x8000; - this->actor.speedXZ *= 0.02f + (0.02f * Rand_ZeroOne()); + this->actor.speed *= 0.02f + (0.02f * Rand_ZeroOne()); this->actor.gravity = -1.5f; this->unk_260 = 50; this->unk_263 = 1; @@ -375,7 +375,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) { if (this->actor.params == ENARROW_8) { R_TRANS_FADE_FLASH_ALPHA_STEP = -1; Actor_Spawn(&play->actorCtx, play, ACTOR_EN_M_FIRE1, this->actor.world.pos.x, this->actor.world.pos.y, - this->actor.world.pos.z, 0, 0, 0, this->actor.speedXZ == 0.0f); + this->actor.world.pos.z, 0, 0, 0, this->actor.speed == 0.0f); sp82 = NA_SE_IT_DEKU; } else { sp82 = NA_SE_IT_SLING_REFLECT; @@ -396,7 +396,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) { Math_Vec3f_Diff(&sp7C->world.pos, &this->actor.world.pos, &this->unk_268); sp7C->flags |= ACTOR_FLAG_8000; this->collider.base.atFlags &= ~AT_HIT; - this->actor.speedXZ *= 0.5f; + this->actor.speed *= 0.5f; this->actor.velocity.y *= 0.5f; } else { this->unk_261 |= 1; @@ -424,9 +424,9 @@ void func_8088ACE0(EnArrow* this, PlayState* play) { func_8088AA98(this, play); if (this->actor.params == ENARROW_7) { if (this->bubble.unk_149 == 0) { - sp78 = sqrtf(SQ(this->actor.speedXZ) + SQ(this->actor.velocity.y)); - sp74 = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; - temp_f12_2 = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; + sp78 = sqrtf(SQ(this->actor.speed) + SQ(this->actor.velocity.y)); + sp74 = Math_SinS(this->actor.world.rot.y) * this->actor.speed; + temp_f12_2 = Math_CosS(this->actor.world.rot.y) * this->actor.speed; this->actor.prevPos.x = this->actor.world.pos.x - (sp74 * (10.0f / sp78)); this->actor.prevPos.y = this->actor.world.pos.y - (this->actor.velocity.y * (10.0f / sp78)); @@ -456,7 +456,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) { Math_Vec3f_Copy(&this->unk_228, &this->actor.world.pos); - if (this->actor.speedXZ == 0.0f) { + if (this->actor.speed == 0.0f) { this->actor.velocity.y -= 1.0f; if (this->actor.velocity.y < this->actor.terminalVelocity) { this->actor.velocity.y = this->actor.terminalVelocity; @@ -474,7 +474,7 @@ void func_8088ACE0(EnArrow* this, PlayState* play) { } if (this->actor.params < ENARROW_6) { - this->actor.shape.rot.x = Math_Atan2S_XY(this->actor.speedXZ, -this->actor.velocity.y); + this->actor.shape.rot.x = Math_Atan2S_XY(this->actor.speed, -this->actor.velocity.y); } } @@ -641,7 +641,7 @@ void EnArrow_Draw(Actor* thisx, PlayState* play) { &this->actor, this->actor.projectedPos.z < 160.0f ? 0 : 1); } else if (this->actor.params == ENARROW_7) { s32 spA4 = 255 - (s32)(this->bubble.unk_144 * 4.0f); - f32 spA0 = (this->actor.speedXZ * 0.1f) + 1.0f; + f32 spA0 = (this->actor.speed * 0.1f) + 1.0f; f32 sp9C = (1.0f / spA0); OPEN_DISPS(play->state.gfxCtx); @@ -659,7 +659,7 @@ void EnArrow_Draw(Actor* thisx, PlayState* play) { MTXMODE_APPLY); Matrix_Translate(0.0f, 0.0f, 460.0f, MTXMODE_APPLY); - if (this->actor.speedXZ == 0.0f) { + if (this->actor.speed == 0.0f) { func_800B8118(&this->actor, play, MTXMODE_NEW); gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_06F380); @@ -687,7 +687,7 @@ void EnArrow_Draw(Actor* thisx, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx); return; - } else if (this->actor.speedXZ != 0.0f) { + } else if (this->actor.speed != 0.0f) { u8 sp63 = (Math_CosS(this->unk_260 * 5000) * 127.5f) + 127.5f; f32 sp5C; @@ -710,7 +710,7 @@ void EnArrow_Draw(Actor* thisx, PlayState* play) { Matrix_Push(); Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY); - if (this->actor.speedXZ == 0.0f) { + if (this->actor.speed == 0.0f) { phi_v0 = 0; } else { phi_v0 = (play->gameplayFrames % 256) * 4000; 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 18ccfb030c..0994ada491 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 @@ -213,7 +213,7 @@ void EnAttackNiw_EnterViewFromOffscreen(EnAttackNiw* this, PlayState* play) { Vec3f flightTarget; s32 pad; - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; // randomTargetCenterOffset is set in _Init, only needs to be set once // but the view is moving, so now we need to re-calculate the spot in space @@ -314,7 +314,7 @@ void EnAttackNiw_AimAtPlayer(EnAttackNiw* this, PlayState* play) { Math_SmoothStepToS(&this->actor.world.rot.y, this->targetRotY, 2, this->rotStep, 0); Math_SmoothStepToS(&this->actor.world.rot.x, this->targetRotX, 2, this->rotStep, 0); Math_ApproachF(&this->rotStep, 10000.0f, 1.0f, 1000.0f); - Math_ApproachF(&this->actor.speedXZ, this->targetXZSpeed, 0.9f, 1.0f); + Math_ApproachF(&this->actor.speed, this->targetXZSpeed, 0.9f, 1.0f); if (this->actor.gravity == -2.0f && this->unkTimer25A == 0 && (this->actor.bgCheckFlags & 8 || this->randomAngleChangeTimer == 0)) { 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 38690e122c..4c611c2734 100644 --- a/src/overlays/actors/ovl_En_Az/z_en_az.c +++ b/src/overlays/actors/ovl_En_Az/z_en_az.c @@ -437,9 +437,9 @@ s32 func_80A95534(PlayState* play, ActorPathing* actorPathing) { this->unk_36C = actorPathing->distSqToCurPointXZ; } } - Math_SmoothStepToF(&this->actor.speedXZ, this->unk_36C, 0.8f, 2.0f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, this->unk_36C, 0.8f, 2.0f, 0.0f); actorPathing->moveFunc = SubS_ActorPathing_MoveWithGravity; - if (actorPathing->distSqToCurPointXZ <= this->actor.speedXZ) { + if (actorPathing->distSqToCurPointXZ <= this->actor.speed) { ret = true; } return ret; @@ -454,11 +454,11 @@ s32 func_80A9565C(PlayState* play, ActorPathing* actorPathing) { actorPathing->moveFunc = func_80A94A90; this->unk_374 |= 0x2000; temp_f0 = func_80A954AC(this); - if ((actorPathing->distSqToCurPointXZ < SQ(this->actor.speedXZ)) || (temp_f0 <= 0.0f)) { + if ((actorPathing->distSqToCurPointXZ < SQ(this->actor.speed)) || (temp_f0 <= 0.0f)) { ret = true; } else { this->unk_39E = this->actor.world.rot.x = - Math_Atan2S(-this->actor.velocity.y, Math_CosS(-this->actor.world.rot.x) * this->actor.speedXZ); + Math_Atan2S(-this->actor.velocity.y, Math_CosS(-this->actor.world.rot.x) * this->actor.speed); } return ret; } @@ -474,10 +474,10 @@ s32 func_80A95730(PlayState* play, ActorPathing* actorPathing) { this->actor.gravity = 0.0f; temp_f0 = func_80A954AC(this); - if ((actorPathing->distSqToCurPointXZ < SQ(this->actor.speedXZ)) || (temp_f0 <= 0.0f)) { + if ((actorPathing->distSqToCurPointXZ < SQ(this->actor.speed)) || (temp_f0 <= 0.0f)) { ret = true; } else { - sp40 = SQ(this->actor.speedXZ) / actorPathing->distSqToCurPoint; + sp40 = SQ(this->actor.speed) / actorPathing->distSqToCurPoint; sp34 = ABS(actorPathing->rotToCurPoint.x - this->actor.world.rot.x); sp3C = (s32)(sp34 * sp40) + 0xAAA; @@ -521,12 +521,12 @@ s32 func_80A958B0(PlayState* play, ActorPathing* actorPathing) { } else { Math_SmoothStepToF(&this->unk_36C, 26.0f, 0.5f, 1.0f, 0.01f); } - Math_SmoothStepToF(&this->actor.speedXZ, this->unk_36C, 0.8f, 2.0f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, this->unk_36C, 0.8f, 2.0f, 0.0f); temp1 = func_80A954AC(this); - if ((actorPathing->distSqToCurPointXZ < SQ(this->actor.speedXZ)) || (temp1 <= 0.0f)) { + if ((actorPathing->distSqToCurPointXZ < SQ(this->actor.speed)) || (temp1 <= 0.0f)) { ret = true; } else { - sp3C = SQ(this->actor.speedXZ) / actorPathing->distSqToCurPoint; + sp3C = SQ(this->actor.speed) / actorPathing->distSqToCurPoint; sp30 = ABS(actorPathing->rotToCurPoint.x - this->actor.world.rot.x); sp2C = (s32)(sp30 * sp3C) + 0xAAA; sp30 = ABS(actorPathing->rotToCurPoint.y - this->actor.world.rot.y); @@ -608,7 +608,7 @@ void func_80A95DA0(EnAz* this, PlayState* play) { SubS_ActorPathing_Init(play, &this->actor.world.pos, &this->actor, sp40, play->setupPathList, BEAVER_GET_PARAM_FF(&this->actor), 0, 0, 1, 1); this->unk_36C = 4.0f; - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; this->actor.gravity = 0.0f; SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, BEAVER_ANIM_SWIM_WITH_SPINNING_TAIL, &this->animIndex); @@ -665,7 +665,7 @@ void func_80A95FE8(EnAz* this, PlayState* play) { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, BEAVER_ANIM_IDLE, &this->animIndex); this->unk_374 &= ~0x1000; this->actor.gravity = -1.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 3, 0x1000, 0x100); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 3, 0x1038, 0x100); if (this->actor.bgCheckFlags & 1) { @@ -1510,7 +1510,7 @@ void func_80A97EAC(EnAz* this, PlayState* play) { SubS_ActorPathing_Init(play, &this->actor.world.pos, &this->actor, &this->unk_300, play->setupPathList, BEAVER_GET_PARAM_FF(&this->actor), 0, 0, 1, 0); this->unk_36C = 8.0f; - this->actor.speedXZ = 8.0f; + this->actor.speed = 8.0f; this->actor.gravity = 0.0f; this->actor.velocity.y = 6.0f; SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, BEAVER_ANIM_SWIM_WITH_SPINNING_TAIL, @@ -1554,7 +1554,7 @@ void func_80A97F9C(EnAz* this, PlayState* play) { play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_FADE_WHITE; gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; func_80A979DC(this, play); } else { if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] == SECONDS_TO_TIMER(0)) { @@ -1798,7 +1798,7 @@ void EnAz_Draw(Actor* thisx, PlayState* play2) { CLOSE_DISPS(play->state.gfxCtx); } OPEN_DISPS(play->state.gfxCtx); - if ((this->actor.depthInWater >= 28.0f) && (this->actor.speedXZ > 0.5f)) { + if ((this->actor.depthInWater >= 28.0f) && (this->actor.speed > 0.5f)) { Matrix_Translate(this->unk_3B4.x, this->unk_3B4.y, this->unk_3B4.z, MTXMODE_NEW); Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_APPLY); Matrix_RotateXS(this->actor.shape.rot.x, MTXMODE_APPLY); 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 dd8c5a96fb..b16f33c316 100644 --- a/src/overlays/actors/ovl_En_Baba/z_en_baba.c +++ b/src/overlays/actors/ovl_En_Baba/z_en_baba.c @@ -320,8 +320,8 @@ s32 EnBaba_MoveForward(EnBaba* this, f32 speedTarget) { s32 reachedEnd = false; Vec3f point; - Math_SmoothStepToF(&this->actor.speedXZ, speedTarget, 0.4f, 1000.0f, 0.0f); - rotStep = this->actor.speedXZ * 400.0f; + Math_SmoothStepToF(&this->actor.speed, speedTarget, 0.4f, 1000.0f, 0.0f); + rotStep = this->actor.speed * 400.0f; if (SubS_CopyPointFromPath(this->path, this->waypoint, &point) && SubS_MoveActorToPoint(&this->actor, &point, rotStep)) { this->waypoint++; @@ -485,7 +485,7 @@ void EnBaba_HandleSchedule(EnBaba* this, PlayState* play) { this->animIndex = BOMB_SHOP_LADY_ANIM_KNOCKED_OVER; // Ouch this->textId = 0x2A30; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Enemy_StartFinishingBlow(play, &this->actor); this->stateFlags |= BOMB_SHOP_LADY_STATE_KNOCKED_OVER; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); 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 2a4afb087a..516219265a 100644 --- a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c +++ b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c @@ -244,17 +244,17 @@ void EnBaguo_Roll(EnBaguo* this, PlayState* play) { this->timer = 100; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnBaguo_Idle; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { if (!this->bouncedFlag && this->collider.base.atFlags & AT_BOUNCED) { this->zRollDirection ^= 1; this->bouncedFlag = 1; - this->actor.speedXZ = -7.0f; + this->actor.speed = -7.0f; } Math_ApproachF(&this->currentRotation.x, this->targetRotation.x, 0.2f, 1000.0f); Math_ApproachF(&this->currentRotation.z, this->targetRotation.z, 0.2f, 1000.0f); - Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.3f, 0.5f); + Math_ApproachF(&this->actor.speed, 5.0f, 0.3f, 0.5f); this->actor.world.rot.x += (s16)this->currentRotation.x; if (this->currentRotation.z != 0.0f) { @@ -272,7 +272,7 @@ void EnBaguo_Roll(EnBaguo* this, PlayState* play) { void EnBaguo_SetupRetreatUnderground(EnBaguo* this) { this->action = NEJIRON_ACTION_RETREATING; this->actionFunc = EnBaguo_RetreatUnderground; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void EnBaguo_RetreatUnderground(EnBaguo* this, PlayState* play) { @@ -330,7 +330,7 @@ void EnBaguo_CheckForDetonation(EnBaguo* this, PlayState* play) { if (i || this->actor.colChkInfo.damageEffect == NEJIRON_DMGEFF_KILL) { Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); this->action = NEJIRON_ACTION_EXPLODING; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.shape.shadowScale = 0.0f; for (i = 0; i < ARRAY_COUNT(this->effects); i++) { 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 a8b93fc2f8..519043dd83 100644 --- a/src/overlays/actors/ovl_En_Bat/z_en_bat.c +++ b/src/overlays/actors/ovl_En_Bat/z_en_bat.c @@ -203,7 +203,7 @@ void EnBat_SetupPerch(EnBat* this) { this->collider.dim.worldSphere.center.x = this->actor.focus.pos.x; this->collider.dim.worldSphere.center.y = this->actor.focus.pos.y; this->collider.dim.worldSphere.center.z = this->actor.focus.pos.z; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = EnBat_Perch; } @@ -214,7 +214,7 @@ void EnBat_Perch(EnBat* this, PlayState* play) { void EnBat_SetupFlyIdle(EnBat* this) { this->timer = 100; this->collider.base.acFlags |= AC_ON; - this->actor.speedXZ = 3.5f; + this->actor.speed = 3.5f; this->actionFunc = EnBat_FlyIdle; } @@ -262,7 +262,7 @@ void EnBat_FlyIdle(EnBat* this, PlayState* play) { void EnBat_SetupDiveAttack(EnBat* this) { this->collider.base.atFlags |= AT_ON; this->timer = 300; - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; sNumberAttacking++; this->actionFunc = EnBat_DiveAttack; } @@ -317,7 +317,7 @@ void EnBat_DiveAttack(EnBat* this, PlayState* play) { void EnBat_SetupDie(EnBat* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_1; Enemy_StartFinishingBlow(play, &this->actor); - this->actor.speedXZ *= Math_CosS(this->actor.world.rot.x); + this->actor.speed *= Math_CosS(this->actor.world.rot.x); this->actor.bgCheckFlags &= ~1; this->actor.velocity.y = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_FFLY_DEAD); @@ -343,7 +343,7 @@ void EnBat_SetupDie(EnBat* this, PlayState* play) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40); if (this->actor.flags & ACTOR_FLAG_8000) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } this->collider.base.acFlags &= ~AC_ON; @@ -352,7 +352,7 @@ void EnBat_SetupDie(EnBat* this, PlayState* play) { } void EnBat_Die(EnBat* this, PlayState* play) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); this->actor.colorFilterTimer = 40; if (!(this->actor.flags & ACTOR_FLAG_8000)) { // Carried by arrow @@ -397,7 +397,7 @@ void EnBat_SetupStunned(EnBat* this) { if (this->actionFunc != EnBat_Stunned) { this->actor.shape.yOffset = 700.0f; this->actor.velocity.y = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.pos.y += 13.0f; } Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); 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 793054c330..d122c6d2e6 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -216,7 +216,7 @@ void EnBb_UpdateStateForFlying(EnBb* this) { Math_StepToF(&this->flameScaleY, 0.8f, 0.1f); Math_StepToF(&this->flameScaleX, 1.0f, 0.1f); EnBb_CheckForWall(this); - Math_StepToF(&this->actor.speedXZ, this->maxSpeed, 0.5f); + Math_StepToF(&this->actor.speed, this->maxSpeed, 0.5f); Math_ApproachS(&this->actor.shape.rot.y, this->targetYRotation, 5, 0x3E8); this->actor.world.rot.y = this->actor.shape.rot.y; } @@ -309,7 +309,7 @@ void EnBb_SetupDown(EnBb* this) { this->collider.base.atFlags |= AT_ON; this->timer = 140; this->collider.base.acFlags |= AC_ON; - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; this->flameScaleY = 0.0f; this->flameScaleX = 0.0f; this->actor.gravity = -2.0f; @@ -363,11 +363,11 @@ void EnBb_SetupDead(EnBb* this, PlayState* play) { func_800BE568(&this->actor, &this->collider); this->timer = 15; this->actor.shape.rot.x += 0x4E20; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_BUBLE_DEAD); Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x70); this->actor.velocity.y = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->bodyPartDrawStatus = BB_BODY_PART_DRAW_STATUS_DEAD; this->actor.gravity = -1.5f; @@ -422,12 +422,12 @@ void EnBb_SetupDamage(EnBb* this) { this->drawDmgEffScale = 0.4f; } else if (this->actor.colChkInfo.damageEffect == EN_BB_DMGEFF_STUN) { Actor_SetColorFilter(&this->actor, 0, 255, 0, 20); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else if (this->actor.colChkInfo.damageEffect == EN_BB_DMGEFF_HOOKSHOT) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20); - this->actor.speedXZ = 7.0f; + this->actor.speed = 7.0f; } this->actor.gravity = -1.0f; @@ -435,14 +435,14 @@ void EnBb_SetupDamage(EnBb* this) { } void EnBb_Damage(EnBb* this, PlayState* play) { - Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); - if ((this->actor.bgCheckFlags & 1) && (this->actor.speedXZ < 0.1f)) { + Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f); + if ((this->actor.bgCheckFlags & 1) && (this->actor.speed < 0.1f)) { EnBb_SetupDown(this); } } void EnBb_SetupFrozen(EnBb* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.velocity.y > 0.0f) { this->actor.velocity.y = 0.0f; } @@ -472,7 +472,7 @@ void EnBb_SetupWaitForRevive(EnBb* this) { this->actor.shape.rot.x = 0; this->actor.world.pos.y += 50.0f; this->timer = 200; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; this->actionFunc = EnBb_WaitForRevive; 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 faaf9c67ae..745ab6df51 100644 --- a/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c +++ b/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c @@ -273,7 +273,7 @@ void EnBbfall_SetupWaitForPlayer(EnBbfall* this) { this->actor.colChkInfo.health = sColChkInfoInit.health; this->actor.colorFilterTimer = 0; this->isBgCheckCollisionEnabled = false; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos); @@ -323,7 +323,7 @@ void EnBbfall_SetupFly(EnBbfall* this) { this->flameOpacity = 255; this->isBgCheckCollisionEnabled = true; this->actor.bgCheckFlags &= ~1; - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; this->actor.gravity = -1.0f; this->actionFunc = EnBbfall_Fly; } @@ -372,7 +372,7 @@ void EnBbfall_SetupDown(EnBbfall* this) { this->timer = 200; this->flameOpacity = 0; this->collider.base.acFlags |= AC_ON; - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; this->flameScaleY = 0.0f; this->flameScaleX = 0.0f; this->actor.gravity = -2.0f; @@ -430,11 +430,11 @@ void EnBbfall_SetupDead(EnBbfall* this, PlayState* play) { func_800BE5CC(&this->actor, &this->collider, 0); this->timer = 15; this->actor.shape.rot.x += 0x4E20; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_BUBLE_DEAD); Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x70); this->actor.velocity.y = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->bodyPartDrawStatus = BBFALL_BODY_PART_DRAW_STATUS_DEAD; this->actor.gravity = -1.5f; @@ -488,20 +488,20 @@ void EnBbfall_SetupDamage(EnBbfall* this) { this->drawDmgEffScale = 0.4f; } else if (this->actor.colChkInfo.damageEffect == EN_BBFALL_DMGEFF_STUN) { Actor_SetColorFilter(&this->actor, 0, 255, 0, 20); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else if (this->actor.colChkInfo.damageEffect == EN_BBFALL_DMGEFF_HOOKSHOT) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20); - this->actor.speedXZ = 7.0f; + this->actor.speed = 7.0f; } this->actionFunc = EnBbfall_Damage; } void EnBbfall_Damage(EnBbfall* this, PlayState* play) { - Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); - if ((this->actor.bgCheckFlags & 1) && (this->actor.speedXZ < 0.1f)) { + Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f); + if ((this->actor.bgCheckFlags & 1) && (this->actor.speed < 0.1f)) { if (EnBbfall_IsTouchingLava(this, play)) { EnBbfall_SetupSinkIntoLava(this); } else { @@ -511,7 +511,7 @@ void EnBbfall_Damage(EnBbfall* this, PlayState* play) { } void EnBbfall_SetupFrozen(EnBbfall* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.velocity.y > 0.0f) { this->actor.velocity.y = 0.0f; } 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 602d428020..ad45c3a669 100644 --- a/src/overlays/actors/ovl_En_Bee/z_en_bee.c +++ b/src/overlays/actors/ovl_En_Bee/z_en_bee.c @@ -173,7 +173,7 @@ void EnBee_FlyIdle(EnBee* this, PlayState* play) { } Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &nextPos), 1, 0x7D0, 0); - Math_ApproachF(&this->actor.speedXZ, 3.0f, 0.3f, 1.0f); + Math_ApproachF(&this->actor.speed, 3.0f, 0.3f, 1.0f); if ((this->attackDelayTimer == 0) && (this->actor.params != BEE_BEHAVIOR_IDLE)) { EnBee_SetupAttack(this); @@ -227,7 +227,7 @@ void EnBee_Attack(EnBee* this, PlayState* play) { Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &nextPos), 1, 0x1388, 0); Math_ApproachF(&this->actor.world.pos.y, nextPos.y, 0.3f, 3.0f); - Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.3f, 1.0f); + Math_ApproachF(&this->actor.speed, 5.0f, 0.3f, 1.0f); } void EnBee_UpdateDamage(EnBee* this, PlayState* play) { @@ -238,7 +238,7 @@ void EnBee_UpdateDamage(EnBee* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { Enemy_StartFinishingBlow(play, &this->actor); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 10, NA_SE_EN_CUTBODY); this->actor.colChkInfo.health = 0; SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EN_EXTINCT); 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 2aff9891d3..da6bc06a33 100644 --- a/src/overlays/actors/ovl_En_Bh/z_en_bh.c +++ b/src/overlays/actors/ovl_En_Bh/z_en_bh.c @@ -52,7 +52,7 @@ void func_80C22DEC(EnBh* this, PlayState* play) { s16 yRot; s16 zRot; - this->actor.speedXZ = 3.0f; + this->actor.speed = 3.0f; xDiff = this->pos.x - this->actor.world.pos.x; yDiff = this->pos.y - this->actor.world.pos.y; zDiff = this->pos.z - this->actor.world.pos.z; 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 af18596bfe..41fd002f51 100644 --- a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c +++ b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c @@ -408,7 +408,7 @@ void func_80A282C8(EnBigpamet* this, PlayState* play) { void func_80A28378(EnBigpamet* this) { this->actor.parent->params = GEKKO_INIT_SNAPPER; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80A283A0; } @@ -421,7 +421,7 @@ void func_80A283A0(EnBigpamet* this, PlayState* play) { void func_80A283F0(EnBigpamet* this) { Animation_PlayLoop(&this->skelAnime2, &object_tl_Anim_00823C); - this->actor.speedXZ = 1.0f; + this->actor.speed = 1.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.params = ENBIGPAMET_1; this->actionFunc = func_80A2844C; @@ -435,7 +435,7 @@ void func_80A2844C(EnBigpamet* this, PlayState* play) { 0x400); this->actor.world.rot.y = this->actor.shape.rot.y; } else if (this->actor.parent->params == GEKKO_JUMP_ON_SNAPPER) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else if (this->actor.parent->params == GEKKO_ON_SNAPPER) { func_80A28E40(this); } @@ -446,7 +446,7 @@ void func_80A284E4(EnBigpamet* this) { this->unk_29E = 0; this->unk_2A8 = 1.0f; this->unk_2A4 = 1.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_B_PAMET_VOICE); Actor_PlaySfx(this->actor.parent, NA_SE_EN_FROG_VOICE1); this->actionFunc = func_80A2855C; @@ -468,7 +468,7 @@ void func_80A2855C(EnBigpamet* this, PlayState* play) { void func_80A28618(EnBigpamet* this) { this->actor.draw = func_80A2966C; this->unk_2A8 = 0.5f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_CUTTER_ON); this->actionFunc = func_80A2866C; } @@ -499,7 +499,7 @@ void func_80A28708(EnBigpamet* this, PlayState* play) { } void func_80A28760(EnBigpamet* this) { - this->actor.speedXZ = 15.0f; + this->actor.speed = 15.0f; if (this->actor.bgCheckFlags & 8) { s16 temp_v1 = this->actor.yawTowardsPlayer - this->actor.wallYaw; @@ -561,7 +561,7 @@ void func_80A28970(EnBigpamet* this) { this->actor.shape.rot.z = 0; this->collider.base.atFlags &= ~AT_ON; this->collider.info.bumper.dmgFlags = 0xF7CFFFFF; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80A289C8; } @@ -618,7 +618,7 @@ void func_80A28B98(EnBigpamet* this, PlayState* play) { this->collider.base.acFlags &= ~AC_ON; this->actor.velocity.y = 22.0f; - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; if ((this->actor.draw == func_80A2966C) && (this->actionFunc != func_80A28DC0)) { this->actor.draw = EnBigpamet_Draw; @@ -659,7 +659,7 @@ void func_80A28D0C(EnBigpamet* this, PlayState* play) { void func_80A28D80(EnBigpamet* this) { this->actor.draw = func_80A2966C; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.shape.rot.x = 0; this->actor.shape.rot.z = 0; this->unk_2A8 = 0.0f; @@ -681,7 +681,7 @@ void func_80A28DC0(EnBigpamet* this, PlayState* play) { void func_80A28E40(EnBigpamet* this) { Animation_MorphToPlayOnce(&this->skelAnime2, &object_tl_Anim_000440, -2.0f); this->actor.flags |= ACTOR_FLAG_1; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80A28E98; } 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 f5aab7460f..c932959a02 100644 --- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c +++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c @@ -482,7 +482,7 @@ void EnBigpo_SetupWarpOut(EnBigpo* this) { this->rotVelocity = 0x2000; this->idleTimer = 32; this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DISAPPEAR); this->actionFunc = EnBigpo_WarpingOut; } @@ -556,7 +556,7 @@ void EnBigpo_IdleFlying(EnBigpo* this, PlayState* play) { this->hoverHeightCycleTimer = (this->hoverHeightCycleTimer == 0) ? 40 : (this->hoverHeightCycleTimer - 1); Math_StepToF(&this->savedHeight, player->actor.world.pos.y + 100.0f, 1.5f); this->actor.world.pos.y = (sin_rad(this->hoverHeightCycleTimer * (M_PI / 20)) * 10.0f) + this->savedHeight; - Math_StepToF(&this->actor.speedXZ, 3.0f, 0.2f); + Math_StepToF(&this->actor.speed, 3.0f, 0.2f); func_800B9010(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { this->unk208 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); @@ -580,7 +580,7 @@ void EnBigpo_SetupSpinUp(EnBigpo* this) { this->collider.base.atFlags |= AT_ON; this->rotVelocity = 0x800; this->actionFunc = EnBigpo_SpinningUp; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void EnBigpo_SpinningUp(EnBigpo* this, PlayState* play) { @@ -603,7 +603,7 @@ void EnBigpo_SpinAttack(EnBigpo* this, PlayState* play) { s16 yawDiff; SkelAnime_Update(&this->skelAnime); - Math_StepToF(&this->actor.speedXZ, 10.0f, 1.0f); + Math_StepToF(&this->actor.speed, 10.0f, 1.0f); Math_SmoothStepToF(&this->actor.world.pos.y, player->actor.world.pos.y, 0.3f, 7.5f, 1.0f); EnBigpo_UpdateSpin(this); yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y; @@ -628,7 +628,7 @@ void EnBigpo_SpinningDown(EnBigpo* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Math_SmoothStepToF(&this->actor.world.pos.y, player->actor.world.pos.y + 100.0f, 0.3f, 5.0f, 1.0f); - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f); + Math_StepToF(&this->actor.speed, 0.0f, 0.2f); if (Math_ScaledStepToS(&this->rotVelocity, 0, 0x200)) { // spin down complete, re-allow hittable this->collider.base.colType = COLTYPE_HIT3; @@ -649,14 +649,14 @@ void EnBigpo_HitStun(EnBigpo* this) { this->collider.base.acFlags &= ~AC_ON; func_800BE504(&this->actor, &this->collider); this->actionFunc = EnBigpo_CheckHealth; - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; } /* * check if just damaged or dead */ void EnBigpo_CheckHealth(EnBigpo* this, PlayState* play) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); if (SkelAnime_Update(&this->skelAnime)) { if (this->actor.colChkInfo.health == 0) { EnBigpo_SetupDeath(this); @@ -668,7 +668,7 @@ void EnBigpo_CheckHealth(EnBigpo* this, PlayState* play) { void EnBigpo_SetupDeath(EnBigpo* this) { this->idleTimer = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.hintId = TATL_HINT_ID_NONE; this->collider.base.ocFlags1 &= ~OC1_ON; 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 22ccb33940..a49f161f8a 100644 --- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c +++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c @@ -1020,11 +1020,11 @@ void EnBigslime_SetupMoveOnCeiling(EnBigslime* this) { this->actor.velocity.y = 20.0f; if (this->subCamId != SUB_CAM_ID_DONE) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->ceilingMoveTimer = 20; } else { this->ceilingMoveTimer = 320; - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; } this->wavySurfaceTimer = 0; @@ -1051,7 +1051,7 @@ void EnBigslime_MoveOnCeiling(EnBigslime* this, PlayState* play) { } else if ((this->actor.xzDistToPlayer < 250.0f) || (this->ceilingMoveTimer == 0)) { EnBigslime_SetupDrop(this); } else { - this->actor.speedXZ = (fabsf(Math_SinS(pitch)) * 3.0f) + 5.0f; + this->actor.speed = (fabsf(Math_SinS(pitch)) * 3.0f) + 5.0f; Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 10, 0x800, 0x80); this->gekkoRot.y = this->actor.world.rot.y; } @@ -1060,7 +1060,7 @@ void EnBigslime_MoveOnCeiling(EnBigslime* this, PlayState* play) { void EnBigslime_SetupDrop(EnBigslime* this) { this->actor.velocity.y = 0.0f; this->ceilingDropTimer = 30; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = EnBigslime_Drop; } @@ -1818,7 +1818,7 @@ void EnBigslime_SetupFreeze(EnBigslime* this) { s32 i; s32 j; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->freezeTimer = 40; if (this->actor.bgCheckFlags & 1) { this->actor.velocity.y = 0.0f; @@ -2026,7 +2026,7 @@ void EnBigslime_FrozenFall(EnBigslime* this, PlayState* play) { void EnBigslime_SetupJumpGekko(EnBigslime* this) { Animation_PlayLoop(&this->skelAnime, &gGekkoJumpForwardAnim); - this->actor.speedXZ = 8.0f; + this->actor.speed = 8.0f; this->jumpTimer = 100; this->actor.world.rot.y = this->gekkoRot.y; this->gekkoYaw = this->actor.yawTowardsPlayer + 0x8000; @@ -2050,9 +2050,9 @@ void EnBigslime_JumpGekko(EnBigslime* this, PlayState* play) { } if (!(this->actor.bgCheckFlags & 1) || ((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) { - this->actor.speedXZ = 8.0f; + this->actor.speed = 8.0f; } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if (Math_SmoothStepToS(&this->actor.world.rot.y, this->gekkoYaw, 5, 0x1000, 0x80) == 0) { @@ -2087,7 +2087,7 @@ void EnBigslime_JumpGekko(EnBigslime* this, PlayState* play) { void EnBigslime_SetupIdleLookAround(EnBigslime* this) { Animation_PlayOnce(&this->skelAnime, &gGekkoNervousIdleAnim); this->idleTimer = 60; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (BINANG_SUB(Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), this->gekkoRot.y) > 0) { this->gekkoYaw = this->gekkoRot.y + (Rand_Next() >> 20) + 0x2000; } else { @@ -2144,7 +2144,7 @@ void EnBigslime_IdleNoticePlayer(EnBigslime* this, PlayState* play) { void EnBigslime_SetupThrowMinislime(EnBigslime* this) { Animation_PlayOnce(&this->skelAnime, &gGekkoWindupPunchAnim); EnBigslime_GekkoSfxOutsideBigslime(this, NA_SE_EN_FROG_HOLD_SLIME); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = EnBigslime_ThrowMinislime; } @@ -2168,7 +2168,7 @@ void EnBigslime_SetupDamageGekko(EnBigslime* this, s32 isNotFrozen) { Animation_MorphToPlayOnce(&this->skelAnime, &gGekkoDamagedAnim, -3.0f); this->gekkoCollider.base.acFlags &= ~AC_ON; this->damageSpinTimer = 20; - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; this->actor.gravity = -2.0f; this->actor.velocity.y = 0.0f; if (isNotFrozen) { @@ -2192,7 +2192,7 @@ void EnBigslime_DamageGekko(EnBigslime* this, PlayState* play) { this->damageSpinTimer--; damageSpinTimer = CLAMP_MAX(this->damageSpinTimer, 10); this->gekkoRot.y += 0x300 * damageSpinTimer; - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); if (this->damageSpinTimer == 0) { EnBigslime_SetupCutscene(this); } @@ -2205,7 +2205,7 @@ void EnBigslime_SetupStunGekko(EnBigslime* this) { } this->actionFunc = EnBigslime_StunGekko; this->skelAnime.playSpeed = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void EnBigslime_StunGekko(EnBigslime* this, PlayState* play) { @@ -2227,7 +2227,7 @@ void EnBigslime_SetupCutsceneFormBigslime(EnBigslime* this) { this->actor.world.rot.x = -Actor_WorldPitchTowardPoint(&this->actor, &this->actor.home.pos); this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); this->actionFunc = EnBigslime_CutsceneFormBigslime; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void EnBigslime_CutsceneFormBigslime(EnBigslime* this, PlayState* play) { @@ -2245,7 +2245,7 @@ void EnBigslime_SetupFormBigslime(EnBigslime* this) { this->gekkoRot.x = 0x4000 - this->actor.world.rot.x; this->formBigslimeTimer = 0; this->wavySurfaceTimer = 0; - this->actor.speedXZ = 25.0f; + this->actor.speed = 25.0f; this->gekkoRot.y = this->actor.world.rot.y; this->formBigslimeCutsceneTimer = 2; @@ -2281,7 +2281,7 @@ void EnBigslime_FormBigslime(EnBigslime* this, PlayState* play) { Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos); this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Animation_PlayLoop(&this->skelAnime, &gGekkoSwimForwardAnim); this->formBigslimeCutsceneTimer--; Actor_PlaySfx(&this->actor, NA_SE_EN_B_SLIME_COMBINE); @@ -2324,7 +2324,7 @@ void EnBigslime_SetupCutsceneDefeat(EnBigslime* this, PlayState* play) { Animation_GetLastFrame(&gGekkoDamagedAnim.common), ANIMMODE_ONCE_INTERP, 0.0f); this->gekkoCollider.base.acFlags &= ~AC_ON; this->defeatTimer = 60; - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; this->actor.gravity = -2.0f; this->actor.velocity.y = 0.0f; EnBigslime_GekkoSfxOutsideBigslime(this, NA_SE_EN_FROG_DEAD); @@ -2363,7 +2363,7 @@ void EnBigslime_CutsceneDefeat(EnBigslime* this, PlayState* play) { this->defeatTimer--; defeatTimer = CLAMP_MAX(this->defeatTimer, 10); this->gekkoRot.y += 0x300 * defeatTimer; - if (Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f)) { + if (Math_StepToF(&this->actor.speed, 0.0f, 0.5f)) { EnBigslime_SetupGekkoDespawn(this, play); } else { // Continue for the camera to follow Gekko as it spins in defeat @@ -2533,7 +2533,7 @@ void EnBigslime_SetupCutscene(EnBigslime* this) { ActorCutscene_SetIntentToPlay(this->cutscene); this->actionFuncStored = this->actionFunc; this->actionFunc = EnBigslime_PlayCutscene; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void EnBigslime_PlayCutscene(EnBigslime* this, PlayState* play) { 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 bfedfda2c1..134eee5190 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -209,7 +209,7 @@ void func_80871058(EnBom* this, PlayState* play) { this->actor.velocity.y = -this->actor.velocity.y; } - if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) { + if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & 8)) { s16 yDiff = BINANG_SUB(this->actor.wallYaw, this->actor.world.rot.y); if (ABS_ALT(yDiff) > 0x4000) { @@ -219,12 +219,12 @@ void func_80871058(EnBom* this, PlayState* play) { Actor_PlaySfx(&this->actor, this->isPowderKeg ? NA_SE_EV_PUT_DOWN_WOODBOX : NA_SE_EV_BOMB_BOUND); Actor_MoveWithGravity(&this->actor); - this->actor.speedXZ *= 0.7f; + this->actor.speed *= 0.7f; this->actor.bgCheckFlags &= ~8; } if (!(this->actor.bgCheckFlags & 1)) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.08f); + Math_StepToF(&this->actor.speed, 0.0f, 0.08f); } else { Vec3f* sp58; u32 sp54 = func_800C99D4(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); @@ -251,33 +251,33 @@ void func_80871058(EnBom* this, PlayState* play) { Math_ApproachF(&this->actor.shape.yOffset, 700.0f, 1.0f, 700.0f); } - sp40 = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; - sp3C = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; + sp40 = Math_SinS(this->actor.world.rot.y) * this->actor.speed; + sp3C = Math_CosS(this->actor.world.rot.y) * this->actor.speed; Actor_GetSlopeDirection(this->actor.floorPoly, &slopeNormal, &downwardSlopeYaw); sp40 += 3.0f * slopeNormal.x; sp3C += 3.0f * slopeNormal.z; sp38 = sqrtf(SQ(sp40) + SQ(sp3C)); - if ((sp38 < this->actor.speedXZ) || + if ((sp38 < this->actor.speed) || (SurfaceType_GetSlope(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) == 1)) { if (sp38 > 16.0f) { - this->actor.speedXZ = 16.0f; + this->actor.speed = 16.0f; } else { - this->actor.speedXZ = sp38; + this->actor.speed = sp38; } this->actor.world.rot.y = Math_Atan2S_XY(sp3C, sp40); } - if (!Math_StepToF(&this->actor.speedXZ, 0.0f, sp58->x)) { + if (!Math_StepToF(&this->actor.speed, 0.0f, sp58->x)) { s16 temp = this->actor.world.rot.y; s32 pad; if (ABS_ALT(BINANG_SUB(this->actor.world.rot.y, this->actor.shape.rot.y)) > 0x4000) { temp = BINANG_ROT180(temp); } - Math_ScaledStepToS(&this->actor.shape.rot.y, temp, this->actor.speedXZ * 100.0f); - this->unk_1FA += (s16)(this->actor.speedXZ * 800.0f); + Math_ScaledStepToS(&this->actor.shape.rot.y, temp, this->actor.speed * 100.0f); + this->unk_1FA += (s16)(this->actor.speed * 800.0f); } if (this->actor.bgCheckFlags & 2) { @@ -444,7 +444,7 @@ void EnBom_Update(Actor* thisx, PlayState* play) { if (this->unk_1FC != 0) { this->unk_1FC--; - Math_ApproachZeroF(&thisx->speedXZ, 1.0f, 1.0f); + Math_ApproachZeroF(&thisx->speed, 1.0f, 1.0f); Actor_MoveWithGravity(thisx); Actor_UpdateBgCheckInfo(play, thisx, 35.0f, 10.0f, 36.0f, 4); if (this->unk_1FC == 0) { 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 cbcc402117..c01dea3048 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 @@ -184,7 +184,7 @@ void EnBomChu_WaitForRelease(EnBomChu* this, PlayState* play) { func_800B8EF4(play, &this->actor); this->isMoving = true; - this->actor.speedXZ = 8.0f; + this->actor.speed = 8.0f; this->movingSpeed = 8.0f; EnBomChu_SetupMove(this); } @@ -233,7 +233,7 @@ void EnBomChu_Move(EnBomChu* this, PlayState* play) { bgIdUpDown = bgIdSide = BGCHECK_SCENE; isFloorPolyValid = false; - this->actor.speedXZ = this->movingSpeed; + this->actor.speed = this->movingSpeed; lineLength = 2.0f * this->movingSpeed; if ((this->timer == 0) || (this->collider.base.acFlags & AC_HIT) || (this->collider.base.ocFlags1 & OC1_HIT)) { @@ -259,7 +259,7 @@ void EnBomChu_Move(EnBomChu* this, PlayState* play) { isFloorPolyValid = EnBomChu_UpdateFloorPoly(this, polySide, play); Math_Vec3f_Copy(&this->actor.world.pos, &posSide); this->actor.floorBgId = bgIdSide; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { if (this->actor.floorPoly != polyUpDown) { isFloorPolyValid = EnBomChu_UpdateFloorPoly(this, polyUpDown, play); @@ -269,7 +269,7 @@ void EnBomChu_Move(EnBomChu* this, PlayState* play) { this->actor.floorBgId = bgIdUpDown; } } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; lineLength *= 3.0f; Math_Vec3f_Copy(&posA, &posB); @@ -316,8 +316,8 @@ void EnBomChu_Move(EnBomChu* this, PlayState* play) { func_800B8F98(&this->actor, NA_SE_IT_BOMBCHU_MOVE - SFX_FLAG); } - if (this->actor.speedXZ != 0.0f) { - this->movingSpeed = this->actor.speedXZ; + if (this->actor.speed != 0.0f) { + this->movingSpeed = this->actor.speed; } } @@ -336,7 +336,7 @@ void EnBomChu_Explode(EnBomChu* this, PlayState* play) { } this->timer = 1; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.depthInWater > 0.0f) { for (i = 0; i < 40; i++) { @@ -441,7 +441,7 @@ void EnBomChu_HandleNonSceneCollision(EnBomChu* this, PlayState* play) { isFloorPolyValid = EnBomChu_UpdateFloorPoly(this, poly, play); Math_Vec3f_Copy(&this->actor.world.pos, &originalWorldPos); this->actor.floorBgId = bgId; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (isFloorPolyValid) { EnBomChu_UpdateRotation(this); 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 3157c9d5b1..5d4432de12 100644 --- a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c +++ b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c @@ -322,7 +322,7 @@ void func_80C0520C(EnBombers2* this, PlayState* play) { if ((fabsf(this->unk_29C.x - this->actor.world.pos.x) < 3.0f) && (fabsf(this->unk_29C.z - this->actor.world.pos.z) < 3.0f)) { this->unk_2B6 = this->actor.yawTowardsPlayer; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (fabsf(this->actor.world.rot.y - this->actor.yawTowardsPlayer) < 100.0f) { func_801477B4(play); this->talkState = TEXT_STATE_5; 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 fe0101ab4f..aff0579b12 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -168,7 +168,7 @@ void func_808AEAE0(EnBombf* this, PlayState* play) { } else if ((this->colliderCylinder.base.acFlags & AC_HIT) && ((this->colliderCylinder.info.acHitInfo->toucher.dmgFlags & 0x13828) || ((this->colliderCylinder.info.acHitInfo->toucher.dmgFlags & 0x200) && - (player->transformation == PLAYER_FORM_GORON) && (player->actor.speedXZ > 15.0f)))) { + (player->transformation == PLAYER_FORM_GORON) && (player->actor.speed > 15.0f)))) { this->colliderCylinder.base.acFlags &= ~AC_HIT; if (this->colliderCylinder.base.ac->category != ACTORCAT_BOSS) { bombf = (EnBombf*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOMBF, this->actor.world.pos.x, @@ -233,11 +233,11 @@ void func_808AEE3C(EnBombf* this, PlayState* play) { this->unk_204 = 1.0f; if (!(this->actor.bgCheckFlags & 1)) { - Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.025f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.025f, 0.0f); return; } - Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 1.5f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 1.5f, 0.0f); if (this->actor.bgCheckFlags & 2) { func_800B8EF4(play, &this->actor); if (this->actor.velocity.y < -6.0f) { @@ -345,7 +345,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) { this->actor.velocity.y = -this->actor.velocity.y; } - if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) { + if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & 8)) { s16 yDiff = BINANG_SUB(this->actor.wallYaw, this->actor.world.rot.y); if (ABS_ALT(yDiff) > 0x4000) { @@ -357,7 +357,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) { DREG(6) = 1; Actor_UpdateBgCheckInfo(play, &this->actor, 5.0f, 10.0f, 0.0f, 0x1F); DREG(6) = 0; - this->actor.speedXZ *= 0.7f; + this->actor.speed *= 0.7f; this->actor.bgCheckFlags &= ~8; } 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 5f852993ba..042b4e332b 100644 --- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c +++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c @@ -215,7 +215,7 @@ s32 func_80C012FC(EnBomjimb* this, PlayState* play) { if (!Play_InCsMode(play) && (this->actor.xzDistToPlayer < 40.0f) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 50.0f) && (play->msgCtx.msgLength == 0)) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; func_80C02740(this, play); return true; } @@ -368,7 +368,7 @@ void func_80C01A24(EnBomjimb* this, PlayState* play) { if ((this->unk_2E4 != NULL) && (this->unk_2E4->update != NULL)) { ((EnNiw*)this->unk_2E4)->unk2BC.z = 90000.0f; } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_2E4 = NULL; this->actor.gravity = -2.0f; func_80C02108(this); @@ -380,7 +380,7 @@ void func_80C01A24(EnBomjimb* this, PlayState* play) { } if (this->unk_2C0 != 0) { - Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.5f, 2.0f); + Math_ApproachF(&this->actor.speed, 6.0f, 0.5f, 2.0f); } if ((this->unk_2C0 != 0) && !(this->actor.bgCheckFlags & 1)) { @@ -395,13 +395,13 @@ void func_80C01B40(EnBomjimb* this) { } void func_80C01B74(EnBomjimb* this, PlayState* play) { - Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.5f, 2.0f); + Math_ApproachF(&this->actor.speed, 6.0f, 0.5f, 2.0f); if ((this->collider.base.acFlags & AC_HIT) || (this->actor.bgCheckFlags & 1)) { this->collider.base.acFlags &= ~AC_HIT; if ((this->unk_2E4 != NULL) && (this->unk_2E4->update != NULL)) { ((EnNiw*)this->unk_2E4)->unk2BC.z = 90000.0f; } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_2E4 = NULL; this->actor.gravity = -2.0f; func_80C02108(this); @@ -419,7 +419,7 @@ void func_80C01C18(EnBomjimb* this, PlayState* play) { this->unk_294.z = this->unk_2E4->world.pos.z; } } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_2CA = 2; this->actionFunc = func_80C01CD0; } @@ -553,7 +553,7 @@ void func_80C0217C(EnBomjimb* this, PlayState* play) { return; } - Math_ApproachF(&this->actor.speedXZ, 8.0f, 0.5f, 2.0f); + Math_ApproachF(&this->actor.speed, 8.0f, 0.5f, 2.0f); Math_Vec3f_Copy(&sp74, &this->actor.world.pos); sp74.x += Math_SinS(this->actor.world.rot.y) * 50.0f; @@ -611,7 +611,7 @@ void func_80C0217C(EnBomjimb* this, PlayState* play) { void func_80C0250C(EnBomjimb* this) { func_80C0113C(this, 15, 1.0f); this->unk_2D4 = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_2D6 = BINANG_ROT180(this->actor.yawTowardsPlayer); func_80C012E0(this); this->unk_2CA = 6; @@ -640,7 +640,7 @@ void func_80C02570(EnBomjimb* this, PlayState* play) { void func_80C0267C(EnBomjimb* this) { func_80C012E0(this); func_80C0113C(this, 8, 1.0f); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->unk_2AE = 40; this->unk_2C2 = 0; 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 eb3365b836..05072da729 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -241,7 +241,7 @@ void func_8091C794(EnButte* this, PlayState* play) { s16 yaw; func_8091C524(this); - Math_SmoothStepToF(&this->actor.speedXZ, sp4C->unk_04, sp4C->unk_08, sp4C->unk_0C, 0.0f); + Math_SmoothStepToF(&this->actor.speed, sp4C->unk_04, sp4C->unk_08, sp4C->unk_0C, 0.0f); if (this->unk_24F == 1) { distSq = SQ(100.0f); @@ -276,9 +276,8 @@ void func_8091C794(EnButte* this, PlayState* play) { func_8091C6B4(this); - playSpeed = - (((this->actor.speedXZ * 0.5f) + (Rand_ZeroOne() * 0.2f)) + ((1.0f - Math_SinS(this->unk_258)) * 0.15f)) + - ((1.0f - Math_SinS(this->unk_256)) * 0.3f) + sp38; + playSpeed = (((this->actor.speed * 0.5f) + (Rand_ZeroOne() * 0.2f)) + ((1.0f - Math_SinS(this->unk_258)) * 0.15f)) + + ((1.0f - Math_SinS(this->unk_256)) * 0.3f) + sp38; this->skelAnime.playSpeed = CLAMP(playSpeed, 0.2f, 1.5f); SkelAnime_Update(&this->skelAnime); @@ -318,7 +317,7 @@ void func_8091CBB4(EnButte* this, PlayState* play) { s16 yaw; func_8091C5EC(this); - Math_SmoothStepToF(&this->actor.speedXZ, sp5C->unk_04, sp5C->unk_08, sp5C->unk_0C, 0.0f); + Math_SmoothStepToF(&this->actor.speed, sp5C->unk_04, sp5C->unk_08, sp5C->unk_0C, 0.0f); sp40 = 0.0f; if ((this->unk_24E != 0) && (this->unk_24C < 12)) { @@ -344,7 +343,7 @@ void func_8091CBB4(EnButte* this, PlayState* play) { func_8091C6B4(this); - playSpeed = ((this->actor.speedXZ * 0.5f) + (Rand_ZeroOne() * 0.2f) + ((1.0f - Math_SinS(this->unk_258)) * 0.15f)) + + playSpeed = ((this->actor.speed * 0.5f) + (Rand_ZeroOne() * 0.2f) + ((1.0f - Math_SinS(this->unk_258)) * 0.15f)) + ((1.0f - Math_SinS(this->unk_256)) * 0.3f) + sp40; this->skelAnime.playSpeed = CLAMP(playSpeed, 0.2f, 1.5f); SkelAnime_Update(&this->skelAnime); @@ -356,7 +355,7 @@ void func_8091CBB4(EnButte* this, PlayState* play) { distSq = Math3D_XZDistanceSquared(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x, this->actor.home.pos.z); - if ((player->heldItemAction != PLAYER_IA_STICK) || !(fabsf(player->actor.speedXZ) < 1.8f) || (this->unk_252 > 0) || + if ((player->heldItemAction != PLAYER_IA_STICK) || !(fabsf(player->actor.speed) < 1.8f) || (this->unk_252 > 0) || !(distSq < SQ(320.0f))) { func_8091C748(this); } else if ((distSq > SQ(240.0f)) && diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index bfc8281942..0353c6b4a8 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 @@ -549,7 +549,7 @@ void EnClearTag_UpdateCamera(EnClearTag* this, PlayState* play) { player->actor.world.pos.z = -950.0f; } - player->actor.speedXZ = 0.0f; + player->actor.speed = 0.0f; if (this->activeTimer == 0) { this->cameraState = 1; } @@ -578,7 +578,7 @@ void EnClearTag_UpdateCamera(EnClearTag* this, PlayState* play) { player->actor.world.pos.z = -950.0f; } - player->actor.speedXZ = 0.0f; + player->actor.speed = 0.0f; if (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) { mainCam = Play_GetCamera(play, CAM_ID_MAIN); mainCam->eye = this->subCamEye; 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 61304db8e8..9dda146c39 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 @@ -117,10 +117,10 @@ void func_80AFDE00(EnColMan* this, PlayState* play) { if (this->actor.bgCheckFlags & 1) { if (this->actor.params == EN_COL_MAN_HEART_PIECE) { this->actor.params = EN_COL_MAN_RECOVERY_HEART; - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; this->actor.velocity.y = 8.0f; } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } } if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_56_02)) { @@ -164,7 +164,7 @@ void func_80AFDFB4(EnColMan* this, PlayState* play) { if ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f)) { if (!this->hasSetRandomValues) { this->actor.world.rot.y = randPlusMinusPoint5Scaled(30000.0f); - this->actor.speedXZ = 2.0f + BREG(56) + Rand_ZeroFloat(2.0f); + this->actor.speed = 2.0f + BREG(56) + Rand_ZeroFloat(2.0f); this->actor.velocity.y = 12.0f + BREG(57) + Rand_ZeroFloat(5.0f); this->hasSetRandomValues = true; Actor_PlaySfx(&this->actor, NA_SE_EN_ANSATSUSYA_ROCK); 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 43f6349408..9e8234c591 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -163,7 +163,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); onInitialAnimFrame = Animation_OnFrame(&this->skelAnime, 0.0f); - this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 3.0f; + this->actor.speed = (Rand_ZeroOne() * 1.5f) + 3.0f; if ((this->actor.parent != NULL) && (this->actor.parent->home.rot.z == 0)) { this->actor.home.pos.x = this->actor.parent->world.pos.x; @@ -233,7 +233,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) { void EnCrow_SetupDiveAttack(EnCrow* this) { this->timer = 300; this->actionFunc = EnCrow_DiveAttack; - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; this->skelAnime.playSpeed = 2.0f; } @@ -295,7 +295,7 @@ void EnCrow_CheckIfFrozen(EnCrow* this, PlayState* play) { void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) { f32 scale; - this->actor.speedXZ *= Math_CosS(this->actor.world.rot.x); + this->actor.speed *= Math_CosS(this->actor.world.rot.x); this->actor.velocity.y = 0.0f; Animation_Change(&this->skelAnime, &gGuayFlyAnim, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -3.0f); this->actor.shape.yOffset = 0.0f; @@ -325,7 +325,7 @@ void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) { Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40); if (this->actor.flags & ACTOR_FLAG_8000) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } this->collider.base.acFlags &= ~AC_ON; @@ -335,7 +335,7 @@ void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) { } void EnCrow_Damaged(EnCrow* this, PlayState* play) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); this->actor.colorFilterTimer = 40; if (!(this->actor.flags & ACTOR_FLAG_8000)) { @@ -385,7 +385,7 @@ void EnCrow_Die(EnCrow* this, PlayState* play) { void EnCrow_SetupTurnAway(EnCrow* this) { this->timer = 100; this->pitchTarget = -0x1000; - this->actor.speedXZ = 3.5f; + this->actor.speed = 3.5f; this->yawTarget = this->actor.yawTowardsPlayer + 0x8000; this->skelAnime.playSpeed = 2.0f; if (this->actor.colChkInfo.damageEffect == GUAY_DMGEFF_STUN) { 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 6a75aedc34..911e711c15 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -838,7 +838,7 @@ void EnDekubaba_SetupPrunedSomersaultDie(EnDekubaba* this) { this->actor.gravity = -0.8f; this->actor.velocity.y = 4.0f; this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000; - this->actor.speedXZ = this->size * 3.0f; + this->actor.speed = this->size * 3.0f; this->collider.base.acFlags &= ~AC_ON; this->actor.flags |= ACTOR_FLAG_10 | ACTOR_FLAG_20; this->actionFunc = EnDekubaba_PrunedSomersaultDie; @@ -851,7 +851,7 @@ void EnDekubaba_PrunedSomersaultDie(EnDekubaba* this, PlayState* play) { f32 deltaY; f32 deltaZ; - Math_StepToF(&this->actor.speedXZ, 0.0f, this->size * 0.1f); + Math_StepToF(&this->actor.speed, 0.0f, this->size * 0.1f); if (this->timer == 0) { Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C); @@ -865,7 +865,7 @@ void EnDekubaba_PrunedSomersaultDie(EnDekubaba* this, PlayState* play) { this->actor.scale.z = 0.0f; this->actor.scale.y = 0.0f; this->actor.scale.x = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4); EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, this->size * 3.0f, 0, (s32)(this->size * 12.0f), (s32)(this->size * 5.0f), 15, HAHEN_OBJECT_DEFAULT, 10, NULL); 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 15a2401f86..580d4bb81c 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -411,7 +411,7 @@ void func_808BDFB8(EnDekunuts* this, PlayState* play) { this->unk_18C = 1; } - Math_StepToF(&this->actor.speedXZ, 7.5f, 1.0f); + Math_StepToF(&this->actor.speed, 7.5f, 1.0f); if (!Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_192, 1, 0xE38, 0xB6)) { if (this->actor.bgCheckFlags & 0x20) { this->unk_192 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); @@ -435,7 +435,7 @@ void func_808BDFB8(EnDekunuts* this, PlayState* play) { (fabsf(this->actor.world.pos.y - this->actor.home.pos.y) < 2.0f)) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.flags &= ~ACTOR_FLAG_20; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; func_808BDC9C(this); } else if (this->unk_190 == 0) { func_808BE1CC(this); @@ -445,7 +445,7 @@ void func_808BDFB8(EnDekunuts* this, PlayState* play) { void func_808BE1CC(EnDekunuts* this) { Animation_PlayLoop(&this->skelAnime, &gDekuScrubPantingAnim); this->unk_190 = 3; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->unk_18D != 0) { this->unk_18D--; } @@ -468,7 +468,7 @@ void func_808BE22C(EnDekunuts* this, PlayState* play) { void func_808BE294(EnDekunuts* this, s32 arg1) { Animation_MorphToPlayOnce(&this->skelAnime, &gDekuScrubDamageAnim, -3.0f); if (this->actor.params == ENDEKUNUTS_GET_FF00_0) { - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; if (arg1 != 0) { func_800BE504(&this->actor, &this->collider); } @@ -483,14 +483,14 @@ void func_808BE294(EnDekunuts* this, s32 arg1) { } void func_808BE358(EnDekunuts* this, PlayState* play) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f); + Math_StepToF(&this->actor.speed, 0.0f, 1.0f); if (SkelAnime_Update(&this->skelAnime)) { func_808BE484(this); } } void func_808BE3A8(EnDekunuts* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.velocity.y > 0.0f) { this->actor.velocity.y = 0.0f; } @@ -520,7 +520,7 @@ void func_808BE3FC(EnDekunuts* this, PlayState* play) { void func_808BE484(EnDekunuts* this) { Animation_PlayOnce(&this->skelAnime, &gDekuScrubDieAnim); this->actionFunc = func_808BE4D4; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_DEAD); } 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 fe8143b15e..4470505ec8 100644 --- a/src/overlays/actors/ovl_En_Dg/z_en_dg.c +++ b/src/overlays/actors/ovl_En_Dg/z_en_dg.c @@ -338,15 +338,15 @@ void EnDg_MoveAlongPath(EnDg* this, PlayState* play) { if ((this->index == ENDG_INDEX_SWAMP_SPIDER_HOUSE) || ((this->index == ENDG_INDEX_ROMANI_RANCH) && (play->sceneId == SCENE_OMOYA))) { - Math_ApproachF(&this->actor.speedXZ, 1.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 1.0f, 0.2f, 1.0f); } else if (this->index == ENDG_INDEX_ROMANI_RANCH) { - Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 3.5f, 0.2f, 1.0f); } else if (play->sceneId == SCENE_CLOCKTOWER) { - Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 3.5f, 0.2f, 1.0f); } else if (sRacetrackDogInfo[this->index].textId & 0x11) { - Math_ApproachF(&this->actor.speedXZ, 1.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 1.0f, 0.2f, 1.0f); } else { - Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 3.5f, 0.2f, 1.0f); } } else { Actor_Kill(&this->actor); @@ -355,7 +355,7 @@ void EnDg_MoveAlongPath(EnDg* this, PlayState* play) { void EnDg_SpawnFloorDustRing(EnDg* this, PlayState* play) { s16 curFrame = this->skelAnime.curFrame; - s16 mod = (this->actor.speedXZ > 6.0f) ? 2 : 3; + s16 mod = (this->actor.speed > 6.0f) ? 2 : 3; Vec3f pos; if (((this->index + curFrame) % mod) == 0) { @@ -492,7 +492,7 @@ void EnDg_TryPickUp(EnDg* this, PlayState* play) { EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_SIT_DOWN); this->actor.flags &= ~ACTOR_FLAG_1; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (Player_GetMask(play) == PLAYER_MASK_TRUTH) { this->actor.flags |= ACTOR_FLAG_10000; func_800B8614(&this->actor, play, 100.0f); @@ -620,7 +620,7 @@ void EnDg_ChooseActionForForm(EnDg* this, PlayState* play) { case PLAYER_FORM_ZORA: this->dogFlags &= ~DOG_FLAG_JUMP_ATTACKING; - if ((this->behavior != DOG_BEHAVIOR_ZORA) && (player->actor.speedXZ > 1.0f)) { + if ((this->behavior != DOG_BEHAVIOR_ZORA) && (player->actor.speed > 1.0f)) { this->behavior = DOG_BEHAVIOR_ZORA; EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); this->actionFunc = EnDg_ApproachPlayer; @@ -634,7 +634,7 @@ void EnDg_ChooseActionForForm(EnDg* this, PlayState* play) { case PLAYER_FORM_GORON: this->dogFlags &= ~DOG_FLAG_JUMP_ATTACKING; - if ((this->behavior != DOG_BEHAVIOR_GORON) && (player->actor.speedXZ > 1.0f)) { + if ((this->behavior != DOG_BEHAVIOR_GORON) && (player->actor.speed > 1.0f)) { this->behavior = DOG_BEHAVIOR_GORON; EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK_BACKWARDS); this->timer = 50; @@ -649,7 +649,7 @@ void EnDg_ChooseActionForForm(EnDg* this, PlayState* play) { case PLAYER_FORM_DEKU: this->dogFlags &= ~DOG_FLAG_JUMP_ATTACKING; - if ((this->behavior != DOG_BEHAVIOR_DEKU) && (player->actor.speedXZ > 1.0f)) { + if ((this->behavior != DOG_BEHAVIOR_DEKU) && (player->actor.speed > 1.0f)) { this->behavior = DOG_BEHAVIOR_DEKU; EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); this->actionFunc = EnDg_ApproachPlayerToAttack; @@ -733,7 +733,7 @@ void EnDg_BackAwayFromGoron(EnDg* this, PlayState* play) { } this->actor.world.rot.y = this->actor.shape.rot.y; - Math_ApproachF(&this->actor.speedXZ, -1.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, -1.5f, 0.2f, 1.0f); Actor_MoveWithGravity(&this->actor); } @@ -760,18 +760,18 @@ void EnDg_RunAwayFromGoron(EnDg* this, PlayState* play) { Math_SmoothStepToS(&this->actor.world.rot.y, yRotation, 4, 0x3E8, 1); this->actor.world.rot.y = this->actor.shape.rot.y; - if (player->actor.speedXZ != 0.0f) { - Math_ApproachF(&this->actor.speedXZ, player->actor.speedXZ, 0.2f, 1.0f); + if (player->actor.speed != 0.0f) { + Math_ApproachF(&this->actor.speed, player->actor.speed, 0.2f, 1.0f); } else { - Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 3.5f, 0.2f, 1.0f); } } else { EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_BARK); this->actionFunc = EnDg_BarkAtGoron; } - if (this->actor.speedXZ > 7.0f) { - this->actor.speedXZ = 7.0f; + if (this->actor.speed > 7.0f) { + this->actor.speed = 7.0f; } Actor_MoveWithGravity(&this->actor); @@ -811,7 +811,7 @@ void EnDg_ApproachPlayerToAttack(EnDg* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; if (this->actor.xzDistToPlayer < 70.0f) { - Math_ApproachZeroF(&this->actor.speedXZ, 0.2f, 1.0f); + Math_ApproachZeroF(&this->actor.speed, 0.2f, 1.0f); if (Animation_OnFrame(&this->skelAnime, 7.0f)) { s16 yawDiff = ABS_ALT(player->actor.shape.rot.y - this->actor.shape.rot.y); @@ -827,7 +827,7 @@ void EnDg_ApproachPlayerToAttack(EnDg* this, PlayState* play) { } } else { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xC00); - Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 5.0f, 0.2f, 1.0f); } Actor_MoveWithGravity(&this->actor); @@ -841,7 +841,7 @@ void EnDg_ApproachPlayerToAttack(EnDg* this, PlayState* play) { */ void EnDg_RunAfterAttacking(EnDg* this, PlayState* play) { this->dogFlags &= ~DOG_FLAG_BOUNCED; - Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.1f, 0.5f); + Math_ApproachF(&this->actor.speed, 3.5f, 0.1f, 0.5f); Actor_MoveWithGravity(&this->actor); if (DECR(this->attackTimer) == 0) { this->attackTimer = 20; @@ -893,7 +893,7 @@ void EnDg_JumpAttack(EnDg* this, PlayState* play) { this->dogFlags &= ~DOG_FLAG_JUMP_ATTACKING; this->dogFlags |= DOG_FLAG_BOUNCED; this->collider.base.atFlags &= ~AT_BOUNCED; - this->actor.speedXZ *= -1.0f; + this->actor.speed *= -1.0f; EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); this->actionFunc = EnDg_RunAfterAttacking; return; @@ -919,9 +919,9 @@ void EnDg_JumpAttack(EnDg* this, PlayState* play) { sAnimationInfo[DOG_ANIM_JUMP_ATTACK].playSpeed = 1.2f; this->actor.velocity.y = 2.0f * rand + 3.0f; - this->actor.speedXZ = 8.0f + rand; + this->actor.speed = 8.0f + rand; } else if (curFrame > 20) { - Math_ApproachF(&this->actor.speedXZ, 2.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 2.5f, 0.2f, 1.0f); } if (curFrame > 23) { @@ -949,7 +949,7 @@ void EnDg_WalkToPlayer(EnDg* this, PlayState* play) { } else { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xC00); this->actor.world.rot.y = this->actor.shape.rot.y; - Math_ApproachF(&this->actor.speedXZ, 2.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 2.0f, 0.2f, 1.0f); Actor_MoveWithGravity(&this->actor); } @@ -996,12 +996,12 @@ void EnDg_ApproachPlayer(EnDg* this, PlayState* play) { this->actionFunc = EnDg_SitNextToPlayer; } 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); + Math_ApproachF(&this->actor.speed, 1.5f, 0.2f, 1.0f); } else { - Math_ApproachF(&this->actor.speedXZ, player->actor.speedXZ, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, player->actor.speed, 0.2f, 1.0f); } } else { - Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 3.5f, 0.2f, 1.0f); } EnDg_CheckForBremenMaskMarch(this, play); @@ -1033,7 +1033,7 @@ void EnDg_SlowlyBackUpBeforeAttacking(EnDg* this, PlayState* play) { } this->actor.world.rot.y = this->actor.shape.rot.y; - Math_ApproachF(&this->actor.speedXZ, -1.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, -1.0f, 0.2f, 1.0f); Actor_MoveWithGravity(&this->actor); EnDg_PlaySfxWalk(this); EnDg_PlaySfxGrowl(this, 4.0f); @@ -1059,7 +1059,7 @@ void EnDg_BackAwayFromPlayer(EnDg* this, PlayState* play) { } this->actor.world.rot.y = this->actor.shape.rot.y; - Math_ApproachF(&this->actor.speedXZ, -2.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, -2.0f, 0.2f, 1.0f); Actor_MoveWithGravity(&this->actor); } @@ -1110,7 +1110,7 @@ void EnDg_SetupSwim(EnDg* this, PlayState* play) { this->actionFunc = EnDg_Swim; } - Math_ApproachF(&this->actor.speedXZ, 1.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 1.0f, 0.2f, 1.0f); Actor_MoveWithGravity(&this->actor); } @@ -1183,13 +1183,13 @@ void EnDg_Swim(EnDg* this, PlayState* play) { this->timer = Rand_S16Offset(60, 60); Actor_PlaySfx(&this->actor, NA_SE_EV_OUT_OF_WATER); EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); - Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 3.5f, 0.2f, 1.0f); this->actionFunc = EnDg_IdleMove; } Math_SmoothStepToS(&this->actor.world.rot.y, yRotation, 4, 0x3E8, 1); this->actor.shape.rot.y = this->actor.world.rot.y; - Math_ApproachF(&this->actor.speedXZ, 0.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 0.5f, 0.2f, 1.0f); Actor_MoveWithGravity(&this->actor); } @@ -1230,9 +1230,9 @@ void EnDg_JumpOutOfWater(EnDg* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EV_OUT_OF_WATER); EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); this->actionFunc = EnDg_IdleMove; - Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 3.5f, 0.2f, 1.0f); } else { - Math_ApproachF(&this->actor.speedXZ, 0.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 0.5f, 0.2f, 1.0f); } Actor_MoveWithGravity(&this->actor); @@ -1266,7 +1266,7 @@ void EnDg_Thrown(EnDg* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EV_MONKEY_WALK); } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.gravity = -3.0f; if (player->transformation == PLAYER_FORM_HUMAN) { EnDg_TryPickUp(this, play); 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 53889ac175..f92bfb4942 100644 --- a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c +++ b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c @@ -593,7 +593,7 @@ void func_8089B7B0(EnDinofos* this) { Animation_MorphToLoop(&this->skelAnime, &object_dinofos_Anim_002E40, -4.0f); this->unk_290 = (s32)Rand_ZeroFloat(20.0f) + 40; this->unk_292 = 30; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; func_8089AD70(this); this->actionFunc = func_8089B834; @@ -625,9 +625,9 @@ void func_8089B8B0(EnDinofos* this, PlayState* play) { phi_f0 = 70.0f; } if (this->actor.xzDistToPlayer <= phi_f0) { - this->actor.speedXZ = -3.5f; + this->actor.speed = -3.5f; } else { - this->actor.speedXZ = 3.5f; + this->actor.speed = 3.5f; } } @@ -650,9 +650,9 @@ void func_8089B98C(EnDinofos* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x100); this->actor.world.rot.y = this->actor.shape.rot.y; if (this->actor.xzDistToPlayer <= phi_f0) { - Math_StepToF(&this->actor.speedXZ, -7.0f, 0.5f); + Math_StepToF(&this->actor.speed, -7.0f, 0.5f); } else { - Math_StepToF(&this->actor.speedXZ, 7.0f, 0.5f); + Math_StepToF(&this->actor.speed, 7.0f, 0.5f); } if (this->actor.xzDistToPlayer < 80.0f) { @@ -674,7 +674,7 @@ void func_8089B98C(EnDinofos* this, PlayState* play) { void func_8089BAC0(EnDinofos* this) { if (this->actionFunc != func_8089BB60) { Animation_MorphToLoop(&this->skelAnime, &object_dinofos_Anim_000580, -4.0f); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if (BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y) > 0) { this->unk_28C = BINANG_ADD(this->actor.shape.rot.y, 0x4000); @@ -701,20 +701,20 @@ void func_8089BBB4(EnDinofos* this, PlayState* play) { s16 rotY = player->actor.shape.rot.y - this->actor.shape.rot.y; if (ABS_ALT(rotY) > 0x7800) { if (Rand_ZeroOne() < 0.5f) { - this->actor.speedXZ = 6.0f; + this->actor.speed = 6.0f; } else { - this->actor.speedXZ = -6.0f; + this->actor.speed = -6.0f; } } else if (rotY >= 0) { - this->actor.speedXZ = 6.0f; + this->actor.speed = 6.0f; } else { - this->actor.speedXZ = -6.0f; + this->actor.speed = -6.0f; } if (this->actionFunc == func_8089D1E0) { - this->skelAnime.playSpeed = this->actor.speedXZ * 0.166666671634f; + this->skelAnime.playSpeed = this->actor.speed * 0.166666671634f; } else { - Animation_Change(&this->skelAnime, &object_dinofos_Anim_00D62C, this->actor.speedXZ * 0.166666671634f, 0.0f, + Animation_Change(&this->skelAnime, &object_dinofos_Anim_00D62C, this->actor.speed * 0.166666671634f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f); } @@ -734,7 +734,7 @@ void func_8089BD28(EnDinofos* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xBB8); if (!func_8089AE00(this, play)) { if (this->actor.bgCheckFlags & 8) { - if (this->actor.speedXZ >= 0.0f) { + if (this->actor.speed >= 0.0f) { phi_v0 = BINANG_ADD(this->actor.shape.rot.y, 0x4000); } else { phi_v0 = BINANG_SUB(this->actor.shape.rot.y, 0x4000); @@ -742,23 +742,23 @@ void func_8089BD28(EnDinofos* this, PlayState* play) { phi_v0 = this->actor.wallYaw - phi_v0; if (ABS_ALT(phi_v0) > 0x4000) { - this->actor.speedXZ *= -0.8f; - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ -= 0.5f; + this->actor.speed *= -0.8f; + if (this->actor.speed < 0.0f) { + this->actor.speed -= 0.5f; } else { - this->actor.speedXZ += 0.5f; + this->actor.speed += 0.5f; } } } phi_v0 = BINANG_SUB(player->actor.shape.rot.y, this->actor.shape.rot.y); if ((phi_v0 >= 0) && (phi_v0 < 0x7800)) { - this->actor.speedXZ += 0.125f; + this->actor.speed += 0.125f; } else if ((phi_v0 < 0) && (phi_v0 > -0x7800)) { - this->actor.speedXZ -= 0.125f; + this->actor.speed -= 0.125f; } - if (this->actor.speedXZ > 0.0f) { + if (this->actor.speed > 0.0f) { this->skelAnime.playSpeed = 1.0f; } else { this->skelAnime.playSpeed = -1.0f; @@ -804,7 +804,7 @@ void func_8089C024(EnDinofos* this, s32 arg1) { } } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_290 = arg1; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = func_8089C0DC; @@ -825,13 +825,13 @@ void func_8089C0DC(EnDinofos* this, PlayState* play) { void func_8089C164(EnDinofos* this) { if (this->unk_290 == 2) { - this->actor.speedXZ = -10.0f; + this->actor.speed = -10.0f; this->actor.velocity.y = 9.0f; this->colliderJntSph.base.acFlags |= AC_ON; } else { this->actor.velocity.y = 12.5f; if (this->unk_290 == 0) { - this->actor.speedXZ = 4.5f; + this->actor.speed = 4.5f; } } @@ -849,7 +849,7 @@ void func_8089C1F8(EnDinofos* this, PlayState* play) { void func_8089C244(EnDinofos* this) { this->actor.bgCheckFlags &= ~1; - this->actor.speedXZ = 8.0f; + this->actor.speed = 8.0f; this->actor.velocity.y = 16.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_JUMP); this->unk_290 = 0; @@ -880,13 +880,13 @@ void func_8089C398(EnDinofos* this) { this->skelAnime.endFrame = Animation_GetLastFrame(&object_dinofos_Anim_0025B4); } - if (this->actor.speedXZ < 0.0f) { + if (this->actor.speed < 0.0f) { this->unk_290 = 1; } else { this->unk_290 = 0; } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; func_8089AD70(this); Actor_PlaySfx(&this->actor, NA_SE_EN_BOMCHU_WALK); this->actionFunc = func_8089C44C; @@ -909,7 +909,7 @@ void func_8089C4F8(EnDinofos* this) { Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_CRY); this->unk_290 = 0; this->unk_292 = -1; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = func_8089C56C; } @@ -941,14 +941,14 @@ void func_8089C690(EnDinofos* this) { if (this->actionFunc != func_8089C2A8) { this->actor.world.rot.y = this->actor.shape.rot.y; } else { - this->actor.speedXZ = 3.0f; + this->actor.speed = 3.0f; } this->actionFunc = func_8089C724; } void func_8089C724(EnDinofos* this, PlayState* play) { if (this->actor.bgCheckFlags & 1) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); } if (SkelAnime_Update(&this->skelAnime)) { @@ -957,7 +957,7 @@ void func_8089C724(EnDinofos* this, PlayState* play) { } void func_8089C784(EnDinofos* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.velocity.y > 0.0f) { this->actor.velocity.y = 0.0f; } @@ -989,7 +989,7 @@ void func_8089C87C(EnDinofos* this, s32 arg1) { Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_00D21C); func_800BE5CC(&this->actor, &this->colliderJntSph, arg1); this->actor.shape.rot.y = BINANG_ROT180(this->actor.world.rot.y); - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; if (this->actor.velocity.y > 0.0f) { this->actor.velocity.y = 0.0f; } @@ -1001,7 +1001,7 @@ void func_8089C87C(EnDinofos* this, s32 arg1) { } void func_8089C938(EnDinofos* this, PlayState* play) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) { if (this->actor.colChkInfo.health == 0) { if (this->actor.cutscene == -1) { @@ -1021,18 +1021,18 @@ void func_8089C938(EnDinofos* this, PlayState* play) { void func_8089CA14(EnDinofos* this) { Animation_MorphToPlayOnce(&this->skelAnime, &object_dinofos_Anim_001040, -5.0f); this->colliderJntSph.base.acFlags |= AC_ON; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = func_8089CA74; } void func_8089CA74(EnDinofos* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x800); - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); if (SkelAnime_Update(&this->skelAnime)) { func_8089CB10(this, play); } else if (!func_8089AE00(this, play) && Animation_OnFrame(&this->skelAnime, 12.0f)) { - this->actor.speedXZ = 8.0f; + this->actor.speed = 8.0f; } } @@ -1042,7 +1042,7 @@ void func_8089CB10(EnDinofos* this, PlayState* play) { Animation_PlayLoop(&this->skelAnime, &object_dinofos_Anim_0013C0); this->unk_290 = 20; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->colliderJntSph.base.atFlags |= AT_ON; func_8089AD70(this); @@ -1130,7 +1130,7 @@ void func_8089CFAC(EnDinofos* this) { Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_00ABD0); this->actor.flags &= ~ACTOR_FLAG_1; Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_DEAD); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = func_8089D018; } @@ -1163,11 +1163,11 @@ void func_8089D018(EnDinofos* this, PlayState* play) { void func_8089D11C(EnDinofos* this, s16 arg1) { if (arg1 >= 0) { - this->actor.speedXZ = -15.0f; + this->actor.speed = -15.0f; } else { - this->actor.speedXZ = 15.0f; + this->actor.speed = 15.0f; } - Animation_Change(&this->skelAnime, &object_dinofos_Anim_00D62C, this->actor.speedXZ * (1.0f / 7.5f), 0.0f, 0.0f, + Animation_Change(&this->skelAnime, &object_dinofos_Anim_00D62C, this->actor.speed * (1.0f / 7.5f), 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f); this->actor.world.rot.y = BINANG_ADD(this->actor.shape.rot.y, 0x4000); this->unk_292 = 10; @@ -1178,10 +1178,10 @@ void func_8089D11C(EnDinofos* this, s16 arg1) { void func_8089D1E0(EnDinofos* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xBB8); - Math_StepToF(&this->actor.speedXZ, 0.0f, 2.0f); + Math_StepToF(&this->actor.speed, 0.0f, 2.0f); this->skelAnime.playSpeed = - (1.0f + fabsf(this->actor.speedXZ * (1.0f / 15.0f))) * ((this->actor.speedXZ >= 0.0f) ? 1.0f : -1.0f); + (1.0f + fabsf(this->actor.speed * (1.0f / 15.0f))) * ((this->actor.speed >= 0.0f) ? 1.0f : -1.0f); this->actor.world.rot.y = BINANG_ADD(this->actor.shape.rot.y, 0x4000); SkelAnime_Update(&this->skelAnime); if (this->unk_292 != 0) { 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 c7f3ee2dc4..c4b25bbe7e 100644 --- a/src/overlays/actors/ovl_En_Dno/z_en_dno.c +++ b/src/overlays/actors/ovl_En_Dno/z_en_dno.c @@ -779,21 +779,21 @@ s32 EnDno_ActorPathing_UpdateActorInfo(PlayState* play, ActorPathing* actorPath) thisx->gravity = 0.0f; temp_v0 = thisx->yawTowardsPlayer - thisx->world.rot.y; if ((temp_v0 <= 0x4000) && (temp_v0 >= -0x4000)) { - Math_SmoothStepToF(&thisx->speedXZ, 15.0f, 0.8f, 1.0f, 0.01f); + Math_SmoothStepToF(&thisx->speed, 15.0f, 0.8f, 1.0f, 0.01f); } else { if (thisx->xzDistToPlayer <= 80.0f) { - Math_SmoothStepToF(&thisx->speedXZ, 8.0f, 0.5f, 0.5f, 0.01f); + Math_SmoothStepToF(&thisx->speed, 8.0f, 0.5f, 0.5f, 0.01f); } else if (thisx->xzDistToPlayer <= 360.0f) { - Math_SmoothStepToF(&thisx->speedXZ, 7.0f, 0.5f, 0.5f, 0.01f); + Math_SmoothStepToF(&thisx->speed, 7.0f, 0.5f, 0.5f, 0.01f); } else { - Math_SmoothStepToF(&thisx->speedXZ, 3.5f, 0.5f, 0.5f, 0.01f); + Math_SmoothStepToF(&thisx->speed, 3.5f, 0.5f, 0.5f, 0.01f); } } - if (actorPath->distSqToCurPoint < SQ(thisx->speedXZ)) { + if (actorPath->distSqToCurPoint < SQ(thisx->speed)) { ret = true; } else { - sp38 = thisx->speedXZ / sqrtf(actorPath->distSqToCurPointXZ); + sp38 = thisx->speed / sqrtf(actorPath->distSqToCurPointXZ); sp2C = ABS(actorPath->rotToCurPoint.x - thisx->world.rot.x); temp_v0_2 = sp2C; temp_v0_2 *= sp38; @@ -810,11 +810,11 @@ s32 EnDno_ActorPathing_UpdateActorInfo(PlayState* play, ActorPathing* actorPath) s32 EnDno_ActorPathing_Move(PlayState* play, ActorPathing* actorPath) { Actor* thisx = actorPath->actor; EnDno* this = (EnDno*)thisx; - f32 sp24 = Math_CosS(-thisx->world.rot.x) * thisx->speedXZ; + f32 sp24 = Math_CosS(-thisx->world.rot.x) * thisx->speed; f32 sp20 = gFramerateDivisorHalf; thisx->velocity.x = Math_SinS(thisx->world.rot.y) * sp24; - thisx->velocity.y = Math_SinS(-thisx->world.rot.x) * thisx->speedXZ; + thisx->velocity.y = Math_SinS(-thisx->world.rot.x) * thisx->speed; thisx->velocity.z = Math_CosS(thisx->world.rot.y) * sp24; this->unk_334.x += (this->actor.velocity.x * sp20) + this->actor.colChkInfo.displacement.x; @@ -864,7 +864,7 @@ void func_80A730A0(EnDno* this, PlayState* play) { func_800B9010(&this->actor, NA_SE_EV_BUTLER_FRY - SFX_FLAG); if (this->actorPath.flags & ACTOR_PATHING_REACHED_END_PERMANENT) { Math_Vec3f_Copy(&this->actor.world.pos, &this->actorPath.curPoint); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.x = 0.0f; this->actor.velocity.y = 0.0f; this->actor.velocity.z = 0.0f; @@ -876,7 +876,7 @@ void func_80A73244(EnDno* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_8000000; this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8); this->unk_328 = 2; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Flags_UnsetSwitch(play, EN_DNO_GET_RACE_STARTED_SWITCH_FLAG(&this->actor)); gSaveContext.timerStates[TIMER_ID_MINIGAME_1] = TIMER_STATE_STOP; this->unk_44E = 0; 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 81044f5da5..23a60c5d45 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -536,7 +536,7 @@ s32 func_80877278(EnDodongo* this, PlayState* play) { void func_808773C4(EnDodongo* this) { Animation_MorphToLoop(&this->skelAnime, &object_dodongo_Anim_004C20, -4.0f); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->timer = Rand_S16Offset(30, 50); this->actionFunc = func_80877424; } @@ -556,7 +556,7 @@ void func_80877424(EnDodongo* this, PlayState* play) { void func_80877494(EnDodongo* this) { Animation_MorphToLoop(&this->skelAnime, &object_dodongo_Anim_008B1C, -4.0f); - this->actor.speedXZ = this->unk_334 * 1.5f; + this->actor.speed = this->unk_334 * 1.5f; this->timer = Rand_S16Offset(50, 70); this->actionFunc = func_80877500; } @@ -616,7 +616,7 @@ void func_808777A8(EnDodongo* this) { Sphere16* sph; Animation_MorphToPlayOnce(&this->skelAnime, &object_dodongo_Anim_0028F0, -4.0f); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; for (i = 0; i < ARRAY_COUNT(this->collider3Elements); i++) { sph = &this->collider3.elements[i].dim.worldSphere; @@ -696,7 +696,7 @@ void func_80877DE0(EnDodongo* this) { this->actor.flags |= ACTOR_FLAG_10; this->timer = 25; this->actionFunc = func_80877E60; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void func_80877E60(EnDodongo* this, PlayState* play) { @@ -849,7 +849,7 @@ void func_80878424(EnDodongo* this, PlayState* play) { void func_80878594(EnDodongo* this) { this->actionFunc = func_808785B0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void func_808785B0(EnDodongo* this, PlayState* play) { @@ -874,7 +874,7 @@ void func_8087864C(EnDodongo* this) { Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_DAMAGE); this->timer = 0; this->unk_304 = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); this->actionFunc = func_808786C8; } @@ -895,7 +895,7 @@ void func_80878724(EnDodongo* this) { this->unk_304 = 0; Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_J_DEAD); this->actor.flags &= ~ACTOR_FLAG_1; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); this->actionFunc = func_808787B0; } 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 4ff68de3e7..abc3c0597d 100644 --- a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c +++ b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c @@ -345,9 +345,9 @@ void EnDragon_RetreatOrIdle(EnDragon* this, PlayState* play) { EnDragon_SetupExtend(this); } else if ((this->timer != 0) && (fabsf(this->actor.world.pos.x - this->actor.home.pos.x) > 101.0f) && (fabsf(this->actor.world.pos.z - this->actor.home.pos.z) > 101.0f)) { - this->actor.speedXZ = -100.0f; + this->actor.speed = -100.0f; } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if ((fabsf(this->actor.world.pos.x - this->actor.home.pos.x) > 4.0f) && (fabsf(this->actor.world.pos.z - this->actor.home.pos.z) > 4.0f)) { @@ -388,12 +388,12 @@ void EnDragon_Extend(EnDragon* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_UTSUBO_APPEAR - SFX_FLAG); extendedPos.x += Math_SinS(this->actor.world.rot.y) * -530.0f; extendedPos.z += Math_CosS(this->actor.world.rot.y) * -530.0f; - this->actor.speedXZ = 40.0f; + this->actor.speed = 40.0f; Math_SmoothStepToS(&this->jawZRotation, 0xFA0, 5, 0xBB8, 0x14); if ((fabsf(this->actor.world.pos.x - extendedPos.x) < 51.0f) && (fabsf(this->actor.world.pos.z - extendedPos.z) < 51.0f)) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Math_ApproachF(&this->actor.world.pos.x, extendedPos.x, 0.3f, 50.0f); Math_ApproachF(&this->actor.world.pos.z, extendedPos.z, 0.3f, 50.0f); if ((fabsf(this->actor.world.pos.x - extendedPos.x) < 4.0f) && @@ -513,7 +513,7 @@ void EnDragon_Grab(EnDragon* this, PlayState* play) { pos.z += Math_CosS(this->actor.world.rot.y) * -930.0f; Math_Vec3f_Copy(&this->actor.world.pos, &pos); this->jawZRotation = 0x1450; - this->actor.speedXZ = 60.0f; + this->actor.speed = 60.0f; } this->grabTimer++; @@ -655,7 +655,7 @@ void EnDragon_Dead(EnDragon* this, PlayState* play) { if ((this->timer != 0) && (fabsf(this->actor.world.pos.x - this->actor.home.pos.x) > 121.0f) && (fabsf(this->actor.world.pos.z - this->actor.home.pos.z) > 121.0f)) { - this->actor.speedXZ = -120.0f; + this->actor.speed = -120.0f; if (((this->pythonIndex & 1) == 0) && (Rand_ZeroOne() < 0.5f)) { //! @bug: !play->gameplayFrames is 0 essentially all the time, so this code never runs. if (((!play->gameplayFrames) & 0x1F)) { @@ -667,7 +667,7 @@ void EnDragon_Dead(EnDragon* this, PlayState* play) { return; } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if ((fabsf(this->actor.world.pos.x - this->actor.home.pos.x) > 20.0f) && (fabsf(this->actor.world.pos.z - this->actor.home.pos.z) > 20.0f)) { Math_ApproachF(&this->actor.world.pos.x, this->actor.home.pos.x, 0.3f, 300.0f); @@ -754,7 +754,7 @@ void EnDragon_UpdateDamage(EnDragon* this, PlayState* play) { if ((this->action == DEEP_PYTHON_ACTION_EXTEND) && (this->grabWaitTimer == 0) && (player->invincibilityTimer == 0) && (this->collider.elements[0].info.ocElemFlags & OCELEM_HIT) && (!(func_800B64FC(play, 1000.0f, &this->actor.world.pos, &sp30) >= 0.0f) || (sp30 != 1))) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->action = DEEP_PYTHON_ACTION_GRAB; this->actor.flags |= ACTOR_FLAG_100000; this->actionFunc = EnDragon_SetupGrab; 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 406d3bd9d1..0e0433a5ef 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -233,7 +233,7 @@ void func_8088C9CC(EnElf* this, PlayState* play) { this->unk_244 = 2; this->unk_248 = 0x400; this->unk_254 = 2.0f; - this->actor.speedXZ = 1.5f; + this->actor.speed = 1.5f; this->unk_26C = func_8088C920; this->unk_25C = (s32)Rand_ZeroFloat(8.0f) + 4; } else { @@ -558,9 +558,9 @@ void func_8088D9BC(EnElf* this, PlayState* play) { Vec3f* vec = &this->unk_224; if (this->fairyFlags & 0x4000) { - Math_SmoothStepToF(&this->actor.speedXZ, 5.0f, 0.5f, 1.0f, 0.01f); + Math_SmoothStepToF(&this->actor.speed, 5.0f, 0.5f, 1.0f, 0.01f); } else { - Math_SmoothStepToF(&this->actor.speedXZ, this->unk_254, 0.2f, 0.5f, 0.01f); + Math_SmoothStepToF(&this->actor.speed, this->unk_254, 0.2f, 0.5f, 0.01f); } switch (this->unk_244) { @@ -606,7 +606,7 @@ void func_8088DB4C(EnElf* this, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4) { xzVelocity = sqrtf(SQ(xVelTarget) + SQ(zVelTarget)); clampedXZ = CLAMP(xzVelocity, arg2, arg3); - this->actor.speedXZ = clampedXZ; + this->actor.speed = clampedXZ; if ((xzVelocity != clampedXZ) && (xzVelocity != 0.0f)) { xzVelocity = clampedXZ / xzVelocity; @@ -976,7 +976,7 @@ void func_8088E850(EnElf* this, PlayState* play) { if (arrowPointedActor != NULL) { func_8088DB4C(this, &nextPos, 0.0f, 30.0f, 0.2f); - if (this->actor.speedXZ >= 5.0f) { + if (this->actor.speed >= 5.0f) { func_8088F5F4(this, play, 0x10); } } else { @@ -1299,7 +1299,7 @@ void func_8088FA38(EnElf* this, PlayState* play) { refPos = this->actor.focus.pos; func_8088DB4C(this, &refPos, 0, 30.0f, 0.2f); - if (this->actor.speedXZ >= 5.0f) { + if (this->actor.speed >= 5.0f) { func_8088F5F4(this, play, 0x10); } 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 366f86f6c0..65cc04d84f 100644 --- a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c +++ b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c @@ -55,7 +55,7 @@ static ColliderCylinderInit sCylinderInit = { }; void EnElforg_InitializeParams(EnElforg* this) { - this->actor.speedXZ = 1.0f; + this->actor.speed = 1.0f; this->targetSpeedXZ = 1.0f; this->actor.velocity.y = 0.0f; this->actor.world.rot.y = randPlusMinusPoint5Scaled(0x10000); @@ -189,22 +189,22 @@ void EnElforg_SpawnSparkles(EnElforg* this, PlayState* play, s32 life) { void EnElforg_ApproachTargetYPosition(EnElforg* this, Vec3f* targetPos) { f32 yDifference = targetPos->y - this->actor.world.pos.y; - if (fabsf(yDifference) < this->actor.speedXZ) { + if (fabsf(yDifference) < this->actor.speed) { this->actor.world.pos.y = targetPos->y; } else if (yDifference > 0.0f) { - this->actor.world.pos.y += this->actor.speedXZ; + this->actor.world.pos.y += this->actor.speed; } else { - this->actor.world.pos.y -= this->actor.speedXZ; + this->actor.world.pos.y -= this->actor.speed; } } void EnElforg_ApproachTargetSpeedXZ(EnElforg* this) { - if (this->actor.speedXZ > this->targetSpeedXZ) { - this->actor.speedXZ *= 0.9f; - } else if (this->actor.speedXZ < (this->targetSpeedXZ - 0.1f)) { - this->actor.speedXZ += 0.1f; + if (this->actor.speed > this->targetSpeedXZ) { + this->actor.speed *= 0.9f; + } else if (this->actor.speed < (this->targetSpeedXZ - 0.1f)) { + this->actor.speed += 0.1f; } else { - this->actor.speedXZ = this->targetSpeedXZ; + this->actor.speed = this->targetSpeedXZ; } } @@ -292,7 +292,7 @@ void EnElforg_TurnInFairy(EnElforg* this, PlayState* play) { // flying towards the fountain's center. SkelAnime_Update(&this->skelAnime); this->actor.shape.yOffset *= 0.9f; - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; EnElforg_ApproachTargetYPosition(this, &player->bodyPartsPos[PLAYER_BODYPART_WAIST]); xzDistToPlayer = this->actor.xzDistToPlayer; 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 2338e1c0c0..573d386e59 100644 --- a/src/overlays/actors/ovl_En_Estone/z_en_estone.c +++ b/src/overlays/actors/ovl_En_Estone/z_en_estone.c @@ -71,12 +71,12 @@ void EnEstone_Init(Actor* thisx, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; if (this->actor.params == ENESTONE_TYPE_LARGE) { - this->actor.speedXZ = Rand_ZeroFloat(5.0f) + 2.0f; + this->actor.speed = Rand_ZeroFloat(5.0f) + 2.0f; this->scale = (Rand_ZeroFloat(1.0f) * 0.005f) + 0.005f; this->actor.velocity.y = Rand_ZeroFloat(10.0f) + 15.0f; this->actor.gravity = -2.0f; } else { - this->actor.speedXZ = Rand_ZeroFloat(3.0f) + 1.0f; + this->actor.speed = Rand_ZeroFloat(3.0f) + 1.0f; this->scale = (Rand_ZeroFloat(1.0f) * 0.003f) + 0.003f; this->actor.velocity.y = Rand_ZeroFloat(5.0f) + 7.0f; this->actor.gravity = -1.0f; @@ -139,7 +139,7 @@ void EnEstone_Active(EnEstone* this, PlayState* play) { velocity.y = this->actor.floorHeight; Actor_SpawnFloorDustRing(play, &this->actor, &velocity, 0.0f, 10, 6.0f, 50, 30, true); this->actor.velocity.y = this->actor.gravity = 0.0f; - this->actor.speedXZ *= 0.3f; + this->actor.speed *= 0.3f; this->actor.shape.shadowScale = 0.0f; this->inactive = true; this->timer = 50; 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 93c9ebb414..affea4c349 100644 --- a/src/overlays/actors/ovl_En_Fall/z_en_fall.c +++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.c @@ -499,7 +499,7 @@ void EnFall_MoonsTear_Initialize(EnFall* this) { } this->actor.world.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); this->actor.world.rot.x = Math_Vec3f_Pitch(&this->actor.world.pos, &this->actor.home.pos); - this->actor.speedXZ = Math_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.home.pos) / 82.0f; + this->actor.speed = Math_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.home.pos) / 82.0f; this->actor.shape.rot.x = this->actor.world.rot.x; this->actor.shape.rot.y = this->actor.world.rot.y; } @@ -516,7 +516,7 @@ void EnFall_MoonsTear_Fall(EnFall* this, PlayState* play) { } if (this->actor.draw != NULL) { - if (Math_Vec3f_StepTo(&this->actor.world.pos, &this->actor.home.pos, this->actor.speedXZ) <= 0.0f) { + if (Math_Vec3f_StepTo(&this->actor.world.pos, &this->actor.home.pos, this->actor.speed) <= 0.0f) { Actor_PlaySfx(&this->actor, NA_SE_EV_GORON_BOUND_1); SET_WEEKEVENTREG(WEEKEVENTREG_74_80); SET_WEEKEVENTREG(WEEKEVENTREG_74_20); 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 dd6ba07cb1..dd54a3eded 100644 --- a/src/overlays/actors/ovl_En_Famos/z_en_famos.c +++ b/src/overlays/actors/ovl_En_Famos/z_en_famos.c @@ -347,7 +347,7 @@ void EnFamos_UpdateFlipStatus(EnFamos* this) { */ void EnFamos_SetupStillIdle(EnFamos* this) { this->actionFunc = EnFamos_StillIdle; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void EnFamos_StillIdle(EnFamos* this, PlayState* play) { @@ -376,7 +376,7 @@ void EnFamos_SetupPathingIdle(EnFamos* this) { Math_Vec3s_ToVec3f(&this->targetDest, &this->pathPoints[this->currentPathNode]); this->targetYaw = Actor_WorldYawTowardPoint(&this->actor, &this->targetDest); this->actionFunc = EnFamos_PathingIdle; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void EnFamos_PathingIdle(EnFamos* this, PlayState* play) { @@ -399,7 +399,7 @@ void EnFamos_SetupTurnHome(EnFamos* this) { this->targetYaw = Actor_WorldYawTowardPoint(&this->actor, &this->calmPos); Math_Vec3f_Copy(&this->targetDest, &this->calmPos); this->actionFunc = EnFamos_TurnHome; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void EnFamos_TurnHome(EnFamos* this, PlayState* play) { @@ -439,9 +439,9 @@ void EnFamos_ReturnHome(EnFamos* this, PlayState* play) { EnFamos_SetupStillIdle(this); } } else if (distanceToHome < 40.0f) { - Math_StepToF(&this->actor.speedXZ, 0.5f, 0.3f); + Math_StepToF(&this->actor.speed, 0.5f, 0.3f); } else { - Math_StepToF(&this->actor.speedXZ, 3.0f, 0.3f); + Math_StepToF(&this->actor.speed, 3.0f, 0.3f); } } @@ -451,7 +451,7 @@ void EnFamos_ReturnHome(EnFamos* this, PlayState* play) { void EnFamos_SetupAlert(EnFamos* this) { this->actor.world.rot.y = this->actor.shape.rot.y; this->stateTimer = 8; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->isCalm == true) { this->isCalm = false; @@ -498,7 +498,7 @@ void EnFamos_Chase(EnFamos* this, PlayState* play) { abovePlayerPos.y = player->actor.world.pos.y + 100.0f; abovePlayerPos.z = player->actor.world.pos.z; this->actor.world.rot.x = -Actor_WorldPitchTowardPoint(&this->actor, &abovePlayerPos); - Math_StepToF(&this->actor.speedXZ, 6.0f, 0.5f); + Math_StepToF(&this->actor.speed, 6.0f, 0.5f); surfaceType = func_800C9B18(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); if ((this->actor.xzDistToPlayer < 30.0f) && (this->actor.floorHeight > BGCHECK_Y_MIN) && // close enough @@ -514,7 +514,7 @@ void EnFamos_Chase(EnFamos* this, PlayState* play) { void EnFamos_SetupAttackAim(EnFamos* this) { Animation_PlayOnce(&this->skelAnime, &gFamosShakeAnim); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_AMOS_VOICE); this->actionFunc = EnFamos_AttackAim; } @@ -537,7 +537,7 @@ void EnFamos_Attack(EnFamos* this, PlayState* play) { s32 hitFloor; u32 surfaceType; - Math_StepToF(&this->actor.speedXZ, 20.0f, 2.0f); + Math_StepToF(&this->actor.speed, 20.0f, 2.0f); this->stateTimer--; if (this->stateTimer == 0) { this->emblemCollider.base.acFlags &= ~AC_ON; @@ -585,7 +585,7 @@ void EnFamos_SetupFinishAttack(EnFamos* this) { SkelAnime_Update(&this->skelAnime); this->emblemCollider.base.acFlags |= AC_ON; this->stateTimer = 3; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EV_EXPLOSION); this->actionFunc = EnFamos_FinishAttack; } @@ -604,12 +604,12 @@ void EnFamos_FinishAttack(EnFamos* this, PlayState* play) { void EnFamos_SetupAttackRebound(EnFamos* this) { this->actor.world.rot.x = 0x4000; this->actionFunc = EnFamos_AttackRebound; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void EnFamos_AttackRebound(EnFamos* this, PlayState* play) { - Math_StepToF(&this->actor.speedXZ, 5.0f, 0.3f); - if (this->actor.speedXZ > 1.0f) { + Math_StepToF(&this->actor.speed, 5.0f, 0.3f); + if (this->actor.speed > 1.0f) { if (ABS_ALT(this->flipRot) > 0x4000) { func_800B9010(&this->actor, NA_SE_EN_FAMOS_FLOAT_REVERSE - SFX_FLAG); } else { @@ -618,7 +618,7 @@ void EnFamos_AttackRebound(EnFamos* this, PlayState* play) { } if ((this->baseHeight < this->actor.world.pos.y) || (this->actor.bgCheckFlags & 0x10)) { // touching ceiling - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; EnFamos_SetupChase(this); } } @@ -629,7 +629,7 @@ void EnFamos_AttackRebound(EnFamos* this, PlayState* play) { void EnFamos_SetupScanForPlayer(EnFamos* this) { this->stateTimer = 60; this->actionFunc = EnFamos_ScanForPlayer; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void EnFamos_ScanForPlayer(EnFamos* this, PlayState* play) { @@ -651,7 +651,7 @@ void EnFamos_ScanForPlayer(EnFamos* this, PlayState* play) { void EnFamos_SetupDeathSlam(EnFamos* this) { this->emblemCollider.base.acFlags &= ~AC_ON; this->stateTimer = 20; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20); this->flippedTimer = -1; this->actor.world.pos.y = this->actor.floorHeight - 60.0f; @@ -681,7 +681,7 @@ void EnFamos_SetupDeathExplosion(EnFamos* this) { } void EnFamos_DeathExplosion(EnFamos* this, PlayState* play) { - Math_StepToF(&this->actor.speedXZ, 3.0f, 0.3f); + Math_StepToF(&this->actor.speed, 3.0f, 0.3f); if (this->actor.colorFilterTimer == 0) { Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, false, 4); } @@ -712,7 +712,7 @@ void EnFamos_SetupDeathFade(EnFamos* this) { this->actor.flags &= ~ACTOR_FLAG_1; this->actor.shape.shadowDraw = NULL; this->actionFunc = EnFamos_DeathFade; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void EnFamos_DeathFade(EnFamos* this, PlayState* play) { 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 cc06fe2e12..0efbf9674c 100644 --- a/src/overlays/actors/ovl_En_Fg/z_en_fg.c +++ b/src/overlays/actors/ovl_En_Fg/z_en_fg.c @@ -212,7 +212,7 @@ void EnFg_Idle(EnFg* this, PlayState* play) { this->actor.world.rot.y = Math_Vec3f_Yaw(&ac->world.pos, &this->actor.world.pos); this->actor.shape.rot = this->actor.world.rot; this->actor.velocity.y = 10.0f; - this->actor.speedXZ = 3.0f; + this->actor.speed = 3.0f; this->actor.gravity = -0.8f; this->bounceCounter = 1; this->timer = 0; @@ -263,7 +263,7 @@ void EnFg_Jump(EnFg* this, PlayState* play) { this->actor.world.rot.y = Math_Vec3f_Yaw(&ac->world.pos, &this->actor.world.pos); this->actor.shape.rot = this->actor.world.rot; this->actor.velocity.y = 10.0f; - this->actor.speedXZ = 3.0f; + this->actor.speed = 3.0f; this->actor.gravity = -0.8f; this->bounceCounter = 1; this->timer = 0; 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 4f5de6c914..bd00c3cbd8 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -215,7 +215,7 @@ s32 EnFirefly_ReturnToPerch(EnFirefly* this, PlayState* play) { EnFirefly_SetupPerch(this); } else { if (distFromHome * 0.05f < 1.0f) { - this->actor.speedXZ *= distFromHome * 0.05f; + this->actor.speed *= distFromHome * 0.05f; } Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), @@ -274,7 +274,7 @@ s32 EnFirefly_SeekTorch(EnFirefly* this, PlayState* play) { void EnFirefly_SetupFlyIdle(EnFirefly* this) { this->timer = Rand_S16Offset(70, 100); - this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 1.5f; + this->actor.speed = (Rand_ZeroOne() * 1.5f) + 1.5f; Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300); this->pitchTarget = ((this->maxAltitude < this->actor.world.pos.y) ? 0xC00 : -0xC00) + 0x1554; this->skelAnime.playSpeed = 1.0f; @@ -291,7 +291,7 @@ void EnFirefly_FlyIdle(EnFirefly* this, PlayState* play) { } isSkelAnimeUpdated = Animation_OnFrame(&this->skelAnime, 0.0f); - this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 1.5f; + this->actor.speed = (Rand_ZeroOne() * 1.5f) + 1.5f; if (!EnFirefly_ReturnToPerch(this, play) && !EnFirefly_SeekTorch(this, play)) { if (isSkelAnimeUpdated) { @@ -372,7 +372,7 @@ void EnFirefly_SetupFall(EnFirefly* this, PlayState* play) { } if (this->actor.flags & ACTOR_FLAG_8000) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } this->actionFunc = EnFirefly_Fall; @@ -381,7 +381,7 @@ void EnFirefly_SetupFall(EnFirefly* this, PlayState* play) { // Fall to the ground after being hit void EnFirefly_Fall(EnFirefly* this, PlayState* play) { this->actor.colorFilterTimer = 40; - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); if (!(this->actor.flags & ACTOR_FLAG_8000)) { if (this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { @@ -398,7 +398,7 @@ void EnFirefly_Fall(EnFirefly* this, PlayState* play) { void EnFirefly_SetupDie(EnFirefly* this) { this->timer = 15; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = EnFirefly_Die; } @@ -434,7 +434,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, PlayState* play) { this->timer--; } - Math_StepToF(&this->actor.speedXZ, 4.0f, 0.5f); + Math_StepToF(&this->actor.speed, 4.0f, 0.5f); if (this->actor.bgCheckFlags & 8) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); @@ -480,7 +480,7 @@ void EnFirefly_SetupRebound(EnFirefly* this) { this->actor.world.rot.x = 0x7000; this->timer = 18; this->skelAnime.playSpeed = 1.0f; - this->actor.speedXZ = 2.5f; + this->actor.speed = 2.5f; this->actionFunc = EnFirefly_Rebound; } @@ -489,7 +489,7 @@ void EnFirefly_Rebound(EnFirefly* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x100); Math_StepToF(&this->actor.velocity.y, 0.0f, 0.4f); - if (Math_StepToF(&this->actor.speedXZ, 0.0f, 0.15f)) { + if (Math_StepToF(&this->actor.speed, 0.0f, 0.15f)) { if (this->timer != 0) { this->timer--; } @@ -521,7 +521,7 @@ void EnFirefly_FlyAway(EnFirefly* this, PlayState* play) { return; } - Math_StepToF(&this->actor.speedXZ, 3.0f, 0.3f); + Math_StepToF(&this->actor.speed, 3.0f, 0.3f); if (this->actor.bgCheckFlags & 1) { this->pitchTarget = 0x954; @@ -550,7 +550,7 @@ void EnFirefly_SetupStunned(EnFirefly* this) { if (this->actionFunc != EnFirefly_Stunned) { this->actor.velocity.y = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } this->auraType = KEESE_AURA_NONE; @@ -586,7 +586,7 @@ void EnFirefly_Stunned(EnFirefly* this, PlayState* play) { void EnFirefly_SetupPerch(EnFirefly* this) { this->timer = 1; this->actionFunc = EnFirefly_Perch; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } // When perching, sit on collision and flap at random intervals @@ -611,7 +611,7 @@ void EnFirefly_SetupDisturbDiveAttack(EnFirefly* this) { this->actor.shape.rot.x = 0x1554; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->timer = 50; - this->actor.speedXZ = 3.0f; + this->actor.speed = 3.0f; this->actionFunc = EnFirefly_DisturbDiveAttack; } 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 d164bf0703..60c09ebceb 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -278,12 +278,12 @@ void func_8091DF68(Actor* thisx, PlayState* play) { EnFish* this = THIS; func_8091DD48(this); - Math_SmoothStepToF(&thisx->speedXZ, 0.0f, 0.05f, 0.3f, 0.0f); + Math_SmoothStepToF(&thisx->speed, 0.0f, 0.05f, 0.3f, 0.0f); - if ((thisx->speedXZ * 1.4f) + 0.8f > 2.0f) { + if ((thisx->speed * 1.4f) + 0.8f > 2.0f) { this->skelAnime.playSpeed = 2.0f; } else { - this->skelAnime.playSpeed = (thisx->speedXZ * 1.4f) + 0.8f; + this->skelAnime.playSpeed = (thisx->speed * 1.4f) + 0.8f; } this->unk_270 >>= 1; @@ -327,7 +327,7 @@ void func_8091E128(Actor* thisx, PlayState* play) { EnFish* this = THIS; func_8091DD48(this); - Math_SmoothStepToF(&thisx->speedXZ, 1.8f, 0.08f, 0.4f, 0.0f); + Math_SmoothStepToF(&thisx->speed, 1.8f, 0.08f, 0.4f, 0.0f); if ((func_8091D630(&thisx->world.pos, &thisx->home.pos) > SQ(80.0f)) || (this->unk_240 < 4)) { this->unk_270 = this->unk_264; @@ -342,10 +342,10 @@ void func_8091E128(Actor* thisx, PlayState* play) { this->unk_24C = 0.0f; } - if ((thisx->speedXZ * 1.5f) + 0.8f > 4.0f) { + if ((thisx->speed * 1.5f) + 0.8f > 4.0f) { this->skelAnime.playSpeed = 4.0f; } else { - this->skelAnime.playSpeed = (thisx->speedXZ * 1.5f) + 0.8f; + this->skelAnime.playSpeed = (thisx->speed * 1.5f) + 0.8f; } if (this->unk_240 <= 0) { @@ -378,7 +378,7 @@ void func_8091E34C(Actor* thisx, PlayState* play2) { s32 pad; func_8091DD48(this); - Math_SmoothStepToF(&thisx->speedXZ, 4.2f, 0.08f, 1.4f, 0.0f); + Math_SmoothStepToF(&thisx->speed, 4.2f, 0.08f, 1.4f, 0.0f); if (func_8091D630(&thisx->world.pos, &thisx->home.pos) > SQ(160.0f)) { this->unk_270 = this->unk_264; @@ -418,10 +418,10 @@ void func_8091E34C(Actor* thisx, PlayState* play2) { this->unk_24C = 0.0f; } - if ((thisx->speedXZ * 1.5f) + 0.8f > 4.0f) { + if ((thisx->speed * 1.5f) + 0.8f > 4.0f) { this->skelAnime.playSpeed = 4.0f; } else { - this->skelAnime.playSpeed = (thisx->speedXZ * 1.5f) + 0.8f; + this->skelAnime.playSpeed = (thisx->speed * 1.5f) + 0.8f; } if ((this->unk_240 <= 0) || (!sp3C && (sp38 == 0))) { @@ -453,7 +453,7 @@ void func_8091E658(Actor* thisx, PlayState* play) { s16 sp32; func_8091DD48(this); - Math_SmoothStepToF(&thisx->speedXZ, 1.8f, 0.1f, 0.5f, 0.0f); + Math_SmoothStepToF(&thisx->speed, 1.8f, 0.1f, 0.5f, 0.0f); if (func_8091D630(&thisx->world.pos, &thisx->home.pos) > SQ(80.0f)) { this->unk_270 = this->unk_264; @@ -475,10 +475,10 @@ void func_8091E658(Actor* thisx, PlayState* play) { this->unk_24C = 1.2f; } - if ((thisx->speedXZ * 1.5f) + 0.8f > 4.0f) { + if ((thisx->speed * 1.5f) + 0.8f > 4.0f) { this->skelAnime.playSpeed = 4.0f; } else { - this->skelAnime.playSpeed = (thisx->speedXZ * 1.5f) + 0.8f; + this->skelAnime.playSpeed = (thisx->speed * 1.5f) + 0.8f; } if (this->unk_240 <= 0) { @@ -502,7 +502,7 @@ void func_8091E810(EnFish* this) { void func_8091E880(Actor* thisx, PlayState* play) { EnFish* this = THIS; - Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 0.1f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.1f, 0.1f, 0.0f); this->unk_26E = 0x43; this->unk_272 = 0x43; this->unk_268 = 0x4000; @@ -563,7 +563,7 @@ void func_8091EAF0(Actor* thisx, PlayState* play) { s32 sp40 = play->state.frames; s16 phi_v1; - Math_SmoothStepToF(&this->actor.speedXZ, Rand_ZeroOne() * 0.2f, 0.1f, 0.1f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, Rand_ZeroOne() * 0.2f, 0.1f, 0.1f, 0.0f); phi_v1 = (s16)((((sp40 >> 5) & 2) | ((sp40 >> 2) & 1)) << 0xB) * 0.3f; if (sp40 & 4) { phi_v1 *= -1; @@ -625,12 +625,12 @@ void func_8091ED70(Actor* thisx, PlayState* play) { func_8091D840(thisx, play, 2, 25.0f); } - Math_SmoothStepToF(&thisx->speedXZ, 2.8f, 0.1f, 0.4f, 0.0f); + Math_SmoothStepToF(&thisx->speed, 2.8f, 0.1f, 0.4f, 0.0f); if ((thisx->bgCheckFlags & 8) || !(thisx->bgCheckFlags & 0x20)) { sp2E = Math_Vec3f_Yaw(&thisx->world.pos, &thisx->home.pos); thisx->home.rot.y = Rand_S16Offset(-100, 100) + sp2E; - thisx->speedXZ *= 0.5f; + thisx->speed *= 0.5f; } this->unk_268 = 0; @@ -651,10 +651,10 @@ void func_8091ED70(Actor* thisx, PlayState* play) { func_8091D728(this); } - if ((thisx->speedXZ * 1.5f) + 1.0f > 4.8f) { + if ((thisx->speed * 1.5f) + 1.0f > 4.8f) { this->skelAnime.playSpeed = 4.8f; } else { - this->skelAnime.playSpeed = (thisx->speedXZ * 1.5f) + 1.0f; + this->skelAnime.playSpeed = (thisx->speed * 1.5f) + 1.0f; } if (this->unk_240 <= 0) { @@ -700,14 +700,14 @@ void func_8091EFE8(Actor* thisx, PlayState* play) { } if (this->unk_277 == 0) { - Math_SmoothStepToF(&this->actor.speedXZ, 2.8f, 0.1f, 0.4f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, 2.8f, 0.1f, 0.4f, 0.0f); if (this->unk_240 < 6) { - this->actor.speedXZ *= 0.75f; + this->actor.speed *= 0.75f; } } if ((this->actor.bgCheckFlags & 8) && !(this->actor.bgCheckFlags & 0x20)) { - this->actor.speedXZ *= 0.5f; + this->actor.speed *= 0.5f; } if (((Rand_Next() >> 0x1B) == 0) || ((this->actor.bgCheckFlags & 8) && ((Rand_Next() >> 0x1E) == 0)) || @@ -760,10 +760,10 @@ void func_8091EFE8(Actor* thisx, PlayState* play) { } this->actor.velocity.y *= 0.8f; - if ((this->actor.speedXZ * 1.5f) + 1.0f > 4.8f) { + if ((this->actor.speed * 1.5f) + 1.0f > 4.8f) { this->skelAnime.playSpeed = 4.8f; } else { - this->skelAnime.playSpeed = (this->actor.speedXZ * 1.5f) + 1.0f; + this->skelAnime.playSpeed = (this->actor.speed * 1.5f) + 1.0f; } } @@ -804,7 +804,7 @@ void func_8091F3BC(Actor* thisx, PlayState* play) { func_8091DD48(this); Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 2.0f); - Math_SmoothStepToF(&this->actor.speedXZ, sp3C->x, sp3C->y, sp3C->z, 0.0f); + Math_SmoothStepToF(&this->actor.speed, sp3C->x, sp3C->y, sp3C->z, 0.0f); this->unk_24C = 0.0f; if (func_8091D630(&this->actor.world.pos, &this->actor.home.pos) > SQ(15.0f)) { @@ -820,7 +820,7 @@ void func_8091F3BC(Actor* thisx, PlayState* play) { phi_f0 = 0.0f; } - temp_f2 = this->actor.speedXZ + 0.4f + phi_f0; + temp_f2 = this->actor.speed + 0.4f + phi_f0; this->skelAnime.playSpeed = CLAMP(temp_f2, 0.5f, 1.6f); if (this->unk_240 <= 0) { 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 110a596b0b..55b6bfca06 100644 --- a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c +++ b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c @@ -235,7 +235,7 @@ void func_80B287F4(EnFish2* this, s32 arg1) { if (arg1 == 0) { this->unk_338 = 410.0f - this->unk_2C4; } - Math_ApproachF(&this->unk_350->speedXZ, (D_80B2B380[0] - this->unk_330) * this->unk_338, 0.1f, 0.4f); + Math_ApproachF(&this->unk_350->speed, (D_80B2B380[0] - this->unk_330) * this->unk_338, 0.1f, 0.4f); } Math_Vec3f_Copy(&sp2C, &this->unk_350->world.pos); this->unk_34A = Math_Vec3f_Yaw(&this->actor.world.pos, &sp2C); @@ -377,14 +377,14 @@ void func_80B28C14(EnFish2* this, PlayState* play) { } if (this->unk_2B4 == 0) { - Math_ApproachF(&this->actor.speedXZ, (D_80B2B380[0] - this->unk_330) * 400.0f, 0.3f, 0.3f); - if (this->actor.speedXZ > 3.0f) { - this->actor.speedXZ = 3.0f; - } else if (this->actor.speedXZ < 1.5f) { - this->actor.speedXZ = 1.5f; + Math_ApproachF(&this->actor.speed, (D_80B2B380[0] - this->unk_330) * 400.0f, 0.3f, 0.3f); + if (this->actor.speed > 3.0f) { + this->actor.speed = 3.0f; + } else if (this->actor.speed < 1.5f) { + this->actor.speed = 1.5f; } } else { - Math_ApproachZeroF(&this->actor.speedXZ, 0.3f, 0.3f); + Math_ApproachZeroF(&this->actor.speed, 0.3f, 0.3f); } if ((D_80B2B2E8 == 0) && (D_80B2B2E0 != 2)) { @@ -448,7 +448,7 @@ void func_80B29194(EnFish2* this) { } this->unk_2C4 = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->unk_2C8 == 0) { this->unk_34C = 400; Math_Vec3f_Copy(&this->actor.world.pos, &this->unk_324); @@ -463,12 +463,12 @@ void func_80B29194(EnFish2* this) { void func_80B29250(EnFish2* this, PlayState* play) { if (!func_80B28478(this)) { - Math_ApproachF(&this->actor.speedXZ, (D_80B2B380[0] - this->unk_330) * 1000.0f, 0.3f, 0.3f); + Math_ApproachF(&this->actor.speed, (D_80B2B380[0] - this->unk_330) * 1000.0f, 0.3f, 0.3f); - if (this->actor.speedXZ > 4.0f) { - this->actor.speedXZ = 4.0f; - } else if (this->actor.speedXZ < 2.0f) { - this->actor.speedXZ = 2.0f; + if (this->actor.speed > 4.0f) { + this->actor.speed = 4.0f; + } else if (this->actor.speed < 2.0f) { + this->actor.speed = 2.0f; } func_80B287F4(this, 0); @@ -492,12 +492,12 @@ void func_80B293C4(EnFish2* this, PlayState* play) { if (func_80B28478(this) == 0) { func_80B287F4(this, 1); - Math_ApproachF(&this->actor.speedXZ, (*D_80B2B380 - this->unk_330) * 1000.0f, 0.3f, 0.3f); + Math_ApproachF(&this->actor.speed, (*D_80B2B380 - this->unk_330) * 1000.0f, 0.3f, 0.3f); - if (this->actor.speedXZ > 3.0f) { - this->actor.speedXZ = 3.0f; - } else if (this->actor.speedXZ < 1.0f) { - this->actor.speedXZ = 1.0f; + if (this->actor.speed > 3.0f) { + this->actor.speed = 3.0f; + } else if (this->actor.speed < 1.0f) { + this->actor.speed = 1.0f; } if (this->unk_2CC <= currentFrame) { @@ -526,7 +526,7 @@ void func_80B2951C(EnFish2* this) { } this->unk_2B4 = 10; - this->actor.speedXZ = 3.0f; + this->actor.speed = 3.0f; Actor_Kill(this->unk_350); this->unk_350 = NULL; D_80B2B2F4 = &this->actor; @@ -542,7 +542,7 @@ void func_80B295A4(EnFish2* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &play->view.eye), 1, 0x1388, 0); - Math_ApproachZeroF(&this->actor.speedXZ, 0.3f, 0.3f); + Math_ApproachZeroF(&this->actor.speed, 0.3f, 0.3f); if (this->unk_2B4 != 0) { Math_Vec3f_Copy(&sp60, &this->unk_318); sp60.x += randPlusMinusPoint5Scaled(100.0f); @@ -576,7 +576,7 @@ void func_80B29778(EnFish2* this) { } this->actionFunc = func_80B297FC; this->unk_324.y = this->unk_2D4; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void func_80B297FC(EnFish2* this, PlayState* play) { @@ -605,7 +605,7 @@ void func_80B297FC(EnFish2* this, PlayState* play) { if ((fabsf(this->actor.world.pos.x - this->unk_324.x) < 2.0f) && (this->actor.world.pos.y < (this->unk_2D4 + 3.0f)) && (fabsf(this->actor.world.pos.z - this->unk_324.z) < 2.0f)) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_34A = BINANG_ROT180(this->actor.home.rot.y); this->unk_2C4++; this->actor.velocity.y = 0.0f; @@ -770,8 +770,8 @@ void func_80B29EE4(EnFish2* this, PlayState* play) { this->unk_2C4++; } this->unk_338 = 410.0f - this->unk_2C4; - Math_ApproachF(&this->actor.speedXZ, 2.0f, 0.3f, 0.3f); - Math_ApproachF(&this->unk_350->speedXZ, (D_80B2B380[0] - this->unk_330) * this->unk_338, 0.1f, 0.4f); + Math_ApproachF(&this->actor.speed, 2.0f, 0.3f, 0.3f); + Math_ApproachF(&this->unk_350->speed, (D_80B2B380[0] - this->unk_330) * this->unk_338, 0.1f, 0.4f); func_80B289DC(this, play); Math_Vec3f_Copy(&sp2C, &this->unk_350->world.pos); this->unk_34A = Math_Vec3f_Yaw(&this->actor.world.pos, &sp2C); @@ -887,7 +887,7 @@ void func_80B2A498(EnFish2* this, PlayState* play) { temp_v0 = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_COL_MAN, sp80.x, sp80.y, sp80.z, 0, this->actor.world.rot.y, 0, 0); if (temp_v0 != NULL) { - temp_v0->speedXZ = 4.0f; + temp_v0->speed = 4.0f; temp_v0->velocity.y = 15.0f; Actor_PlaySfx(&this->actor, NA_SE_SY_PIECE_OF_HEART); CLEAR_WEEKEVENTREG(WEEKEVENTREG_81_10); 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 79ca3a14b8..04b0752599 100644 --- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c +++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c @@ -1574,7 +1574,7 @@ void EnFishing_DrawLureHook(PlayState* play, Vec3f* pos, Vec3f* refPos, u8 hookI Matrix_Translate(pos->x, pos->y, pos->z, MTXMODE_NEW); - if ((player->actor.speedXZ == 0.0f) && (D_809101B4 == 0.0f)) { + if ((player->actor.speed == 0.0f) && (D_809101B4 == 0.0f)) { Math_ApproachF(&sLureHookRotY[hookIndex], ry, 0.1f, 0.3f); } else { sLureHookRotY[hookIndex] = ry; @@ -1785,7 +1785,7 @@ void EnFishing_DrawLureAndLine(PlayState* play, Vec3f* linePos, Vec3f* lineRot) sLurePos = sReelLinePos[LINE_SEG_COUNT - 1]; sLureRot.x = sReelLineRot[LINE_SEG_COUNT - 2].x + M_PI; - if ((player->actor.speedXZ == 0.0f) && (D_80917200 == 0)) { + if ((player->actor.speed == 0.0f) && (D_80917200 == 0)) { Math_ApproachF(&sLureRot.y, sReelLineRot[LINE_SEG_COUNT - 2].y, 0.1f, 0.2f); } else { sLureRot.y = sReelLineRot[LINE_SEG_COUNT - 2].y; @@ -2871,9 +2871,9 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { this->actor.uncullZoneScale = 50.0f; if (this->unk_148 == 0) { - sp118 = (player->actor.speedXZ * 0.15f) + 0.25f; + sp118 = (player->actor.speed * 0.15f) + 0.25f; } else { - sp118 = (player->actor.speedXZ * 0.3f) + 0.25f; + sp118 = (player->actor.speed * 0.3f) + 0.25f; } if ((D_80917200 != 0) || (sSubCamId != SUB_CAM_ID_DONE) || @@ -3018,7 +3018,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { case 10: this->unk_1AC = this->actor.home.pos; - Math_ApproachF(&this->actor.speedXZ, 2.0f, 1.0f, 0.5f); + Math_ApproachF(&this->actor.speed, 2.0f, 1.0f, 0.5f); Math_ApproachF(&this->unk_1A8, 4096.0f, 1.0f, 256.0f); if (sp124 < 40.0f) { @@ -3040,7 +3040,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { case 11: this->unk_1AC = this->actor.home.pos; - Math_ApproachF(&this->actor.speedXZ, 0.0f, 1.0f, 0.05f); + Math_ApproachF(&this->actor.speed, 0.0f, 1.0f, 0.05f); Math_ApproachF(&this->unk_1A8, 0.0f, 1.0f, 256.0f); if (sp124 >= 40.0f) { @@ -3070,7 +3070,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { break; case 0: - Math_ApproachF(&this->actor.speedXZ, 1.0f, 1.0f, 0.05f); + Math_ApproachF(&this->actor.speed, 1.0f, 1.0f, 0.05f); Math_ApproachF(&this->unk_1A8, 0.0f, 1.0f, 256.0f); if (this->unk_172[0] == 0) { @@ -3107,14 +3107,14 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { if ((this->actor.xzDistToPlayer < (250.0f * sp118)) || (this->unk_172[1] != 0)) { Math_ApproachF(&this->unk_1A8, 8192.0f, 1.0f, 768.0f); - Math_ApproachF(&this->actor.speedXZ, 4.2f, 1.0f, 0.75); + Math_ApproachF(&this->actor.speed, 4.2f, 1.0f, 0.75); this->unk_188 = 1.2f; this->unk_18C = 4000.0f; this->unk_172[0] = 20; } else { this->unk_188 = 1.0f; this->unk_18C = 2000.0f; - Math_ApproachF(&this->actor.speedXZ, 1.5f, 1.0f, 0.1f); + Math_ApproachF(&this->actor.speed, 1.5f, 1.0f, 0.1f); } if ((this->unk_172[0] == 0) || (sp124 < 50.0f)) { @@ -3136,7 +3136,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { Math_ApproachS(&this->unk_15E, 0, 0x14, 0x20); if ((this->actor.xzDistToPlayer < (250.0f * sp118)) || (this->unk_172[1] != 0)) { - Math_ApproachF(&this->actor.speedXZ, 3.0f, 1.0f, 0.75); + Math_ApproachF(&this->actor.speed, 3.0f, 1.0f, 0.75); this->unk_188 = 1.0f; this->unk_172[0] = 20; this->unk_18C = 4000.0f; @@ -3150,12 +3150,12 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { } else if (sp124 > 50.0f) { this->unk_188 = 0.8f; this->unk_18C = 1500.0f; - Math_ApproachF(&this->actor.speedXZ, 1.0f, 1.0f, 0.1f); + Math_ApproachF(&this->actor.speed, 1.0f, 1.0f, 0.1f); Math_ApproachF(&this->unk_1A8, 2048.0f, 1.0f, 128.0f); } else { this->unk_188 = 0.4f; this->unk_18C = 500.0f; - Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 0.02f); + Math_ApproachZeroF(&this->actor.speed, 1.0f, 0.02f); Math_ApproachF(&this->unk_1A8, 0.0f, 1.0f, 256.0f); } @@ -3184,11 +3184,11 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { Math_ApproachS(&this->unk_15E, -0x1000, 0x14, 0x100); if (this->actor.world.pos.y < (WATER_SURFACE_Y(play) - 20.0f)) { - Math_ApproachF(&this->actor.speedXZ, 0.5f, 1.0f, 0.1f); + Math_ApproachF(&this->actor.speed, 0.5f, 1.0f, 0.1f); } else { - Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 0.01f); + Math_ApproachZeroF(&this->actor.speed, 1.0f, 0.01f); - if ((this->actor.speedXZ == 0.0f) || (this->actor.world.pos.y > (WATER_SURFACE_Y(play) - 5.0f))) { + if ((this->actor.speed == 0.0f) || (this->actor.world.pos.y > (WATER_SURFACE_Y(play) - 5.0f))) { this->unk_1AC.x = Rand_ZeroFloat(300.0f); this->unk_1AC.z = Rand_ZeroFloat(300.0f); this->unk_1AC.y = this->actor.floorHeight + 10.0f; @@ -3222,7 +3222,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { if (sp124 > 40.0f) { this->unk_188 = 0.7f; this->unk_18C = 1200.0f; - Math_ApproachF(&this->actor.speedXZ, 0.5f, 1.0f, 0.01f); + Math_ApproachF(&this->actor.speed, 0.5f, 1.0f, 0.01f); Math_ApproachF(&this->unk_1A8, 2048.0f, 1.0f, 128.0f); } else { this->unk_150 = -1; @@ -3285,7 +3285,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { this->unk_18C = 500.0f; this->unk_172[0] = Rand_ZeroFloat(10.0f) + 2.0f; } - Math_ApproachF(&this->actor.speedXZ, -0.2f, 1.0f, 0.1f); + Math_ApproachF(&this->actor.speed, -0.2f, 1.0f, 0.1f); this->unk_156 = 1; } else { if (this->unk_156 != 0) { @@ -3293,7 +3293,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { this->unk_1A8 = 0.0f; this->unk_18C = 3000.0f; } - Math_ApproachF(&this->actor.speedXZ, 3.0f, 1.0f, 0.15f); + Math_ApproachF(&this->actor.speed, 3.0f, 1.0f, 0.15f); this->unk_156 = 0; } @@ -3377,7 +3377,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { this->unk_1AC.z = sLurePos.z + sp100.z; this->unk_1AC.y = sLurePos.y - 10.0f; this->unk_1A8 = 4096.0f; - Math_ApproachF(&this->actor.speedXZ, this->unk_180 * 0.8f, 1.0f, 1.0f); + Math_ApproachF(&this->actor.speed, this->unk_180 * 0.8f, 1.0f, 1.0f); if ((D_8090CD14 != 3) || (sLurePos.y > (WATER_SURFACE_Y(play) + 5.0f)) || (sqrtf(SQ(sLurePos.x) + SQ(sLurePos.z)) > 800.0f)) { @@ -3402,7 +3402,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { this->unk_149 = 50; sp134 = 2; this->unk_1AC = sLurePos; - Math_ApproachF(&this->actor.speedXZ, this->unk_180, 1.0f, 1.0f); + Math_ApproachF(&this->actor.speed, this->unk_180, 1.0f, 1.0f); if ((D_8090CD14 != 3) || (this->unk_172[0] == 0) || (sLurePos.y > (WATER_SURFACE_Y(play) + 5.0f)) || (sqrtf(SQ(sLurePos.x) + SQ(sLurePos.z)) > 800.0f)) { @@ -3467,7 +3467,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { case -3: this->unk_149 = 50; this->unk_1AC = sLurePos; - Math_ApproachF(&this->actor.speedXZ, 2.0f, 1.0f, 1.0f); + Math_ApproachF(&this->actor.speed, 2.0f, 1.0f, 1.0f); if ((D_8090CD14 != 3) || (this->unk_172[0] == 0) || (sLurePos.y > (WATER_SURFACE_Y(play) + 5.0f)) || (sqrtf(SQ(sLurePos.x) + SQ(sLurePos.z)) > 800.0f)) { @@ -3641,17 +3641,17 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { D_8091726C = 0.0f; this->unk_188 = 1.6f; this->unk_18C = 6000.0f; - Math_ApproachF(&this->actor.speedXZ, 7.5f, 1.0f, 1.0f); + Math_ApproachF(&this->actor.speed, 7.5f, 1.0f, 1.0f); Math_ApproachS(&this->unk_168, 0x4E20, 2, 0xFA0); } else { if ((D_80917274 == 0) && (D_80917206 == 2)) { this->unk_188 = 1.0f; this->unk_18C = 2000.0f; - Math_ApproachF(&this->actor.speedXZ, 3.0f, 1.0f, 0.2f); + Math_ApproachF(&this->actor.speed, 3.0f, 1.0f, 0.2f); } else { this->unk_188 = 1.4f; this->unk_18C = 5000.0f; - Math_ApproachF(&this->actor.speedXZ, 5.0f, 1.0f, 0.5f); + Math_ApproachF(&this->actor.speed, 5.0f, 1.0f, 0.5f); } if (this->unk_148 == 0) { @@ -3676,7 +3676,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { D_8091726C = 1.3f - (this->unk_1A4 * 0.00899f * 1.4f); } - Math_ApproachF(&this->actor.speedXZ, 2.0f, 1.0f, 0.5f); + Math_ApproachF(&this->actor.speed, 2.0f, 1.0f, 0.5f); if (this->unk_172[1] == 0) { this->unk_14A = 0; @@ -3697,7 +3697,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { } if (D_80917274 || (D_80917206 != 2)) { - if (this->actor.speedXZ < 3.0f) { + if (this->actor.speed < 3.0f) { if (D_809171FE & 8) { sp100.x = -0.8f; } else { @@ -3720,11 +3720,11 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { if ((SQ(sp10C.x) + SQ(sp10C.y) + SQ(sp10C.z)) > SQ(20.0f)) { Math_ApproachF(&this->actor.world.pos.x, sReelLinePos[LINE_SEG_COUNT - 2].x, 0.2f, - 2.0f * (this->actor.speedXZ * 1.5f)); + 2.0f * (this->actor.speed * 1.5f)); Math_ApproachF(&this->actor.world.pos.y, sReelLinePos[LINE_SEG_COUNT - 2].y, 0.2f, - 2.0f * (this->actor.speedXZ * 1.5f) * 5.0f * 0.1f); + 2.0f * (this->actor.speed * 1.5f) * 5.0f * 0.1f); Math_ApproachF(&this->actor.world.pos.z, sReelLinePos[LINE_SEG_COUNT - 2].z, 0.2f, - 2.0f * (this->actor.speedXZ * 1.5f)); + 2.0f * (this->actor.speed * 1.5f)); } if (CHECK_BTN_ALL(input->cur.button, BTN_A) || (input->rel.stick_y < -30)) { @@ -3955,7 +3955,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { D_8090CF18 = 3; } - Math_ApproachF(&this->actor.speedXZ, 5.0f, 1.0f, 1.0f); + Math_ApproachF(&this->actor.speed, 5.0f, 1.0f, 1.0f); if (sp124 < 20.0f) { Math_ApproachS(&this->unk_168, 0x4E20, 2, 0xFA0); @@ -4014,7 +4014,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { spF6 = -0x1F40; } - if (this->actor.speedXZ >= 3.2f) { + if (this->actor.speed >= 3.2f) { Math_ApproachS(&this->unk_166, spF6, 2, 0x4E20); } else { Math_ApproachS(&this->unk_166, spF6, 3, 0xBB8); @@ -4050,7 +4050,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { Math_ApproachS(&this->unk_15A, this->unk_160, spF0, spEE); Math_ApproachS(&this->unk_15C, this->unk_162, spFA, 0x2000); - if (this->actor.speedXZ <= 0.5f) { + if (this->actor.speed <= 0.5f) { Math_ApproachS(&this->actor.shape.rot.x, 0, 10, this->unk_170); Math_ApproachS(&this->unk_170, 0x500, 1, 0x20); } else { @@ -4081,14 +4081,14 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { if ((this->actor.world.pos.y < WATER_SURFACE_Y(play)) && (this->actor.world.pos.y > (WATER_SURFACE_Y(play) - 10.0f)) && !(this->unk_154 & 1) && - (this->actor.speedXZ > 0.0f)) { + (this->actor.speed > 0.0f)) { Vec3f pos = this->actor.world.pos; pos.y = WATER_SURFACE_Y(play); EnFishing_SpawnRipple(&this->actor.projectedPos, play->specialEffects, &pos, 80.0f, 500.0f, 150, 90); } - if ((this->actor.speedXZ > 0.0f) || (this->unk_150 == 5)) { + if ((this->actor.speed > 0.0f) || (this->unk_150 == 5)) { f32 velocityY = this->actor.velocity.y; spD8 = this->unk_1A4 * 0.1f; @@ -5133,7 +5133,7 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) { if ((D_809171FC != 0) && (D_8090CD4C == 0) && (player->actor.world.pos.z > 1360.0f) && (fabsf(player->actor.world.pos.x) < 25.0f)) { player->actor.world.pos.z = 1360.0f; - player->actor.speedXZ = 0.0f; + player->actor.speed = 0.0f; if (D_8090CD50 == 0) { D_8090CD4C = 10; @@ -5306,7 +5306,7 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) { // fallthrough case 11: player->actor.world.pos.z = 1360.0f; - player->actor.speedXZ = 0.0f; + player->actor.speed = 0.0f; if (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) { Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); @@ -5455,7 +5455,7 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) { } if ((player->actor.floorHeight < (WATER_SURFACE_Y(play) - 3.0f)) && - (player->actor.world.pos.y < (player->actor.floorHeight + 3.0f)) && (player->actor.speedXZ > 1.0f) && + (player->actor.world.pos.y < (player->actor.floorHeight + 3.0f)) && (player->actor.speed > 1.0f) && ((play->gameplayFrames % 2) == 0)) { Vec3f pos; @@ -5466,7 +5466,7 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) { } if ((player->actor.floorHeight < WATER_SURFACE_Y(play)) && - (player->actor.floorHeight > (WATER_SURFACE_Y(play) - 10.0f)) && (player->actor.speedXZ >= 4.0f) && + (player->actor.floorHeight > (WATER_SURFACE_Y(play) - 10.0f)) && (player->actor.speed >= 4.0f) && ((play->gameplayFrames % 4) == 0)) { s16 i; 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 04e9631388..eeb1a6bc31 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -259,7 +259,7 @@ void func_808D0A48(EnFloormas* this, PlayState* play) { void func_808D0B08(EnFloormas* this) { Animation_PlayOnce(&this->skelAnime, &gWallmasterIdleAnim); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_808D0B50; } @@ -301,7 +301,7 @@ void func_808D0CE4(EnFloormas* this) { } this->unk_18E = Rand_S16Offset(2, 4); - this->actor.speedXZ = 1.5f; + this->actor.speed = 1.5f; this->actionFunc = func_808D0D70; } @@ -334,7 +334,7 @@ void func_808D0D70(EnFloormas* this, PlayState* play) { void func_808D0ECC(EnFloormas* this) { Animation_PlayOnce(&this->skelAnime, &gWallmasterStopWalkAnim); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_808D0F14; } @@ -346,7 +346,7 @@ void func_808D0F14(EnFloormas* this, PlayState* play) { void func_808D0F50(EnFloormas* this) { this->unk_18E = 0; - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; this->skelAnime.playSpeed = 3.0f; this->actionFunc = func_808D0F80; } @@ -370,7 +370,7 @@ void func_808D0F80(EnFloormas* this, PlayState* play) { void func_808D108C(EnFloormas* this) { s16 sp36 = this->unk_190 - this->actor.shape.rot.y; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (sp36 > 0) { Animation_MorphToPlayOnce(&this->skelAnime, &gFloormasterTurnAnim, -3.0f); } else { @@ -419,7 +419,7 @@ void func_808D11BC(EnFloormas* this, PlayState* play) { void func_808D1380(EnFloormas* this, PlayState* play) { Animation_Change(&this->skelAnime, &gWallmasterHoverAnim, 3.0f, 0.0f, Animation_GetLastFrame(&gWallmasterHoverAnim), ANIMMODE_ONCE, -3.0f); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.gravity = 0.0f; func_808D08D0(this); Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 15.0f, 6, 20.0f, 300, 100, 1); @@ -460,7 +460,7 @@ void func_808D14DC(EnFloormas* this, PlayState* play) { void func_808D161C(EnFloormas* this) { this->unk_18E = 25; this->actor.gravity = -0.15f; - this->actor.speedXZ = 0.5f; + this->actor.speed = 0.5f; this->actionFunc = func_808D1650; } @@ -471,7 +471,7 @@ void func_808D1650(EnFloormas* this, PlayState* play) { this->unk_18E--; } - Math_StepToF(&this->actor.speedXZ, 15.0f, SQ(this->actor.speedXZ) * (1.0f / 3.0f)); + Math_StepToF(&this->actor.speed, 15.0f, SQ(this->actor.speed) * (1.0f / 3.0f)); Math_ScaledStepToS(&this->actor.shape.rot.x, -0x1680, 0x140); temp_f0_2 = this->actor.world.pos.y - this->actor.floorHeight; @@ -492,7 +492,7 @@ void func_808D1650(EnFloormas* this, PlayState* play) { void func_808D1740(EnFloormas* this) { Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 1.0f, 41.0f, 42.0f, ANIMMODE_ONCE, 5.0f); - if ((this->actor.speedXZ < 0.0f) || (this->actionFunc != func_808D1650)) { + if ((this->actor.speed < 0.0f) || (this->actionFunc != func_808D1650)) { this->unk_18E = 30; } else { this->unk_18E = 45; @@ -519,14 +519,14 @@ void func_808D17EC(EnFloormas* this, PlayState* play) { } if (this->actor.bgCheckFlags & 8) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if (sp24 != 0) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 2.0f); + Math_StepToF(&this->actor.speed, 0.0f, 2.0f); } - if ((this->actor.speedXZ > 0.0f) && ((this->actor.world.pos.y - this->actor.floorHeight) < 12.0f)) { + if ((this->actor.speed > 0.0f) && ((this->actor.world.pos.y - this->actor.floorHeight) < 12.0f)) { func_808D14DC(this, play); } @@ -575,7 +575,7 @@ void func_808D19D4(EnFloormas* this) { this->actor.flags &= ~ACTOR_FLAG_400; this->actor.flags |= ACTOR_FLAG_200; this->actor.colChkInfo.health = 1; - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; this->actor.velocity.y = 7.0f; this->actionFunc = func_808D1B44; } @@ -587,7 +587,7 @@ void func_808D1B44(EnFloormas* this, PlayState* play) { this->unk_194 = 50; func_808D0C14(this); } - Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f); + Math_StepToF(&this->actor.speed, 0.0f, 1.0f); } if (this->actor.bgCheckFlags & 2) { Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); @@ -596,7 +596,7 @@ void func_808D1B44(EnFloormas* this, PlayState* play) { void func_808D1BCC(EnFloormas* this) { Animation_PlayLoopSetSpeed(&this->skelAnime, &gWallmasterWalkAnim, 4.5f); - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; this->actionFunc = func_808D1C1C; } @@ -624,7 +624,7 @@ void func_808D1D0C(EnFloormas* this) { if (this->actionFunc != func_808D1C1C) { Animation_PlayLoopSetSpeed(&this->skelAnime, &gWallmasterWalkAnim, 4.5f); } - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; this->actionFunc = func_808D1D6C; } @@ -667,7 +667,7 @@ void func_808D1D6C(EnFloormas* this, PlayState* play) { void func_808D1ED4(EnFloormas* this, PlayState* play) { Vec3f sp34; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; sp34.x = this->actor.world.pos.x; sp34.y = this->actor.world.pos.y + 15.0f; @@ -686,7 +686,7 @@ void func_808D1F7C(EnFloormas* this, PlayState* play) { void func_808D1FD4(EnFloormas* this) { Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 2.0f, 0.0f, 41.0f, ANIMMODE_ONCE, 0.0f); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_808D2040; } @@ -697,11 +697,11 @@ void func_808D2040(EnFloormas* this, PlayState* play) { if (this->skelAnime.curFrame < 20.0f) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); } else if (Animation_OnFrame(&this->skelAnime, 20.0f)) { - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; this->actor.velocity.y = 7.0f; } else if (this->actor.bgCheckFlags & 2) { this->unk_18E = 50; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); func_808D1740(this); } else if ((this->actor.playerHeightRel < -10.0f) && (this->collider.base.ocFlags1 & OC1_HIT) && @@ -716,7 +716,7 @@ void func_808D217C(EnFloormas* this, Player* player) { Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 1.0f, 36.0f, 45.0f, ANIMMODE_ONCE, -3.0f); this->actor.flags &= ~ACTOR_FLAG_1; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; func_808D08D0(this); ptr = &D_808D3900[GET_PLAYER_FORM]; @@ -759,7 +759,7 @@ void func_808D22C8(EnFloormas* this, PlayState* play) { this->actor.shape.rot.x = 0; this->actor.velocity.y = 6.0f; this->actor.flags |= ACTOR_FLAG_1; - this->actor.speedXZ = -3.0f; + this->actor.speed = -3.0f; func_808D1740(this); } else if ((this->unk_190 % 20) == 0) { Player_PlaySfx(player, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->voiceSfxIdOffset); @@ -770,7 +770,7 @@ void func_808D22C8(EnFloormas* this, PlayState* play) { void func_808D2484(EnFloormas* this) { Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 2.0f, 0.0f, 41.0f, ANIMMODE_ONCE, 0.0f); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_808D24F0; } @@ -791,7 +791,7 @@ void func_808D24F0(EnFloormas* this, PlayState* play) { } if (Animation_OnFrame(&this->skelAnime, 20.0f)) { - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; this->actor.velocity.y = 7.0f; } else if (this->skelAnime.curFrame < 20.0f) { Math_ApproachS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, phi_s1), 2, 0xE38); @@ -801,14 +801,14 @@ void func_808D24F0(EnFloormas* this, PlayState* play) { func_808D2A20(this); this->collider.base.ocFlags1 |= OC1_ON; } else if (this->actor.bgCheckFlags & 2) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); func_808D1740(this); } if ((fabsf(this->actor.world.pos.x - phi_s1->world.pos.x) < 5.0f) && (fabsf(this->actor.world.pos.z - phi_s1->world.pos.z) < 5.0f)) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 2.0f); + Math_StepToF(&this->actor.speed, 0.0f, 2.0f); } } @@ -817,7 +817,7 @@ void func_808D2700(EnFloormas* this) { this->unk_18E = 0; this->unk_194 = 1500; this->actor.params = ENFLOORMAS_GET_7FFF_40; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; func_808D08D0(this); this->actionFunc = func_808D2764; } @@ -924,7 +924,7 @@ void func_808D2B18(EnFloormas* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gWallmasterDamageAnim, -3.0f); func_800BE504(&this->actor, &this->collider); Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20); - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; this->actor.velocity.y = 5.5f; if (this->actor.params == ENFLOORMAS_GET_7FFF_40) { EnFloormas* parent = (EnFloormas*)this->actor.parent; @@ -960,12 +960,12 @@ void func_808D2C08(EnFloormas* this, PlayState* play) { } } - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f); + Math_StepToF(&this->actor.speed, 0.0f, 0.2f); } void func_808D2CDC(EnFloormas* this) { Animation_PlayOnce(&this->skelAnime, &gWallmasterRecoverFromDamageAnim); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = func_808D2D30; @@ -978,7 +978,7 @@ void func_808D2D30(EnFloormas* this, PlayState* play) { } void func_808D2D6C(EnFloormas* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.velocity.y > 0.0f) { this->actor.velocity.y = 0.0f; } @@ -1085,8 +1085,8 @@ void EnFloormas_Update(Actor* thisx, PlayState* play) { if (this->actionFunc != func_808D2AA8) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; - this->actor.speedXZ *= -0.5f; - this->actor.speedXZ = CLAMP_MAX(this->actor.speedXZ, -5.0f); + this->actor.speed *= -0.5f; + this->actor.speed = CLAMP_MAX(this->actor.speed, -5.0f); this->actor.velocity.y = 5.0f; func_808D1740(this); } 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 0fa4927a97..712a20428d 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 @@ -156,7 +156,7 @@ void func_80ACE51C(EnFuMato* this, PlayState* play) { } } - this->dyna.actor.speedXZ = 2.0f; + this->dyna.actor.speed = 2.0f; this->dyna.actor.shape.rot.y = Math_Vec3f_Yaw(&this->dyna.actor.world.pos, &this->dyna.actor.parent->world.pos); Actor_MoveWithGravity(&this->dyna.actor); 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 171c6a397c..9158009935 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -188,7 +188,7 @@ void EnFz_Init(Actor* thisx, PlayState* play) { this->unk_BCE = 0; this->unk_BD7 = 1; this->unk_BD8 = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.uncullZoneScale = 400.0f; this->unk_BAC = this->actor.world.pos.y; this->unk_BB4 = this->actor.world.pos.y; @@ -364,7 +364,7 @@ void func_80932C98(EnFz* this, PlayState* play) { this->actor.bgCheckFlags &= ~0x8; this->unk_BCD = 0; this->unk_BBC = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } } @@ -405,7 +405,7 @@ void func_80932C98(EnFz* this, PlayState* play) { this->unk_BCD = 0; this->unk_BBC = 0.0f; this->collider1.base.acFlags &= ~AC_HIT; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_BCA = 10; func_809330D4(this); } else if (this->collider2.base.acFlags & AC_BOUNCED) { @@ -572,7 +572,7 @@ void func_809333D8(EnFz* this, PlayState* play) { void func_80933414(EnFz* this) { this->unk_BD6 = 1; this->unk_BBC = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_BCA = 40; this->actionFunc = func_80933444; } @@ -649,7 +649,7 @@ void func_809336C0(EnFz* this, PlayState* play) { this->unk_BBC = 0.0f; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_BCC = 1; this->unk_BCE = 0; this->unk_BD8 = 1; @@ -672,7 +672,7 @@ void func_80933790(EnFz* this) { this->unk_BCE = 0; this->unk_BD8 = 1; this->actor.flags &= ~ACTOR_FLAG_1; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_BBC = 0.0f; this->actionFunc = func_809337D4; } @@ -821,7 +821,7 @@ void EnFz_Update(Actor* thisx, PlayState* play) { } } - Math_StepToF(&this->actor.speedXZ, this->unk_BBC, 0.2f); + Math_StepToF(&this->actor.speed, this->unk_BBC, 0.2f); Actor_MoveWithGravity(&this->actor); if (this->unk_BCC != 0) { Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 20.0f, 5); 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 b9c81ebad5..d94267b382 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -202,7 +202,7 @@ void EnGe1_SetupPath(EnGe1* this, PlayState* play) { this->picto.actor.world.rot.y = Math_Vec3f_Yaw(&this->picto.actor.world.pos, &nextPoint); this->picto.actor.world.rot.x = Math_Vec3f_Pitch(&this->picto.actor.world.pos, &nextPoint); - this->picto.actor.speedXZ = 15.0f; + this->picto.actor.speed = 15.0f; } } else { this->path = NULL; 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 bcbed04115..403a160660 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -104,7 +104,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { this->picto.actor.terminalVelocity = -9.0f; this->picto.actor.gravity = -1.0f; - this->picto.actor.speedXZ = 1.5f; + this->picto.actor.speed = 1.5f; this->actionFunc = EnGe2_Walk; this->picto.validationFunc = EnGe2_ValidatePictograph; @@ -121,7 +121,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, 0.0f); this->actionFunc = EnGe2_GuardStationary; - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; this->picto.actor.uncullZoneForward = 4000.0f; break; @@ -263,7 +263,7 @@ void EnGe2_SetupBlownAwayPath(EnGe2* this, PlayState* play) { this->picto.actor.world.rot.y = Math_Vec3f_Yaw(&this->picto.actor.world.pos, &nextPoint); this->picto.actor.world.rot.x = Math_Vec3f_Pitch(&this->picto.actor.world.pos, &nextPoint); - this->picto.actor.speedXZ = 15.0f; + this->picto.actor.speed = 15.0f; } } else { this->path = NULL; @@ -328,7 +328,7 @@ s32 EnGe2_FollowPathWithoutGravity(EnGe2* this) { pitchTarget = Math_Vec3f_Pitch(&this->picto.actor.world.pos, &point); Math_SmoothStepToS(&this->picto.actor.world.rot.y, yawTarget, 0xA, 0x3E8, 0x64); Math_SmoothStepToS(&this->picto.actor.world.rot.x, pitchTarget, 6, 0x7D0, 0xC8); - this->picto.actor.speedXZ = 15.0f; + this->picto.actor.speed = 15.0f; Actor_MoveWithoutGravityReverse(&this->picto.actor); @@ -392,7 +392,7 @@ void EnGe2_CapturePlayer(EnGe2* this, PlayState* play) { } void EnGe2_SetupCapturePlayer(EnGe2* this) { - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; this->actionFunc = EnGe2_CapturePlayer; Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, -8.0f); @@ -430,7 +430,7 @@ void EnGe2_SetupCharge(EnGe2* this, PlayState* play) { Animation_Change(&this->skelAnime, &gGerudoPurpleChargingAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGerudoPurpleChargingAnim), 0, -8.0f); this->timer = 50; - this->picto.actor.speedXZ = 4.0f; + this->picto.actor.speed = 4.0f; this->actionFunc = EnGe2_Charge; } } @@ -439,7 +439,7 @@ void EnGe2_SetupLookAround(EnGe2* this) { Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, -8.0f); this->timer = 60; - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; this->actionFunc = EnGe2_LookAround; } @@ -479,20 +479,20 @@ void EnGe2_PatrolDuties(EnGe2* this, PlayState* play) { f32 visionRange = gSaveContext.save.isNight ? 200.0f : 280.0f; if (player->csMode == 0x1A) { - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; this->actionFunc = EnGe2_SetupCharge; Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, -8.0f); this->stateFlags |= GERUDO_PURPLE_STATE_CAPTURING; } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_80_08)) { - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; this->actionFunc = EnGe2_TurnToPlayerFast; Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, -8.0f); } else if (EnGe2_LookForPlayer(play, &this->picto.actor, &this->picto.actor.focus.pos, this->picto.actor.shape.rot.y, 0x1800, visionRange, this->verticalDetectRange)) { if ((GERUDO_PURPLE_GET_EXIT(&this->picto.actor) != GERUDO_PURPLE_EXIT_NONE) && !Play_InCsMode(play)) { - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; func_800B7298(play, &this->picto.actor, 0x1A); func_801000A4(NA_SE_SY_FOUND); Message_StartTextbox(play, 0x1194, &this->picto.actor); @@ -504,14 +504,14 @@ void EnGe2_PatrolDuties(EnGe2* this, PlayState* play) { if ((this->collider.info.acHitInfo != NULL) && (this->collider.info.acHitInfo->toucher.dmgFlags & DMG_DEKU_NUT)) { Actor_SetColorFilter(&this->picto.actor, 0, 120, 0, 400); - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; this->actionFunc = EnGe2_Stunned; this->stateFlags |= GERUDO_PURPLE_STATE_STUNNED; } else { Animation_Change(&this->skelAnime, &gGerudoPurpleFallingToGroundAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGerudoPurpleFallingToGroundAnim), 2, -8.0f); this->timer = 200; - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; this->actionFunc = EnGe2_KnockedOut; Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_DEAD); this->picto.actor.flags &= ~ACTOR_FLAG_1; @@ -566,7 +566,7 @@ void EnGe2_LookAround(EnGe2* this, PlayState* play) { void EnGe2_Walk(EnGe2* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - this->picto.actor.speedXZ = 1.5f; + this->picto.actor.speed = 1.5f; switch (EnGe2_FollowPath(this)) { case GERUDO_PURPLE_PATHSTATUS_END: @@ -634,7 +634,7 @@ void EnGe2_PerformCutsceneActions(EnGe2* this, PlayState* play) { switch (this->csAction) { case ENGE2_CSACTION_BEEHIVE_RUN_AWAY: EnGe2_FollowPath(this); - this->picto.actor.speedXZ = 5.0f; + this->picto.actor.speed = 5.0f; if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) { Actor_PlaySfx(&this->picto.actor, NA_SE_EV_PIRATE_WALK); @@ -708,7 +708,7 @@ void EnGe2_Update(Actor* thisx, PlayState* play) { this->stateFlags &= ~GERUDO_PURPLE_STATE_KO; this->stateFlags &= ~GERUDO_PURPLE_STATE_PATH_REVERSE; this->picto.actor.flags |= ACTOR_FLAG_20; - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; } this->actionFunc(this, play); 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 2d0b819152..ba84c4f56e 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.c +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.c @@ -228,7 +228,7 @@ s32 func_80BB18FC(EnGeg* this, Actor* actor) { if ((sp24 < 150.0f) && (fabsf(sp20) < 5.0f)) { this->unk_230 |= 0x20; - actor->speedXZ = 0.0f; + actor->speed = 0.0f; actor->velocity.y = 0.0f; this->actor.child = actor; actor->parent = &this->actor; @@ -741,13 +741,13 @@ void func_80BB2F7C(EnGeg* this, PlayState* play) { if ((this->actor.xzDistToPlayer < 150.0f) && (fabsf(this->actor.playerHeightRel) < 10.0f) && (this->actor.bgCheckFlags & 1)) { this->unk_4AC = 2; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_230 &= ~1; this->actor.shape.yOffset = 0.0f; func_80BB2020(this, play); this->actionFunc = func_80BB2E00; } else { - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; Actor_MoveWithGravity(&this->actor); } @@ -841,7 +841,7 @@ void func_80BB3318(EnGeg* this, PlayState* play) { func_800AEF44(Effect_GetByIndex(this->unk_4DC)); Actor_Kill(&this->actor); } else { - Math_ApproachF(&this->actor.speedXZ, 10.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 10.0f, 0.2f, 1.0f); Actor_MoveWithGravity(&this->actor); } @@ -1058,7 +1058,7 @@ void func_80BB3BE0(EnGeg* this, PlayState* play) { } void func_80BB3CB4(EnGeg* this, PlayState* play) { - f32 sp24 = play->state.frames * this->actor.speedXZ * 1400.0f; + f32 sp24 = play->state.frames * this->actor.speed * 1400.0f; OPEN_DISPS(play->state.gfxCtx); 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 b2f35c49e9..fe3e2fb463 100644 --- a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c +++ b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c @@ -192,17 +192,17 @@ void func_80B3B120(EnGg2* this, PlayState* play) { if (func_80B3B648(this, this->unk_1D8, this->unk_1DC) != 0) { if (this->unk_1DC >= (this->unk_1D8->count - 2)) { this->actionFunc = func_80B3AE60; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { this->unk_1DC++; } } - Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 5.0f, 0.2f, 1.0f); } } void func_80B3B21C(EnGg2* this, PlayState* play) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if ((this->actor.xzDistToPlayer < 100.0f) && CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { this->unk_2E4 = ActorCutscene_GetAdditionalCutscene(this->unk_2E4); this->actionFunc = func_80B3B5D4; @@ -256,7 +256,7 @@ void func_80B3B294(EnGg2* this, PlayState* play) { } } } - Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 5.0f, 0.2f, 1.0f); } void func_80B3B4B0(EnGg2* this, PlayState* play) { 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 7312cbbc86..f0c8508853 100644 --- a/src/overlays/actors/ovl_En_Gk/z_en_gk.c +++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.c @@ -821,7 +821,7 @@ void func_80B51EA4(EnGk* this, PlayState* play) { } if (ABS_ALT(sp36) < 0x2AAA) { - Math_ApproachF(&this->actor.speedXZ, 3.0f, 0.2f, 0.5f); + Math_ApproachF(&this->actor.speed, 3.0f, 0.2f, 0.5f); } Actor_MoveWithGravity(&this->actor); } 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 f5f36e5240..8e62b499b9 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -1770,7 +1770,7 @@ void func_80A153FC(EnGo* this, PlayState* play) { func_80A118F8(this->unk_3F8, this->actor.world.pos); this->actor.shape.rot.x = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_COLD); @@ -1809,8 +1809,8 @@ void func_80A153FC(EnGo* this, PlayState* play) { func_800AEF44(Effect_GetByIndex(this->unk_3E8)); } - this->actor.speedXZ = 4.0f; - this->actor.shape.rot.x += (s16)(this->actor.speedXZ * 546.0f); + this->actor.speed = 4.0f; + this->actor.shape.rot.x += (s16)(this->actor.speed * 546.0f); Actor_MoveWithGravity(&this->actor); } } 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 a081c68edc..9ba8582786 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -358,7 +358,7 @@ s32 func_8093F34C(EnGoroiwa* this) { f32 x; f32 z; - Math_StepToF(&this->actor.speedXZ, D_80942DFC[this->unk_1E4], 0.3f); + Math_StepToF(&this->actor.speed, D_80942DFC[this->unk_1E4], 0.3f); Actor_UpdateVelocityWithGravity(&this->actor); temp_v0 = &this->unk_1D0[this->unk_1D8]; this->actor.velocity.y *= 0.97f; @@ -368,7 +368,7 @@ s32 func_8093F34C(EnGoroiwa* this) { tempX = x - this->actor.world.pos.x; tempZ = z - this->actor.world.pos.z; - if (SQ(this->actor.speedXZ + 1.0f) < (SQ(tempX) + SQ(tempZ))) { + if (SQ(this->actor.speed + 1.0f) < (SQ(tempX) + SQ(tempZ))) { this->actor.world.pos.x += this->actor.velocity.x; this->actor.world.pos.y += this->actor.velocity.y; this->actor.world.pos.z += this->actor.velocity.z; @@ -393,12 +393,12 @@ s32 func_8093F498(EnGoroiwa* this) { sp2C.y = temp_v0->y; sp2C.z = temp_v0->z; - Math_StepToF(&this->actor.speedXZ, D_80942DFC[this->unk_1E4], 0.3f); + Math_StepToF(&this->actor.speed, D_80942DFC[this->unk_1E4], 0.3f); Math_Vec3f_Diff(&sp2C, &this->actor.world.pos, &this->actor.velocity); temp_f0 = Math3D_Vec3fMagnitude(&this->actor.velocity); - if ((this->actor.speedXZ + 1.0f) < temp_f0) { - Math_Vec3f_Scale(&this->actor.velocity, this->actor.speedXZ / temp_f0); + if ((this->actor.speed + 1.0f) < temp_f0) { + Math_Vec3f_Scale(&this->actor.velocity, this->actor.speed / temp_f0); this->actor.world.pos.x += this->actor.velocity.x; this->actor.world.pos.y += this->actor.velocity.y; this->actor.world.pos.z += this->actor.velocity.z; @@ -894,7 +894,7 @@ void func_80940E38(EnGoroiwa* this, PlayState* play) { if (this->actor.flags & ACTOR_FLAG_40) { if (this->actor.xzDistToPlayer < 1000.0f) { - sp5C = (1000.0f - this->actor.xzDistToPlayer) * 0.0012f * (this->actor.speedXZ * 0.1f); + sp5C = (1000.0f - this->actor.xzDistToPlayer) * 0.0012f * (this->actor.speed * 0.1f); if (Rand_ZeroOne() < sp5C) { this->unk_1CE += 20000; sp46 = (s32)Rand_ZeroFloat(20000.0f) + this->unk_1CE; @@ -1049,7 +1049,7 @@ s32 func_8094156C(EnGoroiwa* this, PlayState* play) { temp2 = Math_SinS(ptr->unk_1E); temp3 = Math_SinS(this->actor.world.rot.y); - ptr->unk_0C = ((1.0f / D_80942DFC[this->unk_1E4]) * (temp3 * 14.0f * this->actor.speedXZ)) + + ptr->unk_0C = ((1.0f / D_80942DFC[this->unk_1E4]) * (temp3 * 14.0f * this->actor.speed)) + (temp2 * (temp + 5.0f)); ptr->unk_10 = (Rand_ZeroOne() * 11.0f) + 20.0f; @@ -1057,7 +1057,7 @@ s32 func_8094156C(EnGoroiwa* this, PlayState* play) { temp = Rand_ZeroOne(); temp2 = Math_CosS(ptr->unk_1E); temp3 = Math_CosS(this->actor.world.rot.y); - ptr->unk_14 = ((1.0f / D_80942DFC[this->unk_1E4]) * ((temp3 * 14.0f) * this->actor.speedXZ)) + + ptr->unk_14 = ((1.0f / D_80942DFC[this->unk_1E4]) * ((temp3 * 14.0f) * this->actor.speed)) + (temp2 * (temp + 5.0f)); ptr->unk_1C = 0; @@ -1218,7 +1218,7 @@ void func_80941DB4(EnGoroiwa* this) { func_8093EAB0(this, 6); this->actor.gravity = -0.86f; this->actor.terminalVelocity = -15.0f; - this->actor.speedXZ *= 0.15f; + this->actor.speed *= 0.15f; this->actor.velocity.y = 5.0f; this->unk_1C4 = 1.0f; } @@ -1237,7 +1237,7 @@ void func_80941EB4(EnGoroiwa* this) { static s16 D_80942EAC[] = { 20, 6, 20 }; this->actionFunc = func_80941F10; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; func_8093EAB0(this, 6); this->unk_1C8 = D_80942EAC[this->actor.home.rot.z & 3]; this->unk_1C4 = 0.0f; @@ -1257,7 +1257,7 @@ void func_80941F54(EnGoroiwa* this) { this->actionFunc = func_80941FA4; func_8093EAB0(this, 7); this->unk_1C4 = 0.0f; - this->actor.velocity.y = fabsf(this->actor.speedXZ) * 0.1f; + this->actor.velocity.y = fabsf(this->actor.speed) * 0.1f; } void func_80941FA4(EnGoroiwa* this, PlayState* play) { @@ -1273,7 +1273,7 @@ void func_80941FA4(EnGoroiwa* this, PlayState* play) { } else if (func_8093F5EC(this)) { func_8093FC00(this); func_809419D0(this); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } } } @@ -1283,7 +1283,7 @@ void func_80942084(EnGoroiwa* this) { func_8093EAB0(this, 7); this->unk_1C4 = 0.3f; this->unk_1CA = 0; - this->actor.velocity.y = fabsf(this->actor.speedXZ) * -0.3f; + this->actor.velocity.y = fabsf(this->actor.speed) * -0.3f; this->unk_1E5 |= 0x10; this->unk_1E5 &= ~0x20; } @@ -1302,7 +1302,7 @@ void func_809420F0(EnGoroiwa* this, PlayState* play) { func_8093FC00(this); func_809419D0(this); this->unk_1E5 &= ~0x10; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } } } @@ -1441,7 +1441,7 @@ void EnGoroiwa_Update(Actor* thisx, PlayState* play) { } if ((ENGOROIWA_GET_3000(&this->actor) == ENGOROIWA_3000_2) && (this->actor.bgCheckFlags & 1) && - (this->actionFunc == func_80941A10) && (this->actor.speedXZ > 2.0f)) { + (this->actionFunc == func_80941A10) && (this->actor.speed > 2.0f)) { Math_StepToF(&this->actor.scale.x, 0.16f, (this->actor.xzDistToPlayer < 400.0f) ? this->unk_1E0 * 1.4f : this->unk_1E0); 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 6600aa2bbb..9a506c0ba5 100644 --- a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c +++ b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c @@ -397,11 +397,11 @@ void EnGrasshopper_Fly(EnGrasshopper* this, PlayState* play) { Math_SmoothStepToS(&this->actor.world.rot.z, this->targetRot.z, 5, 0x3E8, 5); this->targetRot.z *= 0.8f; if (this->waitTimer != 0) { - Math_ApproachZeroF(&this->actor.speedXZ, 0.2f, 0.5f); + Math_ApproachZeroF(&this->actor.speed, 0.2f, 0.5f); } else { this->targetRot.z = (this->actor.world.rot.y - this->targetRot.y) * 0.2f; targetSpeed = (this->index * 0.1f) + 4.0f; - Math_ApproachF(&this->actor.speedXZ, targetSpeed, 0.4f, 0.7f); + Math_ApproachF(&this->actor.speed, targetSpeed, 0.4f, 0.7f); Math_ApproachF(&this->rotationalVelocity, 2000.0f, 1.0f, 50.0f); Math_SmoothStepToS(&this->actor.world.rot.y, this->targetRot.y, 5, this->rotationalVelocity, 5); if (this->timer == 0) { @@ -464,7 +464,7 @@ void EnGrasshopper_RoamInCircles(EnGrasshopper* this, PlayState* play) { rotationSpeed = this->index + 70; targetSpeed = (this->index * 0.05f) + 4.0f; this->targetRot.y = Math_Atan2S(diffX, diffZ); - Math_ApproachF(&this->actor.speedXZ, targetSpeed, 0.4f, 0.8f); + Math_ApproachF(&this->actor.speed, targetSpeed, 0.4f, 0.8f); Math_SmoothStepToS(&this->actor.world.rot.y, this->targetRot.y, rotationSpeed, 0xFA0, 0xA); } } @@ -478,7 +478,7 @@ void EnGrasshopper_SetupBank(EnGrasshopper* this) { this->targetBankRot.y = this->actor.world.rot.y + 0x8000; this->action = EN_GRASSHOPPER_ACTION_BANK; this->bankState = EN_GRASSHOPPER_BANK_STATE_BANKING; - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; this->actionFunc = EnGrasshopper_Bank; } @@ -531,7 +531,7 @@ void EnGrasshopper_Bounced(EnGrasshopper* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG); targetSpeed = (this->index * 0.05f) + 7.0f; - Math_ApproachF(&this->actor.speedXZ, targetSpeed, 0.4f, 0.8f); + Math_ApproachF(&this->actor.speed, targetSpeed, 0.4f, 0.8f); Math_SmoothStepToS(&this->actor.world.rot.z, this->targetRot.z, 5, 0x3E8, 5); this->targetRot.z *= 0.8f; Math_SmoothStepToS(&this->actor.world.rot.y, this->targetRot.y, 5, this->rotationalVelocity, 5); @@ -603,7 +603,7 @@ void EnGrasshopper_SetupAttack(EnGrasshopper* this) { EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_ATTACK); this->approachSpeed = 0.0f; Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0xA, 0xFA0, 0xA); - this->actor.speedXZ = 3.0f; + this->actor.speed = 3.0f; this->baseFlyHeight = this->actor.world.pos.y; this->collider.elements[0].info.toucherFlags &= ~(TOUCH_ON | TOUCH_SFX_WOOD); this->collider.elements[1].info.toucherFlags |= (TOUCH_ON | TOUCH_SFX_WOOD); @@ -675,7 +675,7 @@ void EnGrasshopper_SetupWaitAfterAttack(EnGrasshopper* this) { Math_ApproachF(&this->actor.world.pos.y, this->targetPosY, 0.1f, 10.0f); this->action = EN_GRASSHOPPER_ACTION_WAIT_AFTER_ATTACK; this->waitTimer = 20; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->collider.elements[1].info.toucherFlags &= ~(TOUCH_ON | TOUCH_SFX_WOOD); this->actionFunc = EnGrasshopper_WaitAfterAttack; } @@ -697,7 +697,7 @@ void EnGrasshopper_SetupDamaged(EnGrasshopper* this, PlayState* play) { Vec3f damagedVelocity; EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_DAMAGE); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.flags |= ACTOR_FLAG_1; this->approachSpeed = 0.0f; this->collider.elements[1].info.toucherFlags &= ~(TOUCH_ON | TOUCH_SFX_WOOD); @@ -727,7 +727,7 @@ void EnGrasshopper_Damaged(EnGrasshopper* this, PlayState* play) { void EnGrasshopper_SetupDead(EnGrasshopper* this, PlayState* play) { EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_DEAD); this->actor.flags |= ACTOR_FLAG_8000000; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->approachSpeed = 0.0f; this->actor.velocity.y = 5.0f; this->actor.gravity = -0.5f; @@ -768,7 +768,7 @@ void EnGrasshopper_Dead(EnGrasshopper* this, PlayState* play) { void EnGrasshopper_SetupFall(EnGrasshopper* this) { EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_FALL); this->action = EN_GRASSHOPPER_ACTION_FALL; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->approachSpeed = 0.0f; this->actionFunc = EnGrasshopper_Fall; } 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 7703520523..a540da68a4 100644 --- a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c +++ b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c @@ -186,7 +186,7 @@ void func_80B22040(EnHakurock* this, PlayState* play) { void func_80B220A8(EnHakurock* this) { this->actor.params = EN_HAKUROCK_TYPE_BOULDER; this->actor.draw = func_80B228F4; - this->actor.speedXZ = Rand_ZeroFloat(3.5f) + 2.5f; + this->actor.speed = Rand_ZeroFloat(3.5f) + 2.5f; this->actor.velocity.y = Rand_ZeroFloat(4.5f) + 18.0f; Actor_SetScale(&this->actor, (Rand_ZeroFloat(5.0f) + 15.0f) * 0.001f); this->actor.world.rot.y = ((s32)Rand_Next() >> 0x12) + this->actor.parent->shape.rot.y + 0x8000; 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 a576cc8f4a..eb41fc0457 100644 --- a/src/overlays/actors/ovl_En_Hg/z_en_hg.c +++ b/src/overlays/actors/ovl_En_Hg/z_en_hg.c @@ -191,7 +191,7 @@ void EnHg_ChasePlayer(EnHg* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 pad; - this->actor.speedXZ = 1.6f; + this->actor.speed = 1.6f; 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))) { 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 67637d532d..c0ba3a8fd6 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 @@ -316,7 +316,7 @@ void func_80BDBA28(EnHiddenNuts* this, PlayState* play) { Actor_Kill(&this->actor); } - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; this->actor.gravity = -2.0f; this->actor.velocity.y = 4.0f; this->actor.world.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_20C); @@ -360,7 +360,7 @@ void func_80BDBB48(EnHiddenNuts* this, PlayState* play) { if (this->unk_220 == 2) { if (this->unk_22C <= sp58) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; func_80BDB1B4(this, 6); } 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 10e3138f42..d9df702ce0 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 @@ -182,7 +182,7 @@ void func_80C1FE20(EnHintSkb* this, PlayState* play) { void func_80C1FE30(EnHintSkb* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); - this->actor.speedXZ = 1.6f; + this->actor.speed = 1.6f; this->actionFunc = func_80C1FE80; } @@ -199,7 +199,7 @@ void func_80C1FE80(EnHintSkb* this, PlayState* play) { void func_80C1FF30(EnHintSkb* this) { this->collider.base.atFlags &= ~AT_BOUNCED; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); this->actionFunc = func_80C1FF88; } @@ -242,7 +242,7 @@ void func_80C200B8(EnHintSkb* this, PlayState* play) { void func_80C2011C(EnHintSkb* this) { if (this->actor.bgCheckFlags & 1) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->actionFunc = func_80C2016C; @@ -250,10 +250,10 @@ void func_80C2011C(EnHintSkb* this) { void func_80C2016C(EnHintSkb* this, PlayState* play) { if (this->actor.bgCheckFlags & 2) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else if (this->actor.bgCheckFlags & 1) { - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ += 0.05f; + if (this->actor.speed < 0.0f) { + this->actor.speed += 0.05f; } } @@ -276,12 +276,12 @@ void func_80C20274(EnHintSkb* this) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8); this->actor.gravity = -1.0f; - this->actor.speedXZ = 1.0f; + this->actor.speed = 1.0f; } else { this->actor.world.rot.y = this->actor.yawTowardsPlayer; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); if (this->actor.bgCheckFlags & 1) { - this->actor.speedXZ = -4.0f; + this->actor.speed = -4.0f; } } Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); @@ -295,14 +295,14 @@ void func_80C20334(EnHintSkb* this, PlayState* play) { for (i = 0; i < 10; i++) { func_80C215E4(play, this, &this->actor.world.pos); } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if (this->actor.bgCheckFlags & 1) { - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ += 0.05f; - } else if (this->actor.speedXZ != 0.0f) { - this->actor.speedXZ -= 0.05f; + if (this->actor.speed < 0.0f) { + this->actor.speed += 0.05f; + } else if (this->actor.speed != 0.0f) { + this->actor.speed -= 0.05f; } Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 2500, 0); } @@ -319,7 +319,7 @@ void func_80C20484(EnHintSkb* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); this->unk_3E8 |= 4; if (this->actor.bgCheckFlags & 1) { - this->actor.speedXZ = -6.0f; + this->actor.speed = -6.0f; } this->actionFunc = func_80C204F0; } @@ -335,7 +335,7 @@ void func_80C204F0(EnHintSkb* this, PlayState* play) { void func_80C20540(EnHintSkb* this) { if (this->actor.bgCheckFlags & 1) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->actionFunc = func_80C20590; @@ -363,7 +363,7 @@ void func_80C20590(EnHintSkb* this, PlayState* play) { void func_80C2066C(EnHintSkb* this) { if (this->actor.bgCheckFlags & 1) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } this->actionFunc = func_80C2069C; } @@ -388,7 +388,7 @@ void func_80C2069C(EnHintSkb* this, PlayState* play) { void func_80C2075C(EnHintSkb* this) { this->unk_3E0 = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80C2077C; } @@ -401,7 +401,7 @@ void func_80C2077C(EnHintSkb* this, PlayState* play) { this->unk_3E6 = 0x1147; if (this->skelAnime.animation == &object_skb_Anim_00697C) { play->msgCtx.msgMode = 0x44; - this->actor.speedXZ = 2.4f; + this->actor.speed = 2.4f; this->actor.gravity = -1.0f; this->actor.velocity.y = 3.0f; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8); @@ -455,7 +455,7 @@ void func_80C208D0(EnHintSkb* this, PlayState* play) { if (this->actor.bgCheckFlags & 2) { s32 i; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; for (i = 0; i < 10; i++) { func_80C215E4(play, this, &this->actor.world.pos); 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 1c17e4058b..8e5d7a06f1 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -402,8 +402,8 @@ void func_8087B7C0(EnHorse* this, PlayState* play, Path* path) { this->unk_58C = 0x2B; } this->unk_58C--; - if (this->actor.speedXZ > 5.0f) { - this->actor.speedXZ -= 0.5f; + if (this->actor.speed > 5.0f) { + this->actor.speed -= 0.5f; } } else if (this->unk_590 > 0) { if (this->unk_590 == 0x1F4) { @@ -412,19 +412,19 @@ void func_8087B7C0(EnHorse* this, PlayState* play, Path* path) { } } this->unk_590--; - if (this->actor.speedXZ < this->unk_398) { - this->actor.speedXZ += 1.0f; + if (this->actor.speed < this->unk_398) { + this->actor.speed += 1.0f; } else { - this->actor.speedXZ -= 0.5f; + this->actor.speed -= 0.5f; } } else if (this->actor.params == ENHORSE_5) { s16 sp4A; if (sp68 >= this->curRaceWaypoint) { - if (this->actor.speedXZ < this->unk_398) { - this->actor.speedXZ += 0.5f; + if (this->actor.speed < this->unk_398) { + this->actor.speed += 0.5f; } else { - this->actor.speedXZ -= 0.5f; + this->actor.speed -= 0.5f; } this->unk_394 |= 1; return; @@ -433,50 +433,50 @@ void func_8087B7C0(EnHorse* this, PlayState* play, Path* path) { sp4A = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y; if ((fabsf(Math_SinS(sp4A)) < 0.9f) && (Math_CosS(sp4A) > 0.0f)) { - if (this->actor.speedXZ < this->unk_398) { - this->actor.speedXZ += 0.5f; + if (this->actor.speed < this->unk_398) { + this->actor.speed += 0.5f; } else { - this->actor.speedXZ -= 0.25f; + this->actor.speed -= 0.25f; } this->unk_394 |= 1; } else { - if (this->actor.speedXZ < 13.0f) { - this->actor.speedXZ += 0.4f; + if (this->actor.speed < 13.0f) { + this->actor.speed += 0.4f; } else { - this->actor.speedXZ -= 0.2f; + this->actor.speed -= 0.2f; } this->unk_394 &= ~1; } } else if (sp68 >= this->curRaceWaypoint) { - if (this->actor.speedXZ < this->unk_398) { - this->actor.speedXZ += 0.5f; + if (this->actor.speed < this->unk_398) { + this->actor.speed += 0.5f; } else { - this->actor.speedXZ -= 0.5f; + this->actor.speed -= 0.5f; } this->unk_394 |= 1; } else if ((sp68 + 1) == this->curRaceWaypoint) { s16 sp48 = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y; if ((fabsf(Math_SinS(sp48)) < 0.9f) && (Math_CosS(sp48) > 0.0f)) { - if (this->actor.speedXZ < this->unk_398) { - this->actor.speedXZ += 0.5f; + if (this->actor.speed < this->unk_398) { + this->actor.speed += 0.5f; } else { - this->actor.speedXZ -= 0.25f; + this->actor.speed -= 0.25f; } this->unk_394 |= 1; } else { - if (this->actor.speedXZ < 12.0f) { - this->actor.speedXZ += 0.4f; + if (this->actor.speed < 12.0f) { + this->actor.speed += 0.4f; } else { - this->actor.speedXZ -= 0.2f; + this->actor.speed -= 0.2f; } this->unk_394 &= ~1; } } else { - if (this->actor.speedXZ < 13.0f) { - this->actor.speedXZ += 0.4f; + if (this->actor.speed < 13.0f) { + this->actor.speed += 0.4f; } else { - this->actor.speedXZ -= 0.2f; + this->actor.speed -= 0.2f; } this->unk_394 &= ~1; } @@ -800,7 +800,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { thisx->gravity = -3.5f; ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawHorse, 20.0f); this->action = ENHORSE_ACTION_IDLE; - thisx->speedXZ = 0.0f; + thisx->speed = 0.0f; if (this->type == HORSE_TYPE_2) { sJntSphInit.elements[0].dim.limb = 13; @@ -989,7 +989,7 @@ void EnHorse_Freeze(EnHorse* this, PlayState* play) { } void EnHorse_Frozen(EnHorse* this, PlayState* play) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->noInputTimer--; if (this->noInputTimer < 0) { this->colliderCylinder1.base.ocFlags1 |= OC1_ON; @@ -1004,7 +1004,7 @@ void EnHorse_Frozen(EnHorse* this, PlayState* play) { if (play->csCtx.state != CS_STATE_0) { EnHorse_StartMountedIdle(this); } else { - this->actor.speedXZ = 8.0f; + this->actor.speed = 8.0f; EnHorse_StartGalloping(this); } } else if (this->prevAction == ENHORSE_ACTION_IDLE) { @@ -1035,10 +1035,10 @@ void EnHorse_UpdateSpeed(EnHorse* this, PlayState* play, f32 brakeDecel, f32 bra f32 temp_f12; if (!EnHorse_PlayerCanMove(this, play)) { - if (this->actor.speedXZ > 8.0f) { - this->actor.speedXZ -= decel; - } else if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ = 0.0f; + if (this->actor.speed > 8.0f) { + this->actor.speed -= decel; + } else if (this->actor.speed < 0.0f) { + this->actor.speed = 0.0f; } return; } @@ -1047,63 +1047,62 @@ void EnHorse_UpdateSpeed(EnHorse* this, PlayState* play, f32 brakeDecel, f32 bra EnHorse_StickDirection(&this->curStick, &stickMag, &stickAngle); if (Math_CosS(stickAngle) <= brakeAngle) { - this->actor.speedXZ -= brakeDecel; - this->actor.speedXZ = CLAMP_MIN(this->actor.speedXZ, 0.0f); + this->actor.speed -= brakeDecel; + this->actor.speed = CLAMP_MIN(this->actor.speed, 0.0f); return; } if (stickMag < minStickMag) { this->stateFlags &= ~ENHORSE_BOOST; this->stateFlags &= ~ENHORSE_BOOST_DECEL; - this->actor.speedXZ -= decel; - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ = 0.0f; + this->actor.speed -= decel; + if (this->actor.speed < 0.0f) { + this->actor.speed = 0.0f; } return; } if (this->stateFlags & ENHORSE_BOOST) { if ((16 - this->boostTimer) > 0) { - this->actor.speedXZ = - (((EnHorse_SlopeSpeedMultiplier(this, play) * this->boostSpeed) - this->actor.speedXZ) / - (16.0f - this->boostTimer)) + - this->actor.speedXZ; + this->actor.speed = (((EnHorse_SlopeSpeedMultiplier(this, play) * this->boostSpeed) - this->actor.speed) / + (16.0f - this->boostTimer)) + + this->actor.speed; } else { - this->actor.speedXZ = EnHorse_SlopeSpeedMultiplier(this, play) * this->boostSpeed; + this->actor.speed = EnHorse_SlopeSpeedMultiplier(this, play) * this->boostSpeed; } - if ((EnHorse_SlopeSpeedMultiplier(this, play) * this->boostSpeed) <= this->actor.speedXZ) { + if ((EnHorse_SlopeSpeedMultiplier(this, play) * this->boostSpeed) <= this->actor.speed) { this->stateFlags &= ~ENHORSE_BOOST; this->stateFlags |= ENHORSE_BOOST_DECEL; } } else if (this->stateFlags & ENHORSE_BOOST_DECEL) { - if (this->actor.speedXZ > baseSpeed) { - this->actor.speedXZ -= 0.06f; - } else if (this->actor.speedXZ < baseSpeed) { - this->actor.speedXZ = baseSpeed; + if (this->actor.speed > baseSpeed) { + this->actor.speed -= 0.06f; + } else if (this->actor.speed < baseSpeed) { + this->actor.speed = baseSpeed; this->stateFlags &= ~ENHORSE_BOOST_DECEL; } } else { - if (this->actor.speedXZ <= (baseSpeed * (1.0f / 54.0f) * stickMag)) { + if (this->actor.speed <= (baseSpeed * (1.0f / 54.0f) * stickMag)) { phi_f0 = 1.0f; } else { phi_f0 = -1.0f; } - this->actor.speedXZ += phi_f0 * 50.0f * 0.01f; + this->actor.speed += phi_f0 * 50.0f * 0.01f; - if (this->actor.speedXZ > baseSpeed) { - this->actor.speedXZ -= decel; - if (this->actor.speedXZ < baseSpeed) { - this->actor.speedXZ = baseSpeed; + if (this->actor.speed > baseSpeed) { + this->actor.speed -= decel; + if (this->actor.speed < baseSpeed) { + this->actor.speed = baseSpeed; } } } temp_f12 = stickAngle * (1 / 32236.f); - turn = stickAngle * temp_f12 * temp_f12 * (2.2f - (this->actor.speedXZ * (1.0f / this->boostSpeed))); - turn = CLAMP(turn, -turnSpeed * (2.2f - (1.7f * this->actor.speedXZ * (1.0f / this->boostSpeed))), - turnSpeed * (2.2f - (1.7f * this->actor.speedXZ * (1.0f / this->boostSpeed)))); + turn = stickAngle * temp_f12 * temp_f12 * (2.2f - (this->actor.speed * (1.0f / this->boostSpeed))); + turn = CLAMP(turn, -turnSpeed * (2.2f - (1.7f * this->actor.speed * (1.0f / this->boostSpeed))), + turnSpeed * (2.2f - (1.7f * this->actor.speed * (1.0f / this->boostSpeed)))); this->actor.world.rot.y += turn; this->actor.shape.rot.y = this->actor.world.rot.y; } @@ -1141,7 +1140,7 @@ void EnHorse_MountedIdle(EnHorse* this, PlayState* play) { f32 mag; s16 angle = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; EnHorse_StickDirection(&this->curStick, &mag, &angle); if (mag > 10.0f) { if (EnHorse_PlayerCanMove(this, play) == true) { @@ -1188,7 +1187,7 @@ void EnHorse_MountedIdleWhinnying(EnHorse* this, PlayState* play) { f32 stickMag; s16 stickAngle = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; EnHorse_StickDirection(&this->curStick, &stickMag, &stickAngle); if (stickMag > 10.0f) { if (EnHorse_PlayerCanMove(this, play) == true) { @@ -1222,7 +1221,7 @@ void EnHorse_MountedTurn(EnHorse* this, PlayState* play) { s16 clampedYaw; s16 stickAngle; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; EnHorse_PlayWalkingSound(this); if (EnHorse_PlayerCanMove(this, play) == true) { EnHorse_StickDirection(&this->curStick, &stickMag, &stickAngle); @@ -1300,15 +1299,15 @@ void EnHorse_MountedWalk(EnHorse* this, PlayState* play) { ((this->noInputTimer > 0) && (this->noInputTimer < (this->noInputTimerMax - 20)))) { EnHorse_UpdateSpeed(this, play, 0.3f, -0.5f, 10.0f, 0.06f, 3.0f, 0x320); } else { - this->actor.speedXZ = 3.0f; + this->actor.speed = 3.0f; } - if (this->actor.speedXZ == 0.0f) { + if (this->actor.speed == 0.0f) { this->stateFlags &= ~ENHORSE_FLAG_9; EnHorse_StartMountedIdleResetAnim(this); this->noInputTimer = 0; this->noInputTimerMax = 0; - } else if (this->actor.speedXZ > 3.0f) { + } else if (this->actor.speed > 3.0f) { this->stateFlags &= ~ENHORSE_FLAG_9; EnHorse_StartTrotting(this); this->noInputTimer = 0; @@ -1324,9 +1323,9 @@ void EnHorse_MountedWalk(EnHorse* this, PlayState* play) { if (this->waitTimer <= 0) { this->stateFlags &= ~ENHORSE_FLAG_9; - this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.75f; - if ((SkelAnime_Update(&this->skin.skelAnime) || (this->actor.speedXZ == 0.0f)) && (this->noInputTimer <= 0)) { - if (this->actor.speedXZ > 3.0f) { + this->skin.skelAnime.playSpeed = this->actor.speed * 0.75f; + if ((SkelAnime_Update(&this->skin.skelAnime) || (this->actor.speed == 0.0f)) && (this->noInputTimer <= 0)) { + if (this->actor.speed > 3.0f) { EnHorse_StartTrotting(this); this->noInputTimer = 0; this->noInputTimerMax = 0; @@ -1340,7 +1339,7 @@ void EnHorse_MountedWalk(EnHorse* this, PlayState* play) { } } else { this->waitTimer--; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } } @@ -1363,18 +1362,18 @@ void EnHorse_MountedTrot(EnHorse* this, PlayState* play) { EnHorse_UpdateSpeed(this, play, 0.3f, -0.5f, 10.0f, 0.06f, 6.0f, 800); EnHorse_StickDirection(&this->curStick, &stickMag, &stickAngle); - if (this->actor.speedXZ < 3.0f) { + if (this->actor.speed < 3.0f) { EnHorse_StartWalkingInterruptable(this); } - this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.375f; + this->skin.skelAnime.playSpeed = this->actor.speed * 0.375f; if (SkelAnime_Update(&this->skin.skelAnime)) { func_8087C178(this); Rumble_Request(0.0f, 60, 8, 255); - if (this->actor.speedXZ >= 6.0f) { + if (this->actor.speed >= 6.0f) { EnHorse_StartGallopingInterruptable(this); - } else if (this->actor.speedXZ < 3.0f) { + } else if (this->actor.speed < 3.0f) { EnHorse_StartWalkingInterruptable(this); } else { EnHorse_MountedTrotReset(this); @@ -1428,14 +1427,14 @@ void EnHorse_MountedGallop(EnHorse* this, PlayState* play) { EnHorse_UpdateSpeed(this, play, 0.3f, -0.5f, 10.0f, 0.06f, 8.0f, 800); } else if (this->noInputTimer > 0) { this->noInputTimer--; - this->actor.speedXZ = 8.0f; + this->actor.speed = 8.0f; } - if (this->actor.speedXZ < 6.0f) { + if (this->actor.speed < 6.0f) { EnHorse_StartTrotting(this); } - this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.3f; + this->skin.skelAnime.playSpeed = this->actor.speed * 0.3f; if (SkelAnime_Update(&this->skin.skelAnime)) { func_8087C1C0(this); @@ -1443,7 +1442,7 @@ void EnHorse_MountedGallop(EnHorse* this, PlayState* play) { if (EnHorse_PlayerCanMove(this, play) == true) { if ((stickMag >= 10.0f) && (Math_CosS(stickAngle) <= -0.5f)) { EnHorse_StartBraking(this, play); - } else if (this->actor.speedXZ < 6.0f) { + } else if (this->actor.speed < 6.0f) { EnHorse_StartTrotting(this); } else { EnHorse_MountedGallopReset(this); @@ -1491,7 +1490,7 @@ void EnHorse_MountedRearing(EnHorse* this, PlayState* play) { f32 stickMag; s16 stickAngle; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->curFrame > 25.0f) { if (!(this->stateFlags & ENHORSE_LAND2_SOUND)) { this->stateFlags |= ENHORSE_LAND2_SOUND; @@ -1560,15 +1559,15 @@ void EnHorse_StartBraking(EnHorse* this, PlayState* play) { } void EnHorse_Stopping(EnHorse* this, PlayState* play) { - if (this->actor.speedXZ > 0.0f) { - this->actor.speedXZ -= 0.6f; - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ = 0.0f; + if (this->actor.speed > 0.0f) { + this->actor.speed -= 0.6f; + if (this->actor.speed < 0.0f) { + this->actor.speed = 0.0f; } } if ((this->stateFlags & ENHORSE_STOPPING_NEIGH_SOUND) && (this->skin.skelAnime.curFrame > 29.0f)) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if ((Rand_ZeroOne() > 0.5f) && ((gSaveContext.save.entrance != ENTRANCE(ROMANI_RANCH, 0)) || (Cutscene_GetSceneLayer(play) == 0))) { if (this->stateFlags & ENHORSE_DRAW) { @@ -1586,9 +1585,9 @@ void EnHorse_Stopping(EnHorse* this, PlayState* play) { } if (this->skin.skelAnime.curFrame > 29.0f) { - this->actor.speedXZ = 0.0f; - } else if ((this->actor.speedXZ > 3.0f) && (this->stateFlags & ENHORSE_FORCE_REVERSING)) { - this->actor.speedXZ = 3.0f; + this->actor.speed = 0.0f; + } else if ((this->actor.speed > 3.0f) && (this->stateFlags & ENHORSE_FORCE_REVERSING)) { + this->actor.speed = 3.0f; } if (SkelAnime_Update(&this->skin.skelAnime)) { @@ -1630,14 +1629,14 @@ void EnHorse_Reverse(EnHorse* this, PlayState* play) { ((this->noInputTimer > 0) && (this->noInputTimer < (this->noInputTimerMax - 20)))) { if ((stickMag < 10.0f) && (this->noInputTimer <= 0)) { EnHorse_StartMountedIdleResetAnim(this); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; return; } else if (stickMag < 10.0f) { stickAngle = -0x7FFF; } else if (Math_CosS(stickAngle) > -0.5f) { this->noInputTimerMax = 0; EnHorse_StartMountedIdleResetAnim(this); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; return; } } else if (stickMag < 10.0f) { @@ -1646,13 +1645,13 @@ void EnHorse_Reverse(EnHorse* this, PlayState* play) { } else if ((player->actor.flags & ACTOR_FLAG_100) || (play->csCtx.state != CS_STATE_0) || (ActorCutscene_GetCurrentIndex() != -1) || (player->stateFlags1 & PLAYER_STATE1_20)) { EnHorse_StartMountedIdleResetAnim(this); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; return; } else { stickAngle = -0x7FFF; } - this->actor.speedXZ = -2.0f; + this->actor.speed = -2.0f; turnAmount = -0x8000 - stickAngle; turnAmount = CLAMP(turnAmount, -2400.0f, 2400.0f); this->actor.world.rot.y += turnAmount; @@ -1665,7 +1664,7 @@ void EnHorse_Reverse(EnHorse* this, PlayState* play) { } } - this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.5f * 1.5f; + this->skin.skelAnime.playSpeed = this->actor.speed * 0.5f * 1.5f; if (SkelAnime_Update(&this->skin.skelAnime) && (this->noInputTimer <= 0) && (EnHorse_PlayerCanMove(this, play) == true)) { @@ -1724,8 +1723,8 @@ void EnHorse_LowJump(EnHorse* this, PlayState* play) { this->stateFlags |= ENHORSE_JUMPING; - if (this->actor.speedXZ < 12.0f) { - this->actor.speedXZ = 12.0f; + if (this->actor.speed < 12.0f) { + this->actor.speed = 12.0f; } if (this->actor.floorHeight != BGCHECK_Y_MIN) { @@ -1822,8 +1821,8 @@ void EnHorse_HighJump(EnHorse* this, PlayState* play) { this->stateFlags |= ENHORSE_JUMPING; - if (this->actor.speedXZ < 13.0f) { - this->actor.speedXZ = 13.0f; + if (this->actor.speed < 13.0f) { + this->actor.speed = 13.0f; } if (this->actor.floorHeight != BGCHECK_Y_MIN) { @@ -1908,7 +1907,7 @@ void EnHorse_Inactive(EnHorse* this, PlayState* play) { void EnHorse_PlayIdleAnimation(EnHorse* this, s32 anim, f32 morphFrames, f32 startFrames) { this->action = ENHORSE_ACTION_IDLE; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if ((anim != ENHORSE_ANIM_IDLE) && (anim != ENHORSE_ANIM_WHINNY) && (anim != ENHORSE_ANIM_REARING)) { anim = ENHORSE_ANIM_IDLE; @@ -1963,7 +1962,7 @@ void EnHorse_StartIdleRidable(EnHorse* this) { } void EnHorse_Idle(EnHorse* this, PlayState* play) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; EnHorse_IdleAnimSounds(this, play); if ((D_801BDAA4 != 0) && (this->type == HORSE_TYPE_2)) { @@ -2102,18 +2101,18 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { } if (this->animIndex == ENHORSE_ANIM_GALLOP) { - this->actor.speedXZ = 8.0f; - this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.3f; + this->actor.speed = 8.0f; + this->skin.skelAnime.playSpeed = this->actor.speed * 0.3f; } else { if (this->animIndex == ENHORSE_ANIM_TROT) { - this->actor.speedXZ = 6.0f; - this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.375f; + this->actor.speed = 6.0f; + this->skin.skelAnime.playSpeed = this->actor.speed * 0.375f; } else if (this->animIndex == ENHORSE_ANIM_WALK) { - this->actor.speedXZ = 3.0f; + this->actor.speed = 3.0f; EnHorse_PlayWalkingSound(this); - this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.75f; + this->skin.skelAnime.playSpeed = this->actor.speed * 0.75f; } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->skin.skelAnime.playSpeed = 1.0f; } } @@ -2152,7 +2151,7 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { void EnHorse_InitIngoHorse(EnHorse* this) { this->curRaceWaypoint = 0; this->soundTimer = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; EnHorse_UpdateIngoHorseAnim(this); if (this->stateFlags & ENHORSE_DRAW) { Audio_PlaySfxAtPos(&this->unk_218, NA_SE_IT_INGO_HORSE_NEIGH); @@ -2177,17 +2176,17 @@ void EnHorse_UpdateIngoHorseAnim(EnHorse* this) { this->action = ENHORSE_ACTION_INGO_RACE; this->stateFlags &= ~ENHORSE_SANDDUST_SOUND; - if (this->actor.speedXZ == 0.0f) { + if (this->actor.speed == 0.0f) { if (this->animIndex != ENHORSE_ANIM_IDLE) { animChanged = true; } this->animIndex = ENHORSE_ANIM_IDLE; - } else if (this->actor.speedXZ <= 3.0f) { + } else if (this->actor.speed <= 3.0f) { if (this->animIndex != ENHORSE_ANIM_WALK) { animChanged = true; } this->animIndex = ENHORSE_ANIM_WALK; - } else if (this->actor.speedXZ <= 6.0f) { + } else if (this->actor.speed <= 6.0f) { if (this->animIndex != ENHORSE_ANIM_TROT) { animChanged = true; } @@ -2200,16 +2199,16 @@ void EnHorse_UpdateIngoHorseAnim(EnHorse* this) { } if (this->animIndex == ENHORSE_ANIM_WALK) { - animSpeed = this->actor.speedXZ * 0.5f; + animSpeed = this->actor.speed * 0.5f; } else if (this->animIndex == ENHORSE_ANIM_TROT) { - animSpeed = this->actor.speedXZ * 0.25f; + animSpeed = this->actor.speed * 0.25f; if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_RUN); } else { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); } } else if (this->animIndex == ENHORSE_ANIM_GALLOP) { - animSpeed = this->actor.speedXZ * 0.2f; + animSpeed = this->actor.speed * 0.2f; if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_RUN); } else { @@ -2240,26 +2239,26 @@ void EnHorse_UpdateIngoRace(EnHorse* this, PlayState* play) { } if (!this->inRace) { - this->actor.speedXZ = 0.0f; - this->rider->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; + this->rider->actor.speed = 0.0f; if (this->animIndex != ENHORSE_ANIM_IDLE) { EnHorse_UpdateIngoHorseAnim(this); } } if (this->animIndex == ENHORSE_ANIM_WALK) { - playSpeed = this->actor.speedXZ * 0.5f; + playSpeed = this->actor.speed * 0.5f; } else if (this->animIndex == ENHORSE_ANIM_TROT) { - playSpeed = this->actor.speedXZ * 0.25f; + playSpeed = this->actor.speed * 0.25f; } else if (this->animIndex == ENHORSE_ANIM_GALLOP) { - playSpeed = this->actor.speedXZ * 0.2f; + playSpeed = this->actor.speed * 0.2f; } else { playSpeed = 1.0f; } this->skin.skelAnime.playSpeed = playSpeed; if (SkelAnime_Update(&this->skin.skelAnime) || - ((this->animIndex == ENHORSE_ANIM_IDLE) && (this->actor.speedXZ != 0.0f))) { + ((this->animIndex == ENHORSE_ANIM_IDLE) && (this->actor.speed != 0.0f))) { EnHorse_UpdateIngoHorseAnim(this); } } @@ -2296,8 +2295,8 @@ void func_80881398(EnHorse* this, PlayState* play) { f32 curFrame; this->stateFlags |= ENHORSE_JUMPING; - if (this->actor.speedXZ < 14.0f) { - this->actor.speedXZ = 14.0f; + if (this->actor.speed < 14.0f) { + this->actor.speed = 14.0f; } animeUpdated = SkelAnime_Update(&this->skin.skelAnime); @@ -2352,7 +2351,7 @@ void func_8088159C(EnHorse* this, PlayState* play) { void func_80881634(EnHorse* this) { this->curRaceWaypoint = 0; this->soundTimer = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; func_8088168C(this); if (this->stateFlags & ENHORSE_DRAW) { Audio_PlaySfxAtPos(&this->unk_218, NA_SE_IT_INGO_HORSE_NEIGH); @@ -2367,17 +2366,17 @@ void func_8088168C(EnHorse* this) { this->action = ENHORSE_ACTION_5; this->stateFlags &= ~ENHORSE_SANDDUST_SOUND; - if (this->actor.speedXZ == 0.0f) { + if (this->actor.speed == 0.0f) { if (this->animIndex != ENHORSE_ANIM_IDLE) { animChanged = true; } this->animIndex = ENHORSE_ANIM_IDLE; - } else if (this->actor.speedXZ <= 3.0f) { + } else if (this->actor.speed <= 3.0f) { if (this->animIndex != ENHORSE_ANIM_WALK) { animChanged = true; } this->animIndex = ENHORSE_ANIM_WALK; - } else if (this->actor.speedXZ <= 6.0f) { + } else if (this->actor.speed <= 6.0f) { if (this->animIndex != ENHORSE_ANIM_TROT) { animChanged = true; } @@ -2390,16 +2389,16 @@ void func_8088168C(EnHorse* this) { } if (this->animIndex == ENHORSE_ANIM_WALK) { - animSpeed = this->actor.speedXZ * 0.5f; + animSpeed = this->actor.speed * 0.5f; } else if (this->animIndex == ENHORSE_ANIM_TROT) { - animSpeed = this->actor.speedXZ * 0.25f; + animSpeed = this->actor.speed * 0.25f; if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_RUN); } else { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_HORSE_RUN); } } else if (this->animIndex == ENHORSE_ANIM_GALLOP) { - animSpeed = this->actor.speedXZ * 0.2f; + animSpeed = this->actor.speed * 0.2f; if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_RUN); } else { @@ -2434,8 +2433,8 @@ void func_808819D8(EnHorse* this, PlayState* play) { } if (!this->inRace) { - this->actor.speedXZ = 0.0f; - this->rider->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; + this->rider->actor.speed = 0.0f; if (this->animIndex != ENHORSE_ANIM_IDLE) { EnHorse_UpdateIngoHorseAnim(this); } @@ -2450,25 +2449,25 @@ void func_808819D8(EnHorse* this, PlayState* play) { } if (!this->inRace) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->animIndex != ENHORSE_ANIM_IDLE) { func_8088168C(this); } } if (this->animIndex == ENHORSE_ANIM_WALK) { - animSpeed = this->actor.speedXZ * 0.5f; + animSpeed = this->actor.speed * 0.5f; } else if (this->animIndex == ENHORSE_ANIM_TROT) { - animSpeed = this->actor.speedXZ * 0.25f; + animSpeed = this->actor.speed * 0.25f; } else if (this->animIndex == ENHORSE_ANIM_GALLOP) { - animSpeed = this->actor.speedXZ * 0.2f; + animSpeed = this->actor.speed * 0.2f; } else { animSpeed = 1.0f; } this->skin.skelAnime.playSpeed = animSpeed; if (SkelAnime_Update(&this->skin.skelAnime) || - ((this->animIndex == ENHORSE_ANIM_IDLE) && (this->actor.speedXZ != 0.0f))) { + ((this->animIndex == ENHORSE_ANIM_IDLE) && (this->actor.speed != 0.0f))) { func_8088168C(this); } @@ -2484,7 +2483,7 @@ void EnHorse_CsMoveInit(EnHorse* this, PlayState* play, CsCmdActorAction* action this->animIndex = ENHORSE_ANIM_GALLOP; this->cutsceneAction = 1; Animation_PlayOnceSetSpeed(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], - this->actor.speedXZ * 0.2f * 1.5f); + this->actor.speed * 0.2f * 1.5f); } void EnHorse_CsMoveToPoint(EnHorse* this, PlayState* play, CsCmdActorAction* action) { @@ -2497,18 +2496,18 @@ void EnHorse_CsMoveToPoint(EnHorse* this, PlayState* play, CsCmdActorAction* act if (Math3D_Distance(&endPos, &this->actor.world.pos) > 8.0f) { EnHorse_RotateToPoint(this, play, &endPos, 0x320); - this->actor.speedXZ = 8.0f; - this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.3f; + this->actor.speed = 8.0f; + this->skin.skelAnime.playSpeed = this->actor.speed * 0.3f; } else { this->actor.world.pos = endPos; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if (SkelAnime_Update(&this->skin.skelAnime)) { func_8087C1C0(this); Rumble_Request(0.0f, 120, 8, 255); Animation_PlayOnceSetSpeed(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], - this->actor.speedXZ * 0.3f); + this->actor.speed * 0.3f); } } @@ -2562,7 +2561,7 @@ void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorAction* action) { } curFrame = this->skin.skelAnime.curFrame; - this->actor.speedXZ = 13.0f; + this->actor.speed = 13.0f; this->stateFlags |= ENHORSE_JUMPING; if (curFrame > 19.0f) { @@ -2626,7 +2625,7 @@ void EnHorse_CsRearingInit(EnHorse* this, PlayState* play, CsCmdActorAction* act } void EnHorse_CsRearing(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->curFrame > 25.0f) { if (!(this->stateFlags & ENHORSE_LAND2_SOUND)) { this->stateFlags |= ENHORSE_LAND2_SOUND; @@ -2665,7 +2664,7 @@ void EnHorse_WarpMoveInit(EnHorse* this, PlayState* play, CsCmdActorAction* acti this->animIndex = ENHORSE_ANIM_GALLOP; this->cutsceneAction = 4; Animation_PlayOnceSetSpeed(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], - this->actor.speedXZ * 0.3f); + this->actor.speed * 0.3f); } void EnHorse_CsWarpMoveToPoint(EnHorse* this, PlayState* play, CsCmdActorAction* action) { @@ -2678,18 +2677,18 @@ void EnHorse_CsWarpMoveToPoint(EnHorse* this, PlayState* play, CsCmdActorAction* if (Math3D_Distance(&endPos, &this->actor.world.pos) > 8.0f) { EnHorse_RotateToPoint(this, play, &endPos, 0x320); - this->actor.speedXZ = 8.0f; - this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.3f; + this->actor.speed = 8.0f; + this->skin.skelAnime.playSpeed = this->actor.speed * 0.3f; } else { this->actor.world.pos = endPos; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if (SkelAnime_Update(&this->skin.skelAnime)) { func_8087C1C0(this); Rumble_Request(0.0f, 120, 8, 255); Animation_PlayOnceSetSpeed(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], - this->actor.speedXZ * 0.3f); + this->actor.speed * 0.3f); } } @@ -2719,7 +2718,7 @@ void EnHorse_CsWarpRearingInit(EnHorse* this, PlayState* play, CsCmdActorAction* } void EnHorse_CsWarpRearing(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->curFrame > 25.0f) { if (!(this->stateFlags & ENHORSE_LAND2_SOUND)) { this->stateFlags |= ENHORSE_LAND2_SOUND; @@ -2750,7 +2749,7 @@ void EnHorse_InitCutscene(EnHorse* this, PlayState* play) { this->playerControlled = false; this->action = ENHORSE_ACTION_CS_UPDATE; this->cutsceneAction = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } s32 EnHorse_GetCutsceneFunctionIndex(s32 csAction) { @@ -2829,12 +2828,12 @@ s32 EnHorse_UpdateHbaRaceInfo(EnHorse* this, PlayState* play, RaceInfo* raceInfo } this->actor.shape.rot.y = this->actor.world.rot.y; - if ((this->actor.speedXZ < raceInfo->waypoints[this->curRaceWaypoint].speed) && !(this->hbaFlags & 1)) { - this->actor.speedXZ += 0.4f; + if ((this->actor.speed < raceInfo->waypoints[this->curRaceWaypoint].speed) && !(this->hbaFlags & 1)) { + this->actor.speed += 0.4f; } else { - this->actor.speedXZ -= 0.4f; - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ = 0.0f; + this->actor.speed -= 0.4f; + if (this->actor.speed < 0.0f) { + this->actor.speed = 0.0f; } } return false; @@ -2845,7 +2844,7 @@ void EnHorse_InitHorsebackArchery(EnHorse* this) { this->soundTimer = 0; this->curRaceWaypoint = 0; this->hbaTimer = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; EnHorse_UpdateHbaAnim(this); } @@ -2854,17 +2853,17 @@ void EnHorse_UpdateHbaAnim(EnHorse* this) { f32 animSpeed; this->action = ENHORSE_ACTION_HBA; - if (this->actor.speedXZ == 0.0f) { + if (this->actor.speed == 0.0f) { if (this->animIndex != ENHORSE_ANIM_IDLE) { animChanged = true; } this->animIndex = ENHORSE_ANIM_IDLE; - } else if (this->actor.speedXZ <= 3.0f) { + } else if (this->actor.speed <= 3.0f) { if (this->animIndex != ENHORSE_ANIM_WALK) { animChanged = true; } this->animIndex = ENHORSE_ANIM_WALK; - } else if (this->actor.speedXZ <= 6.0f) { + } else if (this->actor.speed <= 6.0f) { if (this->animIndex != ENHORSE_ANIM_TROT) { animChanged = true; } @@ -2877,9 +2876,9 @@ void EnHorse_UpdateHbaAnim(EnHorse* this) { } if (this->animIndex == ENHORSE_ANIM_WALK) { - animSpeed = this->actor.speedXZ * 0.5f; + animSpeed = this->actor.speed * 0.5f; } else if (this->animIndex == ENHORSE_ANIM_TROT) { - animSpeed = this->actor.speedXZ * 0.25f; + animSpeed = this->actor.speed * 0.25f; if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_RUN); } else { @@ -2887,7 +2886,7 @@ void EnHorse_UpdateHbaAnim(EnHorse* this) { } Rumble_Request(0.0f, 60, 8, 255); } else if (this->animIndex == ENHORSE_ANIM_GALLOP) { - animSpeed = this->actor.speedXZ * 0.2f; + animSpeed = this->actor.speed * 0.2f; if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_RUN); } else { @@ -2939,25 +2938,25 @@ void EnHorse_UpdateHorsebackArchery(EnHorse* this, PlayState* play) { } if (this->hbaStarted == 0) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->animIndex != ENHORSE_ANIM_IDLE) { EnHorse_UpdateHbaAnim(this); } } if (this->animIndex == ENHORSE_ANIM_WALK) { - playSpeed = this->actor.speedXZ * 0.5f; + playSpeed = this->actor.speed * 0.5f; } else if (this->animIndex == ENHORSE_ANIM_TROT) { - playSpeed = this->actor.speedXZ * 0.25f; + playSpeed = this->actor.speed * 0.25f; } else if (this->animIndex == ENHORSE_ANIM_GALLOP) { - playSpeed = this->actor.speedXZ * 0.2f; + playSpeed = this->actor.speed * 0.2f; } else { playSpeed = 1.0f; } this->skin.skelAnime.playSpeed = playSpeed; if (SkelAnime_Update(&this->skin.skelAnime) || - ((this->animIndex == ENHORSE_ANIM_IDLE) && (this->actor.speedXZ != 0.0f))) { + ((this->animIndex == ENHORSE_ANIM_IDLE) && (this->actor.speed != 0.0f))) { EnHorse_UpdateHbaAnim(this); } } @@ -2986,36 +2985,36 @@ void EnHorse_FleePlayer(EnHorse* this, PlayState* play) { if (playerDistToHome > 300.0f) { if (distToHome > 150.0f) { - this->actor.speedXZ += 0.4f; - if (this->actor.speedXZ > 8.0f) { - this->actor.speedXZ = 8.0f; + this->actor.speed += 0.4f; + if (this->actor.speed > 8.0f) { + this->actor.speed = 8.0f; } } else { - this->actor.speedXZ -= 0.5f; - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ = 0.0f; + this->actor.speed -= 0.5f; + if (this->actor.speed < 0.0f) { + this->actor.speed = 0.0f; } } } else if (distToPlayer < 300.0f) { - this->actor.speedXZ += 0.4f; - if (this->actor.speedXZ > 8.0f) { - this->actor.speedXZ = 8.0f; + this->actor.speed += 0.4f; + if (this->actor.speed > 8.0f) { + this->actor.speed = 8.0f; } } else { - this->actor.speedXZ -= 0.5f; - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ = 0.0f; + this->actor.speed -= 0.5f; + if (this->actor.speed < 0.0f) { + this->actor.speed = 0.0f; } } - if (this->actor.speedXZ >= 6.0f) { - this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.3f; + if (this->actor.speed >= 6.0f) { + this->skin.skelAnime.playSpeed = this->actor.speed * 0.3f; nextAnimIndex = ENHORSE_ANIM_GALLOP; - } else if (this->actor.speedXZ >= 3.0f) { - this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.375f; + } else if (this->actor.speed >= 3.0f) { + this->skin.skelAnime.playSpeed = this->actor.speed * 0.375f; nextAnimIndex = ENHORSE_ANIM_TROT; - } else if (this->actor.speedXZ > 0.1f) { - this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.75f; + } else if (this->actor.speed > 0.1f) { + this->skin.skelAnime.playSpeed = this->actor.speed * 0.75f; nextAnimIndex = ENHORSE_ANIM_WALK; EnHorse_PlayWalkingSound(this); } else { @@ -3283,7 +3282,7 @@ void func_808846F0(EnHorse* this, PlayState* play) { this->playerControlled = false; this->action = ENHORSE_ACTION_21; this->unk_3E0 = -1; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void func_80884718(EnHorse* this, PlayState* play) { @@ -3329,9 +3328,9 @@ void func_808848C8(EnHorse* this, PlayState* play) { Vec3f sp24 = { -1916.0f, -106.0f, -523.0f }; EnHorse_PlayWalkingSound(this); - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; func_800F415C(&this->actor, &sp24, 2000); - this->skin.skelAnime.playSpeed = this->actor.speedXZ * 0.75f; + this->skin.skelAnime.playSpeed = this->actor.speed * 0.75f; SkelAnime_Update(&this->skin.skelAnime); if (Math3D_Distance(&sp24, &this->actor.world.pos) < 30.0f) { this->stateFlags &= ~ENHORSE_UNRIDEABLE; @@ -3397,12 +3396,12 @@ void func_80884A40(EnHorse* this, PlayState* play) { void func_80884D04(EnHorse* this, PlayState* play) { f32 playSpeed; - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; this->action = ENHORSE_ACTION_25; this->unk_540 = this->actor.world.pos; Actor_PlaySfx(&this->actor, NA_SE_IT_INGO_HORSE_NEIGH); this->animIndex = ENHORSE_ANIM_GALLOP; - playSpeed = this->actor.speedXZ * 0.2f; + playSpeed = this->actor.speed * 0.2f; Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], sPlaybackSpeeds[this->animIndex] * playSpeed * 2.5f, 0.0f, Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, 0.0f); @@ -3493,13 +3492,13 @@ void EnHorse_ObstructMovement(EnHorse* this, PlayState* play, s32 obstacleType, if ((this->action == ENHORSE_ACTION_5) || (this->action == ENHORSE_ACTION_6)) { this->actor.world.pos = this->actor.prevPos; this->actor.world.rot.y -= 0x640; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.shape.rot.y = this->actor.world.rot.y; this->unk_1EC |= 4; } else if (this->action == ENHORSE_ACTION_25) { this->unk_1EC |= 0x80; this->actor.world.pos = this->actor.prevPos; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else if ((play->sceneId != SCENE_KOEPONARACE) || (this->unk_1EC & 2)) { this->unk_1EC &= ~2; this->actor.world.pos = this->lastPos; @@ -3539,7 +3538,7 @@ void EnHorse_CheckFloors(EnHorse* this, PlayState* play) { f32 nx; f32 ny; f32 nz; - s32 galloping = this->actor.speedXZ > 8.0f; + s32 galloping = this->actor.speed > 8.0f; s32 status; f32 waterHeight; WaterBox* waterbox; @@ -3600,7 +3599,7 @@ void EnHorse_CheckFloors(EnHorse* this, PlayState* play) { pos.y = this->yFront; dist = Math3D_DistPlaneToPos(nx, ny, nz, this->actor.floorPoly->dist, &pos); - if ((frontFloor != this->actor.floorPoly) && (this->actor.speedXZ >= 0.0f) && + if ((frontFloor != this->actor.floorPoly) && (this->actor.speed >= 0.0f) && ((!(this->stateFlags & ENHORSE_JUMPING) && (dist < -40.0f)) || ((this->stateFlags & ENHORSE_JUMPING) && (dist < -200.0f)))) { EnHorse_ObstructMovement(this, play, 4, galloping); @@ -3611,7 +3610,7 @@ void EnHorse_CheckFloors(EnHorse* this, PlayState* play) { pos.y = this->yBack; dist = Math3D_DistPlaneToPos(nx, ny, nz, this->actor.floorPoly->dist, &pos); - if ((backFloor != this->actor.floorPoly) && (this->actor.speedXZ <= 0.0f) && + if ((backFloor != this->actor.floorPoly) && (this->actor.speed <= 0.0f) && ((!(this->stateFlags & ENHORSE_JUMPING) && (dist < -40.0f)) || ((this->stateFlags & ENHORSE_JUMPING) && (dist < -200.0f)))) { EnHorse_ObstructMovement(this, play, 5, galloping); @@ -3621,7 +3620,7 @@ void EnHorse_CheckFloors(EnHorse* this, PlayState* play) { if ((ny < 0.81915206f) || SurfaceType_IsHorseBlocked(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) || (func_800C99D4(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) == 7)) { - if (this->actor.speedXZ >= 0.0f) { + if (this->actor.speed >= 0.0f) { EnHorse_ObstructMovement(this, play, 4, galloping); } else { EnHorse_ObstructMovement(this, play, 5, galloping); @@ -3746,8 +3745,8 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) { } if ((this->actor.bgCheckFlags & 8) && (Math_CosS(this->actor.wallYaw - this->actor.world.rot.y) < -0.3f)) { - if (this->actor.speedXZ > 4.0f) { - this->actor.speedXZ -= 1.0f; + if (this->actor.speed > 4.0f) { + this->actor.speed -= 1.0f; if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_SANDDUST); } else { @@ -3763,8 +3762,8 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) { ((horseJump->actor.params & 0xFF) == 5)) { this->stateFlags |= ENHORSE_FLAG_28; this->unk_3E8 += ((-10.0f / this->actor.scale.y) - this->unk_3E8) * 0.5f; - if (this->actor.speedXZ > 2.0f) { - this->actor.speedXZ -= 1.0f; + if (this->actor.speed > 2.0f) { + this->actor.speed -= 1.0f; if (this->type == HORSE_TYPE_2) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_SANDDUST); } else { @@ -3777,13 +3776,13 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) { } } - if ((this->stateFlags & ENHORSE_JUMPING) || (this->stateFlags & ENHORSE_FLAG_28) || (this->actor.speedXZ < 0.0f) || + if ((this->stateFlags & ENHORSE_JUMPING) || (this->stateFlags & ENHORSE_FLAG_28) || (this->actor.speed < 0.0f) || (this->action == ENHORSE_ACTION_STOPPING) || (this->action == ENHORSE_ACTION_MOUNTED_REARING)) { return; } - if (this->actor.speedXZ > 8.0f) { - if (this->actor.speedXZ < 12.8f) { + if (this->actor.speed > 8.0f) { + if (this->actor.speed < 12.8f) { intersectDist = 160.0f; movingFast = false; } else { @@ -3973,9 +3972,9 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) { EnHorse_Stub1(this); this->postDrawFunc = EnHorse_LowJumpInit; } else if ((movingFast == true) && - (((this->actor.speedXZ < 13.8f) && ((19.0f * temp_f0) < obstacleHeight) && + (((this->actor.speed < 13.8f) && ((19.0f * temp_f0) < obstacleHeight) && (obstacleHeight <= (72.0f * temp_f0))) || - ((this->actor.speedXZ > 13.8f) && (obstacleHeight <= (112.0f * temp_f0))))) { + ((this->actor.speed > 13.8f) && (obstacleHeight <= (112.0f * temp_f0))))) { EnHorse_Stub2(this); this->postDrawFunc = EnHorse_HighJumpInit; } @@ -4096,7 +4095,7 @@ void EnHorse_TiltBody(EnHorse* this, PlayState* play) { s32 targetRoll; s16 turnVel; - speed = this->actor.speedXZ / this->boostSpeed; + speed = this->actor.speed / this->boostSpeed; turnVel = this->actor.shape.rot.y - this->lastYaw; targetRoll = -((s16)((2730.0f * speed) * (turnVel / 960.00006f))); rollDiff = targetRoll - this->actor.world.rot.z; @@ -4224,7 +4223,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) { } if (ActorCutscene_GetCurrentIndex() != -1) { - thisx->speedXZ = 0.0f; + thisx->speed = 0.0f; } if (this->action != ENHORSE_ACTION_25) { @@ -4252,8 +4251,8 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) { } if (this->colliderJntSph.elements->info.ocElemFlags & OCELEM_HIT) { - if (thisx->speedXZ > 10.0f) { - thisx->speedXZ -= 1.0f; + if (thisx->speed > 10.0f) { + thisx->speed -= 1.0f; } } @@ -4351,13 +4350,13 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) { } } - if ((thisx->speedXZ == 0.0f) && !(this->stateFlags & ENHORSE_FLAG_19)) { + if ((thisx->speed == 0.0f) && !(this->stateFlags & ENHORSE_FLAG_19)) { thisx->colChkInfo.mass = MASS_IMMOVABLE; } else { thisx->colChkInfo.mass = MASS_HEAVY; } - if (thisx->speedXZ >= 5.0f) { + if (thisx->speed >= 5.0f) { this->colliderCylinder1.base.atFlags |= AT_ON; } else { this->colliderCylinder1.base.atFlags &= ~AT_ON; 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 9ec44193a2..0335085bd3 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 @@ -120,11 +120,11 @@ f32 func_808DE728(EnHorseLinkChild* this) { f32 phi_fv1; if (this->unk_148 == 2) { - phi_fv1 = D_808DFF18[this->unk_148] * this->actor.speedXZ * (1.0f / 2.0f); + phi_fv1 = D_808DFF18[this->unk_148] * this->actor.speed * (1.0f / 2.0f); } else if (this->unk_148 == 3) { - phi_fv1 = D_808DFF18[this->unk_148] * this->actor.speedXZ * (1.0f / 3.0f); + phi_fv1 = D_808DFF18[this->unk_148] * this->actor.speed * (1.0f / 3.0f); } else if (this->unk_148 == 4) { - phi_fv1 = D_808DFF18[this->unk_148] * this->actor.speedXZ * (1.0f / 5.0f); + phi_fv1 = D_808DFF18[this->unk_148] * this->actor.speed * (1.0f / 5.0f); } else { phi_fv1 = D_808DFF18[this->unk_148]; } @@ -142,7 +142,7 @@ void EnHorseLinkChild_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawHorse, 20.0f); this->unk_144 = 1; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.focus.pos = this->actor.world.pos; this->actor.focus.pos.y += 70.0f; @@ -186,7 +186,7 @@ void func_808DE9A8(EnHorseLinkChild* this) { } void func_808DEA0C(EnHorseLinkChild* this, PlayState* play) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (SkelAnime_Update(&this->skin.skelAnime)) { func_808DE9A8(this); } @@ -194,7 +194,7 @@ void func_808DEA0C(EnHorseLinkChild* this, PlayState* play) { void func_808DEA54(EnHorseLinkChild* this, s32 arg1) { this->unk_144 = 2; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if ((arg1 != 0) && (arg1 != 1)) { arg1 = 0; @@ -237,7 +237,7 @@ void func_808DEB14(EnHorseLinkChild* this, PlayState* play) { void func_808DECA0(EnHorseLinkChild* this) { this->unk_144 = 1; this->unk_148 = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Animation_Change(&this->skin.skelAnime, D_808DFEC0[this->unk_148], func_808DE728(this), 0.0f, Animation_GetLastFrame(D_808DFEC0[this->unk_148]), ANIMMODE_ONCE, -5.0f); } @@ -268,14 +268,14 @@ void func_808DED40(EnHorseLinkChild* this, PlayState* play) { if ((temp_fv0 < 1000.0f) && (temp_fv0 >= 300.0f)) { phi_v0 = 4; - this->actor.speedXZ = 6.0f; + this->actor.speed = 6.0f; } else if ((temp_fv0 < 300.0f) && (temp_fv0 >= 150.0f)) { phi_v0 = 3; - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; } else if ((temp_fv0 < 150.0f) && (temp_fv0 >= 70.0f)) { phi_v0 = 2; this->unk_1E8 = 0; - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; } else { func_808DEA54(this, 1); return; @@ -295,7 +295,7 @@ void func_808DED40(EnHorseLinkChild* this, PlayState* play) { void func_808DEFE8(EnHorseLinkChild* this) { this->unk_144 = 3; this->unk_148 = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Animation_Change(&this->skin.skelAnime, D_808DFEC0[this->unk_148], func_808DE728(this), 0.0f, Animation_GetLastFrame(D_808DFEC0[this->unk_148]), ANIMMODE_ONCE, -5.0f); } @@ -353,16 +353,16 @@ void func_808DF194(EnHorseLinkChild* this, PlayState* play) { if (Math3D_Distance(&player->actor.world.pos, &this->actor.home.pos) > 250.0f) { if (sp44 >= 300.0f) { sp48 = 4; - this->actor.speedXZ = 6.0f; + this->actor.speed = 6.0f; } else if ((sp44 < 300.0f) && (sp44 >= 150.0f)) { sp48 = 3; - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; } else if ((sp44 < 150.0f) && (sp44 >= 70.0f)) { sp48 = 2; this->unk_1E8 = 0; - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->unk_148 == 0) { sp48 = (sp4C == 1) ? 1 : 0; } else { @@ -371,16 +371,16 @@ void func_808DF194(EnHorseLinkChild* this, PlayState* play) { } } else if (sp50 < 200.0f) { sp48 = 4; - this->actor.speedXZ = 6.0f; + this->actor.speed = 6.0f; } else if (sp50 < 300.0f) { sp48 = 3; - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; } else if (sp50 < 400.0f) { sp48 = 2; this->unk_1E8 = 0; - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->unk_148 == 0) { sp48 = (sp4C == 1) ? 1 : 0; } else { @@ -388,7 +388,7 @@ void func_808DF194(EnHorseLinkChild* this, PlayState* play) { } } } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->unk_148 == 0) { sp48 = (sp4C == 1) ? 1 : 0; } else { @@ -432,7 +432,7 @@ void func_808DF620(EnHorseLinkChild* this, PlayState* play) { return; } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; sp36 = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y; if ((Math_CosS(sp36) < 0.7071f) && (this->unk_148 == 2)) { @@ -455,7 +455,7 @@ void func_808DF788(EnHorseLinkChild* this) { this->unk_144 = 4; this->unk_148 = 2; this->unk_1E0 = 0; - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; Animation_Change(&this->skin.skelAnime, D_808DFEC0[this->unk_148], func_808DE728(this), 0.0f, Animation_GetLastFrame(D_808DFEC0[this->unk_148]), ANIMMODE_ONCE, -5.0f); } @@ -488,25 +488,25 @@ void func_808DF838(EnHorseLinkChild* this, PlayState* play) { if (this->unk_1E0 == 0) { if (phi_fv0 >= 300.0f) { phi_v0 = 4; - this->actor.speedXZ = 6.0f; + this->actor.speed = 6.0f; } else if (phi_fv0 >= 150.0f) { phi_v0 = 3; - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; } else { phi_v0 = 2; this->unk_1E8 = 0; - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; } } else if (phi_fv0 >= 300.0f) { phi_v0 = 4; - this->actor.speedXZ = 6.0f; + this->actor.speed = 6.0f; } else if (phi_fv0 >= 150.0f) { phi_v0 = 3; - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; } else if (phi_fv0 >= 70.0f) { phi_v0 = 2; this->unk_1E8 = 0; - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; } else { func_808DF560(this); return; 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 7c22aa4111..727e0f782d 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -375,7 +375,7 @@ void EnIk_SetupIdle(EnIk* this) { Animation_Change(&this->skelAnime, &gIronKnuckleEndHorizontalAttackAnim, 1.0f, frameCount, frameCount, ANIMMODE_ONCE, this->timer); this->actionFunc = EnIk_Idle; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void EnIk_Idle(EnIk* this, PlayState* play) { @@ -397,7 +397,7 @@ void EnIk_Idle(EnIk* this, PlayState* play) { void EnIk_SetupWalk(EnIk* this) { Animation_MorphToLoop(&this->skelAnime, &gIronKnuckleWalkAnim, -4.0f); - this->actor.speedXZ = 0.9f; + this->actor.speed = 0.9f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnIk_WalkTowardsPlayer; } @@ -425,7 +425,7 @@ void EnIk_WalkTowardsPlayer(EnIk* this, PlayState* play) { void EnIk_SetupRun(EnIk* this) { Animation_MorphToLoop(&this->skelAnime, &gIronKnuckleRunAnim, -4.0f); Actor_PlaySfx(&this->actor, NA_SE_EN_TWINROBA_SHOOT_VOICE); - this->actor.speedXZ = 2.5f; + this->actor.speed = 2.5f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnIk_RunTowardsPlayer; } @@ -454,7 +454,7 @@ void EnIk_SetupVerticalAttack(EnIk* this) { s32 pad; f32 playbackSpeed; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->drawArmorFlags) { playbackSpeed = 1.5f; } else { @@ -488,11 +488,11 @@ void EnIk_VerticalAttack(EnIk* this, PlayState* play) { if ((this->skelAnime.curFrame > 13.0f) && (this->skelAnime.curFrame < 23.0f)) { this->colliderQuad.base.atFlags |= AT_ON; if (this->drawArmorFlags) { - this->actor.speedXZ = sin_rad((this->skelAnime.curFrame - 13.0f) * (M_PI / 20)) * 10.0f; + this->actor.speed = sin_rad((this->skelAnime.curFrame - 13.0f) * (M_PI / 20)) * 10.0f; } } else { this->colliderQuad.base.atFlags &= ~AT_ON; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if ((this->drawArmorFlags) && (this->skelAnime.curFrame < 13.0f)) { @@ -525,7 +525,7 @@ void EnIk_TakeOutAxe(EnIk* this, PlayState* play) { } void EnIk_SetupHorizontalDoubleAttack(EnIk* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Animation_Change(&this->skelAnime, &gIronKnuckleHorizontalAttackAnim, (this->drawArmorFlags) ? 1.3f : 1.0f, 0.0f, Animation_GetLastFrame(&gIronKnuckleHorizontalAttackAnim.common), ANIMMODE_ONCE_INTERP, (this->drawArmorFlags) ? 4.0f : 10.0f); @@ -551,12 +551,12 @@ void EnIk_HorizontalDoubleAttack(EnIk* this, PlayState* play) { } else { phi_f2 = this->skelAnime.curFrame - 1.0f; } - this->actor.speedXZ = sin_rad((M_PI / 8) * phi_f2) * 4.5f; + this->actor.speed = sin_rad((M_PI / 8) * phi_f2) * 4.5f; } this->colliderQuad.base.atFlags |= AT_ON; } else { this->colliderQuad.base.atFlags &= ~AT_ON; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if (SkelAnime_Update(&this->skelAnime)) { EnIk_SetupEndHorizontalAttack(this); @@ -566,7 +566,7 @@ void EnIk_HorizontalDoubleAttack(EnIk* this, PlayState* play) { void EnIk_SetupSingleHorizontalAttack(EnIk* this) { f32 playSpeed; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->drawArmorFlags) { this->actor.world.rot.z = 0x1000; playSpeed = 1.3f; @@ -611,7 +611,7 @@ void EnIk_EndHorizontalAttack(EnIk* this, PlayState* play) { } void EnIk_SetupBlock(EnIk* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Animation_Change(&this->skelAnime, &gIronKnuckleBlockAnim, 2.0f, 0.0f, Animation_GetLastFrame(&gIronKnuckleBlockAnim), ANIMMODE_ONCE, -2.0f); this->timer = 20; @@ -634,7 +634,7 @@ void EnIk_SetupReactToAttack(EnIk* this, s32 arg1) { if (arg1) { func_800BE504(&this->actor, &this->colliderCylinder); } - this->actor.speedXZ = 6.0f; + this->actor.speed = 6.0f; temp_v0 = (this->actor.world.rot.y - this->actor.shape.rot.y) + 0x8000; if (ABS_ALT(temp_v0) <= 0x4000) { Animation_MorphToPlayOnce(&this->skelAnime, &gIronKnuckleFrontHitAnim, -4.0f); @@ -645,7 +645,7 @@ void EnIk_SetupReactToAttack(EnIk* this, s32 arg1) { } void EnIk_ReactToAttack(EnIk* this, PlayState* play) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f); + Math_StepToF(&this->actor.speed, 0.0f, 1.0f); if (this->subCamId != SUB_CAM_ID_DONE) { Play_SetCameraAtEye(play, this->subCamId, &this->actor.focus.pos, &Play_GetCamera(play, this->subCamId)->eye); } @@ -664,7 +664,7 @@ void EnIk_ReactToAttack(EnIk* this, PlayState* play) { } void EnIk_SetupDie(EnIk* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Animation_MorphToPlayOnce(&this->skelAnime, &gIronKnuckleDeathAnim, -4.0f); this->timer = 24; Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_DEAD); @@ -705,7 +705,7 @@ void EnIk_Die(EnIk* this, PlayState* play) { void EnIk_SetupFrozen(EnIk* this) { this->invincibilityFrames = 0; this->actionFunc = EnIk_Frozen; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void EnIk_Frozen(EnIk* this, PlayState* play) { @@ -724,7 +724,7 @@ void EnIk_Frozen(EnIk* this, PlayState* play) { void EnIk_SetupCutscene(EnIk* this) { ActorCutscene_SetIntentToPlay(this->actor.cutscene); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.colChkInfo.health != 0) { func_800BE504(&this->actor, &this->colliderCylinder); } 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 df5c41b029..3da8062f40 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -287,8 +287,8 @@ void func_808F3690(EnIn* this, PlayState* play) { s16 sp36; Vec3f sp28; - Math_SmoothStepToF(&this->actor.speedXZ, 1.0f, 0.4f, 1000.0f, 0.0f); - sp36 = this->actor.speedXZ * 400.0f; + Math_SmoothStepToF(&this->actor.speed, 1.0f, 0.4f, 1000.0f, 0.0f); + sp36 = this->actor.speed * 400.0f; if (SubS_CopyPointFromPath(this->path, this->unk244, &sp28) && SubS_MoveActorToPoint(&this->actor, &sp28, sp36)) { this->unk244++; if (this->unk244 >= this->path->count) { 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 9031e9ed34..69e3c8eb8d 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -181,9 +181,9 @@ void func_8091AC78(EnInsect* this) { void func_8091ACC4(EnInsect* this, PlayState* play) { f32 temp_f2; - Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 0.5f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.1f, 0.5f, 0.0f); - temp_f2 = (Rand_ZeroOne() * 0.8f) + (this->actor.speedXZ * 1.2f); + temp_f2 = (Rand_ZeroOne() * 0.8f) + (this->actor.speed * 1.2f); if (temp_f2 < 0.0f) { this->skelAnime.playSpeed = 0.0f; } else { @@ -218,7 +218,7 @@ void func_8091AE5C(EnInsect* this, PlayState* play) { s32 pad; f32 temp_f0; - Math_SmoothStepToF(&this->actor.speedXZ, 1.5f, 0.1f, 0.5f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, 1.5f, 0.1f, 0.5f, 0.0f); if ((EnInsect_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > SQ(40.0f)) || (this->unk_312 < 4)) { @@ -231,7 +231,7 @@ void func_8091AE5C(EnInsect* this, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; - temp_f0 = this->actor.speedXZ * 1.4f; + temp_f0 = this->actor.speed * 1.4f; this->skelAnime.playSpeed = CLAMP(temp_f0, 0.7f, 1.9f); SkelAnime_Update(&this->skelAnime); @@ -261,7 +261,7 @@ void func_8091B07C(EnInsect* this, PlayState* play) { s16 yaw; s32 sp38 = this->actor.xzDistToPlayer < 40.0f; - Math_SmoothStepToF(&this->actor.speedXZ, 1.8f, 0.1f, 0.5f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, 1.8f, 0.1f, 0.5f, 0.0f); if ((EnInsect_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > SQ(160.0f)) || (this->unk_312 < 4)) { @@ -284,7 +284,7 @@ void func_8091B07C(EnInsect* this, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; - speed = this->actor.speedXZ * 1.6f; + speed = this->actor.speed * 1.6f; this->skelAnime.playSpeed = CLAMP(speed, 0.8f, 1.9f); SkelAnime_Update(&this->skelAnime); @@ -299,7 +299,7 @@ void func_8091B274(EnInsect* this) { this->unk_312 = 200; Actor_SetScale(&this->actor, 0.001f); this->actor.draw = NULL; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->skelAnime.playSpeed = 0.3f; this->actionFunc = func_8091B2D8; this->unk_30C &= ~0x100; @@ -336,7 +336,7 @@ void func_8091B440(EnInsect* this, PlayState* play) { s32 pad[2]; Vec3f sp34; - Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 0.5f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.1f, 0.5f, 0.0f); Math_StepToS(&this->actor.shape.rot.x, 0x2AAA, 0x160); Actor_SetScale(&this->actor, CLAMP_MIN(this->actor.scale.x - 0.0002f, 0.001f)); @@ -373,9 +373,9 @@ void func_8091B670(EnInsect* this, PlayState* play) { Vec3f sp40; if (this->unk_312 > 80) { - Math_StepToF(&this->actor.speedXZ, 0.6f, 0.08f); + Math_StepToF(&this->actor.speed, 0.6f, 0.08f); } else { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.02f); + Math_StepToF(&this->actor.speed, 0.0f, 0.02f); } this->actor.velocity.y = 0.0f; @@ -417,7 +417,7 @@ void func_8091B670(EnInsect* this, PlayState* play) { void func_8091B928(EnInsect* this) { this->unk_312 = 100; this->actor.velocity.y = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.terminalVelocity = -0.8f; this->actor.gravity = -0.04f; this->unk_30C &= ~1; 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 5d16c1fcde..ecc6a57c43 100644 --- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c +++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c @@ -1078,13 +1078,13 @@ void func_80B447C0(EnInvadepoh* this, PlayState* play) { void func_80B44A90(EnInvadepoh* this, PlayState* play) { if (this->actor.bgCheckFlags & 1) { this->actor.velocity.y *= 0.3f; - this->actor.speedXZ *= 0.8f; + this->actor.speed *= 0.8f; } else if (this->actor.bgCheckFlags & 8) { this->actor.velocity.y *= 0.8f; - this->actor.speedXZ *= 0.3f; + this->actor.speed *= 0.3f; } else { this->actor.velocity.y *= 0.8f; - this->actor.speedXZ *= 0.8f; + this->actor.speed *= 0.8f; } Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 40.0f, 0.0f, 5); @@ -1151,7 +1151,7 @@ s32 func_80B44C80(EnInvadepoh* this, PlayState* play) { temp_f0_3 = temp_f0 - this->actor.world.pos.x; temp_f0_2 = temp_f2 - this->actor.world.pos.z; - if (this->actor.speedXZ > 0.0f) { + if (this->actor.speed > 0.0f) { if (Math3D_AngleBetweenVectors(&sp6C, &sp60, &sp44) != 0) { sp40 = 1; } else if (sp44 <= 0.0f) { @@ -2309,7 +2309,7 @@ void func_80B47D30(Actor* thisx, PlayState* play) { if (D_80B4E940 == 3) { if ((this->actionFunc == func_80B477B4) || (this->actionFunc == func_80B47600)) { - thisx->speedXZ = 0.0f; + thisx->speed = 0.0f; thisx->velocity.y = 0.0f; thisx->gravity = 0.0f; func_80B47830(this); @@ -2320,8 +2320,8 @@ void func_80B47D30(Actor* thisx, PlayState* play) { } else if (this->collider.base.acFlags & AC_HIT) { Actor* acAttached = this->collider.base.ac; - thisx->speedXZ = acAttached->speedXZ * 0.5f; - thisx->speedXZ = CLAMP(thisx->speedXZ, -60.0f, 60.0f); + thisx->speed = acAttached->speed * 0.5f; + thisx->speed = CLAMP(thisx->speed, -60.0f, 60.0f); thisx->world.rot.y = acAttached->world.rot.y; thisx->gravity = 0.0f; thisx->velocity.y = acAttached->velocity.y * 0.5f; @@ -2564,11 +2564,11 @@ void func_80B487B4(EnInvadepoh* this) { void func_80B48848(EnInvadepoh* this, PlayState* play) { s32 pad; - Math_StepToF(&this->actor.speedXZ, 1.6f, 0.1f); - if (func_80B44B84(this, play, this->actor.speedXZ, 50.0f)) { + Math_StepToF(&this->actor.speed, 1.6f, 0.1f); + if (func_80B44B84(this, play, this->actor.speed, 50.0f)) { func_80B44514(this); this->behaviorInfo.unk4C = 0xC8; - this->actor.speedXZ *= 0.25f; + this->actor.speed *= 0.25f; } else { Math_StepToS(&this->behaviorInfo.unk4C, 0x7D0, 0x46); } @@ -2628,8 +2628,8 @@ void func_80B48AD4(EnInvadepoh* this, PlayState* play) { s16 temp_v1; s32 temp_v1_3; - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f); - if (func_80B44B84(this, play, this->actor.speedXZ, 50.0f)) { + Math_StepToF(&this->actor.speed, 0.0f, 0.2f); + if (func_80B44B84(this, play, this->actor.speed, 50.0f)) { func_80B44514(this); } @@ -2687,7 +2687,7 @@ void func_80B48AD4(EnInvadepoh* this, PlayState* play) { void func_80B48DE4(EnInvadepoh* this) { AlienBehaviorInfo* substruct = &this->behaviorInfo; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Animation_MorphToLoop(&this->skelAnime, &gRomaniIdleAnim, -10.0f); this->behaviorInfo.unk4C = 0; substruct->unk30 = 0.05f; @@ -2836,13 +2836,13 @@ void func_80B49454(EnInvadepoh* this, PlayState* play) { Math_Vec3f_Sum(&D_80B4EDD0[this->unk3AC], &this->actor.home.pos, &sp30); if (Math3D_Vec3fDistSq(&this->actor.world.pos, &sp30) < SQ(400.0f)) { - this->actor.speedXZ *= 0.8f; + this->actor.speed *= 0.8f; } else { - Math_StepToF(&this->actor.speedXZ, 170.0f, 21.0f); - this->actor.speedXZ *= 0.98f; + Math_StepToF(&this->actor.speed, 170.0f, 21.0f); + this->actor.speed *= 0.98f; } - if (func_80B450C0(&this->actor.world.pos.x, &this->actor.world.pos.z, sp30.x, sp30.z, this->actor.speedXZ)) { - this->actor.speedXZ = 0.0f; + if (func_80B450C0(&this->actor.world.pos.x, &this->actor.world.pos.z, sp30.x, sp30.z, this->actor.speed)) { + this->actor.speed = 0.0f; } if (sp30.y < this->actor.world.pos.y) { Math_StepToF(&this->actor.gravity, -12.0f, 7.0f); @@ -2877,9 +2877,9 @@ void func_80B49670(EnInvadepoh* this, PlayState* play) { sp30.z = this->actor.home.pos.z; Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp30), 0xA, 0xBB8, 0x64); if ((play->gameplayFrames % 64) < 14) { - Math_StepToF(&this->actor.speedXZ, 5.0f, 1.0f); + Math_StepToF(&this->actor.speed, 5.0f, 1.0f); } else { - this->actor.speedXZ *= 0.97f; + this->actor.speed *= 0.97f; } if (sp30.y < this->actor.world.pos.y) { this->actor.gravity = -0.5f; @@ -2910,7 +2910,7 @@ void func_80B497EC(EnInvadepoh* this, PlayState* play) { sp30.y = this->actor.home.pos.y + D_80B4E934.y + 400.0f; sp30.z = this->actor.home.pos.z + D_80B4E934.z; Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp30), 4, 0x1F40, 0x64); - Math_StepToF(&this->actor.speedXZ, 70.0f, 3.0f); + Math_StepToF(&this->actor.speed, 70.0f, 3.0f); if (sp30.y < this->actor.world.pos.y) { this->actor.gravity = -2.0f; } else { @@ -2935,7 +2935,7 @@ void func_80B49904(EnInvadepoh* this) { } void func_80B4994C(EnInvadepoh* this, PlayState* play) { - Math_StepToF(&this->actor.speedXZ, 150.0f, 4.0f); + Math_StepToF(&this->actor.speed, 150.0f, 4.0f); this->actor.velocity.y *= 0.95f; Actor_MoveWithGravity(&this->actor); if (this->actionTimer > 0) { @@ -2950,7 +2950,7 @@ void func_80B499BC(EnInvadepoh* this) { this->scaleTarget = 0.2f; this->scaleStep = 0.01f; this->unk3AA = 3000; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80B49A00; } @@ -2962,7 +2962,7 @@ void func_80B49A00(EnInvadepoh* this, PlayState* play) { sp30.y = this->actor.home.pos.y + 800.0f; sp30.z = this->actor.home.pos.z; Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp30), 4, 0x1F40, 0x64); - Math_StepToF(&this->actor.speedXZ, 30.0f, 3.0f); + Math_StepToF(&this->actor.speed, 30.0f, 3.0f); this->actor.velocity.y *= 0.98f; if (sp30.y < this->actor.world.pos.y) { this->actor.gravity = -0.5f; @@ -3234,11 +3234,11 @@ void func_80B4A614(EnInvadepoh* this) { void func_80B4A67C(EnInvadepoh* this, PlayState* play) { s32 pad; - Math_StepToF(&this->actor.speedXZ, 5.0f, 1.0f); - if (func_80B44B84(this, play, this->actor.speedXZ, 50.0f)) { + Math_StepToF(&this->actor.speed, 5.0f, 1.0f); + if (func_80B44B84(this, play, this->actor.speed, 50.0f)) { func_80B44640(this); this->behaviorInfo.unk4C = 0x5DC; - this->actor.speedXZ *= 0.5f; + this->actor.speed *= 0.5f; } else { Math_StepToS(&this->behaviorInfo.unk4C, 0x190, 0x32); } @@ -3539,7 +3539,7 @@ void func_80B4B430(EnInvadepoh* this) { } void func_80B4B484(EnInvadepoh* this, PlayState* play) { - Math_StepToF(&this->actor.speedXZ, 1.1f, 0.5f); + Math_StepToF(&this->actor.speed, 1.1f, 0.5f); if (func_80B44C80(this, play)) { func_80B44690(this); } @@ -3566,17 +3566,17 @@ void func_80B4B564(EnInvadepoh* this, PlayState* play) { Vec3f sp28; f32 temp_f0; - Math_StepToF(&this->actor.speedXZ, 3.8f, 0.45f); + Math_StepToF(&this->actor.speed, 3.8f, 0.45f); if (this->unk3BC >= 0) { Math_Vec3s_ToVec3f(&sp28, &this->pathPoints[this->unk3BC]); temp_f0 = Math3D_Vec3fDistSq(&this->actor.world.pos, &sp28); if (temp_f0 < SQ(80.0f)) { - this->actor.speedXZ *= 0.85f; + this->actor.speed *= 0.85f; } else if (temp_f0 < SQ(150.0f)) { - this->actor.speedXZ *= 0.93f; + this->actor.speed *= 0.93f; } else if (temp_f0 < SQ(250.0f)) { - this->actor.speedXZ *= 0.96f; + this->actor.speed *= 0.96f; } if (this->pathIndex == this->unk3BC || temp_f0 < SQ(50.0f)) { this->actionTimer = 0; @@ -3607,7 +3607,7 @@ void func_80B4B724(EnInvadepoh* this) { void func_80B4B768(EnInvadepoh* this, PlayState* play) { s32 pad; - Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f); + Math_StepToF(&this->actor.speed, 0.0f, 1.0f); Math_SmoothStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardActor(&this->actor, &D_80B5040C->actor), 5, 0x1388, 0x64); func_80B44E90(this, play); @@ -3625,7 +3625,7 @@ void func_80B4B820(EnInvadepoh* this) { } void func_80B4B864(EnInvadepoh* this, PlayState* play) { - Math_StepToF(&this->actor.speedXZ, 0.5f, 1.0f); + Math_StepToF(&this->actor.speed, 0.5f, 1.0f); func_80B44E90(this, play); if (this->animPlayFlag) { func_80B4B510(this); 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 f911bc4f4f..b27111ca01 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -554,8 +554,8 @@ void func_8095E95C(EnIshi* this, PlayState* play) { void func_8095EA70(EnIshi* this) { f32 sp24; - this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; - this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; + this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speed; + this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speed; if (!ENISHI_GET_1(&this->actor)) { sp24 = Rand_ZeroOne() - 0.9f; D_8095F690 = sp24 * 11000.0f; 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 e7c2ad78d0..6aea8641b8 100644 --- a/src/overlays/actors/ovl_En_Jg/z_en_jg.c +++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.c @@ -434,7 +434,7 @@ void EnJg_AlternateTalkOrWalkInPlace(EnJg* this, PlayState* play) { this->actionFunc = EnJg_Walk; } } else if (this->animIndex == EN_JG_ANIM_WALK) { - Math_ApproachF(&this->actor.speedXZ, 0.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 0.0f, 0.2f, 1.0f); EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(this, play); } } @@ -459,10 +459,10 @@ void EnJg_Walk(EnJg* this, PlayState* play) { this->actionFunc = EnJg_AlternateTalkOrWalkInPlace; } else { this->currentPoint++; - Math_ApproachF(&this->actor.speedXZ, 0.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 0.5f, 0.2f, 1.0f); } } else { - Math_ApproachF(&this->actor.speedXZ, 0.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 0.5f, 0.2f, 1.0f); } } @@ -903,7 +903,7 @@ void EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(EnJg* this, PlayState* play if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->flags |= FLAG_LOOKING_AT_PLAYER; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->textId == 0xDAC) { this->action = EN_JG_ACTION_FIRST_THAW; 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 ecfaa6b8ba..5a5233d834 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -254,7 +254,7 @@ s32 func_80968CB8(EnJs* this) { return true; } - Math_StepToF(&this->actor.speedXZ, this->unk_2B4, 0.5f); + Math_StepToF(&this->actor.speed, this->unk_2B4, 0.5f); return false; } @@ -667,7 +667,7 @@ void func_80969B5C(EnJs* this, PlayState* play) { } if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actionFunc = func_80969898; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_2B4 = 0.0f; func_80969AA0(this, play); } else if ((this->actor.xzDistToPlayer < 100.0f) && Player_IsFacingActor(&this->actor, 0x3000, play)) { 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 fbe97b109c..49928a3695 100644 --- a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c +++ b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c @@ -492,7 +492,7 @@ void func_80B85FA8(EnKaizoku* this, PlayState* play) { player->actor.world.pos.z = this->picto.actor.home.pos.z - 30.0f; } - player->actor.speedXZ = 0.0f; + player->actor.speed = 0.0f; this->picto.actor.world.pos.x = this->picto.actor.home.pos.x; this->picto.actor.world.pos.z = this->picto.actor.home.pos.z; Message_StartTextbox(play, D_80B8A8D0[sp54], &this->picto.actor); @@ -681,7 +681,7 @@ void func_80B86804(EnKaizoku* this, PlayState* play) { this->unk_2D8 = 0; this->action = KAIZOKU_ACTION_0; this->actionFunc = func_80B868B8; - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; } void func_80B868B8(EnKaizoku* this, PlayState* play) { @@ -888,7 +888,7 @@ void func_80B86B74(EnKaizoku* this, PlayState* play) { } void func_80B872A4(EnKaizoku* this) { - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_0); this->action = KAIZOKU_ACTION_1; this->actionFunc = func_80B872F4; @@ -928,13 +928,13 @@ void func_80B874D8(EnKaizoku* this, PlayState* play) { EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_3); if (Math_SinS(player->actor.shape.rot.y - this->picto.actor.shape.rot.y) > 0.0f) { - this->picto.actor.speedXZ = -10.0f; + this->picto.actor.speed = -10.0f; } else if (Math_SinS(player->actor.shape.rot.y - this->picto.actor.shape.rot.y) < 0.0f) { - this->picto.actor.speedXZ = 10.0f; + this->picto.actor.speed = 10.0f; } else if (Rand_ZeroOne() > 0.5f) { - this->picto.actor.speedXZ = 10.0f; + this->picto.actor.speed = 10.0f; } else { - this->picto.actor.speedXZ = -10.0f; + this->picto.actor.speed = -10.0f; } this->skelAnime.playSpeed = 1.0f; @@ -952,17 +952,17 @@ void func_80B8760C(EnKaizoku* this, PlayState* play) { this->picto.actor.world.rot.y = this->picto.actor.yawTowardsPlayer + 0x3A98; if ((this->picto.actor.bgCheckFlags & 8) || - !Actor_TestFloorInDirection(&this->picto.actor, play, this->picto.actor.speedXZ, + !Actor_TestFloorInDirection(&this->picto.actor, play, this->picto.actor.speed, this->picto.actor.shape.rot.y + 0x4000)) { if (this->picto.actor.bgCheckFlags & 8) { - if (this->picto.actor.speedXZ >= 0.0f) { + if (this->picto.actor.speed >= 0.0f) { var_v0 = this->picto.actor.shape.rot.y + 0x4000; } else { var_v0 = this->picto.actor.shape.rot.y - 0x4000; } var_v0 = this->picto.actor.wallYaw - var_v0; } else { - this->picto.actor.speedXZ *= -0.8f; + this->picto.actor.speed *= -0.8f; var_v0 = 0; } @@ -1006,7 +1006,7 @@ void func_80B8760C(EnKaizoku* this, PlayState* play) { } } } else { - if (this->picto.actor.speedXZ >= 0.0f) { + if (this->picto.actor.speed >= 0.0f) { this->picto.actor.shape.rot.y += 0x4000; } else { this->picto.actor.shape.rot.y -= 0x4000; @@ -1021,7 +1021,7 @@ void func_80B87900(EnKaizoku* this) { this->swordState = -1; } this->unk_2D8 = 0; - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; this->unk_2B2 = Rand_S16Offset(10, 10); this->bodyCollider.base.acFlags |= AC_HARD; this->lookTimer = 12; @@ -1089,7 +1089,7 @@ void func_80B8798C(EnKaizoku* this, PlayState* play) { void func_80B87C7C(EnKaizoku* this) { EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_8); - this->picto.actor.speedXZ = 6.5f; + this->picto.actor.speed = 6.5f; this->picto.actor.velocity.y = 15.0f; Actor_PlaySfx(&this->picto.actor, NA_SE_EN_TEKU_JUMP); this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y; @@ -1126,7 +1126,7 @@ void func_80B87D3C(EnKaizoku* this, PlayState* play) { this->swordCollider.info.elemType = ELEMTYPE_UNK2; this->picto.actor.shape.rot.x = 0; this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y = this->picto.actor.yawTowardsPlayer; - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; this->picto.actor.velocity.y = 0.0f; this->picto.actor.world.pos.y = this->picto.actor.floorHeight; func_80B87F70(this); @@ -1135,7 +1135,7 @@ void func_80B87D3C(EnKaizoku* this, PlayState* play) { void func_80B87E28(EnKaizoku* this) { EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_8); - this->picto.actor.speedXZ = -8.0f; + this->picto.actor.speed = -8.0f; Actor_PlaySfx(&this->picto.actor, NA_SE_EN_TEKU_JUMP); this->bodyCollider.info.elemType = ELEMTYPE_UNK4; this->bodyCollider.base.colType = COLTYPE_NONE; @@ -1166,7 +1166,7 @@ void func_80B87F70(EnKaizoku* this) { EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_9); this->unk_2D0 = 0; this->swordCollider.base.atFlags &= ~AT_BOUNCED; - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; AudioSfx_StopByPosAndId(&this->picto.actor.projectedPos, NA_SE_EN_PIRATE_BREATH); this->action = KAIZOKU_ACTION_9; this->actionFunc = func_80B87FDC; @@ -1182,7 +1182,7 @@ void func_80B87FDC(EnKaizoku* this, PlayState* play2) { curFrame = this->skelAnime.curFrame; sp2E = ABS_ALT(player->actor.shape.rot.y - this->picto.actor.shape.rot.y); sp2C = ABS_ALT(this->picto.actor.yawTowardsPlayer - this->picto.actor.shape.rot.y); - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; if (Animation_OnFrame(&this->skelAnime, 1.0f)) { Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_ATTACK); @@ -1233,7 +1233,7 @@ void func_80B87FDC(EnKaizoku* this, PlayState* play2) { void func_80B88214(EnKaizoku* this) { EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_8); this->unk_2B2 = 0; - this->picto.actor.speedXZ = 10.0f; + this->picto.actor.speed = 10.0f; this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y = this->picto.actor.yawTowardsPlayer; Actor_PlaySfx(&this->picto.actor, NA_SE_EN_TEKU_JUMP); this->action = KAIZOKU_ACTION_5; @@ -1245,7 +1245,7 @@ void func_80B88278(EnKaizoku* this, PlayState* play) { this->unk_2D8 = 0; if (this->frameCount <= curFrame) { - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; if (!Actor_IsFacingPlayer(&this->picto.actor, 0x1554)) { func_80B872A4(this); this->unk_2B2 = Rand_ZeroOne() * 5.0f + 5.0f; @@ -1274,11 +1274,11 @@ void func_80B88378(EnKaizoku* this, PlayState* play) { Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.yawTowardsPlayer, 1, 0x2EE, 0); this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y; if (this->picto.actor.xzDistToPlayer <= 40.0f) { - Math_ApproachF(&this->picto.actor.speedXZ, -8.0f, 1.0f, 1.5f); + Math_ApproachF(&this->picto.actor.speed, -8.0f, 1.0f, 1.5f); } else if (this->picto.actor.xzDistToPlayer > 55.0f) { - Math_ApproachF(&this->picto.actor.speedXZ, 8.0f, 1.0f, 1.5f); + Math_ApproachF(&this->picto.actor.speed, 8.0f, 1.0f, 1.5f); } else { - Math_ApproachZeroF(&this->picto.actor.speedXZ, 2.0f, 6.65f); + Math_ApproachZeroF(&this->picto.actor.speed, 2.0f, 6.65f); } this->skelAnime.playSpeed = 1.0f; @@ -1375,7 +1375,7 @@ void func_80B88910(EnKaizoku* this) { this->unk_2D0 = 0; this->action = KAIZOKU_ACTION_11; this->actionFunc = func_80B88964; - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; } void func_80B88964(EnKaizoku* this, PlayState* play) { @@ -1400,10 +1400,10 @@ void func_80B88964(EnKaizoku* this, PlayState* play) { Actor_SpawnFloorDustRing(play, &this->picto.actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0); Actor_SpawnFloorDustRing(play, &this->picto.actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0); this->swordState = 1; - this->picto.actor.speedXZ = 10.0f; + this->picto.actor.speed = 10.0f; Actor_PlaySfx(&this->picto.actor, NA_SE_EN_PIRATE_ATTACK); } else if (Animation_OnFrame(&this->skelAnime, 21.0f)) { - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; } else if (Animation_OnFrame(&this->skelAnime, 24.0f)) { this->swordState = -1; } @@ -1453,7 +1453,7 @@ void func_80B88964(EnKaizoku* this, PlayState* play) { void func_80B88CD8(EnKaizoku* this) { EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_3); - this->picto.actor.speedXZ = randPlusMinusPoint5Scaled(12.0f); + this->picto.actor.speed = randPlusMinusPoint5Scaled(12.0f); this->skelAnime.playSpeed = 1.0f; this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y; this->unk_2B2 = Rand_ZeroOne() * 30.0f + 30.0f; @@ -1474,39 +1474,39 @@ void func_80B88D6C(EnKaizoku* this, PlayState* play) { this->picto.actor.world.rot.y = this->picto.actor.shape.rot.y + 0x4000; sp2A = player->actor.shape.rot.y + 0x8000; if (Math_SinS(sp2A - this->picto.actor.shape.rot.y) >= 0.0f) { - this->picto.actor.speedXZ -= 0.25f; - if (this->picto.actor.speedXZ < -8.0f) { - this->picto.actor.speedXZ = -8.0f; + this->picto.actor.speed -= 0.25f; + if (this->picto.actor.speed < -8.0f) { + this->picto.actor.speed = -8.0f; } } else if (Math_SinS((sp2A - this->picto.actor.shape.rot.y)) < 0.0f) { - this->picto.actor.speedXZ += 0.25f; - if (this->picto.actor.speedXZ > 8.0f) { - this->picto.actor.speedXZ = 8.0f; + this->picto.actor.speed += 0.25f; + if (this->picto.actor.speed > 8.0f) { + this->picto.actor.speed = 8.0f; } } if ((this->picto.actor.bgCheckFlags & 8) || - !Actor_TestFloorInDirection(&this->picto.actor, play, this->picto.actor.speedXZ, + !Actor_TestFloorInDirection(&this->picto.actor, play, this->picto.actor.speed, this->picto.actor.shape.rot.y + 0x4000)) { if (this->picto.actor.bgCheckFlags & 8) { - if (this->picto.actor.speedXZ >= 0.0f) { + if (this->picto.actor.speed >= 0.0f) { yaw = this->picto.actor.shape.rot.y + 0x4000; } else { yaw = this->picto.actor.shape.rot.y - 0x4000; } yaw = this->picto.actor.wallYaw - yaw; } else { - this->picto.actor.speedXZ *= -0.8f; + this->picto.actor.speed *= -0.8f; yaw = 0; } if (ABS_ALT(yaw) > 0x4000) { - this->picto.actor.speedXZ *= -0.8f; - if (this->picto.actor.speedXZ < 0.0f) { - this->picto.actor.speedXZ -= 0.5f; + this->picto.actor.speed *= -0.8f; + if (this->picto.actor.speed < 0.0f) { + this->picto.actor.speed -= 0.5f; } else { - this->picto.actor.speedXZ += 0.5f; + this->picto.actor.speed += 0.5f; } } } @@ -1551,7 +1551,7 @@ void func_80B88D6C(EnKaizoku* this, PlayState* play) { // EnKaizoku_SetupStunned void func_80B891B8(EnKaizoku* this) { if (this->picto.actor.bgCheckFlags & 1) { - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; } if (this->action == KAIZOKU_ACTION_11) { @@ -1586,12 +1586,12 @@ void func_80B89280(EnKaizoku* this, PlayState* play) { } if (this->picto.actor.bgCheckFlags & 2) { - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; } if (this->picto.actor.bgCheckFlags & 1) { - if (this->picto.actor.speedXZ < 0.0f) { - this->picto.actor.speedXZ += 0.05f; + if (this->picto.actor.speed < 0.0f) { + this->picto.actor.speed += 0.05f; } } @@ -1619,7 +1619,7 @@ void func_80B893CC(EnKaizoku* this, PlayState* play) { Math_Vec3f_Copy(&this->unk_3C4, &sp34); this->lookTimer = 0; this->unk_2D8 = 0; - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; EnKaizoku_ChangeAnim(this, EN_KAIZOKU_ANIM_5); if (((this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_SFX) || @@ -1674,7 +1674,7 @@ void func_80B8960C(EnKaizoku* this, PlayState* play) { (this->unk_2B8 == 0)) { this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE; } - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; this->unk_2D8 = 1; func_800B7298(play, &this->picto.actor, 0x7B); Enemy_StartFinishingBlow(play, &this->picto.actor); @@ -1693,11 +1693,11 @@ void func_80B8971C(EnKaizoku* this, PlayState* play) { Player* player; if (this->picto.actor.bgCheckFlags & 2) { - this->picto.actor.speedXZ = 0.0f; + this->picto.actor.speed = 0.0f; } if (this->picto.actor.bgCheckFlags & 1) { - Math_SmoothStepToF(&this->picto.actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); + Math_SmoothStepToF(&this->picto.actor.speed, 0.0f, 1.0f, 0.5f, 0.0f); } if ((this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_SFX) || 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 a54bfdc2da..234d865bde 100644 --- a/src/overlays/actors/ovl_En_Kame/z_en_kame.c +++ b/src/overlays/actors/ovl_En_Kame/z_en_kame.c @@ -185,7 +185,7 @@ void func_80AD7018(EnKame* this, PlayState* play) { void func_80AD70A0(EnKame* this) { Animation_MorphToPlayOnce(&this->skelAnime1, &object_tl_Anim_004210, -5.0f); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80AD70EC; } @@ -207,7 +207,7 @@ void func_80AD70EC(EnKame* this, PlayState* play) { void func_80AD71B4(EnKame* this) { Animation_MorphToLoop(&this->skelAnime1, &object_tl_Anim_00823C, -5.0f); - this->actor.speedXZ = 0.5f; + this->actor.speed = 0.5f; this->unk_29E = Animation_GetLastFrame(&object_tl_Anim_00823C) * ((s32)Rand_ZeroFloat(5.0f) + 3); this->unk_2A4 = this->actor.shape.rot.y; this->collider.base.acFlags |= (AC_HARD | AC_ON); @@ -246,7 +246,7 @@ void func_80AD73A8(EnKame* this) { this->unk_29E = 0; this->unk_2AC = 1.0f; this->unk_2A8 = 1.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->unk_2A0 == 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_VOICE); } @@ -278,7 +278,7 @@ void func_80AD7424(EnKame* this, PlayState* play) { } void func_80AD7568(EnKame* this) { - this->actor.speedXZ = this->unk_2A6 * (5.0f / 7552); + this->actor.speed = this->unk_2A6 * (5.0f / 7552); this->actor.shape.rot.z = this->unk_2A6 * 0.11016949f; } @@ -287,7 +287,7 @@ void func_80AD75A8(EnKame* this, PlayState* play) { static Color_RGBA8 D_80AD8E58 = { 180, 180, 180, 255 }; static Vec3f D_80AD8E5C = { 0.0f, 0.75f, 0.0f }; - if ((this->actor.bgCheckFlags & 1) && (this->actor.speedXZ >= 3.0f)) { + if ((this->actor.bgCheckFlags & 1) && (this->actor.speed >= 3.0f)) { if ((play->gameplayFrames % 2) == 0) { u32 temp_v0 = func_800C9BB8(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); @@ -312,7 +312,7 @@ void func_80AD76CC(EnKame* this) { this->unk_2AC = 0.5f; func_80AD7568(this); this->unk_29E = 15; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_CUTTER_ON); this->unk_2BC.y = this->actor.home.pos.y - 100.0f; } else { @@ -401,7 +401,7 @@ void func_80AD7948(EnKame* this, PlayState* play) { void func_80AD7B18(EnKame* this) { this->actor.draw = EnKame_Draw; Animation_MorphToPlayOnce(&this->skelAnime1, &object_tl_Anim_0031DC, -3.0f); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_2AC = 0.1f; this->unk_2A8 = 1.0f; this->actor.world.rot.y = this->actor.shape.rot.y; @@ -434,7 +434,7 @@ void func_80AD7C54(EnKame* this) { } this->actor.draw = EnKame_Draw; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->collider.base.acFlags &= ~AC_ON; this->collider.base.atFlags &= ~AT_ON; this->collider.base.atFlags &= ~(AT_BOUNCED | AT_HIT); @@ -460,7 +460,7 @@ void func_80AD7DA4(EnKame* this) { this->collider.base.acFlags |= AC_ON; this->collider.base.acFlags &= ~AC_HARD; this->collider.base.colType = COLTYPE_HIT6; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80AD7E0C; } @@ -498,7 +498,7 @@ void func_80AD7F10(EnKame* this, PlayState* play) { } void func_80AD7FA4(EnKame* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.velocity.y > 0.0f) { this->actor.velocity.y = 0.0f; } @@ -545,7 +545,7 @@ void func_80AD8148(EnKame* this, PlayState* play) { this->collider.base.atFlags &= ~AT_ON; this->collider.base.atFlags &= ~(AC_HARD | AC_HIT); this->actor.velocity.y = 15.0f; - this->actor.speedXZ = 1.5f; + this->actor.speed = 1.5f; if (play != NULL) { Enemy_StartFinishingBlow(play, &this->actor); if (this->actor.draw == func_80AD8D64) { @@ -581,7 +581,7 @@ void func_80AD825C(EnKame* this, PlayState* play) { void func_80AD8364(EnKame* this) { this->unk_29E = 20; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80AD8388; } 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 a718d141f5..ad14e2c189 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -359,10 +359,10 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { if ((hitItem->toucher.dmgFlags & 0x10) || (hitItem->toucher.dmgFlags & 8) || (hitItem->toucher.dmgFlags & 0x80000000)) { piece->actor.velocity.y = Rand_ZeroFloat(3.0f) + 6.0f; - piece->actor.speedXZ = Rand_ZeroFloat(4.0f) + 6.0f; + piece->actor.speed = Rand_ZeroFloat(4.0f) + 6.0f; } else { piece->actor.velocity.y = Rand_ZeroFloat(2.0f) + 3.0f; - piece->actor.speedXZ = Rand_ZeroFloat(2.0f) + 3.0f; + piece->actor.speed = Rand_ZeroFloat(2.0f) + 3.0f; } if (piece->partCount >= 4) { @@ -499,7 +499,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { if (!(this->actor.bgCheckFlags & 1)) { Actor_PlaySfx(&this->actor, NA_SE_EV_WOODPLATE_BOUND); } - this->actor.speedXZ *= -0.5f; + this->actor.speed *= -0.5f; } if (this->actor.bgCheckFlags & 0x40) { @@ -539,12 +539,12 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { if (this->unk_197 != 0) { if (this->unk_197 > 0) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else if ((this->floorRot.x > 0.1f) || (this->floorRot.z > 0.1f)) { this->airTimer = 10; if (this->actor.bgCheckFlags & 8) { this->actionState = ENKANBAN_GROUND; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; goto nextCase; } else { Vec3f spC8; @@ -556,14 +556,14 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { Math_ApproachF(&this->actor.velocity.z, spC8.z, 0.5f, (KREG(21) * 0.01f) + 0.3f); this->actor.world.rot.y = Math_Atan2S(spC8.x, spC8.z); this->unk_198 = 1; - this->actor.speedXZ = sqrtf(SQXZ(this->actor.velocity)); + this->actor.speed = sqrtf(SQXZ(this->actor.velocity)); } } else { this->unk_198 = 0; - Math_ApproachZeroF(&this->actor.speedXZ, 1, 0.1f); + Math_ApproachZeroF(&this->actor.speed, 1, 0.1f); } } else { - this->actor.speedXZ *= 0.7f; + this->actor.speed *= 0.7f; } if (this->spinRot.x == 0) { @@ -687,38 +687,38 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { s16 rippleDelay; s32 rippleScale; - if ((player->actor.speedXZ > 0.0f) && (player->actor.world.pos.y < this->actor.world.pos.y) && + if ((player->actor.speed > 0.0f) && (player->actor.world.pos.y < this->actor.world.pos.y) && (this->actor.xyzDistToPlayerSq < SQ(50.0f))) { - Math_ApproachF(&this->actor.speedXZ, player->actor.speedXZ, 1.0f, 0.2f); - if (this->actor.speedXZ > 1.0f) { - this->actor.speedXZ = 1.0f; + Math_ApproachF(&this->actor.speed, player->actor.speed, 1.0f, 0.2f); + if (this->actor.speed > 1.0f) { + this->actor.speed = 1.0f; } if (Math_SmoothStepToS(&this->actor.world.rot.y, BINANG_ROT180(this->actor.yawTowardsPlayer), 1, 0x1000, 0) > 0) { - this->spinVel.y = this->actor.speedXZ * 1000.0f; + this->spinVel.y = this->actor.speed * 1000.0f; } else { - this->spinVel.y = this->actor.speedXZ * -1000.0f; + this->spinVel.y = this->actor.speed * -1000.0f; } } if (this->actor.bgCheckFlags & 1) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } Actor_MoveWithGravity(&this->actor); - if (this->actor.speedXZ != 0.0f) { + if (this->actor.speed != 0.0f) { Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 50.0f, 5); if (this->actor.bgCheckFlags & 8) { - this->actor.speedXZ *= -0.5f; + this->actor.speed *= -0.5f; if (this->spinVel.y > 0) { this->spinVel.y = -2000; } else { this->spinVel.y = 2000; } } - Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 0.15f); + Math_ApproachZeroF(&this->actor.speed, 1.0f, 0.15f); } this->actor.shape.rot.y += this->spinVel.y; Math_ApproachS(&this->spinVel.y, 0, 1, 0x3A); @@ -728,9 +728,9 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { Math_ApproachZeroF(&this->floorRot.x, 0.5f, 0.2f); Math_ApproachZeroF(&this->floorRot.z, 0.5f, 0.2f); - if (fabsf(this->actor.speedXZ) > 1.0f) { + if (fabsf(this->actor.speed) > 1.0f) { rippleDelay = 0; - } else if (fabsf(this->actor.speedXZ) > 0.5f) { + } else if (fabsf(this->actor.speed) > 0.5f) { rippleDelay = 3; } else { rippleDelay = 7; @@ -756,12 +756,12 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { this->bounceX = Rand_ZeroFloat(10.0f) + 6.0f; this->bounceZ = Rand_ZeroFloat(10.0f) + 6.0f; this->actor.velocity.y = 2.0f + hammerStrength; - this->actor.speedXZ = Rand_ZeroFloat(1.0f); + this->actor.speed = Rand_ZeroFloat(1.0f); } else { this->bounceX = Rand_ZeroFloat(7.0f) + 3.0f; this->bounceZ = Rand_ZeroFloat(7.0f) + 3.0f; this->actor.velocity.y = 3.0f + hammerStrength; - this->actor.speedXZ = Rand_ZeroFloat(1.5f); + this->actor.speed = Rand_ZeroFloat(1.5f); } this->spinVel.y = randPlusMinusPoint5Scaled(0x1800); @@ -801,12 +801,12 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { this->bounceX = Rand_ZeroFloat(10.0f) + 6.0f; this->bounceZ = Rand_ZeroFloat(10.0f) + 6.0f; this->actor.velocity.y = 2.5f + bombStrength; - this->actor.speedXZ = 3.0f + bombStrength; + this->actor.speed = 3.0f + bombStrength; } else { this->bounceX = Rand_ZeroFloat(7.0f) + 3.0f; this->bounceZ = Rand_ZeroFloat(7.0f) + 3.0f; this->actor.velocity.y = 5.0f + bombStrength; - this->actor.speedXZ = 4.0f + bombStrength; + this->actor.speed = 4.0f + bombStrength; } this->spinVel.y = randPlusMinusPoint5Scaled(0x1800); 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 354bcb630f..7a3658e2ae 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -380,7 +380,7 @@ void EnKarebaba_SetupDying(EnKarebaba* this) { this->actor.gravity = -0.8f; this->actor.velocity.y = 4.0f; this->actor.world.rot.y = BINANG_ROT180(this->actor.shape.rot.y); - this->actor.speedXZ = 3.0f; + this->actor.speed = 3.0f; } else { this->timer = 3; } @@ -401,13 +401,13 @@ void EnKarebaba_Dying(EnKarebaba* this, PlayState* play) { this->timer--; if (this->timer == 0) { this->actor.gravity = -0.8f; - this->actor.speedXZ = 3.0f; + this->actor.speed = 3.0f; this->actor.velocity.y = 4.0f; this->actor.world.rot.y = BINANG_ROT180(this->actor.shape.rot.y); EnKarebaba_SpawnIceEffects(this, play); } } else { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.1f); + Math_StepToF(&this->actor.speed, 0.0f, 0.1f); if (this->timer == 0) { Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C); @@ -417,7 +417,7 @@ void EnKarebaba_Dying(EnKarebaba* this, PlayState* play) { this->actor.scale.z = 0.0f; this->actor.scale.y = 0.0f; this->actor.scale.x = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4); EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); 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 39d55f7f80..fb8c87cf1a 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -512,8 +512,8 @@ void EnKusa_LiftedUp(EnKusa* this, PlayState* play) { if (Actor_HasNoParent(&this->actor, play)) { this->actor.room = play->roomCtx.curRoom.num; EnKusa_SetupFall(this); - this->actor.velocity.x = this->actor.speedXZ * Math_SinS(this->actor.world.rot.y); - this->actor.velocity.z = this->actor.speedXZ * Math_CosS(this->actor.world.rot.y); + this->actor.velocity.x = this->actor.speed * Math_SinS(this->actor.world.rot.y); + this->actor.velocity.z = this->actor.speed * Math_CosS(this->actor.world.rot.y); this->actor.colChkInfo.mass = 80; this->actor.gravity = -0.1f; EnKusa_UpdateVelY(this); 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 910bf49c3b..108b9e9ae7 100644 --- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c +++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c @@ -1038,7 +1038,7 @@ void func_80A5D9C8(EnKusa2* this, PlayState* play) { this->actor.colChkInfo.mass = 80; this->actor.home.rot.y = this->actor.world.rot.y; this->actor.velocity.y = 12.5f; - this->actor.speedXZ += 3.0f; + this->actor.speed += 3.0f; Actor_MoveWithGravity(&this->actor); func_80A5BAFC(this, play); func_80A5CD0C(this); @@ -1137,10 +1137,10 @@ void func_80A5DEB4(EnKusa2* this, PlayState* play) { Math_StepToF(&this->actor.scale.x, 0.4f, 0.032f); this->unk_1C4 += 0x4650; this->actor.scale.z = this->actor.scale.x; - this->actor.speedXZ = fabsf(Math_CosS(this->unk_1C4) + 0.5f) * 1.5f; + this->actor.speed = fabsf(Math_CosS(this->unk_1C4) + 0.5f) * 1.5f; - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ = 0.0f; + if (this->actor.speed < 0.0f) { + this->actor.speed = 0.0f; } Actor_MoveWithGravity(&this->actor); @@ -1165,7 +1165,7 @@ void func_80A5DEB4(EnKusa2* this, PlayState* play) { if (this->unk_1C8 <= 0) { func_80A5CD0C(this); func_80A5BB40(this, play, 4); - this->actor.speedXZ += 4.0f; + this->actor.speed += 4.0f; this->actor.velocity.y = (Rand_ZeroOne() * 4.0f) + 15.0f; func_80A5E1D8(this); } else if (this->actor.bgCheckFlags & 1) { @@ -1174,7 +1174,7 @@ void func_80A5DEB4(EnKusa2* this, PlayState* play) { func_80A5CD0C(this); func_80A5BB40(this, play, 2); this->actor.velocity.y = (Rand_ZeroOne() * 6.0f) + 7.0f; - this->actor.speedXZ += 2.0f; + this->actor.speed += 2.0f; if (this->actor.yawTowardsPlayer < this->actor.world.rot.y) { sp20 = 10000; } else { @@ -1201,7 +1201,7 @@ void func_80A5E210(EnKusa2* this, PlayState* play) { Math_StepToF(&this->actor.gravity, -4.0f, 0.5f); if (this->actor.bgCheckFlags & 1) { - this->actor.speedXZ *= 0.4f; + this->actor.speed *= 0.4f; if (this->actor.bgCheckFlags & 2) { func_80A5D178(this); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_KUSAMUSHI_HIDE); @@ -1253,7 +1253,7 @@ void func_80A5E418(EnKusa2* this) { this->actor.velocity.y *= 0.25f; this->actor.velocity.z *= 0.1f; this->actor.draw = func_80A5EA48; - this->actor.speedXZ *= 0.1f; + this->actor.speed *= 0.1f; this->actor.gravity *= 0.25f; this->unk_1CC = Rand_S16Offset(-800, 1600); this->actionFunc = func_80A5E4BC; 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 9c0eafeb15..ae7ad360ce 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 @@ -674,7 +674,7 @@ void func_80AEACF8(EnLiftNuts* this, PlayState* play) { } void func_80AEAEAC(EnLiftNuts* this) { - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); func_80AE9AC4(this, 1); func_80AE9B4C(1, 1); @@ -685,7 +685,7 @@ 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); + dist = Math_Vec3f_StepTo(&this->actor.world.pos, &this->vec_1D8, this->actor.speed); this->actor.world.pos.y += this->actor.gravity; if (dist == 0.0f) { @@ -739,7 +739,7 @@ void func_80AEB148(EnLiftNuts* this, PlayState* play) { Player* player = GET_PLAYER(play); if (player->stateFlags3 & PLAYER_STATE3_200) { - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; SET_EVENTINF(EVENTINF_34); Interface_StartTimer(4, 0); func_80AE9B4C(1, 2); @@ -749,7 +749,7 @@ void func_80AEB148(EnLiftNuts* this, PlayState* play) { } void func_80AEB1C8(EnLiftNuts* this) { - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; SET_EVENTINF(EVENTINF_34); Interface_StartTimer(4, 0); func_80AE9B4C(1, 2); 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 1be03e655b..1df0d1a0c8 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 @@ -151,17 +151,17 @@ void EnLookNuts_Patrol(EnLookNuts* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Play_InCsMode(play)) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; return; } - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; if (Animation_OnFrame(&this->skelAnime, 1.0f) || Animation_OnFrame(&this->skelAnime, 5.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); } if (D_80A6862C != 0) { - Math_ApproachZeroF(&this->actor.speedXZ, 0.3f, 1.0f); + Math_ApproachZeroF(&this->actor.speed, 0.3f, 1.0f); return; } @@ -207,7 +207,7 @@ void EnLookNuts_StandAndWait(EnLookNuts* this, PlayState* play) { s16 randOffset; SkelAnime_Update(&this->skelAnime); - Math_ApproachZeroF(&this->actor.speedXZ, 0.3f, 1.0f); + Math_ApproachZeroF(&this->actor.speed, 0.3f, 1.0f); if (!Play_InCsMode(play) && (D_80A6862C == 0) && (this->eventTimer == 0)) { this->eventTimer = 10; switch (this->waitTimer) { @@ -276,10 +276,10 @@ void EnLookNuts_RunToPlayer(EnLookNuts* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); } - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0xBB8, 0); if ((this->actor.xzDistToPlayer < 70.0f) || (this->eventTimer == 0)) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; EnLookNuts_SetupSendPlayerToSpawn(this); } } 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 62d848dd9a..802d112629 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c @@ -260,7 +260,7 @@ void EnMa4_RunInCircles(EnMa4* this, PlayState* play) { sAnimIndex = 13; } } else { - this->actor.speedXZ = 2.7f; + this->actor.speed = 2.7f; EnMa4_ChangeAnim(this, 9); sAnimIndex = 9; } @@ -279,7 +279,7 @@ void EnMa4_RunInCircles(EnMa4* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, sp2E, 5, 0x3000, 0x100); } else { if ((D_80AC0254 == 0) && ((Rand_Next() % 4) == 0)) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; D_80AC0254 = 2; EnMa4_ChangeAnim(this, 3); sAnimIndex = 3; @@ -309,14 +309,14 @@ void EnMa4_SetupWait(EnMa4* this) { if ((this->state != MA4_STATE_AFTERHORSEBACKGAME) && (this->state != MA4_STATE_AFTERDESCRIBETHEMCS)) { if (this->type != MA4_TYPE_ALIENS_WON) { EnMa4_ChangeAnim(this, 9); - this->actor.speedXZ = 2.7f; + this->actor.speed = 2.7f; } else { EnMa4_ChangeAnim(this, 15); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } } else { EnMa4_ChangeAnim(this, 1); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } this->actor.gravity = -0.2f; 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 9eed098866..bfe805cb1e 100644 --- a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c +++ b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c @@ -99,7 +99,7 @@ void EnMinifrog_Init(Actor* thisx, PlayState* play) { this->frogIndex = MINIFROG_YELLOW; } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = EnMinifrog_Idle; this->jumpState = MINIFROG_STATE_GROUND; this->flags = 0; 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 a18f712476..02a085e548 100644 --- a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c +++ b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c @@ -240,7 +240,7 @@ void EnMinislime_SetupFall(EnMinislime* this, PlayState* play) { this->collider.base.atFlags |= AT_ON; this->collider.base.acFlags |= AC_ON; this->collider.base.ocFlags1 |= OC1_ON; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.gravity = -2.0f; if (this->actionFunc != EnMinislime_GekkoThrow) { this->actor.scale.x = 0.095f; @@ -269,7 +269,7 @@ void EnMinislime_SetupBreakFromBigslime(EnMinislime* this) { this->actor.world.rot.y = Actor_WorldYawTowardActor(this->actor.parent, &this->actor); this->actor.shape.rot.y = this->actor.world.rot.y; - this->actor.speedXZ = Math_CosS(this->actor.world.rot.x) * 15.0f; + this->actor.speed = Math_CosS(this->actor.world.rot.x) * 15.0f; velY = Math_SinS(this->actor.world.rot.x) * 15.0f; this->actor.bgCheckFlags &= ~1; this->actor.velocity.y = velY + 2.0f; @@ -300,7 +300,7 @@ void EnMinislime_BreakFromBigslime(EnMinislime* this, PlayState* play) { void EnMinislime_SetupIceArrowDamage(EnMinislime* this) { this->collider.base.atFlags &= ~AT_ON; this->frozenTimer = 80; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->frozenScale = 0.1f; this->actionFunc = EnMinislime_IceArrowDamage; } @@ -354,7 +354,7 @@ void EnMinislime_SetupFireArrowDamage(EnMinislime* this) { this->actor.shape.rot.z = 0; this->actor.world.rot.x = 0; this->collider.base.acFlags &= ~AC_ON; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = EnMinislime_FireArrowDamage; } @@ -385,7 +385,7 @@ void EnMinislime_SetupGrowAndShrink(EnMinislime* this) { this->actor.shape.rot.y = 0; this->actor.shape.rot.z = 0; this->actor.world.rot.x = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); this->growShrinkTimer = 42; this->actor.scale.x = 0.19f; @@ -425,8 +425,8 @@ void EnMinislime_Idle(EnMinislime* this, PlayState* play) { this->idleTimer--; speedXZ = sin_rad(this->idleTimer * (M_PI / 10)); - this->actor.speedXZ = speedXZ * 1.5f; - this->actor.speedXZ = CLAMP_MIN(this->actor.speedXZ, 0.0f); + this->actor.speed = speedXZ * 1.5f; + this->actor.speed = CLAMP_MIN(this->actor.speed, 0.0f); Math_StepToF(&this->actor.scale.x, ((0.14f * speedXZ) + 1.5f) * 0.1f, 0.010000001f); Math_StepToF(&this->actor.scale.y, ((cos_rad(this->idleTimer * (M_PI / 10)) * 0.07f) + 0.75f) * 0.1f, 0.010000001f); Math_StepToF(&this->actor.scale.z, 0.3f - this->actor.scale.x, 0.010000001f); @@ -451,7 +451,7 @@ void EnMinislime_Idle(EnMinislime* this, PlayState* play) { } void EnMinislime_SetupBounce(EnMinislime* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->bounceTimer = (this->actionFunc == EnMinislime_GrowAndShrink) ? 1 : 4; Actor_PlaySfx(&this->actor, NA_SE_EN_SLIME_JUMP1); this->actionFunc = EnMinislime_Bounce; @@ -466,7 +466,7 @@ void EnMinislime_Bounce(EnMinislime* this, PlayState* play) { if (this->bounceTimer == 0) { this->actor.gravity = -2.0f; this->actor.world.rot.y = this->actor.yawTowardsPlayer; - this->actor.speedXZ = 1.0f; + this->actor.speed = 1.0f; this->actor.velocity.y = 12.0f; this->actor.shape.rot.y = this->actor.world.rot.y; } @@ -490,7 +490,7 @@ void EnMinislime_Bounce(EnMinislime* this, PlayState* play) { void EnMinislime_SetupMoveToBigslime(EnMinislime* this) { this->actor.gravity = 0.0f; - this->actor.speedXZ = 15.0f; + this->actor.speed = 15.0f; this->actor.shape.rot.x = Actor_WorldPitchTowardPoint(&this->actor, &this->actor.parent->home.pos); this->actor.shape.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.parent->home.pos); this->actor.world.rot.x = -this->actor.shape.rot.x; @@ -517,7 +517,7 @@ void EnMinislime_MoveToBigslime(EnMinislime* this, PlayState* play) { EnMinislime_SetupDisappear(this); } else if ((this->actor.scale.x > 0.0f) && (this->actor.world.pos.y > (GBT_ROOM_5_MAX_Y - 100.0f))) { this->actor.params = MINISLIME_SETUP_DISAPPEAR; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_SetScale(&this->actor, 0.0f); } } @@ -526,7 +526,7 @@ void EnMinislime_SetupKnockback(EnMinislime* this) { this->collider.base.acFlags &= ~AC_ON; this->collider.base.ocFlags1 |= OC1_ON; this->knockbackTimer = 30; - this->actor.speedXZ = 20.0f; + this->actor.speed = 20.0f; func_800BE504(&this->actor, &this->collider); this->actionFunc = EnMinislime_Knockback; } @@ -535,7 +535,7 @@ void EnMinislime_Knockback(EnMinislime* this, PlayState* play) { f32 sqrtFrozenTimer; this->knockbackTimer--; - Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f); + Math_StepToF(&this->actor.speed, 0.0f, 1.0f); sqrtFrozenTimer = sqrtf(this->knockbackTimer); this->actor.scale.x = ((cos_rad(this->knockbackTimer * (M_PI / 3)) * (0.05f * sqrtFrozenTimer)) + 1.0f) * 0.15f; this->actor.scale.z = this->actor.scale.x; @@ -556,7 +556,7 @@ void EnMinislime_SetupDefeatIdle(EnMinislime* this) { this->idleTimer = 20; this->collider.base.atFlags &= ~(AT_ON | AT_HIT); this->collider.base.acFlags &= ~(AC_ON | AC_HIT); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->frozenAlpha > 20) { EnMinislime_AddIceShardEffect(this); } @@ -625,7 +625,7 @@ void EnMinislime_Despawn(EnMinislime* this, PlayState* play) { } void EnMinislime_SetupMoveToGekko(EnMinislime* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; this->collider.base.acFlags &= ~AC_ON; @@ -657,7 +657,7 @@ void EnMinislime_SetupGekkoThrow(EnMinislime* this) { this->collider.base.acFlags |= AC_ON; this->collider.base.ocFlags1 |= OC1_ON; xzDistToPlayer = CLAMP_MIN(this->actor.xzDistToPlayer, 200.0f); - this->actor.speedXZ = 17.5f; + this->actor.speed = 17.5f; this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.gravity = -1.0f; this->actor.velocity.y = ((xzDistToPlayer - 200.0f) * 0.01f) + 3.0f; 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 612e0d3db4..59cc5249fa 100644 --- a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c +++ b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c @@ -256,15 +256,15 @@ void func_80A4E2E8(EnMkk* this, PlayState* play) { s32 sp20; this->unk_14E--; - if ((this->actor.params == 1) && (this->actor.bgCheckFlags & 1) && (this->actor.speedXZ > 2.5f) && + if ((this->actor.params == 1) && (this->actor.bgCheckFlags & 1) && (this->actor.speed > 2.5f) && ((play->gameplayFrames % 3) == 0)) { func_80A4E22C(this, play); } if (this->unk_14E > 0) { - Math_StepToF(&this->actor.speedXZ, 5.0f, 0.7f); + Math_StepToF(&this->actor.speed, 5.0f, 0.7f); sp20 = false; } else { - sp20 = Math_StepToF(&this->actor.speedXZ, 0.0f, 0.7f); + sp20 = Math_StepToF(&this->actor.speed, 0.0f, 0.7f); } if ((player->stateFlags3 & 0x100) || (Player_GetMask(play) == PLAYER_MASK_STONE)) { Math_ScaledStepToS(&this->unk_150, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x400); @@ -274,7 +274,7 @@ void func_80A4E2E8(EnMkk* this, PlayState* play) { Math_ScaledStepToS(&this->unk_150, this->actor.yawTowardsPlayer, 0x400); } this->actor.shape.rot.y = - (s32)(sin_rad(this->unk_14E * ((2 * M_PI) / 15)) * (614.4f * this->actor.speedXZ)) + this->unk_150; + (s32)(sin_rad(this->unk_14E * ((2 * M_PI) / 15)) * (614.4f * this->actor.speed)) + this->unk_150; func_800B9010(&this->actor, NA_SE_EN_KUROSUKE_MOVE - SFX_FLAG); if (sp20) { this->unk_14B &= ~2; @@ -289,7 +289,7 @@ void func_80A4E2E8(EnMkk* this, PlayState* play) { void func_80A4E58C(EnMkk* this) { this->unk_14B |= 1; - this->actor.speedXZ = 3.0f; + this->actor.speed = 3.0f; this->actor.velocity.y = 5.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_KUROSUKE_ATTACK); this->collider.base.atFlags |= AT_ON; @@ -316,7 +316,7 @@ void func_80A4E67C(EnMkk* this) { Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DEAD); this->alpha = 254; func_800BE568(&this->actor, &this->collider); - this->actor.speedXZ = 7.0f; + this->actor.speed = 7.0f; this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.velocity.y = 5.0f; this->actor.gravity = -1.3f; @@ -379,16 +379,16 @@ void func_80A4E84C(EnMkk* this) { this->unk_154.y = this->actor.world.pos.y; this->unk_154.x = this->actor.world.pos.x - 10.0f * Math_SinS(this->actor.shape.rot.y + - (s32)(1228.8f * this->actor.speedXZ * sin_rad(this->unk_14E * (M_PI / 5)))); + (s32)(1228.8f * this->actor.speed * sin_rad(this->unk_14E * (M_PI / 5)))); this->unk_154.z = this->actor.world.pos.z - 10.0f * Math_CosS(this->actor.shape.rot.y + - (s32)(1228.8f * this->actor.speedXZ * sin_rad(this->unk_14E * (M_PI / 5)))); + (s32)(1228.8f * this->actor.speed * sin_rad(this->unk_14E * (M_PI / 5)))); this->unk_160.x = this->unk_154.x - 12.0f * Math_SinS(this->actor.shape.rot.y - - (s32)(1228.8f * this->actor.speedXZ * sin_rad(this->unk_14E * (M_PI / 5)))); + (s32)(1228.8f * this->actor.speed * sin_rad(this->unk_14E * (M_PI / 5)))); this->unk_160.z = this->unk_154.z - 12.0f * Math_CosS(this->actor.shape.rot.y - - (s32)(1228.8f * this->actor.speedXZ * sin_rad(this->unk_14E * (M_PI / 5)))); + (s32)(1228.8f * this->actor.speed * sin_rad(this->unk_14E * (M_PI / 5)))); } } @@ -483,7 +483,7 @@ void func_80A4EF74(EnMkk* this, PlayState* play) { Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos); Math_Vec3f_Copy(&this->unk_154, &this->actor.world.pos); Math_Vec3f_Copy(&this->unk_160, &this->actor.world.pos); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; func_80A4EDF0(this); } else { 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 0cc91d53dc..bd8472a4e9 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -130,37 +130,37 @@ void func_80965DB4(EnMm* this, PlayState* play) { this->actor.velocity.y = 0.0f; } - if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) { + if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & 8)) { angle = BINANG_SUB(this->actor.world.rot.y, BINANG_ROT180(this->actor.wallYaw)); this->actor.world.rot.y += BINANG_SUB(0x8000, (s16)(angle * 2)); - this->actor.speedXZ *= 0.5f; + this->actor.speed *= 0.5f; CollisionCheck_SpawnShieldParticles(play, &this->actor.world.pos); Actor_PlaySfx(&this->actor, NA_SE_EV_HUMAN_BOUND); } if (!(this->actor.bgCheckFlags & 1)) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.08f); + Math_StepToF(&this->actor.speed, 0.0f, 0.08f); } else { - temp_f14 = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; - temp_f12 = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; + temp_f14 = Math_SinS(this->actor.world.rot.y) * this->actor.speed; + temp_f12 = Math_CosS(this->actor.world.rot.y) * this->actor.speed; Actor_GetSlopeDirection(this->actor.floorPoly, &slopeNormal, &downwardSlopeYaw); temp_f14 += 3.0f * slopeNormal.x; temp_f12 += 3.0f * slopeNormal.z; temp_f2 = sqrtf(SQ(temp_f14) + SQ(temp_f12)); - if ((temp_f2 < this->actor.speedXZ) || + if ((temp_f2 < this->actor.speed) || (SurfaceType_GetSlope(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) == 1)) { - this->actor.speedXZ = CLAMP_MAX(temp_f2, 16.0f); + this->actor.speed = CLAMP_MAX(temp_f2, 16.0f); this->actor.world.rot.y = Math_Atan2S_XY(temp_f12, temp_f14); } - if (!Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f)) { + if (!Math_StepToF(&this->actor.speed, 0.0f, 1.0f)) { direction = this->actor.world.rot.y; if (ABS_ALT(BINANG_SUB(this->actor.world.rot.y, this->actor.shape.rot.y)) > 0x4000) { direction = BINANG_ROT180(direction); } - Math_ScaledStepToS(&this->actor.shape.rot.y, direction, this->actor.speedXZ * 100.0f); - this->unk_190 += (s16)(this->actor.speedXZ * 800.0f); + Math_ScaledStepToS(&this->actor.shape.rot.y, direction, this->actor.speed * 100.0f); + this->unk_190 += (s16)(this->actor.speed * 800.0f); } if (this->actor.bgCheckFlags & 2) { 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 6aac1355db..625e509066 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -69,7 +69,7 @@ void EnMs_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.015f); this->actor.colChkInfo.mass = MASS_IMMOVABLE; // Eating Magic Beans all day will do that to you this->actionFunc = EnMs_Wait; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; this->actor.gravity = -1.0f; } 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 30e87a669d..2490c5cc6f 100644 --- a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c +++ b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c @@ -275,9 +275,9 @@ s32 func_80A68DD4(EnMushi2* this, PlayState* play) { } void func_80A68ED8(EnMushi2* this) { - this->actor.velocity.x = this->actor.speedXZ * this->unk_328.x; - this->actor.velocity.y = this->actor.speedXZ * this->unk_328.y; - this->actor.velocity.z = this->actor.speedXZ * this->unk_328.z; + this->actor.velocity.x = this->actor.speed * this->unk_328.x; + this->actor.velocity.y = this->actor.speed * this->unk_328.y; + this->actor.velocity.z = this->actor.speed * this->unk_328.z; Actor_UpdatePos(&this->actor); } @@ -797,7 +797,7 @@ void func_80A6A36C(EnMushi2* this, PlayState* play) { s32 pad; s32 sp20 = false; - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f); + Math_StepToF(&this->actor.speed, 0.0f, 0.2f); this->actor.velocity.y -= this->actor.velocity.y * D_80A6BA14[ENMUSHI2_GET_3(&this->actor)]; Actor_MoveWithGravity(&this->actor); func_80A69424(this, play); @@ -853,11 +853,11 @@ void func_80A6A5C0(EnMushi2* this, PlayState* play) { EnMushi2* this2 = this; func_80A69D3C(this); - Math_SmoothStepToF(&this->actor.speedXZ, this->unk_35C, 0.1f, 0.5f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, this->unk_35C, 0.1f, 0.5f, 0.0f); if (this->unk_354 < SQ(40.0f)) { f32 temp = 1.0f - ((SQ(40.0f) - this->unk_354) * (1.0f / (10.0f * SQ(40.0f)))); - this->actor.speedXZ *= temp; + this->actor.speed *= temp; } func_80A68ED8(this); @@ -866,7 +866,7 @@ void func_80A6A5C0(EnMushi2* this, PlayState* play) { func_80A69388(this); } - this->skelAnime.playSpeed = this->actor.speedXZ * 1.6f; + this->skelAnime.playSpeed = this->actor.speed * 1.6f; this2->skelAnime.playSpeed = CLAMP(this2->skelAnime.playSpeed, 0.1f, 1.9f); if ((this->unk_36A <= 0) || func_80A68BA0(this)) { @@ -896,7 +896,7 @@ void func_80A6A794(EnMushi2* this) { void func_80A6A824(EnMushi2* this, PlayState* play) { EnMushi2* this2 = this; - Math_SmoothStepToF(&this->actor.speedXZ, this->unk_35C, 0.1f, 0.5f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, this->unk_35C, 0.1f, 0.5f, 0.0f); func_80A68ED8(this); func_80A697C4(this, play); @@ -904,7 +904,7 @@ void func_80A6A824(EnMushi2* this, PlayState* play) { func_80A69388(this); } - this->skelAnime.playSpeed = (Rand_ZeroOne() * 0.8f) + (this->actor.speedXZ * 1.2f); + this->skelAnime.playSpeed = (Rand_ZeroOne() * 0.8f) + (this->actor.speed * 1.2f); this2->skelAnime.playSpeed = CLAMP(this2->skelAnime.playSpeed, 0.0f, 1.9f); if ((this->unk_36A <= 0) || func_80A68BA0(this)) { @@ -963,9 +963,9 @@ void func_80A6AB08(EnMushi2* this, PlayState* play) { s16 temp; if (this->unk_368 > 80) { - Math_StepToF(&this->actor.speedXZ, 0.6f, 0.08f); + Math_StepToF(&this->actor.speed, 0.6f, 0.08f); } else { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.02f); + Math_StepToF(&this->actor.speed, 0.0f, 0.02f); } Actor_MoveWithGravity(&this->actor); @@ -1025,8 +1025,8 @@ void func_80A6AE7C(EnMushi2* this, PlayState* play) { this->actor.shape.rot.x -= 0x1F4; this->actor.shape.rot.y += 0xC8; - this->actor.speedXZ += (Rand_ZeroOne() - 0.5f) * 0.16f; - this->actor.speedXZ *= 0.9f; + this->actor.speed += (Rand_ZeroOne() - 0.5f) * 0.16f; + this->actor.speed *= 0.9f; this->actor.world.rot.y += (s16)((Rand_ZeroOne() - 0.5f) * 2000.0f); this->actor.gravity = -0.04f - (Rand_ZeroOne() * 0.02f); this->actor.velocity.y *= 0.95f; @@ -1058,7 +1058,7 @@ void func_80A6B0D8(EnMushi2* this, PlayState* play) { s32 pad[2]; f32 temp_f2; - Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.4f, 1.2f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.4f, 1.2f, 0.0f); temp_f2 = this->actor.scale.x - 0.0002f; Actor_SetScale(&this->actor, CLAMP_MIN(temp_f2, 0.001f)); @@ -1077,11 +1077,11 @@ void func_80A6B0D8(EnMushi2* this, PlayState* play) { } this->actor.velocity.x = - (this->actor.speedXZ * this->unk_328.x) + (-0.01f * this->unk_31C.x) + (this->unk_310.x * temp_f2); + (this->actor.speed * this->unk_328.x) + (-0.01f * this->unk_31C.x) + (this->unk_310.x * temp_f2); this->actor.velocity.y = - (this->actor.speedXZ * this->unk_328.y) + (-0.01f * this->unk_31C.y) + (this->unk_310.y * temp_f2); + (this->actor.speed * this->unk_328.y) + (-0.01f * this->unk_31C.y) + (this->unk_310.y * temp_f2); this->actor.velocity.z = - (this->actor.speedXZ * this->unk_328.z) + (-0.01f * this->unk_31C.z) + (this->unk_310.z * temp_f2); + (this->actor.speed * this->unk_328.z) + (-0.01f * this->unk_31C.z) + (this->unk_310.z * temp_f2); if ((this->actor.flags & ACTOR_FLAG_40) && (this->unk_368 > 20) && (Rand_ZeroOne() < 0.15f)) { Vec3f sp48; 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 c1fb5ebe67..78464e6f21 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 @@ -207,8 +207,8 @@ void EnNeoReeba_ChooseAction(EnNeoReeba* this, PlayState* play) { if (this->actionTimer == 0) { if ((distToPlayer < 140.0f) && (fabsf(this->actor.playerHeightRel) < 100.0f)) { this->targetPos = player->actor.world.pos; - this->targetPos.x += 10.0f * player->actor.speedXZ * Math_SinS(player->actor.world.rot.y); - this->targetPos.z += 10.0f * player->actor.speedXZ * Math_CosS(player->actor.world.rot.y); + this->targetPos.x += 10.0f * player->actor.speed * Math_SinS(player->actor.world.rot.y); + this->targetPos.z += 10.0f * player->actor.speed * Math_CosS(player->actor.world.rot.y); EnNeoReeba_SetupMove(this); } else { EnNeoReeba_SetupReturnHome(this); @@ -273,19 +273,19 @@ void EnNeoReeba_SetupMove(EnNeoReeba* this) { this->actionTimer = 60; this->actionFunc = EnNeoReeba_Move; this->skelAnime.playSpeed = 2.0f; - this->actor.speedXZ = 14.0f; + this->actor.speed = 14.0f; } void EnNeoReeba_Move(EnNeoReeba* this, PlayState* play) { - f32 remainingDist = Math_Vec3f_StepToXZ(&this->actor.world.pos, &this->targetPos, this->actor.speedXZ); + f32 remainingDist = Math_Vec3f_StepToXZ(&this->actor.world.pos, &this->targetPos, this->actor.speed); Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 4.0f, 0xFA, 0xA, 1); if (remainingDist < 2.0f) { EnNeoReeba_SetupChooseAction(this); - } else if (remainingDist < 40.0f && this->actor.speedXZ > 3.0f) { - this->actor.speedXZ -= 2.0f; + } else if (remainingDist < 40.0f && this->actor.speed > 3.0f) { + this->actor.speed -= 2.0f; } if (this->sfxTimer == 0) { @@ -304,18 +304,18 @@ void EnNeoReeba_Move(EnNeoReeba* this, PlayState* play) { void EnNeoReeba_SetupReturnHome(EnNeoReeba* this) { this->actionFunc = EnNeoReeba_ReturnHome; - this->actor.speedXZ = 6.0f; + this->actor.speed = 6.0f; } void EnNeoReeba_ReturnHome(EnNeoReeba* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 pad; - f32 remainingDist = Math_Vec3f_StepToXZ(&this->actor.world.pos, &this->actor.home.pos, this->actor.speedXZ); + f32 remainingDist = Math_Vec3f_StepToXZ(&this->actor.world.pos, &this->actor.home.pos, this->actor.speed); if (remainingDist < 2.0f) { EnNeoReeba_SetupChooseAction(this); - } else if (remainingDist < 40.0f && this->actor.speedXZ > 3.0f) { - this->actor.speedXZ -= 1.0f; + } else if (remainingDist < 40.0f && this->actor.speed > 3.0f) { + this->actor.speed -= 1.0f; } if (Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) > 200.0f || @@ -333,7 +333,7 @@ void EnNeoReeba_SetupBounce(EnNeoReeba* this) { } void EnNeoReeba_Bounce(EnNeoReeba* this, PlayState* play) { - if (Math_Vec3f_StepToXZ(&this->actor.world.pos, &this->targetPos, this->actor.speedXZ) < 2.0f) { + if (Math_Vec3f_StepToXZ(&this->actor.world.pos, &this->targetPos, this->actor.speed) < 2.0f) { EnNeoReeba_SetupChooseAction(this); } 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 105d4d735d..87fcf5a4d5 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -160,7 +160,7 @@ void EnNiw_Init(Actor* thisx, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF this->niwState = NIW_STATE_HELD; this->actionFunc = EnNiw_Held; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk2BC.z = 0.0f; this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; @@ -372,7 +372,7 @@ void EnNiw_Idle(EnNiw* this, PlayState* play) { this->heldTimer = 30; this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF this->niwState = NIW_STATE_HELD; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = EnNiw_Held; return; } else { @@ -415,7 +415,7 @@ void EnNiw_Idle(EnNiw* this, PlayState* play) { } else { this->unkIdleTimer = 4; if (this->actor.bgCheckFlags & 1) { // hit floor - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 3.5f; // hopping up and down } } @@ -476,7 +476,7 @@ void EnNiw_Held(EnNiw* this, PlayState* play) { this->actor.shape.rot.z = 0; rotZ = this->actor.shape.rot.z; this->actor.velocity.y = 8.0f; - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; this->actor.gravity = -2.0f; this->niwState = NIW_STATE_FALLING; this->unk2EC = 0; @@ -497,7 +497,7 @@ void EnNiw_Thrown(EnNiw* this, PlayState* play) { if (this->actor.bgCheckFlags & 1) { // hit floor this->unk2EC = 1; this->hoppingTimer = 80; // hop timer - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 4.0f; } else { return; // wait until back on floor @@ -526,7 +526,7 @@ void EnNiw_Thrown(EnNiw* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF this->niwState = NIW_STATE_HELD; this->actionFunc = EnNiw_Held; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { if (this->hoppingTimer > 5) { Actor_LiftActor(&this->actor, play); @@ -544,7 +544,7 @@ void EnNiw_Swimming(EnNiw* this, PlayState* play) { EnNiw_SpawnAttackNiw(this, play); // spawn attack niw } - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; if (this->actor.bgCheckFlags & 0x20) { // touching water this->actor.gravity = 0.0f; if (this->actor.depthInWater > 15.0f) { @@ -559,16 +559,16 @@ void EnNiw_Swimming(EnNiw* this, PlayState* play) { } if (this->actor.bgCheckFlags & 8) { // hit a wall this->actor.velocity.y = 10.0f; // fly up in straight line - this->actor.speedXZ = 1.0f; + this->actor.speed = 1.0f; } } else { this->actor.gravity = -2.0f; if (this->actor.bgCheckFlags & 8) { // hit a wall this->actor.velocity.y = 10.0f; // fly up in straight line - this->actor.speedXZ = 1.0f; + this->actor.speed = 1.0f; this->actor.gravity = 0.0f; } else { - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; } if (this->actor.bgCheckFlags & 1) { // hit floor @@ -646,7 +646,7 @@ void EnNiw_SetupCuccoStorm(EnNiw* this, PlayState* play) { void EnNiw_CuccoStorm(EnNiw* this, PlayState* play) { EnNiw_SpawnAttackNiw(this, play); if (this->cuccoStormTimer == 1) { // not countdown to 0? mistype? - this->actor.speedXZ = 3.0f; + this->actor.speed = 3.0f; this->isRunningRight = Rand_ZeroFloat(1.99f); this->generalTimer1 = 0; this->unkTimer24E = this->generalTimer1; @@ -662,7 +662,7 @@ void EnNiw_SetupRunAway(EnNiw* this) { this->isRunningRight = Rand_ZeroFloat(1.99f); this->niwState = NIW_STATE_RUNNING; this->actionFunc = EnNiw_RunAway; - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; } void EnNiw_RunAway(EnNiw* this, PlayState* play) { @@ -678,7 +678,7 @@ void EnNiw_RunAway(EnNiw* this, PlayState* play) { this->unk2A4.z = this->unk2B0.z = this->actor.world.pos.z; this->generalTimer2 = this->generalTimer1 = this->unk298 = 0; this->unk300 = this->unk304 = 0; - this->actor.speedXZ = 0; + this->actor.speed = 0; this->targetLimbRots[8] = 0; this->targetLimbRots[6] = 0; this->targetLimbRots[5] = 0; @@ -746,7 +746,7 @@ void EnNiw_CheckRage(EnNiw* this, PlayState* play) { this->actionFunc = EnNiw_Trigger; this->unk304 = 0.0f; this->unk300 = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { this->iframeTimer = 10; @@ -857,7 +857,7 @@ void EnNiw_Update(Actor* thisx, PlayState* play) { this->actor.world.pos.y = this->actor.home.pos.y + 300.0f; } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.gravity = -2.0f; Math_Vec3f_Copy(&this->unk2A4, &this->actor.home.pos); Math_Vec3f_Copy(&this->unk2B0, &this->actor.home.pos); 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 ad872cd210..37872a491f 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -57,7 +57,7 @@ void EnNutsball_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawCircle, 13.0f); Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->actor.shape.rot.y = 0; - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; if (this->actor.params == 2) { this->timer = 1; this->timerThreshold = 0; 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 ee22e9abf5..193d90ed3f 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c @@ -172,7 +172,7 @@ s32 EnNwc_IsFound(EnNwc* this, PlayState* play) { } void EnNwc_ChangeState(EnNwc* this, s16 newState) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; switch (newState) { case NWC_STATE_CHECK_BREMAN: this->stateTimer = 10; @@ -209,7 +209,7 @@ void EnNwc_ChangeState(EnNwc* this, s16 newState) { * If previously checking for breman -> select random (NWC_STATE_TURNING, NWC_STATE_HOPPING_FORWARD) */ void EnNwc_ToggleState(EnNwc* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->state != NWC_STATE_CHECK_BREMAN) { EnNwc_ChangeState(this, NWC_STATE_CHECK_BREMAN); } else { @@ -276,7 +276,7 @@ void EnNwc_Follow(EnNwc* this, PlayState* play) { s16 targetUpperBodyRot = 0; s16 targetFootRot = 0; - if (this->actor.speedXZ > 0.0f) { + if (this->actor.speed > 0.0f) { if (this->stateTimer & 4) { targetFootRot = 0x1B58; targetUpperBodyRot = -0x2710; @@ -312,7 +312,7 @@ void EnNwc_Follow(EnNwc* this, PlayState* play) { Math_Vec3f_Diff(&chickCoords[this->actor.home.rot.z], &this->actor.world.pos, &targetVector); if (SQXZ(targetVector) < SQ(5.0f)) { // too close to keep moving, stop - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; // first nwc in the line follows player, the rest follow the previous one if (this->actor.home.rot.z == 1) { @@ -329,7 +329,7 @@ void EnNwc_Follow(EnNwc* this, PlayState* play) { } else if (this->randomRot < -0x1388) { this->randomRot = -0x1388; } - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; newRotY = Math_Vec3f_Yaw(&this->actor.world.pos, &chickCoords[this->actor.home.rot.z]) + this->randomRot; } @@ -358,7 +358,7 @@ void EnNwc_Follow(EnNwc* this, PlayState* play) { if (this->grog->actor.home.rot.x >= 20) { // all chicks have turned into adult cucco, stop and crow Actor_PlaySfx(&this->actor, NA_SE_EV_CHICKEN_CRY_M); this->actionFunc = EnNwc_CrowAtTheEnd; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_SetScale(&this->actor, 0.01f); } } @@ -383,9 +383,9 @@ void EnNwc_HopForward(EnNwc* this, PlayState* play) { // they only move forward while off the ground, which gives the visual of them hopping to move if (this->actor.bgCheckFlags & 0x1) { // touching floor - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; } } @@ -407,7 +407,7 @@ void EnNwc_RunAway(EnNwc* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EV_CHICK_SONG); } - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; if (this->actor.bgCheckFlags & 0x8) { // touching wall EnNwc_ToggleState(this); } 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 193c246fa8..8f5824bb02 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -329,7 +329,7 @@ void func_80B5BED4(EnOt* this, PlayState* play) { func_800BE33C(&this->actor.world.pos, &this->unk_360->actor.world.pos, &this->actor.world.rot, 0); Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &this->unk_360->actor), 3, 0xE38, 0x38E); - this->actor.speedXZ = 3.5f; + this->actor.speed = 3.5f; this->actor.world.pos.y = this->unk_360->actor.world.pos.y; Actor_MoveWithoutGravityReverse(&this->actor); } @@ -487,7 +487,7 @@ void func_80B5C64C(EnOt* this, PlayState* play) { } void func_80B5C684(EnOt* this, PlayState* play) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIndex); this->actionFunc = func_80B5C6DC; } @@ -819,11 +819,11 @@ void func_80B5D160(EnOt* this, PlayState* play) { s32 EnOt_ActorPathing_Move(PlayState* play, ActorPathing* actorPath) { Actor* thisx = actorPath->actor; EnOt* this = (EnOt*)thisx; - f32 sp24 = Math_CosS(-thisx->world.rot.x) * thisx->speedXZ; + f32 sp24 = Math_CosS(-thisx->world.rot.x) * thisx->speed; f32 sp20 = gFramerateDivisorHalf; thisx->velocity.x = Math_SinS(thisx->world.rot.y) * sp24; - thisx->velocity.y = Math_SinS(-thisx->world.rot.x) * thisx->speedXZ; + thisx->velocity.y = Math_SinS(-thisx->world.rot.x) * thisx->speed; thisx->velocity.z = Math_CosS(thisx->world.rot.y) * sp24; this->unk_330.x += (thisx->velocity.x * sp20) + thisx->colChkInfo.displacement.x; @@ -845,7 +845,7 @@ s32 EnOt_ActorPathing_UpdateActorInfo(PlayState* play, ActorPathing* actorPath) s32 sp34; thisx->gravity = 0.0f; - Math_SmoothStepToF(&thisx->speedXZ, 10.0f, 0.8f, 2.0f, 0.0f); + Math_SmoothStepToF(&thisx->speed, 10.0f, 0.8f, 2.0f, 0.0f); sp50.x = actorPath->curPoint.x - thisx->world.pos.x; sp50.y = actorPath->curPoint.y - thisx->world.pos.y; @@ -856,10 +856,10 @@ s32 EnOt_ActorPathing_UpdateActorInfo(PlayState* play, ActorPathing* actorPath) sp44.z = actorPath->curPoint.z - actorPath->prevPoint.z; temp = Math3D_Parallel(&sp50, &sp44); - if ((actorPath->distSqToCurPointXZ < SQ(thisx->speedXZ)) || (temp <= 0.0f)) { + if ((actorPath->distSqToCurPointXZ < SQ(thisx->speed)) || (temp <= 0.0f)) { ret = true; } else { - temp = SQ(thisx->speedXZ) / actorPath->distSqToCurPoint; + temp = SQ(thisx->speed) / actorPath->distSqToCurPoint; sp34 = ABS(actorPath->rotToCurPoint.x - thisx->world.rot.x); sp2C = (s32)(sp34 * temp) + 0xAAA; @@ -884,7 +884,7 @@ void func_80B5D648(EnOt* this, PlayState* play) { this->actorPath.pointOffset.y = 0.0f; this->actorPath.pointOffset.z = 0.0f; this->actor.gravity = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIndex); this->actor.flags |= ACTOR_FLAG_8000000; this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8); 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 361f7fdec9..743feb0825 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -424,8 +424,8 @@ void func_8095B158(EnOwl* this) { } void func_8095B1E4(EnOwl* this, PlayState* play) { - if (this->actor.speedXZ < 6.0f) { - this->actor.speedXZ += 1.0f; + if (this->actor.speed < 6.0f) { + this->actor.speed += 1.0f; } if (this->actor.xzDistToPlayer > 6000.0f) { @@ -434,8 +434,8 @@ void func_8095B1E4(EnOwl* this, PlayState* play) { } void func_8095B254(EnOwl* this, PlayState* play) { - if (this->actor.speedXZ < 6.0f) { - this->actor.speedXZ += 1.0f; + if (this->actor.speed < 6.0f) { + this->actor.speed += 1.0f; } if (this->actionFlags & 1) { @@ -491,7 +491,7 @@ void func_8095B480(EnOwl* this, PlayState* play) { this->unk_3EC = this->actor.home.rot.y; this->actor.world.pos = this->actor.home.pos; func_8095A510(this, play); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_8095BE0C; } } @@ -540,8 +540,8 @@ void func_8095B76C(EnOwl* this, PlayState* play) { Math_SmoothStepToS(&this->actor.world.rot.y, sp4A, 6, 0x800, 0x200); this->actor.shape.rot.y = this->actor.world.rot.y; - if (sp44 < SQ(this->actor.speedXZ)) { - this->actor.speedXZ = 0.0f; + if (sp44 < SQ(this->actor.speed)) { + this->actor.speed = 0.0f; points = Lib_SegmentedToVirtual(this->path->points); points += this->unk_3F8; @@ -564,13 +564,13 @@ void func_8095B76C(EnOwl* this, PlayState* play) { } func_8095B0C8(this); } else if (sp44 < SQ(21.0f)) { - if (this->actor.speedXZ > 1.0f) { - this->actor.speedXZ -= 1.0f; + if (this->actor.speed > 1.0f) { + this->actor.speed -= 1.0f; } else { - this->actor.speedXZ = 1.0f; + this->actor.speed = 1.0f; } - } else if (this->actor.speedXZ < 6.0f) { - this->actor.speedXZ += 1.0f; + } else if (this->actor.speed < 6.0f) { + this->actor.speed += 1.0f; } func_8095B06C(this); @@ -745,8 +745,8 @@ void func_8095BF78(EnOwl* this, PlayState* play) { Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_3EC, 2, 0x80, 0x40); this->actor.shape.rot.y = this->actor.world.rot.y; - if (this->actor.speedXZ < 16.0f) { - this->actor.speedXZ += 0.5f; + if (this->actor.speed < 16.0f) { + this->actor.speed += 0.5f; } if ((this->unk_3E4 + 1000.0f) < this->actor.world.pos.y) { @@ -767,11 +767,11 @@ void func_8095C09C(EnOwl* this, PlayState* play) { if (this->skelAnime1.curFrame > 45.0f) { this->actor.velocity.y = 2.0f; this->actor.gravity = 0.0f; - this->actor.speedXZ = 8.0f; + this->actor.speed = 8.0f; } else if (this->skelAnime1.curFrame > 17.0f) { this->actor.velocity.y = 6.0f; this->actor.gravity = 0.0f; - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; } if (this->actionFlags & 1) { 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 c99c5c9d82..33c95ce08a 100644 --- a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c +++ b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c @@ -246,7 +246,7 @@ void func_80BD8758(EnPamera* this, PlayState* play) { ActorCutscene_StartAndSetUnkLinkFields(this->cutscenes[0], &this->actor); Camera_SetToTrackActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(this->cutscenes[0])), &this->actor); - this->actor.speedXZ = 1.5f; + this->actor.speed = 1.5f; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); this->actor.shape.rot.y = this->actor.home.rot.y; this->actor.world.rot.y = this->actor.home.rot.y; @@ -255,7 +255,7 @@ void func_80BD8758(EnPamera* this, PlayState* play) { } else if ((this->cutscenes[0] != -1) && (this->actor.xzDistToPlayer < 1000.0f)) { ActorCutscene_SetIntentToPlay(this->cutscenes[0]); } else { - this->actor.speedXZ = 1.5f; + this->actor.speed = 1.5f; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); this->actor.shape.rot.y = this->actor.home.rot.y; this->actor.world.rot.y = this->actor.home.rot.y; @@ -290,7 +290,7 @@ void func_80BD8964(EnPamera* this, PlayState* play) { vec.z = this->pathPoints->z; if (Math_Vec3f_StepTo(&this->actor.world.pos, &vec, 1.0f) < 5.0f) { - this->actor.speedXZ = 1.5f; + this->actor.speed = 1.5f; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); SET_WEEKEVENTREG(WEEKEVENTREG_59_01); func_80BD8B50(this); @@ -329,7 +329,7 @@ void func_80BD8B70(EnPamera* this, PlayState* play) { vec.y = this->pathPoints[this->pathIndex].y; vec.z = this->pathPoints[this->pathIndex].z; sp32 = Math_Vec3f_Yaw(&this->actor.world.pos, &vec); - if (Math_Vec3f_StepToXZ(&this->actor.world.pos, &vec, this->actor.speedXZ) > 10.0f) { + if (Math_Vec3f_StepToXZ(&this->actor.world.pos, &vec, this->actor.speed) > 10.0f) { Math_SmoothStepToS(&this->actor.shape.rot.y, sp32, 0xA, 0x3000, 0x100); this->actor.world.rot.y = this->actor.shape.rot.y; } else if (this->pathIndex < (this->pathPointsCount - 1)) { @@ -344,14 +344,14 @@ void func_80BD8B70(EnPamera* this, PlayState* play) { void func_80BD8CCC(EnPamera* this) { this->hideInisdeTimer = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); this->actionFunc = func_80BD8D1C; } void func_80BD8D1C(EnPamera* this, PlayState* play) { if (this->hideInisdeTimer++ > 200) { - this->actor.speedXZ = 1.5f; + this->actor.speed = 1.5f; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); func_80BD8D80(this); } @@ -373,7 +373,7 @@ void func_80BD8DB0(EnPamera* this, PlayState* play) { vec.y = this->pathPoints[this->pathIndex].y; vec.z = this->pathPoints[this->pathIndex].z; sp32 = Math_Vec3f_Yaw(&this->actor.world.pos, &vec); - if (Math_Vec3f_StepToXZ(&this->actor.world.pos, &vec, this->actor.speedXZ) > 10.0f) { + if (Math_Vec3f_StepToXZ(&this->actor.world.pos, &vec, this->actor.speed) > 10.0f) { Math_SmoothStepToS(&this->actor.shape.rot.y, sp32, 0xA, 0x3000, 0x100); this->actor.world.rot.y = this->actor.shape.rot.y; } else if (this->pathIndex > 0) { @@ -396,7 +396,7 @@ void func_80BD8F60(EnPamera* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x3000, 0x1000); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); - this->actor.speedXZ = 3.0f; + this->actor.speed = 3.0f; func_80BD93CC(this, 0, 0); func_80BD8D80(this); } @@ -425,7 +425,7 @@ void func_80BD90AC(EnPamera* this, PlayState* play) { if (Player_GetMask(play) != PLAYER_MASK_STONE && (this->actionFunc != func_80BD8758) && (this->actionFunc != func_80BD8964) && (this->actionFunc != func_80BD8A7C) && (this->actionFunc != func_80BD8F60) && ((this->actionFunc != func_80BD8B70) || (this->pathIndex != 0)) && - ((this->actionFunc != func_80BD8DB0) || (this->actor.speedXZ != 3.0f)) && + ((this->actionFunc != func_80BD8DB0) || (this->actor.speed != 3.0f)) && ((this->actor.xzDistToPlayer < 150.0f) || ((this->actionFunc == func_80BD909C) && (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 200.0f)))) { @@ -513,7 +513,7 @@ void func_80BD93F4(EnPamera* this, PlayState* play) { void func_80BD94E0(EnPamera* this, PlayState* play) { if ((this->actionFunc != func_80BD8B70) && (this->actionFunc != func_80BD8964) && (this->actionFunc != func_80BD909C) && (this->actionFunc != func_80BD8D1C) && - ((this->actionFunc != func_80BD8DB0) || (this->actor.speedXZ == 3.0f))) { + ((this->actionFunc != func_80BD8DB0) || (this->actor.speed == 3.0f))) { Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos); } else { Actor_TrackNone(&this->headRot, &this->torsoRot); 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 201172cf9a..54888a7d82 100644 --- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c +++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c @@ -497,7 +497,7 @@ void EnPametfrog_SetupFallOffSnapper(EnPametfrog* this, PlayState* play) { Animation_PlayOnce(&this->skelAnime, &gGekkoFallInAirAnim); this->actor.params = GEKKO_FALL_OFF_SNAPPER; - this->actor.speedXZ = 7.0f; + this->actor.speed = 7.0f; this->actor.velocity.y = 15.0f; this->actor.world.rot.y = BINANG_ROT180(this->actor.child->world.rot.y); this->actor.shape.rot.y = this->actor.world.rot.y; @@ -548,9 +548,9 @@ void EnPametfrog_JumpToWall(EnPametfrog* this, PlayState* play) { EnPametfrog_SetupWallCrawl(this); } else if (!(this->actor.bgCheckFlags & 1) || ((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) { - this->actor.speedXZ = 12.0f; + this->actor.speed = 12.0f; } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } } @@ -580,7 +580,7 @@ void EnPametfrog_SetupWallCrawl(EnPametfrog* this) { } Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_RUNAWAY); - this->actor.speedXZ = 8.0f; + this->actor.speed = 8.0f; this->timer = Rand_S16Offset(35, 15); this->actionFunc = EnPametfrog_WallCrawl; } @@ -602,8 +602,8 @@ void EnPametfrog_WallCrawl(EnPametfrog* this, PlayState* play) { } else { SkelAnime_Update(&this->skelAnime); this->timer--; - this->actor.speedXZ = 8.0f; - doubleSpeedXZ = this->actor.speedXZ * 2.0f; + this->actor.speed = 8.0f; + doubleSpeedXZ = this->actor.speed * 2.0f; vec1.x = this->actor.world.pos.x + this->unk_2DC.x * 2.0f; vec1.y = this->actor.world.pos.y + this->unk_2DC.y * 2.0f; vec1.z = this->actor.world.pos.z + this->unk_2DC.z * 2.0f; @@ -619,7 +619,7 @@ void EnPametfrog_WallCrawl(EnPametfrog* this, PlayState* play) { isSuccess = func_8086A2CC(this, poly1); Math_Vec3f_Copy(&this->actor.world.pos, &worldPos1); this->actor.floorBgId = bgId1; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { if (this->actor.floorPoly != poly2) { isSuccess = func_8086A2CC(this, poly2); @@ -659,7 +659,7 @@ void EnPametfrog_SetupWallPause(EnPametfrog* this) { s32 pad; f32 randFloat; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->skelAnime.playSpeed = 1.5f; if (this->timer != 0) { this->wallRotation = this->unk_2E8.y > 0.0f ? (M_PI / 30) : (-M_PI / 30); @@ -705,7 +705,7 @@ void EnPametfrog_SetupClimbDownWall(EnPametfrog* this) { this->actor.shape.rot.x = 0; this->actor.shape.rot.z = 0; this->actor.colChkInfo.mass = 50; - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; this->collider.base.acFlags &= ~AC_ON; this->actor.velocity.y = 0.0f; this->actor.gravity = -1.0f; @@ -744,9 +744,9 @@ void EnPametfrog_RunToSnapper(EnPametfrog* this, PlayState* play) { this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, this->actor.child); this->actor.world.rot.y = this->actor.shape.rot.y; if (!(this->actor.bgCheckFlags & 1) || ((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) { - this->actor.speedXZ = 12.0f; + this->actor.speed = 12.0f; } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if ((this->actor.child->params == 1) && (Actor_WorldDistXZToActor(&this->actor, this->actor.child) < 120.0f) && @@ -760,7 +760,7 @@ void EnPametfrog_SetupJumpOnSnapper(EnPametfrog* this) { this->timer = 6; this->collider.base.ocFlags1 &= ~OC1_ON; this->collider.base.acFlags &= ~AC_ON; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, this->actor.child); this->actor.world.rot.y = this->actor.shape.rot.y; @@ -811,7 +811,7 @@ void EnPametfrog_SetupFallInAir(EnPametfrog* this, PlayState* play) { this->actor.params = GEKKO_RETURN_TO_SNAPPER; } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; this->collider.base.acFlags &= ~AC_ON; this->timer = 10; @@ -997,7 +997,7 @@ void EnPametfrog_SetupCutscene(EnPametfrog* this) { ActorCutscene_SetIntentToPlay(this->cutscene); this->actionFunc = EnPametfrog_PlayCutscene; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; } @@ -1023,7 +1023,7 @@ void EnPametfrog_PlayCutscene(EnPametfrog* this, PlayState* play) { void EnPametfrog_SetupLookAround(EnPametfrog* this) { Animation_PlayOnce(&this->skelAnime, &gGekkoLookAroundAnim); this->collider.base.atFlags &= ~AT_ON; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnPametfrog_LookAround; } @@ -1054,9 +1054,9 @@ void EnPametfrog_JumpToLink(EnPametfrog* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); EnPametfrog_JumpOnGround(this, play); if (!(this->actor.bgCheckFlags & 1) || (this->skelAnime.curFrame > 1.0f && this->skelAnime.curFrame < 12.0f)) { - this->actor.speedXZ = 8.0f; + this->actor.speed = 8.0f; } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if ((this->collider.base.ocFlags1 & OC1_HIT) && (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) && @@ -1069,7 +1069,7 @@ void EnPametfrog_JumpToLink(EnPametfrog* this, PlayState* play) { void EnPametfrog_SetupMeleeAttack(EnPametfrog* this) { Animation_PlayOnce(&this->skelAnime, &gGekkoBoxingStanceAnim); this->timer = 7; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = EnPametfrog_MeleeAttack; } @@ -1113,7 +1113,7 @@ void EnPametfrog_SetupDamage(EnPametfrog* this) { this->timer = 20; this->collider.base.atFlags &= ~AT_ON; this->collider.base.acFlags &= ~AC_ON; - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_DAMAGE); Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20); func_800BE5CC(&this->actor, &this->collider, 0); @@ -1124,7 +1124,7 @@ void EnPametfrog_SetupDamage(EnPametfrog* this) { void EnPametfrog_Damage(EnPametfrog* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); this->timer--; - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); if (this->timer == 0) { if (this->actor.colChkInfo.health > 0) { EnPametfrog_SetupJumpToLink(this); @@ -1141,7 +1141,7 @@ void EnPametfrog_SetupStun(EnPametfrog* this) { } this->collider.base.atFlags &= ~AT_ON; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.colChkInfo.health == 0) { this->collider.base.acFlags &= ~AC_ON; 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 527a91b3dd..2a12b9af8f 100644 --- a/src/overlays/actors/ovl_En_Part/z_en_part.c +++ b/src/overlays/actors/ovl_En_Part/z_en_part.c @@ -52,7 +52,7 @@ void func_80865390(EnPart* this, PlayState* play) { this->actor.world.rot.y = this->actor.parent->shape.rot.y + 0x8000; this->unk146 = 100; this->actor.velocity.y = 7.0f; - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; this->actor.gravity = -1.0f; break; } 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 fe63efd4ef..2ab3024f20 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -378,7 +378,7 @@ void func_80897864(EnPeehat* this) { void func_80897910(EnPeehat* this, PlayState* play) { Player* player = GET_PLAYER(play); - Math_StepToF(&this->actor.speedXZ, 3.0f, 0.25f); + Math_StepToF(&this->actor.speed, 3.0f, 0.25f); Math_StepToF(&this->actor.world.pos.y, this->actor.floorHeight + 80.0f, 3.0f); SkelAnime_Update(&this->skelAnime); if (!gSaveContext.save.isNight && (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 1200.0f)) { @@ -396,7 +396,7 @@ void func_80897910(EnPeehat* this, PlayState* play) { void func_80897A34(EnPeehat* this) { Animation_PlayLoop(&this->skelAnime, &object_ph_Anim_0005C4); this->unk_2B0 = 30; - this->actor.speedXZ = 5.3f; + this->actor.speed = 5.3f; this->colliderTris.base.atFlags |= AT_ON; this->actionFunc = func_80897A94; } @@ -469,7 +469,7 @@ void func_80897D48(EnPeehat* this, PlayState* play) { Vec3f sp34; Math_StepToF(&this->actor.shape.yOffset, -1000.0f, 50.0f); - Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f); + Math_StepToF(&this->actor.speed, 0.0f, 1.0f); Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 50); if (SkelAnime_Update(&this->skelAnime)) { func_80897498(this); @@ -490,7 +490,7 @@ void func_80897D48(EnPeehat* this, PlayState* play) { void func_80897EAC(EnPeehat* this) { Animation_PlayLoop(&this->skelAnime, &object_ph_Anim_0005C4); - this->actor.speedXZ = Rand_ZeroFloat(0.5f) + 2.5f; + this->actor.speed = Rand_ZeroFloat(0.5f) + 2.5f; this->unk_2B0 = Rand_ZeroFloat(10.0f) + 10.0f; this->colliderTris.base.atFlags |= AT_ON; this->colliderSphere.base.acFlags |= AC_ON; @@ -512,7 +512,7 @@ void func_80897F44(EnPeehat* this, PlayState* play) { this->unk_2B0--; if (this->unk_2B0 <= 0) { - this->actor.speedXZ = Rand_ZeroFloat(0.5f) + 2.5f; + this->actor.speed = Rand_ZeroFloat(0.5f) + 2.5f; this->unk_2B0 = Rand_ZeroFloat(10.0f) + 10.0f; this->unk_2B6 = randPlusMinusPoint5Scaled(1000.0f); } @@ -536,7 +536,7 @@ void func_80897F44(EnPeehat* this, PlayState* play) { void func_80898124(EnPeehat* this) { this->actionFunc = func_80898144; - this->actor.speedXZ = 2.5f; + this->actor.speed = 2.5f; } void func_80898144(EnPeehat* this, PlayState* play) { @@ -574,7 +574,7 @@ void func_80898144(EnPeehat* this, PlayState* play) { void func_808982E0(EnPeehat* this) { Animation_MorphToPlayOnce(&this->skelAnime, &object_ph_Anim_000844, -4.0f); - this->actor.speedXZ = -9.0f; + this->actor.speed = -9.0f; this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actionFunc = func_80898338; } @@ -583,7 +583,7 @@ void func_80898338(EnPeehat* this, PlayState* play) { this->unk_2B4 += this->unk_2B2; SkelAnime_Update(&this->skelAnime); - if (Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f)) { + if (Math_StepToF(&this->actor.speed, 0.0f, 0.5f)) { if (this->actor.params != 0) { func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, 40, 7, 0); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 30, NA_SE_EN_EXTINCT); @@ -599,7 +599,7 @@ void func_80898338(EnPeehat* this, PlayState* play) { void func_80898414(EnPeehat* this) { func_800BE568(&this->actor, &this->colliderSphere); this->unk_2B2 = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80898454; } @@ -625,7 +625,7 @@ void func_808984E0(EnPeehat* this) { Actor_PlaySfx(&this->actor, NA_SE_EN_PIHAT_DAMAGE); this->unk_2B2 = 4000; this->unk_2B0 = 14; - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 14); this->colliderSphere.base.acFlags &= ~AC_ON; this->unk_2C4 = 0.0f; @@ -640,7 +640,7 @@ void func_80898594(EnPeehat* this, PlayState* play) { this->unk_2B4 += this->unk_2B2; Math_ScaledStepToS(&this->unk_2B2, 4000, 250); Math_StepToF(&this->actor.world.pos.y, this->actor.floorHeight + 88.5f, 3.0f); - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); this->unk_2B0--; if (this->unk_2B0 <= 0) { if (this->actor.colChkInfo.health == 0) { @@ -930,7 +930,7 @@ void EnPeehat_Draw(Actor* thisx, PlayState* play) { SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, EnPeehat_OverrideLimbDraw, (this->actor.params == 0) ? EnPeehat_PostLimbDraw : NULL, &this->actor); - if ((this->actor.speedXZ != 0.0f) || (this->actor.velocity.y != 0.0f)) { + if ((this->actor.speed != 0.0f) || (this->actor.velocity.y != 0.0f)) { Matrix_MultVecZ(4500.0f, &sp40); Matrix_MultVecZ(-4500.0f, &sp4C); Matrix_MultVecX(4500.0f, &sp58); 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 f612a7927a..f1f34b6bea 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c @@ -1023,14 +1023,14 @@ s32 func_80AF87C4(EnPm* this, PlayState* play) { func_80AF7E98(this, 0); this->unk_258 = 255; this->unk_380 = true; - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; this->actor.gravity = -1.0f; } ret = true; } else if (this->unk_380) { this->unk_258 = 0; this->unk_380 = false; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } return ret; } 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 365930cd5d..14c5c62078 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 @@ -309,7 +309,7 @@ void EnPoSisters_CheckZTarget(EnPoSisters* this, PlayState* play) { void EnPoSisters_SetupObserverIdle(EnPoSisters* this) { Animation_MorphToLoop(&this->skelAnime, &gPoeSistersSwayAnim, -3.0f); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->laughTimer = Rand_S16Offset(100, 50); this->actionFunc = EnPoSisters_ObserverIdle; } @@ -330,7 +330,7 @@ void EnPoSisters_ObserverIdle(EnPoSisters* this, PlayState* play) { void EnPoSisters_SetupAimlessIdleFlying2(EnPoSisters* this) { Animation_MorphToLoop(&this->skelAnime, &gPoeSistersSwayAnim, -3.0f); this->idleFlyingAnimationCounter = Rand_S16Offset(2, 3); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = EnPoSisters_AimlessIdleFlying2; } @@ -360,14 +360,14 @@ void EnPoSisters_SetupAimlessIdleFlying(EnPoSisters* this) { void EnPoSisters_AimlessIdleFlying(EnPoSisters* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - Math_StepToF(&this->actor.speedXZ, 1.0f, 0.2f); + Math_StepToF(&this->actor.speed, 1.0f, 0.2f); if (Animation_OnFrame(&this->skelAnime, 0.0f)) { DECR(this->idleFlyingAnimationCounter); } if ((this->actor.xzDistToPlayer < 600.0f) && (fabsf(this->actor.playerHeightRel + 5.0f) < 30.0f)) { EnPoSisters_SetupInvestigating(this); - } else if ((this->idleFlyingAnimationCounter == 0) && Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f)) { + } else if ((this->idleFlyingAnimationCounter == 0) && Math_StepToF(&this->actor.speed, 0.0f, 0.2f)) { // ! @bug: this is never reached because speedXZ is reduced // at the same rate it is increased at the top of this function EnPoSisters_SetupAimlessIdleFlying2(this); @@ -395,7 +395,7 @@ void EnPoSisters_Investigating(EnPoSisters* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); yawDiff = this->actor.yawTowardsPlayer - player->actor.shape.rot.y; - Math_StepToF(&this->actor.speedXZ, 2.0f, 0.2f); + Math_StepToF(&this->actor.speed, 2.0f, 0.2f); if (yawDiff > 0x3000) { Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x3000, 0x71C); @@ -422,7 +422,7 @@ void EnPoSisters_SetupSpinUp(EnPoSisters* this) { } Animation_MorphToLoop(&this->skelAnime, &gPoeSistersAttackAnim, -5.0f); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->spinupTimer = Animation_GetLastFrame(&gPoeSistersAttackAnim.common) * 3 + 3; this->poSisterFlags &= ~POE_SISTERS_FLAG_UPDATE_SHAPE_ROT; this->actionFunc = EnPoSisters_SpinUp; @@ -440,7 +440,7 @@ void EnPoSisters_SpinUp(EnPoSisters* this, PlayState* play) { } void EnPoSisters_SetupSpinAttack(EnPoSisters* this) { - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; if (this->type == POE_SISTERS_TYPE_MEG) { this->collider.base.colType = COLTYPE_METAL; this->collider.base.acFlags |= AC_HARD; @@ -497,9 +497,9 @@ void EnPoSisters_SetupAttackConnect(EnPoSisters* this) { void EnPoSisters_AttackConnectDrift(EnPoSisters* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - this->actor.shape.rot.y -= (s16)(this->actor.speedXZ * 10.0f * 128.0f); + this->actor.shape.rot.y -= (s16)(this->actor.speed * 10.0f * 128.0f); - if (Math_StepToF(&this->actor.speedXZ, 0.0f, 0.1f)) { // wait to stop moving + if (Math_StepToF(&this->actor.speed, 0.0f, 0.1f)) { // wait to stop moving this->actor.world.rot.y = this->actor.shape.rot.y; if (this->type != POE_SISTERS_TYPE_MEG) { EnPoSisters_SetupAimlessIdleFlying(this); @@ -517,7 +517,7 @@ void EnPoSisters_SetupDamageFlinch(EnPoSisters* this) { } if (this->type != POE_SISTERS_TYPE_MEG) { - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; } this->poSisterFlags &= @@ -552,7 +552,7 @@ void EnPoSisters_DamageFlinch(EnPoSisters* this, PlayState* play) { EnPoSisters_MatchPlayerXZ(this, play); } else if (this->type != POE_SISTERS_TYPE_MEG) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); } } @@ -562,7 +562,7 @@ void EnPoSisters_SetupFlee(EnPoSisters* this) { this->fleeTimer = 5; this->poSisterFlags |= (POE_SISTERS_FLAG_MATCH_PLAYER_HEIGHT | POE_SISTERS_FLAG_UPDATE_SHAPE_ROT | POE_SISTERS_FLAG_CHECK_AC); - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; this->actionFunc = EnPoSisters_Flee; } @@ -587,7 +587,7 @@ void EnPoSisters_SetupSpinToInvis(EnPoSisters* this) { Animation_Change(&this->skelAnime, &gPoeSistersAppearDisappearAnim, 1.5f, 0.0f, Animation_GetLastFrame(&gPoeSistersAppearDisappearAnim.common), ANIMMODE_ONCE, -3.0f); this->invisibleTimer = 100; // 5 seconds - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->poSisterFlags &= ~(POE_SISTERS_FLAG_CHECK_Z_TARGET | POE_SISTERS_FLAG_CHECK_AC); Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DISAPPEAR); @@ -620,7 +620,7 @@ void EnPoSisters_SetupSpinBackToVisible(EnPoSisters* this, PlayState* play) { } this->spinInvisibleTimer = 15; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_APPEAR); this->poSisterFlags &= ~POE_SISTERS_FLAG_CHECK_AC; this->actionFunc = EnPoSisters_SpinBackToVisible; @@ -654,7 +654,7 @@ void EnPoSisters_SpinBackToVisible(EnPoSisters* this, PlayState* play) { void EnPoSisters_SetupDeathStage1(EnPoSisters* this) { this->deathTimer = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.pos.y += 42.0f; this->actor.shape.yOffset = -6000.0f; this->actor.flags &= ~ACTOR_FLAG_1; 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 21cd9d8c44..aeb741bbc9 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -216,7 +216,7 @@ void func_80B2CA4C(EnPoh* this) { Animation_PlayLoop(&this->skelAnime, &object_po_Anim_0015B0); this->unk_18E = Rand_S16Offset(2, 3); this->actionFunc = func_80B2CAA4; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void func_80B2CAA4(EnPoh* this, PlayState* play) { @@ -247,7 +247,7 @@ void func_80B2CB60(EnPoh* this) { void func_80B2CBBC(EnPoh* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - Math_StepToF(&this->actor.speedXZ, 1.0f, 0.2f); + Math_StepToF(&this->actor.speed, 1.0f, 0.2f); if (Animation_OnFrame(&this->skelAnime, 0.0f) && (this->unk_18E != 0)) { this->unk_18E--; } @@ -277,7 +277,7 @@ void func_80B2CD14(EnPoh* this) { Animation_PlayLoop(&this->skelAnime, &object_po_Anim_000A60); this->actionFunc = func_80B2CD64; this->unk_18E = 0; - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; } void func_80B2CD64(EnPoh* this, PlayState* play) { @@ -315,7 +315,7 @@ void func_80B2CD64(EnPoh* this, PlayState* play) { void func_80B2CEC8(EnPoh* this) { Animation_MorphToLoop(&this->skelAnime, &object_po_Anim_0001A8, -6.0f); this->unk_18E = 12; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH); this->actionFunc = func_80B2CF28; } @@ -333,7 +333,7 @@ void func_80B2CF28(EnPoh* this, PlayState* play) { if (this->unk_18E >= 10) { Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0xAAA); } else if (this->unk_18E == 9) { - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; this->skelAnime.playSpeed = 2.0f; } else if (this->unk_18E == 0) { func_80B2CB60(this); @@ -345,13 +345,13 @@ void func_80B2CFF8(EnPoh* this) { Animation_MorphToPlayOnce(&this->skelAnime, &object_po_Anim_0004EC, -6.0f); func_800BE504(&this->actor, &this->colliderCylinder); this->colliderCylinder.base.acFlags &= ~AC_ON; - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 16); this->actionFunc = func_80B2D07C; } void func_80B2D07C(EnPoh* this, PlayState* play) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); if (SkelAnime_Update(&this->skelAnime)) { if (this->actor.colChkInfo.health != 0) { func_80B2DAD0(this); @@ -385,7 +385,7 @@ void func_80B2D140(EnPoh* this, PlayState* play) { } void func_80B2D2C0(EnPoh* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_18E = 0; this->actor.hintId = TATL_HINT_ID_NONE; @@ -445,7 +445,7 @@ void func_80B2D300(EnPoh* this, PlayState* play) { void func_80B2D5DC(EnPoh* this) { Animation_PlayOnce(&this->skelAnime, &object_po_Anim_000A60); this->actionFunc = func_80B2D628; - this->actor.speedXZ = -5.0f; + this->actor.speed = -5.0f; } void func_80B2D628(EnPoh* this, PlayState* play) { @@ -454,7 +454,7 @@ void func_80B2D628(EnPoh* this, PlayState* play) { func_80B2CB60(this); this->unk_18E = 23; } else { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); this->actor.shape.rot.y += 0x1000; } } @@ -463,7 +463,7 @@ void func_80B2D694(EnPoh* this) { Animation_PlayLoop(&this->skelAnime, &object_po_Anim_0015B0); this->unk_192 = BINANG_ROT180(this->actor.world.rot.y); this->actionFunc = func_80B2D6EC; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void func_80B2D6EC(EnPoh* this, PlayState* play) { @@ -482,7 +482,7 @@ void func_80B2D6EC(EnPoh* this, PlayState* play) { void func_80B2D76C(EnPoh* this) { this->unk_18C = 32; this->unk_192 = 0x2000; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; Actor_PlaySfx(&this->actor, NA_SE_EN_PO_DISAPPEAR); Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH); @@ -513,7 +513,7 @@ void func_80B2D7D4(EnPoh* this, PlayState* play) { void func_80B2D924(EnPoh* this) { this->unk_18C = 0; this->unk_192 = 0x2000; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_APPEAR); Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH); this->colliderCylinder.base.acFlags &= ~AC_ON; @@ -539,7 +539,7 @@ void func_80B2D980(EnPoh* this, PlayState* play) { void func_80B2DAD0(EnPoh* this) { Animation_MorphToLoop(&this->skelAnime, &object_po_Anim_0006E0, -5.0f); - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; this->actor.world.rot.y = BINANG_ROT180(this->actor.shape.rot.y); this->colliderCylinder.base.acFlags |= AC_ON; this->unk_18E = 200; 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 be4f1e3c30..bf9f242b44 100644 --- a/src/overlays/actors/ovl_En_Pp/z_en_pp.c +++ b/src/overlays/actors/ovl_En_Pp/z_en_pp.c @@ -537,7 +537,7 @@ void EnPp_Idle(EnPp* this, PlayState* play) { posToLookAt.x += randPlusMinusPoint5Scaled(50.0f); posToLookAt.z += randPlusMinusPoint5Scaled(50.0f); this->targetRotY = Math_Vec3f_Yaw(&this->actor.world.pos, &posToLookAt); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->animIndex != EN_PP_ANIM_IDLE) { EnPp_ChangeAnim(this, EN_PP_ANIM_IDLE); } @@ -561,7 +561,7 @@ void EnPp_Idle(EnPp* this, PlayState* play) { if ((this->maskBounceRotationalVelocity < 0x64) && (fabsf(this->actor.world.rot.y - this->targetRotY) < 100.0f)) { - Math_ApproachF(&this->actor.speedXZ, 1.0f, 0.3f, 1.0f); + Math_ApproachF(&this->actor.speed, 1.0f, 0.3f, 1.0f); } Math_SmoothStepToS(&this->actor.world.rot.y, this->targetRotY, 1, @@ -611,7 +611,7 @@ void EnPp_Charge(EnPp* this, PlayState* play) { Math_SmoothStepToS(&this->maskBounceRotationalVelocity, 0, 1, 0x1F4, 0); if (!this->actionVar.isCharging) { - Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 1.0f); + Math_ApproachZeroF(&this->actor.speed, 0.5f, 1.0f); if (fabsf(this->actor.world.rot.y - this->targetRotY) < 100.0f) { if (this->chargesInStraightLines) { this->actor.world.rot.y = this->targetRotY; @@ -629,13 +629,13 @@ void EnPp_Charge(EnPp* this, PlayState* play) { } } else if (this->animIndex == EN_PP_ANIM_CHARGE) { if (EnPp_CheckCollision(this, play) != EN_PP_COLLISION_RESULT_OK) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; EnPp_SetupRoar(this); return; } if (!this->chargesInStraightLines) { - Math_ApproachF(&this->actor.speedXZ, 10.0f, 0.3f, 1.0f); + Math_ApproachF(&this->actor.speed, 10.0f, 0.3f, 1.0f); } else { Math_ApproachF(&this->actor.world.pos.x, this->targetPos.x, 0.5f, fabsf(Math_SinS(this->targetRotY) * this->chargeAndBounceSpeed)); @@ -661,9 +661,9 @@ void EnPp_Charge(EnPp* this, PlayState* play) { return; } else { if (EN_PP_GET_TYPE(&this->actor) != EN_PP_TYPE_MASKED) { - this->actor.speedXZ *= -1.0f; + this->actor.speed *= -1.0f; } else { - this->actor.speedXZ *= -0.5f; + this->actor.speed *= -0.5f; } EnPp_SetupRoar(this); @@ -682,7 +682,7 @@ void EnPp_SetupAttack(EnPp* this) { EnPp_ChangeAnim(this, EN_PP_ANIM_ATTACK); this->hornColliderOn = true; this->action = EN_PP_ACTION_ATTACK; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = EnPp_Attack; } @@ -711,7 +711,7 @@ void EnPp_SetupBounced(EnPp* this) { this->targetPos.x += distanceFromWorldPos.x; this->targetPos.z += distanceFromWorldPos.z; EnPp_ChangeAnim(this, EN_PP_ANIM_DAMAGE); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->action = EN_PP_ACTION_BOUNCED; this->chargeAndBounceSpeed = 14.0f; this->actionFunc = EnPp_Bounced; @@ -751,7 +751,7 @@ void EnPp_Roar(EnPp* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (EnPp_CheckCollision(this, play) == EN_PP_COLLISION_RESULT_ABOUT_TO_RUN_OFF_LEDGE) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->chargeAndBounceSpeed = 0.0f; } @@ -771,8 +771,8 @@ void EnPp_Roar(EnPp* this, PlayState* play) { } } - Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 1.0f); - if ((this->actor.speedXZ > 0.3f) && (this->secondaryTimer == 0)) { + Math_ApproachZeroF(&this->actor.speed, 0.5f, 1.0f); + if ((this->actor.speed > 0.3f) && (this->secondaryTimer == 0)) { EnPp_SpawnDust(this, play); this->secondaryTimer = 3; } @@ -793,7 +793,7 @@ void EnPp_SetupJump(EnPp* this) { this->secondaryTimer = 0; this->actionVar.hasLandedFromJump = false; this->timer = this->secondaryTimer; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 20.0f; this->actor.gravity = -3.0f; EnPp_ChangeAnim(this, EN_PP_ANIM_JUMP); @@ -853,7 +853,7 @@ void EnPp_SetupStunnedOrFrozen(EnPp* this) { this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE; } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->action = EN_PP_ACTION_STUNNED_OR_FROZEN; this->actionFunc = EnPp_StunnedOrFrozen; } @@ -922,7 +922,7 @@ void EnPp_SetupDamaged(EnPp* this, PlayState* play) { if (EnPp_CheckCollision(this, play) == EN_PP_COLLISION_RESULT_ABOUT_TO_RUN_OFF_LEDGE) { this->damagedVelocity.z = 0.0f; this->damagedVelocity.x = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } Actor_PlaySfx(&this->actor, NA_SE_EN_HIPLOOP_DAMAGE); @@ -957,7 +957,7 @@ void EnPp_Damaged(EnPp* this, PlayState* play) { if (EnPp_CheckCollision(this, play) == EN_PP_COLLISION_RESULT_ABOUT_TO_RUN_OFF_LEDGE) { this->damagedVelocity.z = 0.0f; this->damagedVelocity.x = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if ((fabsf(this->actor.home.pos.y - this->actor.world.pos.y) > 100.0f) && @@ -1172,7 +1172,7 @@ void EnPp_BodyPart_SetupMove(EnPp* this) { this->deadBodyPartRotationalVelocity.x = (this->deadBodyPartIndex * 0x2E) + 0xFF00; this->deadBodyPartRotationalVelocity.z = (this->deadBodyPartIndex * 0x2E) + 0xFF00; if (EN_PP_GET_TYPE(&this->actor) != EN_PP_TYPE_BODY_PART_BODY) { - this->actor.speedXZ = Rand_ZeroFloat(4.0f) + 4.0f; + this->actor.speed = Rand_ZeroFloat(4.0f) + 4.0f; this->actor.world.rot.y = ((s32)randPlusMinusPoint5Scaled(223.0f) + 0x1999) * this->deadBodyPartIndex; } @@ -1295,7 +1295,7 @@ void EnPp_UpdateDamage(EnPp* this, PlayState* play) { (this->actor.colChkInfo.damageEffect != EN_PP_DMGEFF_JUMP)) { attackDealsDamage = true; this->hasBeenDamaged = true; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.colChkInfo.damageEffect == EN_PP_DMGEFF_FIRE) { this->drawDmgEffTimer = 40; this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE; @@ -1350,7 +1350,7 @@ void EnPp_UpdateDamage(EnPp* this, PlayState* play) { this->secondaryTimer = 0; this->timer = 10; this->maskBounceRotationalVelocity = 0x20D0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->action == EN_PP_ACTION_CHARGE) { this->actionVar.isCharging = false; EnPp_ChangeAnim(this, EN_PP_ANIM_TURN_TO_FACE_PLAYER); 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 703d7a90b6..ffcace89b0 100644 --- a/src/overlays/actors/ovl_En_Pr/z_en_pr.c +++ b/src/overlays/actors/ovl_En_Pr/z_en_pr.c @@ -241,7 +241,7 @@ void func_80A326F0(EnPr* this) { func_80A3242C(this, 0); } this->unk_206 = 0; - this->actor.speedXZ = 1.0f; + this->actor.speed = 1.0f; this->actionFunc = func_80A32740; } @@ -343,19 +343,19 @@ void func_80A32AF8(EnPr* this) { void func_80A32B20(EnPr* this, PlayState* play) { Player* player = GET_PLAYER(play); - this->actor.speedXZ = BREG(57) + 3.0f; + this->actor.speed = BREG(57) + 3.0f; Math_SmoothStepToS(&this->unk_22C, this->actor.yawTowardsPlayer, BREG(49) + 1, BREG(50) + 1000, BREG(51)); this->unk_2B8 = D_80A338C0[GET_PLAYER_FORM] + player->actor.world.pos.y; func_80A324E0(this, play); if (!(player->stateFlags1 & PLAYER_STATE1_8000000)) { this->skelAnime.playSpeed = 1.0f; - this->actor.speedXZ = 1.0f; + this->actor.speed = 1.0f; func_80A32854(this); } else if (this->unk_2C8 < sqrtf(SQ(player->actor.world.pos.x - this->actor.home.pos.x) + SQ(player->actor.world.pos.z - this->actor.home.pos.z))) { this->skelAnime.playSpeed = 1.0f; - this->actor.speedXZ = 1.0f; + this->actor.speed = 1.0f; func_80A32854(this); } else if (!func_80A325E4(this) && (this->actor.xzDistToPlayer < 200.0f) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 80.0f)) { @@ -377,7 +377,7 @@ void func_80A32D28(EnPr* this, PlayState* play) { if (!(player->stateFlags1 & PLAYER_STATE1_8000000)) { this->skelAnime.playSpeed = 1.0f; - this->actor.speedXZ = 1.0f; + this->actor.speed = 1.0f; func_80A32854(this); } else { Math_SmoothStepToS(&this->unk_22C, this->actor.yawTowardsPlayer, BREG(49) + 1, BREG(50) + 1000, BREG(51)); @@ -387,7 +387,7 @@ void func_80A32D28(EnPr* this, PlayState* play) { if (this->unk_2C8 < sqrtf(SQ(player->actor.world.pos.x - this->actor.home.pos.x) + SQ(player->actor.world.pos.z - this->actor.home.pos.z))) { this->skelAnime.playSpeed = 1.0f; - this->actor.speedXZ = 1.0f; + this->actor.speed = 1.0f; func_80A32854(this); } } @@ -396,7 +396,7 @@ void func_80A32D28(EnPr* this, PlayState* play) { void func_80A32E60(EnPr* this) { func_80A3242C(this, 4); this->unk_206 = 6; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80A32EA4; } 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 3f0b3ee86d..ab4aa43150 100644 --- a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c +++ b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c @@ -271,9 +271,9 @@ void func_80A745FC(EnPr2* this, PlayState* play) { Math_ApproachF(&this->unk_204, 0.02f, 0.1f, 0.005f); if (this->path->unk2 < this->unk_1D0) { - Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.3f, 1.0f); + Math_ApproachF(&this->actor.speed, 5.0f, 0.3f, 1.0f); } else { - Math_ApproachF(&this->actor.speedXZ, 10.0f, 0.3f, 1.0f); + Math_ApproachF(&this->actor.speed, 10.0f, 0.3f, 1.0f); } if ((this->path != NULL) && !SubS_CopyPointFromPath(this->path, this->unk_1D0, &this->unk_21C)) { @@ -334,7 +334,7 @@ void func_80A748E8(EnPr2* this, PlayState* play) { } if (this->unk_1F4 != 255) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Math_SmoothStepToS(&this->unk_1F4, 0, 1, 30, 100); if (this->unk_1F4 < 2) { Actor_Kill(&this->actor); @@ -370,7 +370,7 @@ void func_80A748E8(EnPr2* this, PlayState* play) { sp4C = true; this->unk_1DC = 0; Math_Vec3f_Copy(&this->unk_21C, &this->unk_228); - Math_ApproachF(&this->actor.speedXZ, 3.0f, 0.3f, 0.2f); + Math_ApproachF(&this->actor.speed, 3.0f, 0.3f, 0.2f); } } break; @@ -383,7 +383,7 @@ void func_80A748E8(EnPr2* this, PlayState* play) { this->unk_1D6 = true; } - Math_ApproachZeroF(&this->actor.speedXZ, 0.1f, 0.2f); + Math_ApproachZeroF(&this->actor.speed, 0.1f, 0.2f); if (this->unk_1DA == 1) { this->unk_1D8 = Rand_S16Offset(100, 100); @@ -393,7 +393,7 @@ void func_80A748E8(EnPr2* this, PlayState* play) { Math_Vec3f_Copy(&this->unk_21C, &sp3C); } } else { - Math_ApproachF(&this->actor.speedXZ, 2.0f, 0.3f, 0.2f); + Math_ApproachF(&this->actor.speed, 2.0f, 0.3f, 0.2f); Math_Vec3f_Copy(&sp3C, &this->actor.world.pos); sp3C.x += Math_SinS(this->actor.world.rot.y) * 20.0f; sp3C.z += Math_CosS(this->actor.world.rot.y) * 20.0f; @@ -452,7 +452,7 @@ void func_80A74E90(EnPr2* this, PlayState* play) { } if (this->unk_1F4 != 255) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Math_SmoothStepToS(&this->unk_1F4, 0, 1, 30, 100); if (this->unk_1F4 < 2) { Actor_Kill(&this->actor); @@ -470,7 +470,7 @@ void func_80A74E90(EnPr2* this, PlayState* play) { } this->unk_21C.y = player->actor.world.pos.y + 30.0f + this->unk_20C; - Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.3f, 1.0f); + Math_ApproachF(&this->actor.speed, 5.0f, 0.3f, 1.0f); this->unk_1F0 = 0; if (this->unk_1E0 == 2) { @@ -532,7 +532,7 @@ void func_80A751B4(EnPr2* this) { this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.z = this->actor.world.rot.z; this->unk_1D8 = 30; - this->actor.speedXZ = Rand_ZeroFloat(0.5f); + this->actor.speed = Rand_ZeroFloat(0.5f); this->actor.world.rot.y = randPlusMinusPoint5Scaled(0x8000); } Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 10); @@ -614,7 +614,7 @@ void func_80A755D8(EnPr2* this, PlayState* play) { Actor_ApplyDamage(&this->actor); if ((this->actor.colChkInfo.health <= 0) && (this->unk_1D4 != 3)) { Enemy_StartFinishingBlow(play, &this->actor); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_PIRANHA_DEAD); if (this->unk_218 >= 0) { @@ -627,7 +627,7 @@ void func_80A755D8(EnPr2* this, PlayState* play) { } if (this->collider.base.atFlags & AT_BOUNCED) { - this->actor.speedXZ = -10.0f; + this->actor.speed = -10.0f; } } 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 d0e40b1a55..9ec37bb001 100644 --- a/src/overlays/actors/ovl_En_Prz/z_en_prz.c +++ b/src/overlays/actors/ovl_En_Prz/z_en_prz.c @@ -218,7 +218,7 @@ s32 func_80A762C0(EnPrz* this, PlayState* play) { } void func_80A76388(EnPrz* this) { - this->actor.speedXZ = randPlusMinusPoint5Scaled(1.0f) + 4.0f; + this->actor.speed = randPlusMinusPoint5Scaled(1.0f) + 4.0f; func_80A75F18(this, 0); this->unk_1EA = 1; this->actionFunc = func_80A763E8; @@ -302,7 +302,7 @@ void func_80A76634(EnPrz* this, PlayState* play) { } void func_80A76748(EnPrz* this) { - this->actor.speedXZ = randPlusMinusPoint5Scaled(1.0f) + 3.0f; + this->actor.speed = randPlusMinusPoint5Scaled(1.0f) + 3.0f; this->unk_1EE = 0; this->unk_1EA = 3; this->skelAnime.playSpeed = 2.0f; @@ -317,7 +317,7 @@ void func_80A767A8(EnPrz* this, PlayState* play) { if (func_80A762C0(this, play)) { func_80A75F18(this, 0); - this->actor.speedXZ = randPlusMinusPoint5Scaled(1.0f) + 4.0f; + this->actor.speed = randPlusMinusPoint5Scaled(1.0f) + 4.0f; func_80A76604(this, play); return; } @@ -373,7 +373,7 @@ void func_80A76A1C(EnPrz* this) { } this->unk_1FE = this->actor.world.rot.y; - this->actor.speedXZ = Rand_ZeroFloat(0.5f); + this->actor.speed = Rand_ZeroFloat(0.5f); this->actor.world.rot.y = randPlusMinusPoint5Scaled(0x8000); Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 30); 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 c6e33345d5..c235c61a0d 100644 --- a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c +++ b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c @@ -515,16 +515,16 @@ void EnRacedog_UpdateSpeed(EnRacedog* this) { this->actor.shape.rot.y = this->actor.world.rot.y; } - Math_ApproachF(&this->actor.speedXZ, this->targetSpeed, 0.5f, 3.0f); + Math_ApproachF(&this->actor.speed, this->targetSpeed, 0.5f, 3.0f); // The dog that the player has selected has a slightly higher max speed than the other dogs. if (this->index == this->selectedDogIndex) { - if (this->actor.speedXZ > 7.5f) { - this->actor.speedXZ = 7.5f; + if (this->actor.speed > 7.5f) { + this->actor.speed = 7.5f; } } else { - if (this->actor.speedXZ > 7.0f) { - this->actor.speedXZ = 7.0f; + if (this->actor.speed > 7.0f) { + this->actor.speed = 7.0f; } } } @@ -602,7 +602,7 @@ void EnRacedog_CheckForFinish(EnRacedog* this) { * to normal speed otherwise. */ void EnRacedog_UpdateRunAnimationPlaySpeed(EnRacedog* this) { - if (this->actor.speedXZ < 3.0f) { + if (this->actor.speed < 3.0f) { sAnimationInfo[RACEDOG_ANIM_RUN].playSpeed = 0.9f; } else { sAnimationInfo[RACEDOG_ANIM_RUN].playSpeed = 1.0f; @@ -660,7 +660,7 @@ s32 EnRacedog_IsOverFinishLine(EnRacedog* this, Vec2f* finishLineCoordinates) { void EnRacedog_SpawnFloorDustRing(EnRacedog* this, PlayState* play) { s16 curFrame = this->skelAnime.curFrame; - s16 mod = (this->actor.speedXZ > 6.0f) ? 2 : 3; + s16 mod = (this->actor.speed > 6.0f) ? 2 : 3; Vec3f pos; if (((this->index + curFrame) % mod) == 0) { 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 6b114dff5f..12af47c7e4 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 @@ -281,7 +281,7 @@ void EnRailSkb_Init(Actor* thisx, PlayState* play) { } Actor_ProcessInitChain(&this->actor, sInitChain); - this->actor.speedXZ = 1.6f; + this->actor.speed = 1.6f; this->actor.hintId = TATL_HINT_ID_STALCHILD; this->unk_3F2 = 0; this->unk_2E4 = -1; 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 c5a13412d5..0690278f2b 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c @@ -286,7 +286,7 @@ void EnRailgibud_Destroy(Actor* thisx, PlayState* play) { } void EnRailgibud_SetupWalkInCircles(EnRailgibud* this) { - this->actor.speedXZ = 0.6f; + this->actor.speed = 0.6f; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_WALK); this->actionFunc = EnRailgibud_WalkInCircles; } @@ -359,7 +359,7 @@ void EnRailgibud_AttemptPlayerFreeze(EnRailgibud* this, PlayState* play) { void EnRailgibud_SetupWalkToPlayer(EnRailgibud* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_WALK); - this->actor.speedXZ = 0.4f; + this->actor.speed = 0.4f; if (this->actionFunc == EnRailgibud_AttemptPlayerFreeze) { this->playerStunWaitTimer = 80; @@ -491,13 +491,13 @@ void EnRailgibud_Grab(EnRailgibud* this, PlayState* play) { void EnRailgibud_SetupGrabFail(EnRailgibud* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_DAMAGE); Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_DAMAGE); - this->actor.speedXZ = -2.0f; + this->actor.speed = -2.0f; this->actionFunc = EnRailgibud_GrabFail; } void EnRailgibud_GrabFail(EnRailgibud* this, PlayState* play) { - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ += 0.15f; + if (this->actor.speed < 0.0f) { + this->actor.speed += 0.15f; } this->actor.world.rot.y = this->actor.yawTowardsPlayer; @@ -530,7 +530,7 @@ void EnRailgibud_TurnAwayAndShakeHead(EnRailgibud* this, PlayState* play) { void EnRailgibud_SetupWalkToHome(EnRailgibud* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_WALK); - this->actor.speedXZ = 0.4f; + this->actor.speed = 0.4f; this->actionFunc = EnRailgibud_WalkToHome; } @@ -538,10 +538,10 @@ void EnRailgibud_WalkToHome(EnRailgibud* this, PlayState* play) { Math_SmoothStepToS(&this->headRotation.y, 0, 1, 100, 0); Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 100, 0); if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 5.0f) { - if (this->actor.speedXZ > 0.2f) { - this->actor.speedXZ -= 0.2f; + if (this->actor.speed > 0.2f) { + this->actor.speed -= 0.2f; } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 200, 10); @@ -568,13 +568,13 @@ void EnRailgibud_SetupDamage(EnRailgibud* this) { this->stunTimer = 0; this->grabWaitTimer = 0; this->actor.world.rot.y = this->actor.yawTowardsPlayer; - this->actor.speedXZ = -2.0f; + this->actor.speed = -2.0f; this->actionFunc = EnRailgibud_Damage; } void EnRailgibud_Damage(EnRailgibud* this, PlayState* play) { - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ += 0.15f; + if (this->actor.speed < 0.0f) { + this->actor.speed += 0.15f; } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { @@ -964,7 +964,7 @@ void EnRailgibud_CheckIfTalkingToPlayer(EnRailgibud* this, PlayState* play) { Message_StartTextbox(play, 0x13B2, &this->actor); this->textId = 0x13B2; Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_AIM); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else if (CHECK_FLAG_ALL(this->actor.flags, (ACTOR_FLAG_1 | ACTOR_FLAG_8)) && !(this->collider.base.acFlags & AC_HIT)) { func_800B8614(&this->actor, play, 100.0f); @@ -982,7 +982,7 @@ void EnRailgibud_CheckIfTalkingToPlayer(EnRailgibud* this, PlayState* play) { if (Message_ShouldAdvance(play)) { this->textId = 0; this->isInvincible = false; - this->actor.speedXZ = 0.6f; + this->actor.speed = 0.6f; } break; 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 353f221fad..6d54407895 100644 --- a/src/overlays/actors/ovl_En_Rat/z_en_rat.c +++ b/src/overlays/actors/ovl_En_Rat/z_en_rat.c @@ -386,7 +386,7 @@ s32 EnRat_IsTouchingSurface(EnRat* this, PlayState* play) { bgIdUpDown = bgIdSide = BGCHECK_SCENE; - lineLength = 2.0f * this->actor.speedXZ; + lineLength = 2.0f * this->actor.speed; posA.x = this->actor.world.pos.x + (this->axisUp.x * 5.0f); posA.y = this->actor.world.pos.y + (this->axisUp.y * 5.0f); @@ -409,7 +409,7 @@ s32 EnRat_IsTouchingSurface(EnRat* this, PlayState* play) { this->shouldRotateOntoSurfaces |= EnRat_UpdateFloorPoly(this, polySide, play); Math_Vec3f_Copy(&this->actor.world.pos, &posSide); this->actor.floorBgId = bgIdSide; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { if (polyUpDown != this->actor.floorPoly) { this->shouldRotateOntoSurfaces |= EnRat_UpdateFloorPoly(this, polyUpDown, play); @@ -419,7 +419,7 @@ s32 EnRat_IsTouchingSurface(EnRat* this, PlayState* play) { this->actor.floorBgId = bgIdUpDown; } } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; lineLength *= 3.0f; Math_Vec3f_Copy(&posA, &posB); @@ -535,7 +535,7 @@ void EnRat_SetupRevive(EnRat* this) { EnRat_InitializeAxes(this); EnRat_UpdateRotation(this); this->actor.flags &= ~ACTOR_FLAG_1; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Animation_PlayLoopSetSpeed(&this->skelAnime, &gRealBombchuSpotAnim, 0.0f); this->revivePosY = 2666.6667f; this->actor.draw = NULL; @@ -573,7 +573,7 @@ void EnRat_Revive(EnRat* this, PlayState* play) { void EnRat_SetupIdle(EnRat* this) { Animation_PlayLoop(&this->skelAnime, &gRealBombchuRunAnim); this->animLoopCounter = 5; - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; this->actionFunc = EnRat_Idle; } @@ -583,7 +583,7 @@ void EnRat_SetupIdle(EnRat* this) { void EnRat_Idle(EnRat* this, PlayState* play) { Player* player = GET_PLAYER(play); - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; if (Animation_OnFrame(&this->skelAnime, 0.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EN_BOMCHU_WALK); if (this->animLoopCounter != 0) { @@ -606,7 +606,7 @@ void EnRat_SetupSpottedPlayer(EnRat* this) { this->actor.flags |= ACTOR_FLAG_10; Animation_MorphToLoop(&this->skelAnime, &gRealBombchuSpotAnim, -5.0f); this->animLoopCounter = 3; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = EnRat_SpottedPlayer; } @@ -640,7 +640,7 @@ void EnRat_UpdateSparkOffsets(EnRat* this) { void EnRat_SetupChasePlayer(EnRat* this) { Animation_MorphToLoop(&this->skelAnime, &gRealBombchuRunAnim, -5.0f); - this->actor.speedXZ = 6.1f; + this->actor.speed = 6.1f; EnRat_UpdateSparkOffsets(this); this->actionFunc = EnRat_ChasePlayer; } @@ -659,7 +659,7 @@ void EnRat_ChasePlayer(EnRat* this, PlayState* play) { Vec3f blureP1; Vec3f blureP2; - this->actor.speedXZ = 6.1f; + this->actor.speed = 6.1f; if (this->hasLostTrackOfPlayer) { if (!(player->stateFlags3 & PLAYER_STATE3_100) && (Player_GetMask(play) != PLAYER_MASK_STONE) && Actor_IsFacingPlayer(&this->actor, 0x3000)) { @@ -713,7 +713,7 @@ void EnRat_ChasePlayer(EnRat* this, PlayState* play) { } void EnRat_SetupBounced(EnRat* this) { - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; this->actor.velocity.y = 8.0f; this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000; this->actor.gravity = -1.0f; @@ -750,7 +750,7 @@ void EnRat_Explode(EnRat* this, PlayState* play) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x100); } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = EnRat_PostDetonation; } @@ -793,7 +793,7 @@ void EnRat_Update(Actor* thisx, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); Actor_SetColorFilter(&this->actor, 0, 120, 0, 40); if (this->actionFunc == EnRat_Bounced) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.velocity.y > 0.0f) { this->actor.velocity.y = 0.0f; } diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 8d73d5de1e..83cdde9a30 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -356,7 +356,7 @@ void EnRd_SetupIdle(EnRd* this) { this->action = EN_RD_ACTION_IDLE; this->animationJudderTimer = (Rand_ZeroOne() * 10.0f) + 5.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnRd_Idle; } @@ -419,7 +419,7 @@ void EnRd_SetupSquattingDance(EnRd* this) { this->action = EN_RD_ACTION_SQUATTING_DANCE; this->animationJudderTimer = (Rand_ZeroOne() * 10.0f) + 5.0f; this->danceEndTimer = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnRd_SquattingDance; } @@ -463,7 +463,7 @@ void EnRd_SetupClappingDance(EnRd* this) { this->action = EN_RD_ACTION_CLAPPING_DANCE; this->animationJudderTimer = (Rand_ZeroOne() * 10.0f) + 5.0f; this->danceEndTimer = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnRd_ClappingDance; } @@ -524,7 +524,7 @@ void EnRd_SetupPirouette(EnRd* this) { this->action = EN_RD_ACTION_PIROUETTE; this->animationJudderTimer = (Rand_ZeroOne() * 10.0f) + 5.0f; this->pirouetteRotationalVelocity = 0x1112; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnRd_Pirouette; } @@ -600,7 +600,7 @@ void EnRd_SetupRiseFromCoffin(EnRd* this) { this->actor.shape.rot.x = -0x4000; this->actor.gravity = 0.0f; this->actor.shape.yOffset = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = EnRd_RiseFromCoffin; } @@ -619,8 +619,8 @@ void EnRd_RiseFromCoffin(EnRd* this, PlayState* play) { if (Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 50.0f, 0.3f, 2.0f, 0.3f) == 0.0f) { if (this->coffinRiseForwardAccelTimer != 0) { this->coffinRiseForwardAccelTimer--; - Math_SmoothStepToF(&this->actor.speedXZ, 6.0f, 0.3f, 1.0f, 0.3f); - } else if (Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.3f, 1.0f, 0.3f) == 0.0f) { + Math_SmoothStepToF(&this->actor.speed, 6.0f, 0.3f, 1.0f, 0.3f); + } else if (Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.3f, 1.0f, 0.3f) == 0.0f) { Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 1, 0x7D0, 0); } } @@ -631,7 +631,7 @@ void EnRd_SetupWalkToPlayer(EnRd* this, PlayState* play) { f32 frameCount = Animation_GetLastFrame(&gGibdoRedeadWalkAnim); Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 1.0f, 4.0f, frameCount, ANIMMODE_LOOP_INTERP, -4.0f); - this->actor.speedXZ = 0.4f; + this->actor.speed = 0.4f; this->action = EN_RD_ACTION_WALKING_TO_PLAYER_OR_RELEASING_GRAB; this->actionFunc = EnRd_WalkToPlayer; } @@ -642,7 +642,7 @@ void EnRd_WalkToPlayer(EnRd* this, PlayState* play) { s16 yaw = ((this->actor.yawTowardsPlayer - this->actor.shape.rot.y) - this->headYRotation) - this->upperBodyYRotation; - this->skelAnime.playSpeed = this->actor.speedXZ; + this->skelAnime.playSpeed = this->actor.speed; Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 250, 0); Math_SmoothStepToS(&this->headYRotation, 0, 1, 100, 0); Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 100, 0); @@ -721,7 +721,7 @@ void EnRd_WalkToHome(EnRd* this, PlayState* play) { if (Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos) >= 5.0f) { Math_SmoothStepToS(&this->actor.shape.rot.y, sp36, 1, 450, 0); } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (!Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 450, 0)) { if (EN_RD_GET_TYPE(&this->actor) != EN_RD_TYPE_CRYING) { EnRd_SetupIdle(this); @@ -783,9 +783,9 @@ void EnRd_WalkToParent(EnRd* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, yaw, 1, 250, 0); if (Actor_WorldDistXYZToPoint(&this->actor, &parentPos) >= 45.0f) { - this->actor.speedXZ = 0.4f; + this->actor.speed = 0.4f; } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (EN_RD_GET_TYPE(&this->actor) != EN_RD_TYPE_CRYING) { EnRd_SetupIdle(this); } else { @@ -814,7 +814,7 @@ void EnRd_SetupGrab(EnRd* this) { this->grabState = 0; this->grabDamageTimer = 200; this->action = EN_RD_ACTION_GRABBING; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = EnRd_Grab; } @@ -930,15 +930,15 @@ void EnRd_AttemptPlayerFreeze(EnRd* this, PlayState* play) { void EnRd_SetupGrabFail(EnRd* this) { this->action = EN_RD_ACTION_FAILING_GRAB; Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadDamageAnim, -6.0f); - this->actor.speedXZ = -2.0f; + this->actor.speed = -2.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->action = EN_RD_ACTION_FAILING_GRAB; this->actionFunc = EnRd_GrabFail; } void EnRd_GrabFail(EnRd* this, PlayState* play) { - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ += 0.15f; + if (this->actor.speed < 0.0f) { + this->actor.speed += 0.15f; } this->actor.world.rot.y = this->actor.yawTowardsPlayer; @@ -1005,7 +1005,7 @@ void EnRd_SetupDamage(EnRd* this) { this->actor.shape.yOffset = 0.0f; Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadDamageAnim, -6.0f); if (this->actor.bgCheckFlags & 1) { - this->actor.speedXZ = -2.0f; + this->actor.speed = -2.0f; } this->actor.flags |= ACTOR_FLAG_1; @@ -1017,8 +1017,8 @@ void EnRd_SetupDamage(EnRd* this) { void EnRd_Damage(EnRd* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ += 0.15f; + if (this->actor.speed < 0.0f) { + this->actor.speed += 0.15f; } this->actor.world.rot.y = this->actor.yawTowardsPlayer; @@ -1043,7 +1043,7 @@ void EnRd_SetupDead(EnRd* this) { this->action = EN_RD_ACTION_DEAD; this->deathTimer = 300; this->actor.flags &= ~ACTOR_FLAG_1; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_DEAD); this->actionFunc = EnRd_Dead; } @@ -1082,7 +1082,7 @@ void EnRd_Dead(EnRd* this, PlayState* play) { void EnRd_SetupStunned(EnRd* this) { this->action = EN_RD_ACTION_STUNNED; this->stunTimer = 10; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; if (gSaveContext.sunsSongState != SUNSSONG_INACTIVE) { this->stunnedBySunsSong = true; @@ -1273,12 +1273,11 @@ void EnRd_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - if ((this->action != EN_RD_ACTION_GRABBING) && (this->actor.speedXZ != 0.0f)) { + if ((this->action != EN_RD_ACTION_GRABBING) && (this->actor.speed != 0.0f)) { Actor_MoveWithGravity(&this->actor); } - if ((this->actor.shape.rot.x == 0) && (this->action != EN_RD_ACTION_GRABBING) && - (this->actor.speedXZ != 0.0f)) { + if ((this->actor.shape.rot.x == 0) && (this->action != EN_RD_ACTION_GRABBING) && (this->actor.speed != 0.0f)) { Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 20.0f, 35.0f, 0x1D); } 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 5cd8c78bc9..58f8f706d9 100644 --- a/src/overlays/actors/ovl_En_Rg/z_en_rg.c +++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.c @@ -231,7 +231,7 @@ void func_80BF3DC4(EnRg* this, PlayState* play) { this->collider2.dim.worldSphere.center.y = this->actor.world.pos.y + this->actor.shape.yOffset; this->collider2.dim.worldSphere.center.z = this->actor.world.pos.z; - if (this->actor.speedXZ >= 10.0f) { + if (this->actor.speed >= 10.0f) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider2.base); } CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider2.base); @@ -318,7 +318,7 @@ void func_80BF40F4(EnRg* this) { } s32 func_80BF416C(EnRg* this, PlayState* play) { - if ((this->actor.bgCheckFlags & 1) && (this->actor.speedXZ >= 0.01f)) { + if ((this->actor.bgCheckFlags & 1) && (this->actor.speed >= 0.01f)) { Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_ROLLING - SFX_FLAG); func_800AE930(&play->colCtx, Effect_GetByIndex(this->unk_340), &this->actor.world.pos, 18.0f, this->actor.shape.rot.y, this->actor.floorPoly, this->actor.floorBgId); @@ -345,9 +345,9 @@ s32 func_80BF42BC(EnRg* this, f32 arg1) { f32 sp2C; s32 sp24; - Math_ApproachF(&this->actor.speedXZ, arg1, 0.3f, 0.5f); + Math_ApproachF(&this->actor.speed, arg1, 0.3f, 0.5f); - sp2C = this->actor.speedXZ * (1.0f / 26); + sp2C = this->actor.speed * (1.0f / 26); if (sp2C > 1.0f) { sp2C = 1.0f; } @@ -410,7 +410,7 @@ s32 func_80BF45B4(EnRg* this) { s16 temp_v0; s16 temp_v1; - if ((this->actor.bgCheckFlags & 8) && (this->actor.speedXZ >= 5.0f)) { + if ((this->actor.bgCheckFlags & 8) && (this->actor.speed >= 5.0f)) { temp_v1 = this->actor.world.rot.y; temp_v0 = temp_v1 - BINANG_ROT180(this->actor.wallYaw); @@ -419,12 +419,12 @@ s32 func_80BF45B4(EnRg* this) { this->unk_322 = 0xA; } else if (ABS_ALT(temp_v0) >= 0x1000) { this->actor.world.rot.y = BINANG_ROT180(BINANG_ROT180(this->actor.wallYaw) - temp_v0); - this->actor.speedXZ *= 0.75f; + this->actor.speed *= 0.75f; this->unk_322 = 0xA; } else { this->actor.world.rot.y = BINANG_ROT180(temp_v1); ret = 1; - this->actor.speedXZ *= 0.25f; + this->actor.speed *= 0.25f; } sp24 = 1; } else if (this->unk_310 & 0x40) { @@ -432,7 +432,7 @@ s32 func_80BF45B4(EnRg* this) { sp24 = 2; if (this->actor.colorFilterTimer == 0) { - this->actor.speedXZ *= 0.5f; + this->actor.speed *= 0.5f; if ((s16)(yaw - this->actor.world.rot.y) > 0) { this->actor.world.rot.y -= 0x2000; } else { @@ -679,7 +679,7 @@ void func_80BF4FC4(EnRg* this, PlayState* play) { if (this->actor.bgCheckFlags & 2) { if (this->unk_310 & 0x400) { this->unk_310 &= ~0x400; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if (this->unk_344 != -1) { 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 10706fa9a5..31a02d64fe 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -214,7 +214,7 @@ void func_808FA19C(EnRr* this, PlayState* play) { } void func_808FA238(EnRr* this, f32 arg1) { - this->actor.speedXZ = arg1; + this->actor.speed = arg1; Actor_PlaySfx(&this->actor, NA_SE_EN_LIKE_WALK); } @@ -271,7 +271,7 @@ void func_808FA3F8(EnRr* this, Player* player) { this->actor.flags &= ~ACTOR_FLAG_1; this->unk_1F0 = 8; this->unk_1E1 = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_218 = 0.0f; this->unk_210 = 0.0f; this->unk_204 = 0.15f; @@ -575,7 +575,7 @@ void func_808FAF94(EnRr* this, PlayState* play) { (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)) { + } else if ((this->actor.xzDistToPlayer < 400.0f) && (this->actor.speed == 0.0f)) { func_808FA238(this, 2.0f); } } @@ -742,7 +742,7 @@ void func_808FB680(EnRr* this, PlayState* play) { } else { Math_SmoothStepToS(&this->actor.shape.rot.y, BINANG_ROT180(this->actor.yawTowardsPlayer), 10, 1000, 0); this->actor.world.rot.y = this->actor.shape.rot.y; - if (this->actor.speedXZ == 0.0f) { + if (this->actor.speed == 0.0f) { func_808FA238(this, 2.0f); } } @@ -801,9 +801,9 @@ void EnRr_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (this->actor.params == ENRR_2) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.1f); + Math_StepToF(&this->actor.speed, 0.0f, 0.1f); } Actor_MoveWithGravity(&this->actor); 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 6bb60af551..8f231ccfae 100644 --- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c +++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c @@ -438,7 +438,7 @@ void EnRuppecrow_UpdateSpeed(EnRuppecrow* this, PlayState* play) { void EnRuppecrow_HandleDeath(EnRuppecrow* this) { f32 scale; - this->actor.speedXZ *= Math_CosS(this->actor.world.rot.x); + this->actor.speed *= Math_CosS(this->actor.world.rot.x); this->actor.velocity.y = 0.0f; Animation_Change(&this->skelAnime, &gGuayFlyAnim, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -3.0f); @@ -466,7 +466,7 @@ void EnRuppecrow_HandleDeath(EnRuppecrow* this) { Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x0, 0x28); if (this->actor.flags & ACTOR_FLAG_8000) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } this->collider.base.acFlags &= ~AC_ON; @@ -508,9 +508,9 @@ void EnRuppecrow_HandleSong(EnRuppecrow* this, PlayState* play) { } if (player->stateFlags2 & PLAYER_STATE2_8000000) { - Math_ApproachF(&this->actor.speedXZ, 0.0f, 0.1f, 1.0f); + Math_ApproachF(&this->actor.speed, 0.0f, 0.1f, 1.0f); } else { - Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.1f, 0.1f); + Math_ApproachF(&this->actor.speed, 6.0f, 0.1f, 0.1f); } Actor_MoveWithoutGravity(&this->actor); @@ -546,7 +546,7 @@ void EnRuppecrow_FlyWhileDroppingRupees(EnRuppecrow* this, PlayState* play) { //! @bug: Source of the "Termina Field Guay Glitch"; guay will no longer fall if killed after this point this->actor.gravity = 0.0f; - Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.2f, 0.5f); + Math_ApproachF(&this->actor.speed, 6.0f, 0.2f, 0.5f); Math_ApproachF(&this->actor.velocity.y, 3.0f, 0.2f, 0.5f); this->actionFunc = EnRuppecrow_FlyToDespawn; @@ -555,7 +555,7 @@ void EnRuppecrow_FlyWhileDroppingRupees(EnRuppecrow* this, PlayState* play) { } else { if (ActorCutscene_GetCurrentIndex() != this->actor.cutscene) { EnRuppecrow_UpdateSpeed(this, play); - Math_ApproachF(&this->actor.speedXZ, this->speedModifier, 0.2f, 0.5f); + Math_ApproachF(&this->actor.speed, this->speedModifier, 0.2f, 0.5f); } Actor_MoveWithoutGravity(&this->actor); @@ -573,7 +573,7 @@ void EnRuppecrow_FlyToDespawn(EnRuppecrow* this, PlayState* play) { this->actor.world.rot.y *= -0x1; } - Math_ApproachF(&this->actor.speedXZ, this->speedModifier, 0.1f, 0.1f); + Math_ApproachF(&this->actor.speed, this->speedModifier, 0.1f, 0.1f); 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) { @@ -591,7 +591,7 @@ void EnRuppecrow_FlyToDespawn(EnRuppecrow* this, PlayState* play) { } void EnRuppecrow_FallToDespawn(EnRuppecrow* this, PlayState* play) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); if (this->currentEffect != ENRUPPECROW_EFFECT_ICE) { Math_StepToF(&this->unk_2C8, 0.0f, 0.05f); 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 108d880234..4adc514532 100644 --- a/src/overlays/actors/ovl_En_Rz/z_en_rz.c +++ b/src/overlays/actors/ovl_En_Rz/z_en_rz.c @@ -604,7 +604,7 @@ void func_80BFC7E0(EnRz* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actionFunc = func_80BFC728; func_80BFB9E4(play, this, EN_RZ_ANIM_THINKING); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; func_80BFBDFC(play); } else if (EnRz_CanTalk(this, play)) { func_800B8614(&this->actor, play, 120.0f); @@ -614,13 +614,13 @@ void func_80BFC7E0(EnRz* this, PlayState* play) { void EnRz_StopToThink(EnRz* this, PlayState* play) { this->timer = 100; this->actionFunc = func_80BFC7E0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 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; + this->actor.speed = 1.5f; switch (EnRz_GetPathStatus(this)) { case EN_RZ_PATHSTATUS_END: @@ -639,7 +639,7 @@ void EnRz_Walk(EnRz* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actionFunc = func_80BFC728; func_80BFB9E4(play, this, EN_RZ_ANIM_THINKING); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; func_80BFBDFC(play); } else if (EnRz_CanTalk(this, play)) { func_800B8614(&this->actor, play, 120.0f); 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 cae39cdae2..1a2f84536b 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -118,7 +118,7 @@ void EnSb_Init(Actor* thisx, PlayState* play) { this->isDead = false; this->actor.colChkInfo.mass = 90; this->actor.shape.rot.y = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.gravity = -0.35f; this->fireCount = 0; this->unk_252 = 0; @@ -191,12 +191,12 @@ void EnSb_SetupIdle(EnSb* this, s32 changeSpeed) { this->state = SHELLBLADE_WAIT_CLOSED; if (changeSpeed) { if (this->actor.depthInWater > 0.0f) { - this->actor.speedXZ = -5.0f; + this->actor.speed = -5.0f; if (this->actor.velocity.y < 0.0f) { this->actor.velocity.y = 2.1f; } } else { - this->actor.speedXZ = -6.0f; + this->actor.speed = -6.0f; if (this->actor.velocity.y < 0.0f) { this->actor.velocity.y = 1.4f; } @@ -253,11 +253,11 @@ void EnSb_TurnAround(EnSb* this, PlayState* play) { this->actor.world.rot.y = this->yawAngle; if (this->actor.depthInWater > 0.0f) { this->actor.velocity.y = 3.0f; - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; this->actor.gravity = -0.35f; } else { this->actor.velocity.y = 2.0f; - this->actor.speedXZ = 6.0f; + this->actor.speed = 6.0f; this->actor.gravity = -2.0f; } EnSb_SpawnBubbles(play, this); @@ -267,7 +267,7 @@ void EnSb_TurnAround(EnSb* this, PlayState* play) { } void EnSb_Lunge(EnSb* this, PlayState* play) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f); + Math_StepToF(&this->actor.speed, 0.0f, 0.2f); if (this->actor.velocity.y <= -0.1f || this->actor.bgCheckFlags & 2) { if (!(this->actor.depthInWater > 0.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); @@ -282,25 +282,25 @@ void EnSb_Bounce(EnSb* this, PlayState* play) { f32 currentFrame = currentFrame = this->skelAnime.curFrame; f32 frameCount = frameCount = Animation_GetLastFrame(&object_sb_Anim_0000B4); - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f); + Math_StepToF(&this->actor.speed, 0.0f, 0.2f); if (currentFrame == frameCount) { if (this->bounceCounter != 0) { this->bounceCounter--; this->attackTimer = 1; if (this->actor.depthInWater > 0.0f) { this->actor.velocity.y = 3.0f; - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; this->actor.gravity = -0.35f; } else { this->actor.velocity.y = 2.0f; - this->actor.speedXZ = 6.0f; + this->actor.speed = 6.0f; this->actor.gravity = -2.0f; } EnSb_SpawnBubbles(play, this); EnSb_SetupLunge(this); } else if (this->actor.bgCheckFlags & 1) { this->actor.bgCheckFlags &= ~2; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->attackTimer = 1; EnSb_SetupWaitClosed(this); } @@ -312,12 +312,12 @@ void EnSb_ReturnToIdle(EnSb* this, PlayState* play) { this->attackTimer--; if (this->actor.bgCheckFlags & 1) { this->actor.bgCheckFlags &= ~1; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } } else if (this->actor.bgCheckFlags & 1) { this->actor.bgCheckFlags &= ~1; this->actionFunc = EnSb_Idle; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } } 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 41c7a3e640..da7c85f638 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 @@ -156,7 +156,7 @@ void EnScRuppe_Init(Actor* thisx, PlayState* play) { if ((this->ruppeIndex < RUPEE_GREEN) || (this->ruppeIndex >= RUPEE_UNUSED)) { this->ruppeIndex = RUPEE_GREEN; } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80BD6A8C; this->actor.gravity = -0.5f; this->actor.shape.yOffset = 700.0f; 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 b37190ee1f..4d3c3b7b7d 100644 --- a/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c +++ b/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c @@ -257,7 +257,7 @@ void func_80BCD640(EnScopecrow* this, PlayState* play) { } } - Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 6.0f, 0.2f, 1.0f); Actor_MoveWithoutGravity(&this->actor); this->unk_264 += 0x1000; this->actor.shape.yOffset = Math_SinS(this->unk_264) * 500.0f; 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 3d5a774cc3..bb52f4425e 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c @@ -126,19 +126,19 @@ void func_80BCAC40(EnScopenuts* this, PlayState* play) { } void func_80BCAD64(EnScopenuts* this, s16 arg1) { - f32 sp24 = Math_CosS(this->actor.world.rot.x) * this->actor.speedXZ; + f32 sp24 = Math_CosS(this->actor.world.rot.x) * this->actor.speed; switch (arg1) { case 1: - this->actor.velocity.y = this->actor.speedXZ; + this->actor.velocity.y = this->actor.speed; this->actor.velocity.x = 0.0f; this->actor.velocity.z = 0.0f; break; case 2: - this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; + this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speed; this->actor.velocity.y = 0.0f; - this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; + this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speed; break; case 3: @@ -149,7 +149,7 @@ void func_80BCAD64(EnScopenuts* this, s16 arg1) { default: this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * sp24; - this->actor.velocity.y = Math_SinS(this->actor.world.rot.x) * this->actor.speedXZ; + this->actor.velocity.y = Math_SinS(this->actor.world.rot.x) * this->actor.speed; this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * sp24; break; } @@ -219,7 +219,7 @@ void func_80BCB078(EnScopenuts* this, PlayState* play) { if (func_80BCC2AC(this, this->path, this->unk_334)) { if (this->unk_334 >= (this->path->count - 1)) { this->actionFunc = func_80BCB1C8; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.gravity = -1.0f; return; } @@ -228,9 +228,9 @@ void func_80BCB078(EnScopenuts* this, PlayState* play) { } if (this->unk_334 >= (this->path->count - 2)) { - Math_ApproachF(&this->actor.speedXZ, 1.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 1.5f, 0.2f, 1.0f); } else { - Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 5.0f, 0.2f, 1.0f); } Actor_MoveWithoutGravity(&this->actor); } @@ -605,7 +605,7 @@ void func_80BCBFFC(EnScopenuts* this, PlayState* play) { this->actionFunc = func_80BCC288; } - Math_ApproachF(&this->actor.speedXZ, 1.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 1.0f, 0.2f, 1.0f); func_80BCAD64(this, sp32); if (this->unk_36C == 2) { @@ -701,7 +701,7 @@ void EnScopenuts_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->unk_328 |= 2; this->unk_328 |= 4; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (ENSCOPENUTS_GET_3E0(&this->actor) == ENSCOPENUTS_3E0_0) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_40)) { 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 893ca400be..d0a3fc0e98 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c @@ -670,7 +670,7 @@ void func_80ADC37C(EnSellnuts* this, PlayState* play) { this->actionFunc = func_80ADC580; } - Math_ApproachF(&this->actor.speedXZ, 2.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 2.0f, 0.2f, 1.0f); Actor_MoveWithoutGravity(&this->actor); if (this->unk_366 == 2) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { @@ -793,7 +793,7 @@ void func_80ADC8C4(EnSellnuts* this, PlayState* play) { this->unk_34C = 22; this->actor.gravity = -1.0f; this->actor.velocity.y = -1.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->unk_34C); this->unk_338 &= ~1; this->unk_338 &= ~2; @@ -802,7 +802,7 @@ void func_80ADC8C4(EnSellnuts* this, PlayState* play) { } this->unk_334++; } - Math_ApproachF(&this->actor.speedXZ, 2.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 2.0f, 0.2f, 1.0f); Actor_MoveWithoutGravity(&this->actor); } } @@ -968,7 +968,7 @@ void EnSellnuts_Init(Actor* thisx, PlayState* play) { this->unk_374 = 0.01f; this->unk_370 = 0.01f; this->unk_36C = 0.01f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; if (CHECK_WEEKEVENTREG(WEEKEVENTREG_73_04)) { if (ENSELLNUTS_GET_1(&this->actor)) { 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 5b08cfaa77..f127902b69 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -325,7 +325,7 @@ void func_80994F7C(EnSkb* this, PlayState* play) { this->unk_3E0 = 1; } this->actionFunc = func_80995190; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else if (Actor_IsFacingPlayer(&this->actor, 0x2AAA) && !(this->collider.base.acFlags & AC_HIT)) { func_800B8614(&this->actor, play, 100.0f); } @@ -333,7 +333,7 @@ void func_80994F7C(EnSkb* this, PlayState* play) { void func_8099504C(EnSkb* this) { this->actionFunc = func_80995068; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void func_80995068(EnSkb* this, PlayState* play) { @@ -349,7 +349,7 @@ void func_80995068(EnSkb* this, PlayState* play) { this->unk_3E0 = 1; } this->actionFunc = func_80995190; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else if (Player_GetMask(play) != PLAYER_MASK_CAPTAIN) { this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_4); this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8); @@ -417,7 +417,7 @@ void func_809952D8(EnSkb* this) { this->unk_3DE = 9; this->actionFunc = func_8099533C; this->actor.shape.shadowScale = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.shape.yOffset = 0.0f; } @@ -439,7 +439,7 @@ void func_809953E8(EnSkb* this) { this->unk_3DE = 10; this->actionFunc = func_8099544C; this->actor.shape.shadowScale = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.shape.yOffset = 0.0f; } @@ -462,7 +462,7 @@ void func_809954F8(EnSkb* this) { this->actionFunc = func_8099556C; this->actor.gravity = 0.0f; this->actor.shape.shadowScale = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.shape.yOffset = 0.0f; this->actor.targetArrowOffset = 4000.0f; } @@ -500,14 +500,14 @@ void func_8099571C(EnSkb* this) { this->actor.shape.shadowScale = 0.0f; if (this->unk_3DE == 9) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8); - this->actor.speedXZ = 2.4f; + this->actor.speed = 2.4f; this->actor.gravity = -1.0f; this->actor.velocity.y = 3.0f; } else if (this->unk_3DE == 0xA) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8); } else if (this->unk_3DE == 0xB) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9); - this->actor.speedXZ = 3.2f; + this->actor.speed = 3.2f; this->actor.gravity = -1.0f; this->actor.velocity.y = 2.0f; } @@ -527,7 +527,7 @@ void func_80995818(EnSkb* this, PlayState* play) { } if (this->actor.bgCheckFlags & 2) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; for (i = 0; i < 10; i++) { func_809947B0(play, this, &this->actor.world.pos); } @@ -539,7 +539,7 @@ void func_809958F4(EnSkb* this) { 0.0f, ANIMMODE_ONCE, -4.0f); this->unk_3E4 = 0; this->actor.flags &= ~ACTOR_FLAG_1; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->unk_3DE = 1; this->actionFunc = func_8099599C; @@ -561,7 +561,7 @@ void func_8099599C(EnSkb* this, PlayState* play) { void func_80995A30(EnSkb* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); - this->actor.speedXZ = 1.6f; + this->actor.speed = 1.6f; this->unk_3DA = 0; this->unk_3DE = 2; this->actionFunc = func_80995A8C; @@ -598,7 +598,7 @@ void func_80995A8C(EnSkb* this, PlayState* play) { void func_80995C24(EnSkb* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); this->collider.base.atFlags &= ~AT_BOUNCED; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_3DE = 3; this->actionFunc = func_80995C84; } @@ -636,7 +636,7 @@ void func_80995DC4(EnSkb* this, PlayState* play) { void func_80995E08(EnSkb* this) { if (this->actor.bgCheckFlags & 1) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); this->unk_3E4 = 0; @@ -646,12 +646,12 @@ void func_80995E08(EnSkb* this) { void func_80995E64(EnSkb* this, PlayState* play) { if (this->actor.bgCheckFlags & 2) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if (this->actor.bgCheckFlags & 1) { - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ += 0.05f; + if (this->actor.speed < 0.0f) { + this->actor.speed += 0.05f; } } @@ -684,17 +684,17 @@ void func_80995F98(EnSkb* this) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8); this->actor.gravity = -1.0f; - this->actor.speedXZ = 1.0f; + this->actor.speed = 1.0f; } else if (this->unk_3DE == 0xB) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9); - this->actor.speedXZ = 3.2f; + this->actor.speed = 3.2f; this->actor.velocity.y = 2.0f; this->actor.gravity = -1.0f; } else { this->actor.world.rot.y = this->actor.yawTowardsPlayer; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); if (this->actor.bgCheckFlags & 1) { - this->actor.speedXZ = -4.0f; + this->actor.speed = -4.0f; } } Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); @@ -709,12 +709,12 @@ void func_809960AC(EnSkb* this, PlayState* play) { for (i = 0; i < 10; i++) { func_809947B0(play, this, &this->actor.world.pos); } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if (this->actor.bgCheckFlags & 1) { - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ += 0.05f; + if (this->actor.speed < 0.0f) { + this->actor.speed += 0.05f; } Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x9C4, 0); } @@ -731,7 +731,7 @@ void func_809961E4(EnSkb* this, PlayState* play) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); this->unk_3D8 |= 0x40; if (this->actor.bgCheckFlags & 1) { - this->actor.speedXZ = -6.0f; + this->actor.speed = -6.0f; } this->unk_3E4 = 0; this->actor.flags &= ~ACTOR_FLAG_1; 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 68f6f1606b..0c4d0d465d 100644 --- a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c +++ b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c @@ -246,15 +246,15 @@ void EnSnowman_Init(Actor* thisx, PlayState* play) { thisx->velocity.y = (Actor_WorldDistXZToActor(thisx, &player->actor) * 0.035f) + -5.0f; thisx->velocity.y = CLAMP_MAX(thisx->velocity.y, 3.5f); if (EN_SNOWMAN_GET_TYPE(thisx) == EN_SNOWMAN_TYPE_SMALL_SNOWBALL) { - thisx->speedXZ = 15.0f; + thisx->speed = 15.0f; } else { - thisx->speedXZ = 22.5f; + thisx->speed = 22.5f; thisx->velocity.y *= 1.5f; } - thisx->world.pos.x += thisx->speedXZ * Math_SinS(thisx->world.rot.y); + thisx->world.pos.x += thisx->speed * Math_SinS(thisx->world.rot.y); thisx->world.pos.y += thisx->velocity.y; - thisx->world.pos.z += thisx->speedXZ * Math_CosS(thisx->world.rot.y); + thisx->world.pos.z += thisx->speed * Math_CosS(thisx->world.rot.y); if (EN_SNOWMAN_GET_TYPE(thisx) == EN_SNOWMAN_TYPE_SMALL_SNOWBALL) { this->collider.dim.radius = 8; @@ -338,7 +338,7 @@ void EnSnowman_SpawnBigSnowballFragmentEffects(EnSnowman* this, PlayState* play) void EnSnowman_SetupMoveSnowPile(EnSnowman* this) { Animation_PlayLoop(&this->snowPileSkelAnime, &gEenoSnowPileMoveAnim); this->actor.scale.y = this->actor.scale.x; - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; this->actor.draw = EnSnowman_DrawSnowPile; this->work.timer = 40; this->turningOnSteepSlope = false; @@ -420,7 +420,7 @@ void EnSnowman_SetupEmerge(EnSnowman* this, PlayState* play) { this->collider.dim.height = this->eenoScale * 25.0f; this->actor.draw = EnSnowman_Draw; this->actor.scale.y = this->actor.scale.x * 0.4f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; EnSnowman_SpawnCircularDustEffect(this, play); this->collider.base.acFlags &= ~AC_ON; @@ -605,7 +605,7 @@ void EnSnowman_SetupMelt(EnSnowman* this) { this->actor.flags &= ~ACTOR_FLAG_1; this->actor.flags |= ACTOR_FLAG_10; this->actor.scale.y = this->actor.scale.x; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = EnSnowman_Melt; } @@ -673,7 +673,7 @@ void EnSnowman_SetupDamaged(EnSnowman* this) { this->work.timer = 20; this->actor.draw = EnSnowman_Draw; this->actor.scale.y = this->actor.scale.x; - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; func_800BE504(&this->actor, &this->collider); if (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_LARGE) { @@ -696,7 +696,7 @@ void EnSnowman_Damaged(EnSnowman* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); rotationalVelocityScale = CLAMP_MAX(this->work.timer, 10); this->actor.shape.rot.y += rotationalVelocityScale * 0x300; - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); if (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_LARGE) { Math_StepToF(&this->actor.scale.y, 1.3f * 0.01f, 0.7f * 0.001f); @@ -878,11 +878,11 @@ void EnSnowman_SetupCombine(EnSnowman* this, PlayState* play, Vec3f* combinePos) //! @bug: If an Eeno is in the middle of submerging, its draw function will still be EnSnowman_Draw. //! It will call EnSnowman_SetupSubmerge again, resulting in the submerge animation playing twice. if (this->actor.draw == EnSnowman_DrawSnowPile) { - this->actor.speedXZ = 3.0f; + this->actor.speed = 3.0f; this->actionFunc = EnSnowman_Combine; } else { this->isHoldingSnowball = false; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; // At this point, the combineState is EN_SNOWMAN_COMBINE_STATE_ACTIVE, and the actionFunc // will be set to EnSnowman_Submerge. When the submerging animation is complete with this @@ -942,7 +942,7 @@ void EnSnowman_Combine(EnSnowman* this, PlayState* play) { } if (Actor_WorldDistXZToPoint(&this->actor, &this->combinePos) < 20.0f) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if (Math_StepToF(&this->actor.scale.x, this->fwork.targetScaleDuringCombine, 0.0005f)) { 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 035bc2bfab..d748b0b7df 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -738,9 +738,9 @@ void EnSob1_EndWalk(EnSob1* this, PlayState* play) { EnSob1_GetDistSqAndOrient(this->path, this->waypoint - 1, &this->actor.world.pos, &distSq), 4, 1000, 1); this->actor.shape.rot.y = this->actor.world.rot.y; - Math_ApproachF(&this->actor.speedXZ, 0.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 0.5f, 0.2f, 1.0f); if (distSq < 12.0f) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (animLastFrame == curFrame) { EnSob1_ChangeAnim(&this->skelAnime, sAnimationInfoBombShopkeeper, BOMB_SHOPKEEPER_ANIM_SIT_AT_COUNTER_START); @@ -777,11 +777,11 @@ void EnSob1_Walk(EnSob1* this, PlayState* play) { EnSob1_GetDistSqAndOrient(this->path, this->waypoint, &this->actor.world.pos, &distSq), 4, 1000, 1); this->actor.shape.rot.y = this->actor.world.rot.y; - this->actor.speedXZ = 2.0f; + this->actor.speed = 2.0f; if (distSq < SQ(5.0f)) { this->waypoint++; if ((this->path->count - 1) < this->waypoint) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; EnSob1_SetupAction(this, EnSob1_EndWalk); } } 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 66dbfca21f..ff34769625 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -781,7 +781,7 @@ void func_808A6E24(EnSt* this, PlayState* play) { this->actor.world.rot.x = 0x4000; this->actor.shape.rot.x = this->actor.world.rot.x; this->unk_2D0 = this->actor.velocity.y = fabsf(this->actor.velocity.y) * 0.6f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if ((s32)this->unk_2D0 != 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); 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 089cb3ebaf..0106430a17 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 @@ -351,7 +351,7 @@ void func_80AE7E9C(EnStopheishi* this) { this->unk_274 = 0; this->disableCollider = false; this->actionFunc = func_80AE7F34; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void func_80AE7F34(EnStopheishi* this, PlayState* play) { 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 4016052baf..997db1cf12 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -452,7 +452,7 @@ void func_80BAAFDC(EnSuttari* this, PlayState* play) { if (this->playerDetected == true) { play_sound(NA_SE_SY_FOUND); this->playerDetected = false; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->unk1F4[0] != 0) { this->unk1F4[0]--; } @@ -485,7 +485,7 @@ void func_80BAB1A0(EnSuttari* this, PlayState* play) { if (this->playerDetected == true) { play_sound(NA_SE_SY_FOUND); this->playerDetected = false; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->unk1F4[0] != 0) { this->unk1F4[0]--; } @@ -1032,7 +1032,7 @@ void func_80BACA14(EnSuttari* this, PlayState* play) { func_800B8614(&this->actor, play, 200.0f); } } - Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 0.1f); + Math_ApproachF(&this->actor.speed, 5.0f, 0.2f, 0.1f); Actor_MoveWithGravity(&this->actor); } @@ -1054,10 +1054,10 @@ void func_80BACBB0(EnSuttari* this, PlayState* play) { } Math_SmoothStepToS(&this->actor.world.rot.y, target, 4, 0x3E8, 1); this->actor.shape.rot.y = this->actor.world.rot.y; - Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 0.1f); + Math_ApproachF(&this->actor.speed, 5.0f, 0.2f, 0.1f); } else { this->actionFunc = func_80BACD2C; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } Actor_MoveWithGravity(&this->actor); if (!(this->actor.bgCheckFlags & 1)) { @@ -1076,7 +1076,7 @@ void func_80BACD2C(EnSuttari* this, PlayState* play) { } if ((this->actor.playerHeightRel < 60.0f) && (this->actor.xzDistToPlayer < 500.0f)) { this->actionFunc = func_80BACBB0; - Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 0.1f); + Math_ApproachF(&this->actor.speed, 5.0f, 0.2f, 0.1f); } else { Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 4, 0x3E8, 1); this->actor.shape.rot.y = this->actor.world.rot.y; @@ -1118,7 +1118,7 @@ void func_80BACEE0(EnSuttari* this, PlayState* play) { if (this->unk428 == 5) { SET_WEEKEVENTREG(WEEKEVENTREG_58_80); this->actionFunc = func_80BADDB4; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else if (Player_GetMask(play) != PLAYER_MASK_STONE) { func_80BAB1A0(this, play); } @@ -1203,7 +1203,7 @@ void func_80BAD380(EnSuttari* this, PlayState* play) { if ((player->stateFlags1 & PLAYER_STATE1_40) && (play->msgCtx.currentTextId != 0x2A31)) { this->flags1 |= 0x8000; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { this->flags1 &= ~0x8000; func_80BABA90(this, 1, 1); @@ -1222,7 +1222,7 @@ void func_80BAD380(EnSuttari* this, PlayState* play) { } else if (this->flags1 & 0x200) { SET_WEEKEVENTREG(WEEKEVENTREG_79_40); this->flags2 |= 4; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; 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); @@ -1233,13 +1233,13 @@ void func_80BAD380(EnSuttari* this, PlayState* play) { if (this->flags2 & 8) { SET_WEEKEVENTREG(WEEKEVENTREG_33_08); } - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Audio_QueueSeqCmd(0x101400FF); this->flags2 |= 4; EnSuttari_TriggerTransition(play, ENTRANCE(NORTH_CLOCK_TOWN, 7)); } else { this->unk3F2 = this->headRot.y; - Math_ApproachF(&this->actor.speedXZ, 4.0f, 0.2f, 0.5f); + Math_ApproachF(&this->actor.speed, 4.0f, 0.2f, 0.5f); Actor_MoveWithGravity(&this->actor); func_80BAB374(this, play); } @@ -1410,10 +1410,10 @@ void func_80BADDB4(EnSuttari* this, PlayState* play) { void func_80BADE14(EnSuttari* this, PlayState* play) { func_80BABA90(this, 1, 2); if (this->unk1F4[1] == -0x63) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { this->unk3F2 = this->headRot.y; - Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.2f, 0.5f); + Math_ApproachF(&this->actor.speed, 6.0f, 0.2f, 0.5f); } Actor_MoveWithGravity(&this->actor); } @@ -1438,7 +1438,7 @@ void func_80BADF3C(EnSuttari* this, PlayState* play) { } this->unk3F2 = this->headRot.y; if (DECR(this->unk3F6) == 0) { - Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.2f, 0.5f); + Math_ApproachF(&this->actor.speed, 6.0f, 0.2f, 0.5f); } Actor_MoveWithGravity(&this->actor); } 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 0d0e75a092..9606e3d080 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -378,8 +378,8 @@ void func_808D94D0(EnSw* this, PlayState* play, s32 arg2, s32 arg3, s16 arg4) { sp68 = BGCHECK_SCENE; sp64 = BGCHECK_SCENE; func_808D90F0(this, arg3, arg4); - this->actor.speedXZ = this->unk_44C; - temp_f20 = thisx->speedXZ * 2.0f; + this->actor.speed = this->unk_44C; + temp_f20 = thisx->speed * 2.0f; sp90.x = this->actor.world.pos.x + (this->unk_368.x * 2.0f); sp90.y = this->actor.world.pos.y + (this->unk_368.y * 2.0f); @@ -397,7 +397,7 @@ void func_808D94D0(EnSw* this, PlayState* play, s32 arg2, s32 arg3, s16 arg4) { func_808D91C4(this, spA4); Math_Vec3f_Copy(&this->actor.world.pos, &sp78); this->actor.floorBgId = sp64; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { if (spA0 != this->actor.floorPoly) { func_808D91C4(this, spA0); @@ -406,7 +406,7 @@ void func_808D94D0(EnSw* this, PlayState* play, s32 arg2, s32 arg3, s16 arg4) { this->actor.floorBgId = sp68; } } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; temp_f20 *= 3.0f; Math_Vec3f_Copy(&sp90, &sp84); @@ -440,8 +440,8 @@ void func_808D94D0(EnSw* this, PlayState* play, s32 arg2, s32 arg3, s16 arg4) { this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.z = this->actor.world.rot.z; - if (this->actor.speedXZ != 0.0f) { - this->unk_44C = this->actor.speedXZ; + if (this->actor.speed != 0.0f) { + this->unk_44C = this->actor.speed; } if (arg2 == 1) { @@ -555,15 +555,15 @@ s32 func_808D9C18(EnSw* this) { f32 new_var; if ((this->unk_498 == 0xF9) || (this->unk_498 == 0x82) || (this->unk_498 == 0xE4) || (this->unk_498 == 0xE5)) { - this->actor.velocity.x = this->actor.speedXZ; - this->actor.velocity.z = this->actor.speedXZ; + this->actor.velocity.x = this->actor.speed; + this->actor.velocity.z = this->actor.speed; this->actor.velocity.x *= Math_SinS(this->actor.world.rot.y); this->actor.velocity.z *= Math_CosS(this->actor.world.rot.y); } else { - new_var = this->actor.speedXZ * this->unk_350.x; - this->actor.velocity.x = new_var + (this->actor.speedXZ * this->unk_368.x); - new_var = this->actor.speedXZ * this->unk_350.z; - this->actor.velocity.z = new_var + this->actor.speedXZ * this->unk_368.z; + new_var = this->actor.speed * this->unk_350.x; + this->actor.velocity.x = new_var + (this->actor.speed * this->unk_368.x); + new_var = this->actor.speed * this->unk_350.z; + this->actor.velocity.z = new_var + this->actor.speed * this->unk_368.z; this->actor.velocity.y = 14.0f; Math_Vec3f_Copy(&sp3C, &this->actor.world.pos); Math_Vec3f_Copy(&sp30, &this->actor.world.pos); @@ -635,10 +635,10 @@ void func_808D9F78(EnSw* this, PlayState* play, s32 arg2) { } Actor_SetScale(&this->actor, 0.02f); func_808D9DA0(this); - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; this->unk_44C = 10.0f; func_808D94D0(this, play, 0, 0, 0); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_44C = 0.0f; this->unk_450 = 1.0f; Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); @@ -647,10 +647,10 @@ void func_808D9F78(EnSw* this, PlayState* play, s32 arg2) { void func_808DA024(EnSw* this, PlayState* play) { func_808D9DA0(this); - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; this->unk_44C = 10.0f; func_808D94D0(this, play, 0, 0, 0); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_44C = 0.0f; this->unk_450 = 1.0f; } @@ -791,7 +791,7 @@ void func_808DA578(EnSw* this, PlayState* play) { temp_f0 = this->skelAnime.endFrame - this->skelAnime.curFrame; this->unk_44C = 0.3f * temp_f0; func_808D94D0(this, play, 1, 0, 0); - if ((this->actor.speedXZ == 0.0f) && (this->unk_44C != 0.0f)) { + if ((this->actor.speed == 0.0f) && (this->unk_44C != 0.0f)) { Math_Vec3f_Copy(&sp30, &this->unk_374); func_808D9894(this, &sp30); temp2 = Math_Atan2S_XY(sp30.z, sp30.x); @@ -822,7 +822,7 @@ void func_808DA6FC(EnSw* this, PlayState* play) { temp_f0 = this->skelAnime.endFrame - this->skelAnime.curFrame; this->unk_44C = 0.14f * temp_f0; func_808D94D0(this, play, 1, 0, 0); - if ((this->actor.speedXZ == 0.0f) && (this->unk_44C != 0.0f)) { + if ((this->actor.speed == 0.0f) && (this->unk_44C != 0.0f)) { Math_Vec3f_Copy(&sp38, &this->unk_374); func_808D9894(this, &sp38); temp2 = Math_Atan2S_XY(sp38.z, sp38.x); @@ -880,7 +880,7 @@ void func_808DA89C(EnSw* this, PlayState* play) { temp_f2 = fabsf(this->actor.velocity.y) * 0.6f; this->actor.velocity.y = temp_f2; this->unk_448 = temp_f2; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if ((s32)temp_f2 != 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_STALTURA_BOUND); } else { @@ -963,7 +963,7 @@ void func_808DACF4(EnSw* this, PlayState* play) { temp = this->skelAnime.endFrame - this->skelAnime.curFrame; this->unk_44C = 0.1f * temp; func_808D94D0(this, play, 1, 0, 0); - if ((this->actor.speedXZ == 0.0f) && (this->unk_44C != 0.0f)) { + if ((this->actor.speed == 0.0f) && (this->unk_44C != 0.0f)) { Math_Vec3f_Copy(&sp38, &this->unk_374); func_808D9894(this, &sp38); 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 aac4a27f6c..ffc8e9d9b9 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 @@ -116,7 +116,7 @@ void EnSyatekiCrow_Destroy(Actor* thisx, PlayState* play) { void EnSyatekiCrow_SetupWaitForSignal(EnSyatekiCrow* this) { Actor_SetScale(&this->actor, 0.03f); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.gravity = 0.0f; this->actor.world = this->actor.home; this->actor.prevPos = this->actor.home.pos; @@ -171,7 +171,7 @@ void EnSyatekiCrow_WaitToMove(EnSyatekiCrow* this, PlayState* play) { if (((EN_SYATEKI_CROW_GET_WAIT_MOD(&this->actor) * 20) + 20) < this->waitTimer) { Actor_PlaySfx(this->actor.parent, NA_SE_EN_KAICHO_CRY); this->waitTimer = 0; - this->actor.speedXZ = EN_SYATEKI_CROW_GET_SPEED_MOD(&this->actor) + 6.0f; + this->actor.speed = EN_SYATEKI_CROW_GET_SPEED_MOD(&this->actor) + 6.0f; this->actor.gravity = -0.5f; this->actionFunc = EnSyatekiCrow_Fly; } else { @@ -222,7 +222,7 @@ void EnSyatekiCrow_SetupDead(EnSyatekiCrow* this) { syatekiMan->score += 60; this->isActive = false; - this->actor.speedXZ *= Math_CosS(this->actor.world.rot.x); + this->actor.speed *= Math_CosS(this->actor.world.rot.x); this->actor.velocity.y = 0.0f; Animation_Change(&this->skelAnime, &gGuayFlyAnim, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -3.0f); this->actor.bgCheckFlags &= ~1; @@ -234,7 +234,7 @@ void EnSyatekiCrow_SetupDead(EnSyatekiCrow* this) { void EnSyatekiCrow_Dead(EnSyatekiCrow* this, PlayState* play) { EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent; - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); this->actor.colorFilterTimer = 40; if (this->actor.colorFilterParams & 0x4000) { 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 c678f37307..f86e501005 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 @@ -164,7 +164,7 @@ void EnSyatekiDekunuts_Destroy(Actor* thisx, PlayState* play) { void EnSyatekiDekunuts_SetupWaitForSignal(EnSyatekiDekunuts* this) { Animation_PlayOnceSetSpeed(&this->skelAnime, &gDekuScrubUpAnim, 0.0f); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world = this->actor.home; this->actor.prevPos = this->actor.home.pos; this->actor.shape.rot = this->actor.world.rot; 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 ce044256a8..7dd26d9a93 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 @@ -216,7 +216,7 @@ void EnSyatekiWf_InitPathStart(EnSyatekiWf* this) { void EnSyatekiWf_SetupWaitForSignal(EnSyatekiWf* this) { EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world = this->actor.home; this->actor.prevPos = this->actor.home.pos; this->actor.shape.rot = this->actor.world.rot; @@ -264,7 +264,7 @@ void EnSyatekiWf_WaitToMove(EnSyatekiWf* this, PlayState* play) { void EnSyatekiWf_SetupRun(EnSyatekiWf* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_WF_ANIM_RUN); - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.draw = EnSyatekiWf_Draw; this->actionFunc = EnSyatekiWf_Run; @@ -310,10 +310,10 @@ void EnSyatekiWf_Run(EnSyatekiWf* this, PlayState* play) { Math_SmoothStepToS(&this->actor.world.rot.y, this->yawTarget, 5, 0x3000, 0x100); this->actor.shape.rot.y = this->actor.world.rot.y; if (distToTarget < 50.0f) { - if (this->actor.speedXZ > 3.0f) { - this->actor.speedXZ = this->actor.speedXZ - 0.5f; + if (this->actor.speed > 3.0f) { + this->actor.speed = this->actor.speed - 0.5f; } else { - this->actor.speedXZ = this->actor.speedXZ; + this->actor.speed = this->actor.speed; } } } else { @@ -339,7 +339,7 @@ void EnSyatekiWf_Run(EnSyatekiWf* this, PlayState* play) { void EnSyatekiWf_SetupJump(EnSyatekiWf* this) { Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_JUMP); this->actor.velocity.y = 20.0f; - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_WF_ANIM_JUMP); this->actionFunc = EnSyatekiWf_Jump; } @@ -351,7 +351,7 @@ void EnSyatekiWf_Jump(EnSyatekiWf* this, PlayState* play) { } void EnSyatekiWf_SetupLand(EnSyatekiWf* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_WF_ANIM_LAND); this->actionFunc = EnSyatekiWf_Land; } @@ -367,7 +367,7 @@ void EnSyatekiWf_Land(EnSyatekiWf* this, PlayState* play) { void EnSyatekiWf_SetupHowl(EnSyatekiWf* this) { this->timer = 40; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_APPEAR); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_WF_ANIM_DAMAGED); this->actionFunc = EnSyatekiWf_Howl; @@ -389,7 +389,7 @@ void EnSyatekiWf_SetupDead(EnSyatekiWf* this, PlayState* play) { EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent; this->isActive = false; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; EffectSsExtra_Spawn(play, &this->actor.world.pos, &sVelocity, &sAccel, 5, 2); Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_DEAD); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_SYATEKI_WF_ANIM_REAR_UP_FALL_OVER); 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 ab86647aaa..ac65fbbe61 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 @@ -322,7 +322,7 @@ void EnTalkGibud_AttemptPlayerFreeze(EnTalkGibud* this, PlayState* play) { void EnTalkGibud_SetupWalkToPlayer(EnTalkGibud* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_WALK); - this->actor.speedXZ = 0.4f; + this->actor.speed = 0.4f; if (this->actionFunc == EnTalkGibud_AttemptPlayerFreeze) { this->playerStunWaitTimer = 80; @@ -448,13 +448,13 @@ void EnTalkGibud_Grab(EnTalkGibud* this, PlayState* play) { void EnTalkGibud_SetupGrabFail(EnTalkGibud* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_DAMAGE); Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_DAMAGE); - this->actor.speedXZ = -2.0f; + this->actor.speed = -2.0f; this->actionFunc = EnTalkGibud_GrabFail; } void EnTalkGibud_GrabFail(EnTalkGibud* this, PlayState* play) { - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ += 0.15f; + if (this->actor.speed < 0.0f) { + this->actor.speed += 0.15f; } this->actor.world.rot.y = this->actor.yawTowardsPlayer; @@ -487,7 +487,7 @@ void EnTalkGibud_TurnAwayAndShakeHead(EnTalkGibud* this, PlayState* play) { void EnTalkGibud_SetupWalkToHome(EnTalkGibud* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_TALK_GIBUD_ANIM_WALK); - this->actor.speedXZ = 0.4f; + this->actor.speed = 0.4f; this->actionFunc = EnTalkGibud_WalkToHome; } @@ -495,10 +495,10 @@ void EnTalkGibud_WalkToHome(EnTalkGibud* this, PlayState* play) { Math_SmoothStepToS(&this->headRotation.y, 0, 1, 100, 0); Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 100, 0); if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 5.0f) { - if (this->actor.speedXZ > 0.2f) { - this->actor.speedXZ -= 0.2f; + if (this->actor.speed > 0.2f) { + this->actor.speed -= 0.2f; } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 200, 10); @@ -521,7 +521,7 @@ void EnTalkGibud_WalkToHome(EnTalkGibud* this, PlayState* play) { void EnTalkGibud_SetupStunned(EnTalkGibud* this) { this->stunTimer = 10; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; if (this->drawDmgEffTimer != 0) { @@ -553,13 +553,13 @@ void EnTalkGibud_SetupDamage(EnTalkGibud* this) { this->stunTimer = 0; this->grabWaitTimer = 0; this->actor.world.rot.y = this->actor.yawTowardsPlayer; - this->actor.speedXZ = -2.0f; + this->actor.speed = -2.0f; this->actionFunc = EnTalkGibud_Damage; } void EnTalkGibud_Damage(EnTalkGibud* this, PlayState* play) { - if (this->actor.speedXZ < 0.0f) { - this->actor.speedXZ += 0.15f; + if (this->actor.speed < 0.0f) { + this->actor.speed += 0.15f; } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { 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 f6b0b2f31f..56384193ec 100644 --- a/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c +++ b/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c @@ -201,7 +201,7 @@ void func_80BB69FC(EnTanron2* this, PlayState* play) { void func_80BB6B80(EnTanron2* this) { this->actionFunc = func_80BB6BD8; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.z = 0.0f; this->actor.velocity.y = 0.0f; this->actor.velocity.x = 0.0f; @@ -240,14 +240,14 @@ void func_80BB6BD8(EnTanron2* this, PlayState* play) { } else { sp32 = Math_Atan2S(sp2C, sp28); } - this->actor.speedXZ = Rand_ZeroFloat(5.0f) + 5.0f; + this->actor.speed = Rand_ZeroFloat(5.0f) + 5.0f; break; case 1: sp32 = Math_Atan2S(sp2C, sp28); - this->actor.speedXZ += 2.0f; - if (this->actor.speedXZ > 10.0f) { - this->actor.speedXZ = 10.0f; + this->actor.speed += 2.0f; + if (this->actor.speed > 10.0f) { + this->actor.speed = 10.0f; } break; @@ -255,14 +255,14 @@ void func_80BB6BD8(EnTanron2* this, PlayState* play) { sp32 = Math_Atan2S(player->actor.world.pos.x - this->actor.world.pos.x, player->actor.world.pos.z - this->actor.world.pos.z) + (s16)Rand_ZeroFloat(20000.0f); - this->actor.speedXZ = Rand_ZeroFloat(7.0f) + 7.0f; + this->actor.speed = Rand_ZeroFloat(7.0f) + 7.0f; if ((this->unk_152 == 0) && (D_80BB8450->unk_1F6 == 0)) { this->unk_158 = 1; } break; } Matrix_RotateYS(sp32, MTXMODE_NEW); - Matrix_MultVecZ(this->actor.speedXZ, &this->actor.velocity); + Matrix_MultVecZ(this->actor.speed, &this->actor.velocity); this->actor.velocity.y = Rand_ZeroFloat(5.0f) + 12.0f; this->unk_14E = 5; } 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 4de900cc4c..1ff73fd9f5 100644 --- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c +++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c @@ -153,7 +153,7 @@ void EnTanron3_SetupLive(EnTanron3* this, PlayState* play) { this->rotationStep = 0; this->rotationScale = 5; this->workTimer[WORK_TIMER_PICK_NEW_DEVIATION] = 50; - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; this->speedMaxStep = 0.5f; this->deviation.x = randPlusMinusPoint5Scaled(500.0f); this->deviation.y = randPlusMinusPoint5Scaled(100.0f); @@ -219,7 +219,7 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) { case true: if (sGyorg->unk_324 != 0 && !(this->timer & 0x7)) { this->nextRotationAngle = 0x4E20; - this->actor.speedXZ = 6.0f; + this->actor.speed = 6.0f; } else { this->nextRotationAngle = 0x1F40; } @@ -242,7 +242,7 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) { } if (this->workTimer[WORK_TIMER_OUT_OF_WATER] == 0) { - if (this->workTimer[WORK_TIMER_PICK_NEW_DEVIATION] == 0 && this->actor.speedXZ > 1.0f) { + if (this->workTimer[WORK_TIMER_PICK_NEW_DEVIATION] == 0 && this->actor.speed > 1.0f) { this->workTimer[WORK_TIMER_PICK_NEW_DEVIATION] = Rand_ZeroFloat(20.0f); this->deviation.x = randPlusMinusPoint5Scaled(100.0f); this->deviation.y = randPlusMinusPoint5Scaled(50.0f + extraScaleY); @@ -265,7 +265,7 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) { Math_SmoothStepToS(&this->actor.world.rot.y, atanTemp, this->rotationScale, this->rotationStep, 0); Math_ApproachS(&this->rotationStep, this->targetRotationStep, 1, 0x100); - Math_ApproachF(&this->actor.speedXZ, this->targetSpeedXZ, 1.0f, this->speedMaxStep); + Math_ApproachF(&this->actor.speed, this->targetSpeedXZ, 1.0f, this->speedMaxStep); Actor_MoveWithoutGravityReverse(&this->actor); } else { switch (this->isBeached) { @@ -276,7 +276,7 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) { this->workTimer[WORK_TIMER_OUT_OF_WATER] = 25; Math_ApproachS(&this->actor.world.rot.x, 0x3000, 5, 0xBD0); if (this->actor.bgCheckFlags & 8) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.velocity.y > 0.0f) { this->actor.velocity.y = -1.0f; } @@ -292,7 +292,7 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) { if (this->actor.bgCheckFlags & 1) { // Fish is still touching land, so it's still beached. Randomly flop around this->actor.velocity.y = Rand_ZeroFloat(5.0f) + 5.0f; - this->actor.speedXZ = Rand_ZeroFloat(2.0f) + 2.0f; + this->actor.speed = Rand_ZeroFloat(2.0f) + 2.0f; if (Rand_ZeroOne() < 0.5f) { this->targetShapeRotation.x = (s16)randPlusMinusPoint5Scaled(500.0f) + this->targetShapeRotation.x + 0x8000; @@ -346,7 +346,7 @@ void EnTanron3_SetupDie(EnTanron3* this, PlayState* play) { this->actor.world.rot.x = Math_Atan2S_XY(sqrtf(SQ(xDistance) + SQ(zDistance)), -yDistance); this->actor.world.rot.y = Math_Atan2S_XY(zDistance, xDistance); this->workTimer[WORK_TIMER_DIE] = 6; - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_KONB_MINI_DEAD); } 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 b533439312..1eaf1d1285 100644 --- a/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.c +++ b/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.c @@ -51,7 +51,7 @@ void EnTanron4_Init(Actor* thisx, PlayState* play2) { OBJECT_TANRON4_LIMB_MAX); thisx->flags &= ~ACTOR_FLAG_1; - thisx->speedXZ = 3.0f + KREG(48); + thisx->speed = 3.0f + KREG(48); thisx->uncullZoneForward = 10000.0f + KREG(70); this->randRollTimer = Rand_ZeroFloat(10.0f); 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 6893b30217..dc33f7a650 100644 --- a/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c +++ b/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c @@ -163,7 +163,7 @@ void EnTanron5_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, (Rand_ZeroFloat(0.015f) + 0.01f) * D_80BE5DD0); } - this->actor.speedXZ = (Rand_ZeroFloat(10.0f) + 10.0f) * D_80BE5DD0; + this->actor.speed = (Rand_ZeroFloat(10.0f) + 10.0f) * D_80BE5DD0; this->actor.velocity.y = (Rand_ZeroFloat(10.0f) + 15.0f) * D_80BE5DD0; this->actor.gravity = -2.5f * D_80BE5DD0; this->actor.terminalVelocity = -1000.0f * D_80BE5DD0; @@ -415,7 +415,7 @@ void func_80BE5818(Actor* thisx, PlayState* play2) { Actor_Kill(&this->actor); } - if (this->actor.speedXZ > 0.02f) { + if (this->actor.speed > 0.02f) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 150.0f, 100.0f, 4); } @@ -443,7 +443,7 @@ void func_80BE5818(Actor* thisx, PlayState* play2) { this->unk_198 += 0x2000; if (this->actor.bgCheckFlags & 1) { this->unk_198 = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } } 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 8b24fc38b5..81b8000484 100644 --- a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c +++ b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c @@ -403,7 +403,7 @@ s32 func_80C10E98(PlayState* play) { if (temp_s1_5 != NULL) { temp_s1_5->velocity.y = Rand_ZeroFloat(3.0f) + 6.0f; - temp_s1_5->speedXZ = Rand_ZeroFloat(3.0f) + 3.0f; + temp_s1_5->speed = Rand_ZeroFloat(3.0f) + 3.0f; temp_s1_5->world.rot.y = phi_s3; } phi_s3 += (s16)(0x10000 / (spB0 + spAC + phi_s0_2 + spA0 + phi_s2 + spA8)); @@ -482,7 +482,7 @@ void func_80C11590(EnThiefbird* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); sp38 = Animation_OnFrame(&this->skelAnime, 0.0f); - this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 3.0f; + this->actor.speed = (Rand_ZeroOne() * 1.5f) + 3.0f; if (this->actor.bgCheckFlags & 8) { this->unk_192 = this->actor.wallYaw; @@ -538,7 +538,7 @@ void func_80C118E4(EnThiefbird* this) { Animation_MorphToLoop(&this->skelAnime, &gTakkuriAttackAnim, -10.0f); this->unk_18E = 300; this->actionFunc = func_80C1193C; - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; } void func_80C1193C(EnThiefbird* this, PlayState* play) { @@ -599,7 +599,7 @@ void func_80C1193C(EnThiefbird* this, PlayState* play) { } void func_80C11C60(EnThiefbird* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; Animation_PlayOnce(&this->skelAnime, &gTakkuriDeathAnim); this->actor.bgCheckFlags &= ~1; @@ -623,7 +623,7 @@ void func_80C11D14(EnThiefbird* this, PlayState* play) { if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { if (this->unk_18E < 38) { func_80C114C0(this, play); - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; } else { return; } @@ -676,9 +676,9 @@ void func_80C11F6C(EnThiefbird* this, PlayState* play) { Animation_MorphToLoop(&this->skelAnime, &gTakkuriFlyWithItemAnim, -4.0f); func_80C10984(this, 15); if (this->actor.colChkInfo.damageEffect != 3) { - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; } else { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if (this->actor.colChkInfo.damageEffect == 5) { @@ -725,7 +725,7 @@ void func_80C1215C(EnThiefbird* this, PlayState* play) { if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { if (this->unk_18E < 38) { func_80C114C0(this, play); - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; } else { return; } @@ -790,7 +790,7 @@ void func_80C1242C(EnThiefbird* this) { this->actor.flags |= ACTOR_FLAG_10; this->collider.base.acFlags |= AC_ON; this->actionFunc = func_80C124B0; - this->actor.speedXZ = 12.0f; + this->actor.speed = 12.0f; } void func_80C124B0(EnThiefbird* this, PlayState* play) { @@ -853,7 +853,7 @@ void func_80C12744(EnThiefbird* this) { this->collider.base.acFlags |= AC_ON; this->actor.flags |= ACTOR_FLAG_10; this->actionFunc = func_80C127F4; - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; this->skelAnime.playSpeed = 3.0f; } @@ -891,9 +891,9 @@ void func_80C127F4(EnThiefbird* this, PlayState* play) { temp_v0 = CLAMP(temp_v0, -0x3000, 0x3000); Math_SmoothStepToS(&this->actor.shape.rot.x, temp_v0, 4, 0x800, 0x80); temp_f0 = Actor_WorldDistXYZToPoint(&this->unk_3EC->actor, &this->limbPos[9]); - this->actor.speedXZ = (0.02f * temp_f0) + 2.0f; - this->actor.speedXZ = CLAMP_MAX(this->actor.speedXZ, 4.0f); - if ((this->unk_3EC->actor.speedXZ <= 0.0f) && (temp_f0 < 40.0f)) { + this->actor.speed = (0.02f * temp_f0) + 2.0f; + this->actor.speed = CLAMP_MAX(this->actor.speed, 4.0f); + if ((this->unk_3EC->actor.speed <= 0.0f) && (temp_f0 < 40.0f)) { s32 i; this->unk_3EC->unk152 = 0; @@ -908,7 +908,7 @@ void func_80C127F4(EnThiefbird* this, PlayState* play) { this->unk_190 = -0x3800; } } else { - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; if (this->actor.bgCheckFlags & 8) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 6, 0x1000, 0x100); } else { 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 6d25e639ea..7c04554b63 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -287,7 +287,7 @@ void func_80893E54(EnTite* this, PlayState* play) { void func_80893ED4(EnTite* this) { Animation_MorphToLoop(&this->skelAnime, &object_tite_Anim_0012E4, 4.0f); this->unk_2BC = Rand_S16Offset(15, 30); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80893F30; } @@ -305,7 +305,7 @@ void func_80893F30(EnTite* this, PlayState* play) { void func_80893FD0(EnTite* this) { Animation_PlayOnce(&this->skelAnime, &object_tite_Anim_00083C); this->actor.velocity.y = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = func_80894024; } @@ -358,7 +358,7 @@ void func_8089408C(EnTite* this, PlayState* play) { this->actor.bgCheckFlags &= ~(0x40 | 0x20 | 0x2 | 0x1); this->actor.gravity = -1.0f; - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; this->actionFunc = func_808942B4; } @@ -366,7 +366,7 @@ void func_808942B4(EnTite* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (((this->actor.bgCheckFlags & 1) || (func_80893ADC(this) && (this->actor.depthInWater > 0.0f))) && (this->actor.velocity.y <= 0.0f)) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->collider.base.atFlags &= ~AT_HIT; if (!func_80893ADC(this)) { func_80893BCC(this, play); @@ -430,7 +430,7 @@ void func_808945B4(EnTite* this, PlayState* play) { void func_808945EC(EnTite* this) { Animation_PlayLoop(&this->skelAnime, &object_tite_Anim_000A14); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; this->actionFunc = func_80894638; } @@ -480,7 +480,7 @@ void func_8089484C(EnTite* this) { } this->actor.velocity.y = 9.5f; this->actor.gravity = -1.0f; - this->actor.speedXZ = 4.0f; + this->actor.speed = 4.0f; if (func_80893ADC(this)) { this->actor.world.pos.y += this->actor.depthInWater; Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_JUMP_WATER); @@ -493,7 +493,7 @@ void func_8089484C(EnTite* this) { void func_80894910(EnTite* this, PlayState* play) { Vec3f sp34; - Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 1.0f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.1f, 1.0f, 0.0f); SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & 0x40) { Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_LAND_WATER); @@ -510,7 +510,7 @@ void func_80894910(EnTite* this, PlayState* play) { if (((this->actor.bgCheckFlags & 1) || (func_80893ADC(this) && (this->actor.depthInWater > 0.0f))) && (this->actor.velocity.y <= 0.0f)) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4000); this->actor.world.rot.y = this->actor.shape.rot.y; @@ -536,7 +536,7 @@ void func_80894910(EnTite* this, PlayState* play) { void func_80894B2C(EnTite* this) { Animation_MorphToLoop(&this->skelAnime, &object_tite_Anim_0012E4, 4.0f); - this->actor.speedXZ = -6.0f; + this->actor.speed = -6.0f; this->actor.gravity = -1.0f; if (this->collider.base.ac != NULL) { func_800BE568(&this->actor, &this->collider); @@ -548,7 +548,7 @@ void func_80894B2C(EnTite* this) { } void func_80894BC8(EnTite* this, PlayState* play) { - Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f); SkelAnime_Update(&this->skelAnime); if (func_80893ADC(this) && (this->actor.velocity.y <= 0.0f)) { this->actor.gravity = 0.0f; @@ -562,7 +562,7 @@ void func_80894BC8(EnTite* this, PlayState* play) { func_80893BCC(this, play); } - if ((this->actor.speedXZ == 0.0f) && ((this->actor.bgCheckFlags & 1) || func_80893ADC(this))) { + if ((this->actor.speed == 0.0f) && ((this->actor.bgCheckFlags & 1) || func_80893ADC(this))) { this->actor.world.rot.y = this->actor.shape.rot.y; this->collider.base.acFlags |= AC_ON; if ((Player_GetMask(play) == PLAYER_MASK_STONE) || @@ -579,7 +579,7 @@ void func_80894BC8(EnTite* this, PlayState* play) { } void func_80894DD0(EnTite* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.velocity.y > 0.0f) { this->actor.velocity.y = 0.0f; } @@ -629,7 +629,7 @@ void func_80895020(EnTite* this, PlayState* play) { f32 temp_f0; Vec3f* ptr; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->collider.base.acFlags &= ~AC_ON; this->actor.colorFilterTimer = 0; SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_TEKU_DEAD); @@ -640,7 +640,7 @@ void func_80895020(EnTite* this, PlayState* play) { this->unk_2BC = 25; this->actor.gravity = -0.58f; this->actor.velocity.y = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; ptr = &this->unk_33C[0]; for (i = 0; i < ARRAY_COUNT(this->limbPos); i++, ptr++) { @@ -685,7 +685,7 @@ void func_808952EC(EnTite* this) { func_80893A18(this); this->unk_2B9 = 1; this->unk_2BC = 400; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.gravity = -1.0f; this->unk_2B8 = Rand_ZeroOne() * 50.0f; this->actor.bgCheckFlags &= ~1; @@ -770,7 +770,7 @@ void func_80895738(EnTite* this, PlayState* play) { } if (this->unk_2BC == -1) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.3f); + Math_StepToF(&this->actor.speed, 0.0f, 0.3f); if (this->actor.bgCheckFlags & 1) { this->actor.world.rot.y = this->actor.shape.rot.y; func_80893ED4(this); @@ -778,13 +778,13 @@ void func_80895738(EnTite* this, PlayState* play) { } } else if (this->unk_2BC > 0) { this->unk_2BC--; - Math_StepToF(&this->actor.speedXZ, 10.0f, 0.3f); + Math_StepToF(&this->actor.speed, 10.0f, 0.3f); this->actor.flags |= ACTOR_FLAG_1000000; CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); if (!func_80893A34(this, play)) { this->unk_2BC = 0; } - } else if ((this->unk_2BC == 0) && Math_StepToF(&this->actor.speedXZ, 0.0f, 0.3f)) { + } else if ((this->unk_2BC == 0) && Math_StepToF(&this->actor.speed, 0.0f, 0.3f)) { this->actor.world.rot.y = this->actor.shape.rot.y; func_80893A18(this); if ((Player_GetMask(play) == PLAYER_MASK_STONE) || (this->actor.xzDistToPlayer > 450.0f) || @@ -796,7 +796,7 @@ void func_80895738(EnTite* this, PlayState* play) { func_80893A9C(this, play); } } - this->actor.shape.rot.y += (s16)(this->actor.speedXZ * 768.0f); + this->actor.shape.rot.y += (s16)(this->actor.speed * 768.0f); } void func_8089595C(EnTite* this, PlayState* play) { @@ -813,7 +813,7 @@ void func_80895A10(EnTite* this) { s16 rand; Animation_Change(&this->skelAnime, &object_tite_Anim_000A14, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 4.0f); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; rand = Rand_S16Offset(20, 20); this->unk_2BC = ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * rand; this->actionFunc = func_80895AC0; @@ -862,7 +862,7 @@ void func_80895AC0(EnTite* this, PlayState* play) { void func_80895CB0(EnTite* this) { this->skelAnime.playSpeed = 1.0f; - this->actor.speedXZ = 1.0f; + this->actor.speed = 1.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_2BC = Rand_S16Offset(20, 20); this->actionFunc = func_80895D08; @@ -890,7 +890,7 @@ void func_80895DE8(EnTite* this) { this->collider.base.acFlags &= ~AC_ON; this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->skelAnime.playSpeed = 1.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80895E28; } 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 d73045928a..57ad2b8fc1 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -299,7 +299,7 @@ void func_80AECA90(EnTk* this, PlayState* play) { } void func_80AECB0C(EnTk* this, PlayState* play) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_3CC = 0xFF; this->unk_2DC = 0.0f; SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4); @@ -631,7 +631,7 @@ void func_80AED610(EnTk* this, PlayState* play) { void func_80AED898(EnTk* this, PlayState* play) { this->unk_316 = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->unk_2CA & 0x1000) { if ((this->unk_2D4 == 4) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4); @@ -706,7 +706,7 @@ void func_80AED940(EnTk* this, PlayState* play) { void func_80AEDBEC(EnTk* this, PlayState* play) { this->actor.params = -1; this->unk_2E8 = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); this->actionFunc = func_80AEDC4C; } @@ -721,7 +721,7 @@ void func_80AEDC4C(EnTk* this, PlayState* play) { } void func_80AEDCBC(EnTk* this, PlayState* play) { - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 5, &this->unk_2D4); Math_Vec3f_Copy(&this->actor.world.pos, &this->unk_2EC); Math_Vec3f_Copy(&this->actor.prevPos, &this->unk_2EC); @@ -740,7 +740,7 @@ void func_80AEDD4C(EnTk* this, PlayState* play) { } void func_80AEDDA0(EnTk* this, PlayState* play) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); this->actor.flags |= ACTOR_FLAG_10000; this->unk_2CA |= 0x80; @@ -1183,10 +1183,10 @@ void func_80AEED38(EnTk* this, PlayState* play) { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); } else { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4); - func_80AEC658(&this->skelAnime, this->unk_320, 1.0f, &this->actor.speedXZ, &sp64); + func_80AEC658(&this->skelAnime, this->unk_320, 1.0f, &this->actor.speed, &sp64); } - if (this->actor.speedXZ > 0.5f) { + if (this->actor.speed > 0.5f) { Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2CC, 2, 0xAAA, 1); this->actor.shape.rot.y = this->actor.world.rot.y; } @@ -1210,17 +1210,17 @@ void func_80AEF094(EnTk* this, PlayState* play) { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); } else { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4); - func_80AEC658(&this->skelAnime, this->unk_320, 1.0f, &this->actor.speedXZ, &sp2C); + func_80AEC658(&this->skelAnime, this->unk_320, 1.0f, &this->actor.speed, &sp2C); } - if (this->actor.speedXZ >= 0.5f) { + if (this->actor.speed >= 0.5f) { Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 2, 0x38E, 1); this->actor.shape.rot.y = this->actor.world.rot.y; } } void func_80AEF15C(EnTk* this, PlayState* play) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); this->unk_30C = func_80AEF1B4; } @@ -1237,7 +1237,7 @@ void func_80AEF210(EnTk* this, PlayState* play) { } void func_80AEF220(EnTk* this, PlayState* play) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); this->unk_30C = func_80AEF278; } 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 bad027d349..4693183de2 100644 --- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c +++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c @@ -176,7 +176,7 @@ void func_80AD3530(EnTrt2* this, PlayState* play) { this->unk_1E4++; } } - Math_ApproachF(&this->actor.speedXZ, 1.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 1.5f, 0.2f, 1.0f); } Actor_MoveWithGravity(&this->actor); @@ -277,7 +277,7 @@ void func_80AD38B8(EnTrt2* this, PlayState* play) { sp30.y = this->actor.wallYaw; } } - Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 5.0f, 0.2f, 1.0f); } Actor_MoveWithoutGravity(&this->actor); @@ -286,8 +286,8 @@ void func_80AD38B8(EnTrt2* this, PlayState* play) { void func_80AD3A24(EnTrt2* this, PlayState* play) { func_80AD46F8(this); - if (this->actor.speedXZ > 0.05f) { - Math_ApproachF(&this->actor.speedXZ, 0.0f, 0.2f, 1.0f); + if (this->actor.speed > 0.05f) { + Math_ApproachF(&this->actor.speed, 0.0f, 0.2f, 1.0f); } else if (DECR(this->unk_3AE) == 0) { this->unk_3AE = Rand_S16Offset(100, 50); EnTrt2_ChangeAnim(&this->skelAnime, sAnimationInfo, TRT2_ANIM_HOVER); @@ -663,7 +663,7 @@ s32 func_80AD4B4C(EnTrt2* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { sp24 = true; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; func_80AD349C(this); this->unk_3B4 = this->unk_3B2; if (this->actor.bgCheckFlags & 1) { @@ -702,7 +702,7 @@ s32 func_80AD4CCC(EnTrt2* this, PlayState* play) { if (((this->unk_3B2 == 4) || (this->unk_3B2 == 5)) && this->actor.isTargeted && !(this->actor.bgCheckFlags & 1) && ((player->transformation == PLAYER_FORM_HUMAN) || (player->transformation == PLAYER_FORM_FIERCE_DEITY))) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 1.5f; this->unk_3B2 = 16; return true; 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 f9654349e2..24ce7fdaa5 100644 --- a/src/overlays/actors/ovl_En_Tru/z_en_tru.c +++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.c @@ -736,7 +736,7 @@ s32 func_80A87400(EnTru* this, PlayState* play) { this->unk_360 = CLAMP(this->unk_360 + 2000, 0, 0x4000); Math_ApproachF(&this->unk_35C, 30.0f, 0.08f, 1000.0f); - Math_ApproachF(&this->actor.speedXZ, 30.0f, 0.2f, 1000.0f); + Math_ApproachF(&this->actor.speed, 30.0f, 0.2f, 1000.0f); if (this->path != NULL) { sp4C = Lib_SegmentedToVirtual(this->path->points); 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 504fffffaf..8a680277df 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 @@ -247,13 +247,13 @@ void func_80B76440(EnTruMt* this, PlayState* play) { s16 temp_v1 = this->unk_394 - Math_Vec3f_Yaw(&this->unk_398, &this->actor.world.pos); if ((temp_v1 <= -0x2000) || (temp_v1 >= 0x2000)) { - Math_ApproachF(&this->actor.speedXZ, 7.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 7.0f, 0.2f, 1.0f); } else if (this->actor.xzDistToPlayer < 300.0f) { - Math_ApproachF(&this->actor.speedXZ, 7.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 7.0f, 0.2f, 1.0f); } else if (this->actor.xzDistToPlayer > 500.0f) { - Math_ApproachF(&this->actor.speedXZ, 2.5f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 2.5f, 0.2f, 1.0f); } else { - Math_ApproachF(&this->actor.speedXZ, 4.0f, 0.2f, 1.0f); + Math_ApproachF(&this->actor.speed, 4.0f, 0.2f, 1.0f); } } } @@ -347,7 +347,7 @@ void func_80B76980(EnTruMt* this, PlayState* play) { SET_EVENTINF(EVENTINF_36); SET_EVENTINF(EVENTINF_40); player->stateFlags3 &= ~PLAYER_STATE3_400; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80B76BB8; } else if (CHECK_EVENTINF(EVENTINF_40)) { u32 score = gSaveContext.minigameScore; @@ -381,7 +381,7 @@ void func_80B76A64(EnTruMt* this, PlayState* play) { if (func_80B76600(this, this->path, this->unk_36C)) { if (this->unk_36C >= (this->path->count - 1)) { this->actionFunc = func_80B76C38; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; return; } this->unk_36C++; 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 c14e478d62..8ed93d9659 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 @@ -257,7 +257,7 @@ void EnTuboTrap_Levitate(EnTuboTrap* this, PlayState* play) { Math_ApproachF(&this->actor.world.pos.y, this->targetHeight, 0.8f, 3.0f); if (fabsf(this->actor.world.pos.y - this->targetHeight) < 10.0f) { - this->actor.speedXZ = 10.0f; + this->actor.speed = 10.0f; this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actionFunc = EnTuboTrap_FlyAtPlayer; } 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 e5479a1d7d..d70d2c43a9 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -376,7 +376,7 @@ void func_808CCBE4(EnVm* this, PlayState* play) { this->actor.world.pos.y = this->actor.focus.pos.y; this->actor.velocity.y = 8.0f; this->actor.gravity = -0.5f; - this->actor.speedXZ = Rand_ZeroOne() + 1.0f; + this->actor.speed = Rand_ZeroOne() + 1.0f; this->unk_210 = 0; this->actor.flags |= ACTOR_FLAG_10; this->actionFunc = func_808CCCF0; 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 910c03cc44..38eb630a37 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -324,7 +324,7 @@ void EnWallmas_Stand(EnWallmas* this, PlayState* play) { void EnWallmas_SetupWalk(EnWallmas* this) { Animation_PlayOnceSetSpeed(&this->skelAnime, &gWallmasterWalkAnim, 3.0f); - this->actor.speedXZ = 3.0f; + this->actor.speed = 3.0f; this->actionFunc = EnWallmas_Walk; } @@ -343,7 +343,7 @@ void EnWallmas_Walk(EnWallmas* this, PlayState* play) { void EnWallmas_SetupJumpToCeiling(EnWallmas* this) { Animation_PlayOnce(&this->skelAnime, &gWallmasterStopWalkAnim); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = EnWallmas_JumpToCeiling; } @@ -355,7 +355,7 @@ void EnWallmas_JumpToCeiling(EnWallmas* this, PlayState* play) { void EnWallmas_SetupReturnToCeiling(EnWallmas* this) { this->timer = 0; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 3.0f, 0.0f, Animation_GetLastFrame(&gWallmasterJumpAnim), ANIMMODE_ONCE, -3.0f); this->actionFunc = EnWallmas_ReturnToCeiling; @@ -398,7 +398,7 @@ void EnWallmas_SetupDamage(EnWallmas* this, s32 arg1) { } Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20); - this->actor.speedXZ = 5.0f; + this->actor.speed = 5.0f; this->actor.velocity.y = 10.0f; this->actionFunc = EnWallmas_Damage; } @@ -416,12 +416,12 @@ void EnWallmas_Damage(EnWallmas* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f); + Math_StepToF(&this->actor.speed, 0.0f, 0.2f); } void EnWallmas_SetupCooldown(EnWallmas* this) { Animation_PlayOnce(&this->skelAnime, &gWallmasterRecoverFromDamageAnim); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnWallmas_Cooldown; @@ -434,7 +434,7 @@ void EnWallmas_Cooldown(EnWallmas* this, PlayState* play) { } void EnWallmas_SetupDie(EnWallmas* this, PlayState* play) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, 250, -10, 2); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 11, NA_SE_EN_EXTINCT); @@ -456,7 +456,7 @@ void EnWallmas_SetupTakePlayer(EnWallmas* this, PlayState* play) { Animation_MorphToPlayOnce(&this->skelAnime, &gWallmasterHoverAnim, -5.0f); this->timer = -30; this->actionFunc = EnWallmas_TakePlayer; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; this->yTarget = this->actor.playerHeightRel; func_800B724C(play, &this->actor, PLAYER_CSMODE_18); @@ -530,7 +530,7 @@ void EnWallmas_WaitForSwitchFlag(EnWallmas* this, PlayState* play) { } void EnWallmas_SetupStun(EnWallmas* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.velocity.y > 0.0f) { this->actor.velocity.y = 0.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 021212ebaa..f647f570fa 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -571,7 +571,7 @@ void func_80991040(EnWf* this, PlayState* play) { void func_809910F0(EnWf* this) { this->collider2.base.acFlags &= ~AC_ON; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Animation_Change(&this->skelAnime, &gWolfosRearUpFallOverAnim, 0.5f, 0.0f, 7.0f, ANIMMODE_ONCE_INTERP, -5.0f); this->unk_2A0 = 5; this->actionFunc = func_80991174; @@ -595,7 +595,7 @@ void func_80991200(EnWf* this) { this->unk_2A0 = (s32)Rand_ZeroFloat(10.0f) + 2; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = func_80991280; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } void func_80991280(EnWf* this, PlayState* play) { @@ -644,7 +644,7 @@ void func_80991438(EnWf* this) { this->collider2.base.acFlags |= AC_ON; Animation_MorphToLoop(&this->skelAnime, &gWolfosRunAnim, -4.0f); this->actor.world.rot.y = this->actor.shape.rot.y; - this->actor.speedXZ = 8.0f; + this->actor.speed = 8.0f; this->actionFunc = func_8099149C; } @@ -761,7 +761,7 @@ void func_80991948(EnWf* this) { } else { this->unk_29A = -16000; } - this->actor.speedXZ = 6.0f; + this->actor.speed = 6.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_2A0 = (s32)Rand_ZeroFloat(30.0f) + 30; this->actionFunc = func_809919F4; @@ -814,7 +814,7 @@ void func_80991C04(EnWf* this) { this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->unk_2A0 = 7; this->skelAnime.endFrame = 20.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80991C80; } @@ -827,7 +827,7 @@ void func_80991C80(EnWf* this, PlayState* play) { sp2A = BINANG_SUB(player->actor.shape.rot.y, this->actor.shape.rot.y); sp30 = ABS_ALT(BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y)); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (((this->skelAnime.curFrame >= 9.0f) && (this->skelAnime.curFrame < 13.0f)) || ((this->skelAnime.curFrame >= 17.0f) && (this->skelAnime.curFrame < 20.0f))) { if (!(this->collider1.base.atFlags & AT_ON)) { @@ -925,7 +925,7 @@ void func_8099223C(EnWf* this) { this->collider2.base.acFlags &= ~AC_ON; Animation_MorphToPlayOnce(&this->skelAnime, &gWolfosBackflipAnim, -3.0f); this->unk_2A0 = 0; - this->actor.speedXZ = -6.0f; + this->actor.speed = -6.0f; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer; Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_JUMP); @@ -949,7 +949,7 @@ void func_809922B4(EnWf* this, PlayState* play) { } void func_809923B0(EnWf* this) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->actor.velocity.y > 0.0f) { this->actor.velocity.y = 0.0f; } @@ -975,7 +975,7 @@ void func_8099245C(EnWf* this) { this->collider2.base.acFlags &= ~AC_ON; Animation_MorphToPlayOnce(&this->skelAnime, &gWolfosDamagedAnim, -4.0f); if (this->actor.bgCheckFlags & 1) { - this->actor.speedXZ = -4.0f; + this->actor.speed = -4.0f; } this->unk_298 = 0; this->actor.world.rot.y = this->actor.yawTowardsPlayer; @@ -987,11 +987,11 @@ void func_809924EC(EnWf* this, PlayState* play) { s16 sp26; if (this->actor.bgCheckFlags & 2) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } - if ((this->actor.bgCheckFlags & 1) && (this->actor.speedXZ < 0.0f)) { - this->actor.speedXZ += 0.05f; + if ((this->actor.bgCheckFlags & 1) && (this->actor.speed < 0.0f)) { + this->actor.speed += 0.05f; } Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3000); @@ -1024,7 +1024,7 @@ void func_809926D0(EnWf* this) { Animation_Change(&this->skelAnime, &gWolfosBackflipAnim, -1.0f, Animation_GetLastFrame(&gWolfosBackflipAnim.common), 0.0f, ANIMMODE_ONCE, -3.0f); this->unk_2A0 = 0; - this->actor.speedXZ = 6.5f; + this->actor.speed = 6.5f; this->actor.velocity.y = 15.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_JUMP); this->actor.world.rot.y = this->actor.shape.rot.y; @@ -1038,7 +1038,7 @@ void func_80992784(EnWf* this, PlayState* play) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.velocity.y = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.world.pos.y = this->actor.floorHeight; if (!Actor_OtherIsTargeted(play, &this->actor)) { func_80991C04(this); @@ -1052,7 +1052,7 @@ void func_8099282C(EnWf* this) { this->collider2.base.acFlags |= AC_ON; this->collider1.base.atFlags &= ~AT_ON; this->unk_2A0 = 10; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; Animation_Change(&this->skelAnime, &gWolfosBlockAnim, -1.0f, Animation_GetLastFrame(&gWolfosBlockAnim.common), 0.0f, ANIMMODE_ONCE, -2.0f); this->actionFunc = func_809928CC; @@ -1103,7 +1103,7 @@ void func_80992A74(EnWf* this, PlayState* play) { } else { this->unk_29A = -16000; } - this->actor.speedXZ = 6.0f; + this->actor.speed = 6.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_2A0 = (s32)Rand_ZeroFloat(10.0f) + 5; this->actionFunc = func_80992B8C; @@ -1156,7 +1156,7 @@ void func_80992D6C(EnWf* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gWolfosRearUpFallOverAnim, -4.0f); this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (this->actor.bgCheckFlags & 1) { - this->actor.speedXZ = -6.0f; + this->actor.speed = -6.0f; } this->actor.flags &= ~ACTOR_FLAG_1; this->unk_2A0 = 25; @@ -1168,11 +1168,11 @@ void func_80992E0C(EnWf* this, PlayState* play) { static Vec3f D_809942F0 = { 0.0f, 0.5f, 0.0f }; if (this->actor.bgCheckFlags & 2) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } if (this->actor.bgCheckFlags & 1) { - Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); + Math_StepToF(&this->actor.speed, 0.0f, 0.5f); } if (SkelAnime_Update(&this->skelAnime)) { @@ -1233,7 +1233,7 @@ void func_80993018(EnWf* this, PlayState* play) { void func_80993148(EnWf* this) { Animation_MorphToLoop(&this->skelAnime, &gWolfosRunAnim, -4.0f); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80993194; } @@ -1318,7 +1318,7 @@ void func_809933A0(EnWf* this, PlayState* play) { void func_80993524(EnWf* this) { Animation_MorphToLoop(&this->skelAnime, &gWolfosRunAnim, -4.0f); - this->actor.speedXZ = 6.0f; + this->actor.speed = 6.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = func_8099357C; } 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 5b207816ba..ccf5a374f4 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -436,7 +436,7 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) { if ((this->unk_146 >= -1) && (((player->rideActor == NULL) && (sqrtf(thisx->xyzDistToPlayerSq) < 20.0f) && (player->linearVelocity != 0.0f)) || ((player->rideActor != NULL) && (sqrtf(thisx->xyzDistToPlayerSq) < 60.0f) && - (player->rideActor->speedXZ != 0.0f)))) { + (player->rideActor->speed != 0.0f)))) { func_808C4458(this, play, &thisx->world.pos, 1); this->unk_146 = -0x15; Actor_PlaySfx(thisx, NA_SE_EV_TREE_SWING); 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 06591b3cd3..8c1c9d4937 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -220,8 +220,8 @@ void EnZo_FollowPath(EnZo* this, PlayState* play) { s16 speed; Vec3f pos; - Math_SmoothStepToF(&this->actor.speedXZ, 1.0f, 0.4f, 1000.0f, 0.0f); - speed = this->actor.speedXZ * 400.0f; + Math_SmoothStepToF(&this->actor.speed, 1.0f, 0.4f, 1000.0f, 0.0f); + speed = this->actor.speed * 400.0f; if (SubS_CopyPointFromPath(this->path, this->waypoint, &pos) && SubS_MoveActorToPoint(&this->actor, &pos, speed)) { this->waypoint++; if (this->waypoint >= this->path->count) { @@ -233,7 +233,7 @@ void EnZo_FollowPath(EnZo* this, PlayState* play) { EnZo_ChangeAnim(&this->skelAnime, 1); this->actionFunc = EnZo_TreadWater; this->actor.gravity = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } } 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 d2de680676..81d5583058 100644 --- a/src/overlays/actors/ovl_En_Zog/z_en_zog.c +++ b/src/overlays/actors/ovl_En_Zog/z_en_zog.c @@ -173,7 +173,7 @@ void func_80B93468(EnZog* this, PlayState* play) { this->actor.world.pos.x = points[-1].x; this->actor.world.pos.z = points[-1].z; this->actor.world.rot.y = Math_Atan2S(points->x - this->actor.world.pos.x, points->z - this->actor.world.pos.z); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } } @@ -762,9 +762,9 @@ void func_80B94A00(EnZog* this, PlayState* play) { if ((this->skelAnime.curFrame >= 35.0f) || ((this->skelAnime.curFrame >= 10.0f) && (this->skelAnime.curFrame <= 24.0f))) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { - this->actor.speedXZ = 1.5f; + this->actor.speed = 1.5f; } if ((this->actor.depthInWater > 0.0f) && ((play->gameplayFrames % 8) == 0)) { @@ -795,7 +795,7 @@ void func_80B94A00(EnZog* this, PlayState* play) { } void func_80B94C5C(EnZog* this, PlayState* play) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->unk_304 != 0) { if (this->actor.shape.yOffset > 0.0f) { this->actor.shape.yOffset -= 20.0f; @@ -818,7 +818,7 @@ void func_80B94C5C(EnZog* this, PlayState* play) { void func_80B94D0C(EnZog* this, PlayState* play) { func_80B93D2C(this, play); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; if (this->unk_320 > 0) { this->unk_320--; this->unk_31C = 1; @@ -857,10 +857,10 @@ void func_80B94E34(EnZog* this, PlayState* play) { func_80B93D2C(this, play); func_80B93BE0(this, play); - if (this->actor.speedXZ < 0.1f) { - this->actor.speedXZ = 0.0f; + if (this->actor.speed < 0.1f) { + this->actor.speed = 0.0f; } else { - if (this->actor.speedXZ > 0.1f) { + if (this->actor.speed > 0.1f) { WaterBox* sp44; Vec3f sp38; @@ -871,15 +871,15 @@ void func_80B94E34(EnZog* this, PlayState* play) { if (WaterBox_GetSurface1(play, &play->colCtx, sp38.x, sp38.z, &sp38.y, &sp44) && (this->actor.world.pos.y < sp38.y)) { EffectSsGSplash_Spawn(play, &sp38, NULL, NULL, 1, - Rand_ZeroFloat(this->actor.speedXZ * 40.0f) + (this->actor.speedXZ * 60.0f)); + Rand_ZeroFloat(this->actor.speed * 40.0f) + (this->actor.speed * 60.0f)); } - if ((player->actor.speedXZ > 3.0f) && (this->unk_324 == 0)) { + if ((player->actor.speed > 3.0f) && (this->unk_324 == 0)) { this->unk_324 = 25; Player_PlaySfx(player, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_PUSH); } } - this->actor.speedXZ *= 0.3f; + this->actor.speed *= 0.3f; } if (ABS_ALT(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0x5000) { @@ -892,12 +892,12 @@ void func_80B94E34(EnZog* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actionFunc = func_80B94D0C; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_300 = 2; } else if (this->actor.bgCheckFlags & 1) { this->actor.home.rot.z = 1; this->actionFunc = func_80B94C5C; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->unk_2FE = 1; this->actor.velocity.y = 0.0f; this->actor.terminalVelocity = 0.0f; @@ -922,7 +922,7 @@ void func_80B95128(EnZog* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actionFunc = func_80B94D0C; this->unk_300 = 2; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; switch (CURRENT_DAY) { case 1: 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 288424f7e4..8c45851901 100644 --- a/src/overlays/actors/ovl_En_Zot/z_en_zot.c +++ b/src/overlays/actors/ovl_En_Zot/z_en_zot.c @@ -299,7 +299,7 @@ s32 func_80B96E5C(EnZot* this) { temp_f14 = points->z - this->actor.world.pos.z; this->actor.world.rot.y = Math_Atan2S(temp_f12, temp_f14); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, 2000, 200); - phi_f2 = SQ(this->actor.speedXZ) * SQ(3.0f); + phi_f2 = SQ(this->actor.speed) * SQ(3.0f); if (this->unk_2D4 == 0) { phi_f2 = SQ(20.0f); @@ -652,9 +652,9 @@ void func_80B979DC(EnZot* this, PlayState* play) { if (func_80B96E5C(this)) { this->actionFunc = func_80B97B5C; func_80B96BEC(this, 0, ANIMMODE_LOOP); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { - this->actor.speedXZ = 1.5f; + this->actor.speed = 1.5f; } } @@ -737,10 +737,10 @@ void func_80B97CC8(EnZot* this, PlayState* play) { void func_80B97D6C(EnZot* this, PlayState* play) { if (func_80B96E5C(this)) { this->actionFunc = func_80B97CC8; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; func_80B96BEC(this, 0, ANIMMODE_LOOP); } else { - this->actor.speedXZ = 8.0f; + this->actor.speed = 8.0f; } if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 5.0f)) { @@ -819,9 +819,9 @@ void func_80B980FC(EnZot* this, PlayState* play) { this->actor.home.rot.x--; } else if (func_80B96E5C(this)) { this->actionFunc = func_80B97100; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } else { - this->actor.speedXZ = 8.0f; + this->actor.speed = 8.0f; if (this->unk_2F0 != 3) { func_80B96BEC(this, 3, ANIMMODE_LOOP); } @@ -1295,13 +1295,13 @@ void func_80B992C0(EnZot* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actionFunc = func_80B991E4; func_80B99160(this, play); - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; func_80B96BEC(this, 0, ANIMMODE_LOOP); } else { if (Player_IsFacingActor(&this->actor, 0x3000, play) && (this->actor.xzDistToPlayer < 100.0f)) { func_800B8614(&this->actor, play, 120.0f); } - this->actor.speedXZ = 1.5f; + this->actor.speed = 1.5f; func_80B96FB0(this); } } 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 349521b26e..5b577a53f3 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -235,15 +235,15 @@ void func_809372D0(ObjBean* this) { sp34 = Math3D_Vec3fMagnitude(&actor->velocity); temp_f2 = D_80938FF8[this->unk_1DE].x; temp_f12 = D_80938FF8[this->unk_1DE].z; - if (sp34 < (actor->speedXZ * 8.0f)) { + if (sp34 < (actor->speed * 8.0f)) { temp_f2 = ((temp_f2 - 2.0f) * 0.1f) + 2.0f; temp_f12 *= 0.4f; } - Math_StepToF(&actor->speedXZ, temp_f2, temp_f12); + Math_StepToF(&actor->speed, temp_f2, temp_f12); - if ((actor->speedXZ + 0.05f) < sp34) { - Math_Vec3f_Scale(&actor->velocity, actor->speedXZ / sp34); + if ((actor->speed + 0.05f) < sp34) { + Math_Vec3f_Scale(&actor->velocity, actor->speed / sp34); this->unk_1BC.x += actor->velocity.x; this->unk_1BC.y += actor->velocity.y; this->unk_1BC.z += actor->velocity.z; @@ -255,7 +255,7 @@ void func_809372D0(ObjBean* this) { } else { this->unk_1DC++; } - actor->speedXZ *= 0.5f; + actor->speed *= 0.5f; } } @@ -775,7 +775,7 @@ void func_80938874(ObjBean* this) { this->actionFunc = func_809388A8; this->dyna.actor.draw = func_80938E00; this->dyna.actor.flags |= ACTOR_FLAG_10; - this->dyna.actor.speedXZ = 0.0f; + this->dyna.actor.speed = 0.0f; } void func_809388A8(ObjBean* this, PlayState* play) { 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 e4b69cbd25..cc94527a0b 100644 --- a/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c +++ b/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c @@ -111,7 +111,7 @@ void ObjBoat_Update(Actor* thisx, PlayState* play) { } this->timer = 60; } - } else if (this->dyna.actor.speedXZ == 0.0f) { + } else if (this->dyna.actor.speed == 0.0f) { if (this->timer != 0) { this->timer--; } @@ -124,7 +124,7 @@ void ObjBoat_Update(Actor* thisx, PlayState* play) { if (this->curPointIndex == this->lastPointIndex) { if (OBJBOAT_GET_4000(thisx)) { this->curPointIndex = 0; - } else if (this->dyna.actor.speedXZ == 0.0f) { + } else if (this->dyna.actor.speed == 0.0f) { this->curPointIndex = 0; this->direction = -1; } @@ -135,11 +135,11 @@ void ObjBoat_Update(Actor* thisx, PlayState* play) { } if (player->csMode != PLAYER_CSMODE_26) { - Math_ScaledStepToS(&this->dyna.actor.shape.rot.y, yawTarget, (s32)(fabsf(this->dyna.actor.speedXZ) * 40.0f)); + Math_ScaledStepToS(&this->dyna.actor.shape.rot.y, yawTarget, (s32)(fabsf(this->dyna.actor.speed) * 40.0f)); this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y; - Math_StepToF(&this->dyna.actor.speedXZ, speedTarget, 0.05f); + Math_StepToF(&this->dyna.actor.speed, speedTarget, 0.05f); Actor_MoveWithGravity(&this->dyna.actor); - if (this->dyna.actor.speedXZ != 0.0f) { + if (this->dyna.actor.speed != 0.0f) { func_800B9010(&this->dyna.actor, NA_SE_EV_PIRATE_SHIP - SFX_FLAG); } } @@ -166,7 +166,7 @@ void ObjBoat_UpdateCutscene(Actor* thisx, PlayState* play2) { this->maxPointIndex = path->count; this->points = Lib_SegmentedToVirtual(path->points); Math_Vec3s_ToVec3f(&this->dyna.actor.world.pos, this->points); - this->dyna.actor.speedXZ = actionIndex->urot.z * (45.0f / 0x2000); + this->dyna.actor.speed = actionIndex->urot.z * (45.0f / 0x2000); this->points++; this->curPointIndex = 1; } @@ -178,8 +178,8 @@ void ObjBoat_UpdateCutscene(Actor* thisx, PlayState* play2) { f32 distRemaining; Math_Vec3s_ToVec3f(&posTarget, this->points); - distRemaining = Math_Vec3f_StepTo(&this->dyna.actor.world.pos, &posTarget, this->dyna.actor.speedXZ); - if ((this->curPointIndex < this->maxPointIndex) && (distRemaining < this->dyna.actor.speedXZ)) { + distRemaining = Math_Vec3f_StepTo(&this->dyna.actor.world.pos, &posTarget, this->dyna.actor.speed); + if ((this->curPointIndex < this->maxPointIndex) && (distRemaining < this->dyna.actor.speed)) { this->points++; this->curPointIndex++; } 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 6e0e7b6acb..24b4188975 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -303,10 +303,10 @@ void func_8098D99C(ObjComb* this, PlayState* play) { temp_v0->parent = &this->actor; if (this->actionFunc == func_8098DC60) { temp_v0->velocity.y = 8.0f; - temp_v0->speedXZ = 2.0f; + temp_v0->speed = 2.0f; } else { temp_v0->velocity.y = 10.0f; - temp_v0->speedXZ = 2.0f; + temp_v0->speed = 2.0f; } this->unk_1B6 = 1; play_sound(NA_SE_SY_TRE_BOX_APPEAR); @@ -431,7 +431,7 @@ void func_8098DE58(ObjComb* this) { this->unk_1B4 = 100; this->actor.terminalVelocity = -20.0f; this->actor.gravity = -1.5f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_8098DEA0; } 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 9daa20badb..1a9f62edec 100644 --- a/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c +++ b/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c @@ -107,15 +107,15 @@ void ObjDanpeilift_Move(ObjDanpeilift* this, PlayState* play) { step = this->speed * 0.16f; } - Math_StepToF(&thisx->speedXZ, target, step); - if ((thisx->speedXZ + 0.05f) < speed) { - Math_Vec3f_Scale(&thisx->velocity, thisx->speedXZ / speed); + Math_StepToF(&thisx->speed, target, step); + if ((thisx->speed + 0.05f) < speed) { + Math_Vec3f_Scale(&thisx->velocity, thisx->speed / speed); thisx->world.pos.x += thisx->velocity.x; thisx->world.pos.y += thisx->velocity.y; thisx->world.pos.z += thisx->velocity.z; } else { this->curPoint += this->direction; - thisx->speedXZ *= 0.4f; + thisx->speed *= 0.4f; isTeleporting = OBJDANPEILIFT_SHOULD_TELEPORT(thisx); isPosUpdated = true; if (((this->curPoint >= this->endPoint) && (this->direction > 0)) || @@ -154,7 +154,7 @@ void ObjDanpeilift_Wait(ObjDanpeilift* this, PlayState* play) { this->waitTimer--; if (this->waitTimer <= 0) { this->actionFunc = ObjDanpeilift_Move; - this->dyna.actor.speedXZ = 0.0f; + this->dyna.actor.speed = 0.0f; } } 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 f0eaaf25ac..a93ab99bfe 100644 --- a/src/overlays/actors/ovl_Obj_Driftice/z_obj_driftice.c +++ b/src/overlays/actors/ovl_Obj_Driftice/z_obj_driftice.c @@ -358,10 +358,10 @@ void func_80A671E0(ObjDriftice* this, PlayState* play) { phi_f12 = this->unk_23C * 0.13f; } - Math_StepToF(&this->dyna.actor.speedXZ, phi_f0, phi_f12); + Math_StepToF(&this->dyna.actor.speed, phi_f0, phi_f12); - if ((this->dyna.actor.speedXZ + 0.05f) < sp3C) { - Math_Vec3f_Scale(&this->dyna.actor.velocity, this->dyna.actor.speedXZ / sp3C); + if ((this->dyna.actor.speed + 0.05f) < sp3C) { + Math_Vec3f_Scale(&this->dyna.actor.velocity, this->dyna.actor.speed / sp3C); this->dyna.actor.world.pos.x += this->dyna.actor.velocity.x; this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y; this->dyna.actor.world.pos.z += this->dyna.actor.velocity.z; @@ -371,7 +371,7 @@ void func_80A671E0(ObjDriftice* this, PlayState* play) { if (1) {} - this->dyna.actor.speedXZ *= 0.5f; + this->dyna.actor.speed *= 0.5f; if (((this->unk_164 >= this->unk_160) && (this->unk_168 > 0)) || ((this->unk_164 <= 0) && (this->unk_168 < 0))) { if (!OBJDRIFTICE_GET_1000(&this->dyna.actor)) { @@ -421,7 +421,7 @@ void func_80A674A8(ObjDriftice* this) { void func_80A674C4(ObjDriftice* this, PlayState* play) { this->unk_24C--; if (this->unk_24C <= 0) { - this->dyna.actor.speedXZ = 0.0f; + this->dyna.actor.speed = 0.0f; func_80A671CC(this); } } 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 ceedeb6c49..69829d09e1 100644 --- a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c +++ b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c @@ -159,7 +159,7 @@ 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) || + } else if ((player->actor.speed > 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 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 973c40b972..fc046b0609 100644 --- a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c +++ b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c @@ -537,7 +537,7 @@ void func_80A1CC0C(ObjFlowerpot* this, PlayState* play) { if (Actor_HasNoParent(&this->actor, play)) { this->actor.room = play->roomCtx.curRoom.num; - if (fabsf(this->actor.speedXZ) < 0.1f) { + if (fabsf(this->actor.speed) < 0.1f) { func_80A1C818(this); Player_PlaySfx(GET_PLAYER(play), NA_SE_PL_PUT_DOWN_POT); this->collider.base.ocFlags1 &= ~OC1_TYPE_PLAYER; 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 a803f7904d..b0557d483a 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 @@ -246,8 +246,8 @@ void func_809AB610(ObjGrassCarry* this, PlayState* play) { if (Actor_HasNoParent(&this->actor, play)) { func_809AB6FC(this); - this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; - this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; + this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speed; + this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speed; this->actor.gravity = -0.1f; this->actor.terminalVelocity = -17.0f; func_809AAF18(this); 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 1e7b8c7679..85b23d232b 100644 --- a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c +++ b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c @@ -206,10 +206,10 @@ s32 func_80A236D4(ObjIceblock* this, Vec3f* arg1) { s32 sp20; sp26 = Math_Vec3f_Yaw(&this->dyna.actor.world.pos, arg1); - sp2C = Math_SinS(sp26) * this->dyna.actor.speedXZ; + sp2C = Math_SinS(sp26) * this->dyna.actor.speed; sp2C = fabsf(sp2C) + 0.01f; - sp28 = Math_CosS(sp26) * this->dyna.actor.speedXZ; + sp28 = Math_CosS(sp26) * this->dyna.actor.speed; sp28 = fabsf(sp28) + 0.01f; sp20 = Math_StepToF(&this->dyna.actor.world.pos.x, arg1->x, sp2C); @@ -892,7 +892,7 @@ void func_80A25440(ObjIceblock* this) { } static InitChainEntry sInitChain[] = { - ICHAIN_F32_DIV1000(speedXZ, 16000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(speed, 16000, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1800, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(terminalVelocity, -26000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), 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 e0c642131a..977ed92c89 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -340,7 +340,7 @@ void ObjKibako_Held(ObjKibako* this, PlayState* play) { func_80926394(this, play); if (Actor_HasNoParent(&this->actor, play)) { this->actor.room = play->roomCtx.curRoom.num; - if (fabsf(this->actor.speedXZ) < 0.1f) { + if (fabsf(this->actor.speed) < 0.1f) { ObjKibako_SetupIdle(this); this->collider.base.ocFlags1 &= ~OC1_TYPE_PLAYER; Actor_PlaySfx(&this->actor, NA_SE_EV_PUT_DOWN_WOODBOX); 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 2f092a4f9f..e9ca6aba89 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -128,7 +128,7 @@ void ObjKibako2_SpawnSkulltula(ObjKibako2* this, PlayState* play) { if (skulltula != NULL) { skulltula->parent = &this->dyna.actor; skulltula->velocity.y = 13.0f; - skulltula->speedXZ = 0.0f; + skulltula->speed = 0.0f; } } } 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 9c9215b24f..7e568ee170 100644 --- a/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.c +++ b/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.c @@ -53,9 +53,9 @@ void ObjKinoko_Update(Actor* thisx, PlayState* play) { return; } Actor_PickUp(thisx, play, GI_MAX, 20.0f, 10.0f); - if (Math_SmoothStepToF(&thisx->speedXZ, 0.0f, 0.04f, 2.0f, 0.5f) < 0.5f) { + if (Math_SmoothStepToF(&thisx->speed, 0.0f, 0.04f, 2.0f, 0.5f) < 0.5f) { thisx->scale.x = 0.0f; - thisx->speedXZ = 110.0f; + thisx->speed = 110.0f; thisx->velocity.x = 0.2f; } if (Math_SmoothStepToF(&thisx->scale.x, thisx->velocity.x, 0.04f, 0.004f, 0.001f) < @@ -76,7 +76,7 @@ void ObjKinoko_Draw(Actor* thisx, PlayState* play) { func_8012C2DC(play->state.gfxCtx); gfx = POLY_XLU_DISP; - gDPSetPrimColor(&gfx[0], 0, 0, 169, 63, 186, (u8)thisx->speedXZ); + gDPSetPrimColor(&gfx[0], 0, 0, 169, 63, 186, (u8)thisx->speed); gDPSetEnvColor(&gfx[1], 110, 44, 200, 100); gDPSetRenderMode(&gfx[2], G_RM_PASS, G_RM_ZB_CLD_SURF2); gSPMatrix(&gfx[3], Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); 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 a4b211bef6..7be450b3b5 100644 --- a/src/overlays/actors/ovl_Obj_Lupygamelift/z_obj_lupygamelift.c +++ b/src/overlays/actors/ovl_Obj_Lupygamelift/z_obj_lupygamelift.c @@ -131,7 +131,7 @@ void func_80AF04D8(ObjLupygamelift* this, PlayState* play) { void func_80AF0514(ObjLupygamelift* this) { this->actionFunc = func_80AF0530; - this->dyna.actor.speedXZ = this->targetSpeedXZ; + this->dyna.actor.speed = this->targetSpeedXZ; } void func_80AF0530(ObjLupygamelift* this, PlayState* play) { @@ -141,11 +141,11 @@ void func_80AF0530(ObjLupygamelift* this, PlayState* play) { target.x = this->points[this->pointIndex].x; target.y = this->points[this->pointIndex].y; target.z = this->points[this->pointIndex].z; - distRemaining = Math_Vec3f_StepTo(&this->dyna.actor.world.pos, &target, this->dyna.actor.speedXZ); + distRemaining = Math_Vec3f_StepTo(&this->dyna.actor.world.pos, &target, this->dyna.actor.speed); if (distRemaining > 30.0f) { - Math_SmoothStepToF(&this->dyna.actor.speedXZ, this->targetSpeedXZ, 0.5f, 5.0f, 0.1f); + Math_SmoothStepToF(&this->dyna.actor.speed, this->targetSpeedXZ, 0.5f, 5.0f, 0.1f); } else if (distRemaining > 0.0f) { - Math_SmoothStepToF(&this->dyna.actor.speedXZ, 5.0f, 0.5f, 5.0f, 1.0f); + Math_SmoothStepToF(&this->dyna.actor.speed, 5.0f, 0.5f, 5.0f, 1.0f); } else { if (this->pointIndex < (this->count - 1)) { this->pointIndex++; 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 5fea12dd0e..d544fcbfcb 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -95,11 +95,11 @@ void func_8099FB64(Actor* thisx, PlayState* play) { actor->parent = thisx; if (rotCheck) { actor->velocity.y = 10.0f; - actor->speedXZ = 3.0f; + actor->speed = 3.0f; } else { speedXZ = sqrtf((destVec.x * destVec.x) + (destVec.z * destVec.z)); actor->velocity.y = (4 * destVec.y) + 4.0f; - actor->speedXZ = (2 * speedXZ) + 2.0f; + actor->speed = (2 * speedXZ) + 2.0f; } } } 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 a0d1b85a66..0a3f703fbd 100644 --- a/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c +++ b/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c @@ -314,17 +314,17 @@ void func_80BA2C94(ObjNozoki* this, PlayState* play) { Flags_UnsetSwitch(play, this->dyna.actor.world.rot.x); } - Math_StepToF(&this->dyna.actor.speedXZ, D_80BA34E4[this->unk_15D], 0.1f); + Math_StepToF(&this->dyna.actor.speed, D_80BA34E4[this->unk_15D], 0.1f); if ((play->actorCtx.flags & ACTORCTX_FLAG_6) || (play->actorCtx.flags & ACTORCTX_FLAG_5)) { temp_f0 = 0.5f; } else { - temp_f0 = this->dyna.actor.speedXZ; + temp_f0 = this->dyna.actor.speed; } sp34 = Math_Vec3f_StepToXZ(&this->dyna.actor.world.pos, &this->dyna.actor.home.pos, temp_f0); - D_80BA36B8 += this->dyna.actor.speedXZ; + D_80BA36B8 += this->dyna.actor.speed; if (play->actorCtx.flags & ACTORCTX_FLAG_6) { if (sp34 <= 5.0f) { @@ -355,14 +355,14 @@ void func_80BA2C94(ObjNozoki* this, PlayState* play) { } } - this->dyna.actor.velocity.x += this->dyna.actor.speedXZ * 0.66f; + this->dyna.actor.velocity.x += this->dyna.actor.speed * 0.66f; if (this->dyna.actor.velocity.x >= 0x10000) { this->dyna.actor.velocity.x -= 0x10000; } play->roomCtx.unk7A[0] = this->dyna.actor.velocity.x; - func_8019FAD8(&gSfxDefaultPos, NA_SE_EV_SECOM_CONVEYOR - SFX_FLAG, this->dyna.actor.speedXZ); + func_8019FAD8(&gSfxDefaultPos, NA_SE_EV_SECOM_CONVEYOR - SFX_FLAG, this->dyna.actor.speed); } void func_80BA3044(ObjNozoki* this, PlayState* play) { 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 3a25ef4020..00d3048848 100644 --- a/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c +++ b/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c @@ -99,7 +99,7 @@ void func_80AC96A4(ObjOcarinalift* this, PlayState* play) { void func_80AC96B4(ObjOcarinalift* this) { this->actionFunc = func_80AC96D0; - this->dyna.actor.speedXZ = 0.0f; + this->dyna.actor.speed = 0.0f; } void func_80AC96D0(ObjOcarinalift* this, PlayState* play) { @@ -125,9 +125,9 @@ void func_80AC96D0(ObjOcarinalift* this, PlayState* play) { phi_fa0 = this->unk160 * 0.16f; } - Math_StepToF(&thisx->speedXZ, phi_fv0, phi_fa0); - if ((thisx->speedXZ + 0.05f) < magnitude) { - Math_Vec3f_Scale(&thisx->velocity, thisx->speedXZ / magnitude); + Math_StepToF(&thisx->speed, phi_fv0, phi_fa0); + if ((thisx->speed + 0.05f) < magnitude) { + Math_Vec3f_Scale(&thisx->velocity, thisx->speed / magnitude); thisx->world.pos.x += thisx->velocity.x; thisx->world.pos.y += thisx->velocity.y; thisx->world.pos.z += thisx->velocity.z; @@ -135,7 +135,7 @@ void func_80AC96D0(ObjOcarinalift* this, PlayState* play) { paramsC = OBJOCARINALIFT_GET_C(thisx); sp34 = true; this->unk168 += this->unk16C; - thisx->speedXZ *= 0.4f; + thisx->speed *= 0.4f; if (((this->unk168 >= this->unk164) && (this->unk16C > 0)) || ((this->unk168 <= 0) && (this->unk16C < 0))) { if (paramsC == OBJOCARINALIFT_PARAMSC_0) { this->unk16C = -this->unk16C; 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 d0a705cf26..0fdf0a86b0 100644 --- a/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c +++ b/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c @@ -141,15 +141,15 @@ void ObjRaillift_Move(ObjRaillift* this, PlayState* play) { step = this->speed * 0.16f; } - Math_StepToF(&thisx->speedXZ, target, step); - if ((thisx->speedXZ + 0.05f) < speed) { - Math_Vec3f_Scale(&thisx->velocity, thisx->speedXZ / speed); + Math_StepToF(&thisx->speed, target, step); + if ((thisx->speed + 0.05f) < speed) { + Math_Vec3f_Scale(&thisx->velocity, thisx->speed / speed); thisx->world.pos.x += thisx->velocity.x; thisx->world.pos.y += thisx->velocity.y; thisx->world.pos.z += thisx->velocity.z; } else { this->curPoint += this->direction; - thisx->speedXZ *= 0.4f; + thisx->speed *= 0.4f; isTeleporting = OBJRAILLIFT_SHOULD_TELEPORT(thisx); isPosUpdated = true; if (((this->curPoint >= this->endPoint) && (this->direction > 0)) || @@ -191,13 +191,13 @@ void ObjRaillift_Wait(ObjRaillift* this, PlayState* play) { this->waitTimer--; if (this->waitTimer <= 0) { this->actionFunc = ObjRaillift_Move; - this->dyna.actor.speedXZ = 0.0f; + this->dyna.actor.speed = 0.0f; } } void ObjRaillift_Idle(ObjRaillift* this, PlayState* play) { if (Flags_GetSwitch(play, OBJRAILLIFT_GET_FLAG(&this->dyna.actor))) { - this->dyna.actor.speedXZ = 0.0f; + this->dyna.actor.speed = 0.0f; ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); this->actionFunc = ObjRaillift_StartCutscene; } 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 de220e7a8d..fde4204a97 100644 --- a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c +++ b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c @@ -417,7 +417,7 @@ void func_80B39FA8(ObjSnowball2* this, PlayState* play) { if (Actor_HasNoParent(&this->actor, play)) { this->actor.room = play->roomCtx.curRoom.num; - this->actor.speedXZ *= 3.8f; + this->actor.speed *= 3.8f; this->actor.velocity.y *= 0.4f; this->actor.gravity = -2.8f; Actor_MoveWithGravity(&this->actor); @@ -470,7 +470,7 @@ void func_80B3A13C(ObjSnowball2* this, PlayState* play) { sp30 = false; if (this->actor.bgCheckFlags & 0x60) { - if ((this->actor.bgCheckFlags & 0x40) || (this->actor.speedXZ > 3.0f)) { + if ((this->actor.bgCheckFlags & 0x40) || (this->actor.speed > 3.0f)) { if (this->actor.depthInWater < (1200.0f * this->actor.scale.y)) { func_80B39470(&this->actor, play); func_80B395EC(&this->actor, play); @@ -488,20 +488,20 @@ void func_80B3A13C(ObjSnowball2* this, PlayState* play) { this->unk_1AA >>= 1; if (sp34) { - this->actor.speedXZ *= 0.8f; + this->actor.speed *= 0.8f; } else { - this->actor.speedXZ *= 0.65f; + this->actor.speed *= 0.65f; } this->actor.velocity.y *= 0.27f; this->actor.gravity *= 0.27f; - if (this->actor.speedXZ < 0.4f) { + if (this->actor.speed < 0.4f) { sp30 = true; } } else { if (sp34) { - this->actor.speedXZ *= 0.8f; + this->actor.speed *= 0.8f; } else { - this->actor.speedXZ *= 0.96f; + this->actor.speed *= 0.96f; } this->actor.velocity.y *= 0.96f; } @@ -527,7 +527,7 @@ void func_80B3A498(ObjSnowball2* this) { this->actor.home.pos.z = this->actor.world.pos.z; this->actor.world.pos.y = this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y); this->actor.shape.yOffset = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actionFunc = func_80B3A500; } @@ -539,7 +539,7 @@ void func_80B3A500(ObjSnowball2* this, PlayState* play) { this->unk_1AC--; - this->actor.speedXZ *= 0.7f; + this->actor.speed *= 0.7f; this->unk_1A8 >>= 1; this->unk_1AA >>= 1; 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 b4f3c3d98b..4541baa2a1 100644 --- a/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c +++ b/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c @@ -195,10 +195,10 @@ void func_80A1DC5C(ObjSpinyroll* this) { void func_80A1DCCC(ObjSpinyroll* this) { f32 phi_f2; - if (this->dyna.actor.speedXZ > 3.0f) { + if (this->dyna.actor.speed > 3.0f) { phi_f2 = 3.0f; } else { - phi_f2 = this->dyna.actor.speedXZ; + phi_f2 = this->dyna.actor.speed; } if (this->unk_4D4 < phi_f2) { @@ -246,15 +246,15 @@ s32 func_80A1DEB8(ObjSpinyroll* this) { s32 sp30 = this->unk_4A8 ^ 1; Vec3f sp24; - Math_StepToF(&this->dyna.actor.speedXZ, this->unk_4A4, this->unk_4A4 * 0.2f); + Math_StepToF(&this->dyna.actor.speed, this->unk_4A4, this->unk_4A4 * 0.2f); - this->dyna.actor.world.pos.x += this->dyna.actor.speedXZ * this->unk_4C4.x; - this->dyna.actor.world.pos.y += this->dyna.actor.speedXZ * this->unk_4C4.y; - this->dyna.actor.world.pos.z += this->dyna.actor.speedXZ * this->unk_4C4.z; + this->dyna.actor.world.pos.x += this->dyna.actor.speed * this->unk_4C4.x; + this->dyna.actor.world.pos.y += this->dyna.actor.speed * this->unk_4C4.y; + this->dyna.actor.world.pos.z += this->dyna.actor.speed * this->unk_4C4.z; Math_Vec3f_Diff(&this->unk_4AC[sp30], &this->dyna.actor.world.pos, &sp24); - return Math3D_LengthSquared(&sp24) < (SQ(this->dyna.actor.speedXZ) + 0.05f); + return Math3D_LengthSquared(&sp24) < (SQ(this->dyna.actor.speed) + 0.05f); } void func_80A1DFA0(ObjSpinyroll* this) { @@ -517,7 +517,7 @@ void ObjSpinyroll_Destroy(Actor* thisx, PlayState* play) { } void func_80A1E9C4(ObjSpinyroll* this) { - this->dyna.actor.speedXZ = 0.0f; + this->dyna.actor.speed = 0.0f; this->actionFunc = func_80A1E9E0; } @@ -531,7 +531,7 @@ void func_80A1E9E0(ObjSpinyroll* this, PlayState* play) { void func_80A1EA10(ObjSpinyroll* this) { this->actionFunc = func_80A1EA4C; this->unk_4E2 = D_80A1F1E4[OBJSPINYROLL_GET_1C00(&this->dyna.actor)]; - this->dyna.actor.speedXZ = 0.0f; + this->dyna.actor.speed = 0.0f; } void func_80A1EA4C(ObjSpinyroll* this, PlayState* play) { @@ -548,7 +548,7 @@ void func_80A1EA4C(ObjSpinyroll* this, PlayState* play) { void func_80A1EAAC(ObjSpinyroll* this) { this->actionFunc = func_80A1EAE0; this->unk_4DC = D_80A1F20C[this->unk_4A8]; - this->dyna.actor.speedXZ = 0.0f; + this->dyna.actor.speed = 0.0f; } void func_80A1EAE0(ObjSpinyroll* this, PlayState* play) { 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 5782442373..5e6f399a8b 100644 --- a/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.c +++ b/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.c @@ -64,7 +64,7 @@ void func_80C253D0(ObjSwprize* this, PlayState* play) { if (collectible != NULL) { if (sp78.y < 0.98f) { collectible->velocity.y = (sp78.y + 1.0f) * 4.0f; - collectible->speedXZ = (2.0f * (1.0f - fabsf(sp78.y))) + 2.0f; + collectible->speed = (2.0f * (1.0f - fabsf(sp78.y))) + 2.0f; collectible->world.rot.y = Math_Atan2S_XY(sp78.z, sp78.x) + D_80C257F8[i]; } else { collectible->world.rot.y = i * (0x10000 / 3); @@ -75,7 +75,7 @@ void func_80C253D0(ObjSwprize* this, PlayState* play) { collectible = Item_DropCollectible(play, &thisx->world.pos, temp_s0); if ((collectible != NULL) && (sp78.y < 0.98f)) { collectible->velocity.y = (sp78.y + 1.0f) * 4.0f; - collectible->speedXZ = (2.0f * (1.0f - fabsf(sp78.y))) + 2.0f; + collectible->speed = (2.0f * (1.0f - fabsf(sp78.y))) + 2.0f; collectible->world.rot.y = Math_Atan2S_XY(sp78.z, sp78.x); } } 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 6b1058e105..5608143b3b 100644 --- a/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c +++ b/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c @@ -181,7 +181,7 @@ void func_80B9BCBC(ObjTaru* this, PlayState* play) { if (spawnedActor != NULL) { spawnedActor->parent = &this->dyna.actor; spawnedActor->velocity.y = 12.0f; - spawnedActor->speedXZ = 2.0f; + spawnedActor->speed = 2.0f; } } } 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 d9e899a134..b8be7538b2 100644 --- a/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c +++ b/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c @@ -148,7 +148,7 @@ void ObjToge_Init(Actor* thisx, PlayState* play) { Math_Vec3f_Copy(&thisx->world.pos, &this->unk_198[0]); thisx->world.rot.y = Math_Vec3f_Yaw(&this->unk_198[0], &this->unk_198[1]); this->unk_194 = 0; - thisx->speedXZ = 0.0f; + thisx->speed = 0.0f; if (sp3E > 0) { s16 sp36; @@ -228,7 +228,7 @@ void func_809A481C(ObjToge* this, PlayState* play) { } void func_809A488C(ObjToge* this) { - this->actor.speedXZ = 1.0f; + this->actor.speed = 1.0f; this->actionFunc = func_809A48AC; } @@ -237,9 +237,9 @@ void func_809A48AC(ObjToge* this, PlayState* play) { s32 sp30 = this->unk_194 ^ 1; if (this->unk_1B4 && (this->unk_194 == 1)) { - Math_StepToF(&this->actor.speedXZ, 2.0f, 0.4f); + Math_StepToF(&this->actor.speed, 2.0f, 0.4f); } else { - Math_StepToF(&this->actor.speedXZ, D_809A4CDC[OBJTOGE_GET_700(&this->actor)], 1.5f); + Math_StepToF(&this->actor.speed, D_809A4CDC[OBJTOGE_GET_700(&this->actor)], 1.5f); this->actor.shape.rot.y += 0x1770; } 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 ac238061eb..d9a0239994 100644 --- a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c +++ b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c @@ -332,7 +332,7 @@ void ObjTokeidai_ExteriorGear_OpenedIdle(ObjTokeidai* this, PlayState* play) { if (Cutscene_CheckActorAction(play, 132) && play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 132)]->action == 2) { this->actionFunc = ObjTokeidai_ExteriorGear_Collapse; - this->actor.speedXZ = this->actor.scale.y * 5.0f; + this->actor.speed = this->actor.scale.y * 5.0f; this->actor.velocity.y = 0.0f; this->actor.terminalVelocity = this->actor.scale.y * -50.0f; this->actor.gravity = this->actor.scale.y * -5.0f; 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 115e7d8b27..30c9fef03f 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -148,7 +148,7 @@ void ObjTsubo_SpawnGoldSkulltula(ObjTsubo* this, PlayState* play, s32 arg2) { if (child != NULL) { child->parent = &this->actor; child->velocity.y = 0.0f; - child->speedXZ = 0.0f; + child->speed = 0.0f; } } } @@ -621,7 +621,7 @@ void func_809291DC(ObjTsubo* this) { this->actor.shape.rot.x = this->actor.home.rot.x; this->actor.world.rot.x = this->actor.home.rot.x; this->actor.velocity.y = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.shape.rot.y = this->actor.home.rot.y; this->actor.world.rot.y = this->actor.home.rot.y; Actor_SetScale(&this->actor, 0.0f); 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 3538a5fabf..75f942e0cf 100644 --- a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c +++ b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c @@ -410,11 +410,11 @@ s32 func_80B783E0(ObjUm* this, PlayState* play, s32 banditIndex, EnHorse* bandit } bandit->actor.world.rot.y = Math_Vec3f_Yaw(&bandit->actor.world.pos, &sp50); - bandit->actor.speedXZ = 45.0f; + bandit->actor.speed = 45.0f; - sp3C = Math_CosS(bandit->actor.world.rot.x) * bandit->actor.speedXZ; + sp3C = Math_CosS(bandit->actor.world.rot.x) * bandit->actor.speed; bandit->actor.velocity.x = Math_SinS(bandit->actor.world.rot.y) * sp3C; - bandit->actor.velocity.y = Math_SinS(bandit->actor.world.rot.x) * bandit->actor.speedXZ; + bandit->actor.velocity.y = Math_SinS(bandit->actor.world.rot.x) * bandit->actor.speed; bandit->actor.velocity.z = Math_CosS(bandit->actor.world.rot.y) * sp3C; bandit->banditPosition.x = @@ -1122,9 +1122,9 @@ ObjUmPathState ObjUm_UpdatePath(ObjUm* this, PlayState* play) { } if (this->animIndex == OBJ_UM_ANIM_TROT) { - this->dyna.actor.speedXZ = 4.0f; + this->dyna.actor.speed = 4.0f; } else if (this->animIndex == OBJ_UM_ANIM_GALLOP) { - this->dyna.actor.speedXZ = 8.0f; + this->dyna.actor.speed = 8.0f; } return sp3C; @@ -1656,9 +1656,9 @@ void ObjUm_ChangeAnim(ObjUm* this, PlayState* play, ObjUmAnimation animIndex) { } if (animIndex == OBJ_UM_ANIM_TROT) { - animPlaybackSpeed = this->dyna.actor.speedXZ * 0.25f; + animPlaybackSpeed = this->dyna.actor.speed * 0.25f; } else if (animIndex == OBJ_UM_ANIM_GALLOP) { - animPlaybackSpeed = this->dyna.actor.speedXZ * 0.2f; + animPlaybackSpeed = this->dyna.actor.speed * 0.2f; } else if (animIndex == OBJ_UM_ANIM_IDLE) { animPlaybackSpeed = 1.0f; } 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 514a68c5fa..257e9eb79b 100644 --- a/src/overlays/actors/ovl_Obj_Vspinyroll/z_obj_vspinyroll.c +++ b/src/overlays/actors/ovl_Obj_Vspinyroll/z_obj_vspinyroll.c @@ -123,14 +123,14 @@ s32 func_80A3C700(ObjVspinyroll* this) { s32 sp30 = this->unk_398 ^ 1; Vec3f sp24; - Math_StepToF(&this->dyna.actor.speedXZ, this->unk_394, this->unk_394 * 0.2f); + Math_StepToF(&this->dyna.actor.speed, this->unk_394, this->unk_394 * 0.2f); - this->dyna.actor.world.pos.x += this->dyna.actor.speedXZ * this->unk_3B4.x; - this->dyna.actor.world.pos.y += this->dyna.actor.speedXZ * this->unk_3B4.y; - this->dyna.actor.world.pos.z += this->dyna.actor.speedXZ * this->unk_3B4.z; + this->dyna.actor.world.pos.x += this->dyna.actor.speed * this->unk_3B4.x; + this->dyna.actor.world.pos.y += this->dyna.actor.speed * this->unk_3B4.y; + this->dyna.actor.world.pos.z += this->dyna.actor.speed * this->unk_3B4.z; Math_Vec3f_Diff(&this->unk_39C[sp30], &this->dyna.actor.world.pos, &sp24); - return Math3D_LengthSquared(&sp24) < (SQ(this->dyna.actor.speedXZ) + 0.05f); + return Math3D_LengthSquared(&sp24) < (SQ(this->dyna.actor.speed) + 0.05f); } void func_80A3C7E8(ObjVspinyroll* this) { @@ -322,7 +322,7 @@ void ObjVspinyroll_Destroy(Actor* thisx, PlayState* play) { } void func_80A3CEC4(ObjVspinyroll* this) { - this->dyna.actor.speedXZ = 0.0f; + this->dyna.actor.speed = 0.0f; this->actionFunc = func_80A3CEE0; } @@ -336,7 +336,7 @@ void func_80A3CEE0(ObjVspinyroll* this, PlayState* play) { void func_80A3CF10(ObjVspinyroll* this) { this->actionFunc = func_80A3CF4C; this->unk_3C8 = D_80A3D478[OBJVSPINYROLL_GET_1C00(&this->dyna.actor)]; - this->dyna.actor.speedXZ = 0.0f; + this->dyna.actor.speed = 0.0f; } void func_80A3CF4C(ObjVspinyroll* this, PlayState* play) { @@ -351,7 +351,7 @@ void func_80A3CF4C(ObjVspinyroll* this, PlayState* play) { void func_80A3CFAC(ObjVspinyroll* this) { this->actionFunc = func_80A3CFE0; this->unk_3C2 = D_80A3D4DC[this->unk_398]; - this->dyna.actor.speedXZ = 0.0f; + this->dyna.actor.speed = 0.0f; } void func_80A3CFE0(ObjVspinyroll* this, PlayState* play) { 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 74e711cfa5..851cf7d355 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -160,7 +160,7 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play) { collectible = (EnItem00*)Item_DropCollectible(play, &spawnPos, ITEM00_MAGIC_LARGE); if (collectible != NULL) { collectible->unk152 = 0x1770; - collectible->actor.speedXZ = 0.0f; + collectible->actor.speed = 0.0f; } } 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 8c1e98bedd..5b4f80ee66 100644 --- a/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c +++ b/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c @@ -62,7 +62,7 @@ void TGSw_ActionExecuteOneShot(TGSw* this, PlayState* play) { } if ((((this->actor.params & 0xFC) >> 2) & 0xFF) == (((actor->params & 0xFC) >> 2) & 0xFF)) { actor->parent = &this->actor; - actor->speedXZ = ABS_ALT(this->actor.world.rot.x); + actor->speed = ABS_ALT(this->actor.world.rot.x); break; } actor = actor->next; @@ -78,7 +78,7 @@ void TGSw_ActionExecuteOneShot(TGSw* this, PlayState* play) { } if ((((this->actor.params & 0xFC) >> 2) & 0xFF) == (((actor->params & 0xFC) >> 2) & 0xFF)) { actor->parent = &this->actor; - actor->speedXZ = ABS_ALT(this->actor.world.rot.x); + actor->speed = ABS_ALT(this->actor.world.rot.x); break; } actor = actor->next; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c index 260541b511..f7b7808835 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c @@ -134,8 +134,8 @@ void EffectSsGSpk_Update(PlayState* play, u32 index, EffectSs* this) { void EffectSsGSpk_UpdateNoAccel(PlayState* play, u32 index, EffectSs* this) { if (this->actor != NULL) { if ((this->actor->category == ACTORCAT_EXPLOSIVES) && (this->actor->update != NULL)) { - this->pos.x += (Math_SinS(this->actor->world.rot.y) * this->actor->speedXZ); - this->pos.z += (Math_CosS(this->actor->world.rot.y) * this->actor->speedXZ); + this->pos.x += (Math_SinS(this->actor->world.rot.y) * this->actor->speed); + this->pos.z += (Math_CosS(this->actor->world.rot.y) * this->actor->speed); } } diff --git a/tools/namefixer.py b/tools/namefixer.py index 17c33fc5c1..12356ba595 100755 --- a/tools/namefixer.py +++ b/tools/namefixer.py @@ -693,6 +693,8 @@ wordReplace = { "actor.minVelocityY": "actor.terminalVelocity", "actor.yDistToWater": "actor.depthInWater", "actor.yDistToPlayer": "actor.playerHeightRel", + "actor.speedXZ": "actor.speed", + "thisx->speedXZ": "thisx->speed", "gSaveContext.unk_3F1E": "gSaveContext.hudVisibilityForceButtonAlphasByStatus", "gSaveContext.unk_3F20": "gSaveContext.nextHudVisibility", From 8b025badd14616338b0a690b4b872d6ca6bd0327 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sat, 4 Mar 2023 15:53:10 -0300 Subject: [PATCH 20/29] `z_fireobj.h` header (#1179) * fireobj.h * name states and cleanups * minor cleanups * format * bss * review * bss * review --- include/functions.h | 7 +- include/z64.h | 47 ----------- include/z64light.h | 3 + include/z_fireobj.h | 77 +++++++++++++++++++ src/code/graph.c | 1 - src/code/z_fireobj.c | 71 ++++++++--------- src/code/z_lifemeter.c | 1 - .../actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c | 6 +- .../actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.h | 1 + .../ovl_Obj_Flowerpot/z_obj_flowerpot.c | 1 + 10 files changed, 120 insertions(+), 95 deletions(-) create mode 100644 include/z_fireobj.h diff --git a/include/functions.h b/include/functions.h index 0aa19e492e..55b034dbdd 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1292,12 +1292,7 @@ s16 ActorCutscene_GetCurrentSubCamId(s16 index); s16 func_800F21CC(void); s32 func_800F22C4(s16 param_1, Actor* actor); void ActorCutscene_SetReturnCamera(s16 index); -void FireObj_SetPosition(FireObj* fire, Vec3f* pos); -void FireObj_Draw(PlayState* play, FireObj* fire); -void FireObj_Init(PlayState* play, FireObj* fire, FireObjInitParams* init, Actor* actor); -void FireObj_Destroy(PlayState* play, FireObj* fire); -void FireObj_SetState2(FireObj* fire, f32 dynamicSizeStep, u8 newState); -void FireObj_Update(PlayState* play, FireObj* fire, Actor* actor); + s32 func_800F3940(PlayState* play); // void func_800F39B4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); // void func_800F3A64(void); diff --git a/include/z64.h b/include/z64.h index 9069dc819a..a26da18afb 100644 --- a/include/z64.h +++ b/include/z64.h @@ -140,28 +140,6 @@ typedef struct { /* 0xF */ s8 a; } F3DVertexNormal; // size = 0x10 -typedef struct { - /* 0x0 */ f32 size; - /* 0x4 */ f32 dynamicSizeStep; - /* 0x8 */ u8 state; - /* 0x9 */ u8 sizeGrowsCos2; - /* 0xA */ u8 colorsIndex; - /* 0xB */ u8 flags; - /* 0xC */ u8 lightParamsIndex; -} FireObjInitParams; // size = 0x10 - -typedef struct FireObjColors { - /* 0x0 */ Color_RGBA8 primColor; - /* 0x4 */ u8 lod; - /* 0x5 */ Color_RGB8 envColor; -} FireObjColors; // size = 0x8 - -typedef struct FireObjLightParams { - /* 0x0 */ s16 radius; - /* 0x2 */ Color_RGB8 color; - /* 0x5 */ Color_RGB8 maxColorAdj; -} FireObjLightParams; // size = 0x8 - // Game Info aka. Static Context // Data normally accessed through REG macros (see regs.h) typedef struct { @@ -687,12 +665,6 @@ typedef enum { STACK_STATUS_OVERFLOW = 2 } StackStatus; -typedef struct FireObjLight { - /* 0x00 */ LightNode* light; - /* 0x04 */ LightInfo lightInfo; - /* 0x12 */ u8 lightParamsIndex; -} FireObjLight; // size = 0x14 - #define OS_SC_RETRACE_MSG 1 #define OS_SC_DONE_MSG 2 #define OS_SC_NMI_MSG 3 // name is made up, 3 is OS_SC_RDP_DONE_MSG in the original sched.c @@ -713,25 +685,6 @@ typedef struct { /* 0x130 */ OSThread thread; } AudioMgr; // size = 0x2E0 -typedef struct FireObj { - /* 0x00 */ Vec3f position; - /* 0x0C */ f32 size; - /* 0x10 */ f32 sizeInv; - /* 0x14 */ f32 xScale; - /* 0x18 */ f32 yScale; - /* 0x1C */ f32 dynamicSize; - /* 0x20 */ f32 dynamicSizeStep; - /* 0x24 */ u8 state; // 0 - growing, 1 - shrinking, 2 - fully lit, 3 - not lit - /* 0x25 */ u8 sizeGrowsCos2; - /* 0x26 */ u8 unk26; - /* 0x27 */ u8 colorsIndex; - /* 0x28 */ u8 flags; // bit 0 - ?, bit 1 - ? - /* 0x29 */ UNK_TYPE1 pad29[0x1]; - /* 0x2A */ s16 ignitionDelay; - /* 0x2C */ ColliderCylinder collision; - /* 0x78 */ FireObjLight light; -} FireObj; // size = 0x8B - typedef struct { /* 0x0 */ u8 seqId; /* 0x1 */ u8 ambienceId; diff --git a/include/z64light.h b/include/z64light.h index 8eaebca61b..1881d6aa1f 100644 --- a/include/z64light.h +++ b/include/z64light.h @@ -5,6 +5,9 @@ #include "PR/gbi.h" #include "color.h" +struct PlayState; + + typedef struct { /* 0x00 */ u8 ambientColor[3]; /* 0x03 */ s8 diffuseDir1[3]; diff --git a/include/z_fireobj.h b/include/z_fireobj.h new file mode 100644 index 0000000000..7bd58d80ae --- /dev/null +++ b/include/z_fireobj.h @@ -0,0 +1,77 @@ +#ifndef Z_FIREOBJ_H +#define Z_FIREOBJ_H + +#include "ultra64.h" +#include "color.h" +#include "z64collision_check.h" +#include "z64light.h" +#include "z64math.h" + +struct PlayState; +struct Actor; + + +typedef struct FireObjInitParams { + /* 0x0 */ f32 size; + /* 0x4 */ f32 dynamicSizeStep; + /* 0x8 */ u8 state; + /* 0x9 */ u8 sizeGrowsCos2; + /* 0xA */ u8 colorsIndex; + /* 0xB */ u8 flags; + /* 0xC */ u8 lightParamsIndex; +} FireObjInitParams; // size = 0x10 + +typedef struct FireObjColors { + /* 0x0 */ Color_RGBA8 primColor; + /* 0x4 */ u8 lod; + /* 0x5 */ Color_RGB8 envColor; +} FireObjColors; // size = 0x8 + +typedef struct FireObjLightParams { + /* 0x0 */ s16 radius; + /* 0x2 */ Color_RGB8 color; + /* 0x5 */ Color_RGB8 maxColorAdj; +} FireObjLightParams; // size = 0x8 + +typedef struct FireObjLight { + /* 0x00 */ LightNode* light; + /* 0x04 */ LightInfo lightInfo; + /* 0x12 */ u8 lightParamsIndex; +} FireObjLight; // size = 0x14 + +typedef struct FireObj { + /* 0x00 */ Vec3f position; + /* 0x0C */ f32 size; + /* 0x10 */ f32 sizeInv; + /* 0x14 */ f32 xScale; + /* 0x18 */ f32 yScale; + /* 0x1C */ f32 dynamicSize; + /* 0x20 */ f32 dynamicSizeStep; + /* 0x24 */ u8 state; // @see FireState enum + /* 0x25 */ u8 sizeGrowsCos2; + /* 0x26 */ u8 timer; + /* 0x27 */ u8 colorsIndex; + /* 0x28 */ u8 flags; // @see FIRE_FLAG_ + /* 0x2A */ s16 ignitionDelay; + /* 0x2C */ ColliderCylinder collision; + /* 0x78 */ FireObjLight light; +} FireObj; // size = 0x8B + +typedef enum FireState { + /* 0 */ FIRE_STATE_GROWING, + /* 1 */ FIRE_STATE_SHRINKING, + /* 2 */ FIRE_STATE_FULLY_LIT, + /* 3 */ FIRE_STATE_NOT_LIT, +} FireState; + +#define FIRE_FLAG_WATER_EXTINGUISHABLE (1 << 0) +#define FIRE_FLAG_INTERACT_STICK (1 << 1) + +void FireObj_SetPosition(FireObj* fire, Vec3f* pos); +void FireObj_Draw(struct PlayState* play, FireObj* fire); +void FireObj_Init(struct PlayState* play, FireObj* fire, FireObjInitParams* init, struct Actor* actor); +void FireObj_Destroy(struct PlayState* play, FireObj* fire); +void FireObj_SetState2(FireObj* fire, f32 dynamicSizeStep, u8 newState); +void FireObj_Update(struct PlayState* play, FireObj* fire, struct Actor* actor); + +#endif diff --git a/src/code/graph.c b/src/code/graph.c index 1c29029b03..be865ee61e 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "global.h" #include "system_malloc.h" #include "overlays/gamestates/ovl_daytelop/z_daytelop.h" diff --git a/src/code/z_fireobj.c b/src/code/z_fireobj.c index e4f014ffae..114e62cc7a 100644 --- a/src/code/z_fireobj.c +++ b/src/code/z_fireobj.c @@ -1,14 +1,7 @@ -#include "global.h" +#include "z_fireobj.h" #include "overlays/actors/ovl_En_Arrow/z_en_arrow.h" #include "objects/gameplay_keep/gameplay_keep.h" -typedef enum { - FIRE_STATE_0, - FIRE_STATE_1, - FIRE_STATE_2, - FIRE_STATE_3, -} FireState; - ColliderCylinderInit sFireObjCollisionInit = { { COLTYPE_NONE, @@ -48,17 +41,17 @@ void FireObj_InitWithParams(PlayState* play, FireObj* fire, FireObjInitParams* i fire->xScale = 0.0f; fire->yScale = 0.0f; fire->dynamicSize = 0.0f; - fire->unk26 = Rand_ZeroOne() * 20.0f; + fire->timer = Rand_ZeroOne() * 20.0f; fire->ignitionDelay = -1; } void FireObj_SetState(FireObj* fire, f32 dynamicSizeStep, u8 newState) { fire->state = newState; - if (fire->state == FIRE_STATE_3) { + if (fire->state == FIRE_STATE_NOT_LIT) { fire->yScale = 0.0f; fire->xScale = 0.0f; fire->dynamicSize = 0.0f; - } else if (fire->state == FIRE_STATE_2) { + } else if (fire->state == FIRE_STATE_FULLY_LIT) { fire->xScale = fire->yScale = fire->size; fire->dynamicSize = 1.0f; } @@ -70,15 +63,16 @@ void FireObj_SetPosition(FireObj* fire, Vec3f* pos) { } void FireObj_StepSize(FireObj* fire) { - if (fire->state == FIRE_STATE_0) { - if (Math_StepToF(&fire->dynamicSize, 1.0f, fire->dynamicSizeStep) != 0) { - FireObj_SetState(fire, fire->dynamicSizeStep, FIRE_STATE_2); + if (fire->state == FIRE_STATE_GROWING) { + if (Math_StepToF(&fire->dynamicSize, 1.0f, fire->dynamicSizeStep)) { + FireObj_SetState(fire, fire->dynamicSizeStep, FIRE_STATE_FULLY_LIT); } - } else if ((fire->state == FIRE_STATE_1) && (Math_StepToF(&fire->dynamicSize, 0.0f, fire->dynamicSizeStep) != 0)) { - FireObj_SetState(fire, fire->dynamicSizeStep, FIRE_STATE_3); + } else if ((fire->state == FIRE_STATE_SHRINKING) && + (Math_StepToF(&fire->dynamicSize, 0.0f, fire->dynamicSizeStep))) { + FireObj_SetState(fire, fire->dynamicSizeStep, FIRE_STATE_NOT_LIT); } if (fire->sizeGrowsCos2 == 1) { - if ((fire->state == FIRE_STATE_0) || (fire->state == FIRE_STATE_1)) { + if ((fire->state == FIRE_STATE_GROWING) || (fire->state == FIRE_STATE_SHRINKING)) { fire->xScale = (1.0f - Math_CosS(SQ(fire->dynamicSize) * 0x4000)) * fire->size; fire->yScale = fire->dynamicSize * fire->size; } else { @@ -101,39 +95,41 @@ void FireObj_UpdateStateTransitions(PlayState* play, FireObj* fire) { Vec3f dist; FireObj_StepSize(fire); - fire->unk26++; + fire->timer++; if (fire->ignitionDelay > 0) { fire->ignitionDelay--; } else if (fire->ignitionDelay == 0) { fire->ignitionDelay = -1; - if ((fire->state == FIRE_STATE_3) || (fire->state == FIRE_STATE_1)) { - nextState = FIRE_STATE_0; + if ((fire->state == FIRE_STATE_NOT_LIT) || (fire->state == FIRE_STATE_SHRINKING)) { + nextState = FIRE_STATE_GROWING; } else { - nextState = FIRE_STATE_1; + nextState = FIRE_STATE_SHRINKING; } FireObj_SetState(fire, fire->dynamicSizeStep, nextState); } - if ((fire->flags & 1) && (fire->state != FIRE_STATE_3) && + + if ((fire->flags & FIRE_FLAG_WATER_EXTINGUISHABLE) && (fire->state != FIRE_STATE_NOT_LIT) && WaterBox_GetSurface1_2(play, &play->colCtx, fire->position.x, fire->position.z, &waterY, &waterBox) && (waterY - fire->position.y > 6500.0f * fire->yScale)) { - FireObj_SetState(fire, fire->dynamicSizeStep, FIRE_STATE_3); + FireObj_SetState(fire, fire->dynamicSizeStep, FIRE_STATE_NOT_LIT); } - if ((fire->flags & 2) && (player->heldItemAction == PLAYER_IA_STICK)) { + if ((fire->flags & FIRE_FLAG_INTERACT_STICK) && (player->heldItemAction == PLAYER_IA_STICK)) { Math_Vec3f_Diff(&player->meleeWeaponInfo[0].tip, &fire->position, &dist); - if (Math3D_LengthSquared(&dist) < 400.0f) { + if (Math3D_LengthSquared(&dist) < SQ(20.0f)) { sp40 = true; } } + if (sp40) { - if (fire->state == FIRE_STATE_3) { + if (fire->state == FIRE_STATE_NOT_LIT) { if (player->unk_B28 > 0) { - FireObj_SetState(fire, fire->dynamicSizeStep, FIRE_STATE_0); + FireObj_SetState(fire, fire->dynamicSizeStep, FIRE_STATE_GROWING); } } else if (player->unk_B28 == 0) { - player->unk_B28 = 0xD2; + player->unk_B28 = 210; SoundSource_PlaySfxAtFixedWorldPos(play, &fire->position, 20, NA_SE_EV_FLAME_IGNITION); - } else if (player->unk_B28 < 0xC8) { - player->unk_B28 = 0xC8; + } else if (player->unk_B28 < 200) { + player->unk_B28 = 200; } } } @@ -142,13 +138,13 @@ void FireObj_Draw(PlayState* play, FireObj* fire) { s32 pad; FireObjColors* fireColors = &sFireObjColors[fire->colorsIndex]; - if (fire->state != FIRE_STATE_3) { + if (fire->state != FIRE_STATE_NOT_LIT) { Vec3s vec; OPEN_DISPS(play->state.gfxCtx); func_8012C2DC(play->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, (fire->unk26 * -20) & 511, 32, 128)); + Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, (fire->timer * -20) % 512U, 32, 128)); gDPSetPrimColor(POLY_XLU_DISP++, 0, fireColors->lod, fireColors->primColor.r, fireColors->primColor.g, fireColors->primColor.b, fireColors->primColor.a); @@ -185,7 +181,7 @@ void FireObj_UpdateLight(PlayState* play, FireObjLight* light, FireObj* fire) { FireObjLightParams* lightParams = &sFireObjLightParams[light->lightParamsIndex]; s16 radius; - if (fire->state == FIRE_STATE_3) { + if (fire->state == FIRE_STATE_NOT_LIT) { Lights_PointSetColorAndRadius(&light->lightInfo, 0, 0, 0, -1); } else { radius = (fire->yScale * 140.0f * fire->sizeInv) + 60.0f; @@ -225,14 +221,15 @@ void FireObj_Update(PlayState* play, FireObj* fire, Actor* actor) { EnArrow* arrow = (EnArrow*)fire->collision.base.ac; FireObj_UpdateStateTransitions(play, fire); - if (fire->state == FIRE_STATE_3) { - if ((fire->collision.base.acFlags & AC_HIT) && (fire->collision.info.acHitInfo->toucher.dmgFlags & 0x800)) { - FireObj_SetState(fire, fire->dynamicSizeStep, FIRE_STATE_0); + if (fire->state == FIRE_STATE_NOT_LIT) { + if ((fire->collision.base.acFlags & AC_HIT) && + (fire->collision.info.acHitInfo->toucher.dmgFlags & DMG_FIRE_ARROW)) { + FireObj_SetState(fire, fire->dynamicSizeStep, FIRE_STATE_GROWING); } } else if ((fire->collision.base.acFlags & AC_HIT) && (arrow->actor.update != NULL) && (arrow->actor.id == ACTOR_EN_ARROW)) { arrow->actor.params = 0; - arrow->collider.info.toucher.dmgFlags = 0x800; + arrow->collider.info.toucher.dmgFlags = DMG_FIRE_ARROW; } fire->collision.dim.pos.x = fire->position.x; fire->collision.dim.pos.y = fire->position.y; diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c index b123baab69..06dd1a0c7c 100644 --- a/src/code/z_lifemeter.c +++ b/src/code/z_lifemeter.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "global.h" #include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" #include "interface/parameter_static/parameter_static.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 0c12374a1b..f4f6a6c00f 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 @@ -63,7 +63,7 @@ static ColliderCylinderInit sCylinderInit = { }; static FireObjInitParams sFireObjInit = { - 0.00405000010505f, 0.0500000007451f, 3, 1, 0, 0, 0, + 0.00405f, 1.0f / 20.0f, FIRE_STATE_NOT_LIT, 1, 0, 0, 0, }; static s16 sInitialAnglePerPetal[] = { 0x0000, 0x2AAA, 0x5555, 0x8000, 0xAAAA, 0xD555 }; @@ -175,7 +175,7 @@ void BgNumaHana_Init(Actor* thisx, PlayState* play) { this->flowerRotationalVelocity = 0x147; this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 210.0f; - FireObj_SetState2(&this->fire, 0.05f, 2); + FireObj_SetState2(&this->fire, 0.05f, FIRE_STATE_FULLY_LIT); Flags_SetSwitch(play, BG_NUMA_HANA_SWITCH_FLAG(&this->dyna.actor)); BgNumaHana_SetupOpenedIdle(this); } else { @@ -215,7 +215,7 @@ void BgNumaHana_SetupClosedIdle(BgNumaHana* this) { * the cutscene where the petals unfold. */ void BgNumaHana_ClosedIdle(BgNumaHana* this, PlayState* play) { - if (this->fire.state != 3) { + if (this->fire.state != FIRE_STATE_NOT_LIT) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_FLAME_IGNITION); if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); 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 fd71577cd8..0e377f539d 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 @@ -2,6 +2,7 @@ #define Z_BG_NUMA_HANA_H #include "global.h" +#include "z_fireobj.h" #define BG_NUMA_HANA_GET_TYPE(thisx) ((thisx)->params & 1) #define BG_NUMA_HANA_SWITCH_FLAG(thisx) (((thisx)->params >> 8) & 0x7F) 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 fc046b0609..c09362936b 100644 --- a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c +++ b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c @@ -4,6 +4,7 @@ * Description: Breakable Pot With Grass */ +#include "prevent_bss_reordering.h" #include "z_obj_flowerpot.h" #include "objects/object_flowerpot/object_flowerpot.h" From 2cce8f67671c7162a946dd11604f83c9630fbc28 Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Sat, 4 Mar 2023 17:53:56 -0500 Subject: [PATCH 21/29] Introduce BgCheckFlags Defines (#1195) * flags * cleanup * adjust comment --- include/z64actor.h | 30 ++++---- src/code/z_actor.c | 75 ++++++++++--------- src/code/z_bgcheck.c | 4 +- src/code/z_en_hy_code.c | 2 +- src/code/z_en_item00.c | 8 +- src/code/z_player_lib.c | 7 +- .../actors/ovl_Bg_Icicle/z_bg_icicle.c | 4 +- .../ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c | 4 +- .../z_bg_ikana_rotaryroom.c | 2 +- .../actors/ovl_Bg_Ingate/z_bg_ingate.c | 2 +- .../ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c | 2 +- src/overlays/actors/ovl_Boss_02/z_boss_02.c | 2 +- src/overlays/actors/ovl_Boss_03/z_boss_03.c | 26 ++++--- src/overlays/actors/ovl_Boss_04/z_boss_04.c | 6 +- .../ovl_En_Akindonuts/z_en_akindonuts.c | 2 +- src/overlays/actors/ovl_En_Am/z_en_am.c | 10 +-- src/overlays/actors/ovl_En_Ani/z_en_ani.c | 2 +- src/overlays/actors/ovl_En_Arrow/z_en_arrow.c | 4 +- .../ovl_En_Attack_Niw/z_en_attack_niw.c | 16 ++-- src/overlays/actors/ovl_En_Az/z_en_az.c | 20 ++--- src/overlays/actors/ovl_En_Baguo/z_en_baguo.c | 6 +- src/overlays/actors/ovl_En_Bat/z_en_bat.c | 18 ++--- src/overlays/actors/ovl_En_Bb/z_en_bb.c | 10 +-- .../actors/ovl_En_Bbfall/z_en_bbfall.c | 18 ++--- .../actors/ovl_En_Bigpamet/z_en_bigpamet.c | 10 +-- src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c | 6 +- .../actors/ovl_En_Bigslime/z_en_bigslime.c | 39 +++++----- src/overlays/actors/ovl_En_Bom/z_en_bom.c | 18 ++--- .../actors/ovl_En_Bom_Chu/z_en_bom_chu.c | 10 +-- src/overlays/actors/ovl_En_Bombf/z_en_bombf.c | 18 ++--- .../actors/ovl_En_Bomjimb/z_en_bomjimb.c | 8 +- src/overlays/actors/ovl_En_Boom/z_en_boom.c | 13 ++-- src/overlays/actors/ovl_En_Box/z_en_box.c | 2 +- .../actors/ovl_En_Bubble/z_en_bubble.c | 2 +- .../actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 2 +- .../actors/ovl_En_Col_Man/z_en_col_man.c | 4 +- src/overlays/actors/ovl_En_Crow/z_en_crow.c | 15 ++-- .../actors/ovl_En_Dekubaba/z_en_dekubaba.c | 5 +- .../actors/ovl_En_Dekunuts/z_en_dekunuts.c | 4 +- src/overlays/actors/ovl_En_Dg/z_en_dg.c | 36 ++++----- .../actors/ovl_En_Dinofos/z_en_dinofos.c | 16 ++-- src/overlays/actors/ovl_En_Dnp/z_en_dnp.c | 2 +- src/overlays/actors/ovl_En_Dns/z_en_dns.c | 3 +- .../actors/ovl_En_Dodongo/z_en_dodongo.c | 2 +- .../actors/ovl_En_Estone/z_en_estone.c | 5 +- src/overlays/actors/ovl_En_Famos/z_en_famos.c | 6 +- src/overlays/actors/ovl_En_Fg/z_en_fg.c | 6 +- .../actors/ovl_En_Firefly/z_en_firefly.c | 23 +++--- src/overlays/actors/ovl_En_Fish/z_en_fish.c | 19 ++--- src/overlays/actors/ovl_En_Fish2/z_en_fish2.c | 2 +- .../actors/ovl_En_Fishing/z_en_fishing.c | 10 +-- .../actors/ovl_En_Floormas/z_en_floormas.c | 28 +++---- src/overlays/actors/ovl_En_Fu/z_en_fu.c | 4 +- .../actors/ovl_En_Fu_Mato/z_en_fu_mato.c | 4 +- src/overlays/actors/ovl_En_Fz/z_en_fz.c | 4 +- src/overlays/actors/ovl_En_Ge2/z_en_ge2.c | 2 +- src/overlays/actors/ovl_En_Geg/z_en_geg.c | 6 +- src/overlays/actors/ovl_En_Gg/z_en_gg.c | 2 +- src/overlays/actors/ovl_En_Gg2/z_en_gg2.c | 2 +- src/overlays/actors/ovl_En_Gk/z_en_gk.c | 2 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 4 +- .../actors/ovl_En_Goroiwa/z_en_goroiwa.c | 12 +-- .../ovl_En_Grasshopper/z_en_grasshopper.c | 3 +- src/overlays/actors/ovl_En_Gs/z_en_gs.c | 2 +- .../actors/ovl_En_Hakurock/z_en_hakurock.c | 6 +- .../actors/ovl_En_Hint_Skb/z_en_hint_skb.c | 30 ++++---- src/overlays/actors/ovl_En_Horse/z_en_horse.c | 5 +- src/overlays/actors/ovl_En_Ik/z_en_ik.c | 4 +- .../actors/ovl_En_Insect/z_en_insect.c | 10 +-- .../actors/ovl_En_Invadepoh/z_en_invadepoh.c | 4 +- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 24 +++--- src/overlays/actors/ovl_En_Jg/z_en_jg.c | 2 +- .../actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c | 14 ++-- .../actors/ovl_En_Kaizoku/z_en_kaizoku.c | 36 ++++----- src/overlays/actors/ovl_En_Kame/z_en_kame.c | 8 +- .../actors/ovl_En_Kanban/z_en_kanban.c | 20 ++--- .../actors/ovl_En_Karebaba/z_en_karebaba.c | 5 +- src/overlays/actors/ovl_En_Kusa/z_en_kusa.c | 9 ++- src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c | 17 +++-- .../actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c | 2 +- .../actors/ovl_En_Minifrog/z_en_minifrog.c | 4 +- .../actors/ovl_En_Minislime/z_en_minislime.c | 40 +++++----- src/overlays/actors/ovl_En_Mkk/z_en_mkk.c | 12 +-- src/overlays/actors/ovl_En_Mm/z_en_mm.c | 12 +-- .../actors/ovl_En_Mt_tag/z_en_mt_tag.c | 3 +- .../actors/ovl_En_Mushi2/z_en_mushi2.c | 6 +- .../actors/ovl_En_Nimotsu/z_en_nimotsu.c | 2 +- src/overlays/actors/ovl_En_Niw/z_en_niw.c | 27 ++++--- .../actors/ovl_En_Nutsball/z_en_nutsball.c | 12 +-- src/overlays/actors/ovl_En_Nwc/z_en_nwc.c | 6 +- src/overlays/actors/ovl_En_Ot/z_en_ot.c | 7 +- src/overlays/actors/ovl_En_Owl/z_en_owl.c | 2 +- .../actors/ovl_En_Pametfrog/z_en_pametfrog.c | 22 +++--- .../actors/ovl_En_Peehat/z_en_peehat.c | 4 +- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 4 +- src/overlays/actors/ovl_En_Poh/z_en_poh.c | 4 +- src/overlays/actors/ovl_En_Pp/z_en_pp.c | 6 +- src/overlays/actors/ovl_En_Pr2/z_en_pr2.c | 5 +- .../actors/ovl_En_Racedog/z_en_racedog.c | 4 +- .../actors/ovl_En_Rail_Skb/z_en_rail_skb.c | 6 +- .../actors/ovl_En_Railgibud/z_en_railgibud.c | 2 +- src/overlays/actors/ovl_En_Rat/z_en_rat.c | 4 +- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 2 +- src/overlays/actors/ovl_En_Rg/z_en_rg.c | 10 +-- src/overlays/actors/ovl_En_Ru/z_en_ru.c | 2 +- .../actors/ovl_En_Ruppecrow/z_en_ruppecrow.c | 10 +-- src/overlays/actors/ovl_En_Sb/z_en_sb.c | 16 ++-- .../actors/ovl_En_Scopecrow/z_en_scopecrow.c | 2 +- .../actors/ovl_En_Scopenuts/z_en_scopenuts.c | 6 +- .../actors/ovl_En_Sellnuts/z_en_sellnuts.c | 4 +- src/overlays/actors/ovl_En_Skb/z_en_skb.c | 24 +++--- .../actors/ovl_En_Snowman/z_en_snowman.c | 8 +- src/overlays/actors/ovl_En_St/z_en_st.c | 2 +- .../actors/ovl_En_Suttari/z_en_suttari.c | 10 +-- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 4 +- .../ovl_En_Syateki_Crow/z_en_syateki_crow.c | 2 +- .../ovl_En_Syateki_Wf/z_en_syateki_wf.c | 10 +-- .../ovl_En_Talk_Gibud/z_en_talk_gibud.c | 2 +- .../actors/ovl_En_Tanron3/z_en_tanron3.c | 8 +- .../actors/ovl_En_Tanron5/z_en_tanron5.c | 4 +- .../actors/ovl_En_Thiefbird/z_en_thiefbird.c | 22 +++--- src/overlays/actors/ovl_En_Tite/z_en_tite.c | 54 ++++++------- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 4 +- src/overlays/actors/ovl_En_Toto/z_en_toto.c | 4 +- src/overlays/actors/ovl_En_Trt2/z_en_trt2.c | 13 ++-- .../actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c | 4 +- src/overlays/actors/ovl_En_Twig/z_en_twig.c | 2 +- src/overlays/actors/ovl_En_Vm/z_en_vm.c | 2 +- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 4 +- src/overlays/actors/ovl_En_Wf/z_en_wf.c | 30 ++++---- .../actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c | 6 +- src/overlays/actors/ovl_En_Zo/z_en_zo.c | 2 +- src/overlays/actors/ovl_En_Zog/z_en_zog.c | 2 +- .../actors/ovl_En_Zoraegg/z_en_zoraegg.c | 2 +- src/overlays/actors/ovl_En_Zow/z_en_zow.c | 2 +- src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c | 4 +- .../actors/ovl_Obj_Armos/z_obj_armos.c | 2 +- .../ovl_Obj_Bigicicle/z_obj_bigicicle.c | 2 +- src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c | 8 +- .../ovl_Obj_Flowerpot/z_obj_flowerpot.c | 9 ++- .../ovl_Obj_Grass_Carry/z_obj_grass_carry.c | 9 ++- .../actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c | 2 +- .../ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.c | 6 +- .../actors/ovl_Obj_Kibako/z_obj_kibako.c | 7 +- .../actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c | 3 +- .../ovl_Obj_Snowball2/z_obj_snowball2.c | 15 ++-- src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c | 2 +- .../actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c | 2 +- .../actors/ovl_Obj_Tsubo/z_obj_tsubo.c | 10 ++- 149 files changed, 719 insertions(+), 672 deletions(-) diff --git a/include/z64actor.h b/include/z64actor.h index 249109a448..d2b28cb385 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -132,6 +132,20 @@ typedef struct { /* 0x18 */ Vec3f feetPos[2]; // Update by using `Actor_SetFeetPos` in PostLimbDrawOpa } ActorShape; // size = 0x30 +#define BGCHECKFLAG_GROUND (1 << 0) // Standing on the ground +#define BGCHECKFLAG_GROUND_TOUCH (1 << 1) // Has touched the ground (only active for 1 frame) +#define BGCHECKFLAG_GROUND_LEAVE (1 << 2) // Has left the ground (only active for 1 frame) +#define BGCHECKFLAG_WALL (1 << 3) // Touching a wall +#define BGCHECKFLAG_CEILING (1 << 4) // Touching a ceiling +#define BGCHECKFLAG_WATER (1 << 5) // In water +#define BGCHECKFLAG_WATER_TOUCH (1 << 6) // Has touched water (reset when leaving water) +#define BGCHECKFLAG_GROUND_STRICT (1 << 7) // Similar to BGCHECKFLAG_GROUND but with no velocity check and is cleared every frame +#define BGCHECKFLAG_CRUSHED (1 << 8) // Crushed between a floor and ceiling (triggers a void for player) +#define BGCHECKFLAG_PLAYER_WALL_INTERACT (1 << 9) // Only set/used by player, related to interacting with walls +#define BGCHECKFLAG_PLAYER_400 (1 << 10) // +#define BGCHECKFLAG_PLAYER_800 (1 << 11) // +#define BGCHECKFLAG_PLAYER_1000 (1 << 12) // + typedef struct Actor { /* 0x000 */ s16 id; // Actor ID /* 0x002 */ u8 category; // Actor category. Refer to the corresponding enum for values @@ -160,7 +174,7 @@ typedef struct Actor { /* 0x086 */ s16 wallYaw; // Y rotation of the wall polygon the actor is touching /* 0x088 */ f32 floorHeight; // Y position of the floor polygon directly below the actor /* 0x08C */ f32 depthInWater; // Directed distance to the surface of active waterbox. Negative value means water is below. - /* 0x090 */ u16 bgCheckFlags; // See comments below actor struct for wip docs. TODO: macros for these flags + /* 0x090 */ u16 bgCheckFlags; // Flags indicating how the actor is interacting with collision /* 0x092 */ s16 yawTowardsPlayer; // Y rotation difference between the actor and the player /* 0x094 */ f32 xyzDistToPlayerSq; // Squared distance between the actor and the player in the x,y,z axis /* 0x098 */ f32 xzDistToPlayer; // Distance between the actor and the player in the XZ plane @@ -198,20 +212,6 @@ typedef enum { /* 1 */ FOOT_RIGHT } ActorFootIndex; -/** - * BgCheckFlags WIP documentation (logical masks): - * 0x001 : Standing on the ground - * 0x002 : Has touched the ground (only active for 1 frame) - * 0x004 : Has left the ground (only active for 1 frame) - * 0x008 : Touching a wall - * 0x010 : Touching a ceiling - * 0x020 : On or below water surface - * 0x040 : Has touched water (actor is responsible for unsetting this the frame it touches the water) - * 0x080 : Similar to & 0x1 but with no velocity check and is cleared every frame - * 0x100 : Crushed between a floor and ceiling (triggers a void for player) - * 0x200 : Only set/used by player, related to interacting with walls - */ - typedef struct { /* 0x000 */ Actor actor; /* 0x144 */ s32 bgId; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 644d933b94..f6039a8edf 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -113,7 +113,7 @@ void ActorShadow_Draw(Actor* actor, Lights* lights, PlayState* play, Gfx* dlist, } void ActorShadow_DrawCircle(Actor* actor, Lights* lights, PlayState* play) { - if (actor->bgCheckFlags & 0x400) { + if (actor->bgCheckFlags & BGCHECKFLAG_PLAYER_400) { func_800B4AEC(play, actor, 50.0f); } @@ -121,7 +121,7 @@ void ActorShadow_DrawCircle(Actor* actor, Lights* lights, PlayState* play) { } void ActorShadow_DrawSquare(Actor* actor, Lights* lights, PlayState* play) { - if (actor->bgCheckFlags & 0x400) { + if (actor->bgCheckFlags & BGCHECKFLAG_PLAYER_400) { func_800B4AEC(play, actor, 50.0f); } @@ -285,7 +285,7 @@ void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, PlayState* play) { floorHeightPtr++; } - if (!(actor->bgCheckFlags & 1)) { + if (!(actor->bgCheckFlags & BGCHECKFLAG_GROUND)) { actor->shape.feetFloorFlags = 0; } else if (actor->shape.feetFloorFlags == 3) { f32 footDistY = actor->shape.feetPos[FOOT_LEFT].y - actor->shape.feetPos[FOOT_RIGHT].y; @@ -336,7 +336,7 @@ void func_800B4B50(Actor* actor, Lights* mapper, PlayState* play) { Light* phi_s0; s32 lightNumMax; - if (actor->bgCheckFlags & 0x400) { + if (actor->bgCheckFlags & BGCHECKFLAG_PLAYER_400) { func_800B4AEC(play, actor, 50.0f); } @@ -1497,9 +1497,9 @@ void Actor_GetSlopeDirection(CollisionPoly* floorPoly, Vec3f* slopeNormal, s16* } s32 func_800B761C(Actor* actor, f32 arg1, s32 arg2) { - if (actor->bgCheckFlags & 1) { - actor->bgCheckFlags &= ~1; - actor->bgCheckFlags |= 4; + if (actor->bgCheckFlags & BGCHECKFLAG_GROUND) { + actor->bgCheckFlags &= ~BGCHECKFLAG_GROUND; + actor->bgCheckFlags |= BGCHECKFLAG_GROUND_LEAVE; if ((actor->velocity.y < 0.0f) && (arg2 & 0x10)) { actor->velocity.y = 0.0f; @@ -1517,21 +1517,22 @@ s32 func_800B7678(PlayState* play, Actor* actor, Vec3f* pos, s32 flags) { pos->y += (flags & 0x800) ? 10.0f : 50.0f; actor->floorHeight = BgCheck_EntityRaycastFloor5_2(play, &play->colCtx, &actor->floorPoly, &bgId, actor, pos); - actor->bgCheckFlags &= ~(0x80 | 0x04 | 0x02); + actor->bgCheckFlags &= ~(BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_GROUND_LEAVE | BGCHECKFLAG_GROUND_STRICT); if (actor->floorHeight <= BGCHECK_Y_MIN) { return func_800B761C(actor, BGCHECK_Y_MIN, flags); } distToFloor = actor->floorHeight - actor->world.pos.y; actor->floorBgId = bgId; - if ((distToFloor >= 0.0f) || (((actor->bgCheckFlags & 1)) && !(actor->bgCheckFlags & 0x800) && - (distToFloor >= -11.0f) && (actor->velocity.y < 0.0f))) { - actor->bgCheckFlags |= 0x80; + if ((distToFloor >= 0.0f) || + (((actor->bgCheckFlags & BGCHECKFLAG_GROUND)) && !(actor->bgCheckFlags & BGCHECKFLAG_PLAYER_800) && + (distToFloor >= -11.0f) && (actor->velocity.y < 0.0f))) { + actor->bgCheckFlags |= BGCHECKFLAG_GROUND_STRICT; - if (actor->bgCheckFlags & 0x10) { + if (actor->bgCheckFlags & BGCHECKFLAG_CEILING) { if (bgId != D_801ED8B4) { if (distToFloor > 15.0f) { - actor->bgCheckFlags |= 0x100; + actor->bgCheckFlags |= BGCHECKFLAG_CRUSHED; } } else { actor->world.pos.x = actor->prevPos.x; @@ -1542,15 +1543,15 @@ s32 func_800B7678(PlayState* play, Actor* actor, Vec3f* pos, s32 flags) { actor->world.pos.y = actor->floorHeight; if (actor->velocity.y <= 0.0f) { - if (!(actor->bgCheckFlags & 1)) { - actor->bgCheckFlags |= 2; + if (!(actor->bgCheckFlags & BGCHECKFLAG_GROUND)) { + actor->bgCheckFlags |= BGCHECKFLAG_GROUND_TOUCH; } else if ((flags & 8) && (actor->gravity < 0.0f)) { actor->velocity.y = -4.0f; } else if (!(flags & 0x100)) { actor->velocity.y = 0.0f; } - actor->bgCheckFlags |= 1; + actor->bgCheckFlags |= BGCHECKFLAG_GROUND; BgCheck2_AttachToMesh(&play->colCtx, actor, (s32)actor->floorBgId); } } else { @@ -1566,14 +1567,14 @@ void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight, s32 pad; Vec3f pos; - if ((actor->floorBgId != BGCHECK_SCENE) && (actor->bgCheckFlags & 1)) { + if ((actor->floorBgId != BGCHECK_SCENE) && (actor->bgCheckFlags & BGCHECKFLAG_GROUND)) { BgCheck2_UpdateActorAttachedToMesh(&play->colCtx, actor->floorBgId, actor); } if (flags & 1) { s32 bgId; - actor->bgCheckFlags &= ~0x1000; + actor->bgCheckFlags &= ~BGCHECKFLAG_PLAYER_1000; if ((!(flags & 0x80) && (BgCheck_EntitySphVsWall3(&play->colCtx, &pos, &actor->world.pos, &actor->prevPos, wallCheckRadius, &actor->wallPoly, &bgId, actor, wallCheckHeight))) || @@ -1582,18 +1583,18 @@ void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight, &actor->wallPoly, &bgId, actor, wallCheckHeight)))) { CollisionPoly* sp7C = actor->wallPoly; - actor->bgCheckFlags |= 8; - if ((flags & 0x200) && (actor->bgCheckFlags & 0x1000) && ((s32)sp7C->normal.y > 0) && + actor->bgCheckFlags |= BGCHECKFLAG_WALL; + if ((flags & 0x200) && (actor->bgCheckFlags & BGCHECKFLAG_PLAYER_1000) && ((s32)sp7C->normal.y > 0) && (sqrtf(SQXYZ(actor->colChkInfo.displacement)) < 10.0f)) { - actor->bgCheckFlags &= ~8; - } else if (actor->bgCheckFlags & 8) { + actor->bgCheckFlags &= ~BGCHECKFLAG_WALL; + } else if (actor->bgCheckFlags & BGCHECKFLAG_WALL) { Math_Vec3f_Copy(&actor->world.pos, &pos); } actor->wallYaw = Math_Atan2S_XY(sp7C->normal.z, sp7C->normal.x); actor->wallBgId = bgId; } else { - actor->bgCheckFlags &= ~8; + actor->bgCheckFlags &= ~BGCHECKFLAG_WALL; } } @@ -1605,10 +1606,10 @@ void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight, pos.y = actor->prevPos.y + 4.0f; if (BgCheck_EntityCheckCeiling(&play->colCtx, &y, &pos, (ceilingCheckHeight + sp94) - 4.0f, &D_801ED8B0, &D_801ED8B4, actor)) { - actor->bgCheckFlags |= 0x10; + actor->bgCheckFlags |= BGCHECKFLAG_CEILING; actor->world.pos.y = (y + sp94) - 4.0f; } else { - actor->bgCheckFlags &= ~0x10; + actor->bgCheckFlags &= ~BGCHECKFLAG_CEILING; } } if (flags & 4) { @@ -1622,9 +1623,9 @@ void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight, if (WaterBox_GetSurface1(play, &play->colCtx, actor->world.pos.x, actor->world.pos.z, &y, &waterbox)) { actor->depthInWater = y - actor->world.pos.y; if (actor->depthInWater <= 0.0f) { - actor->bgCheckFlags &= ~(0x40 | 0x20); - } else if (!(actor->bgCheckFlags & 0x20)) { - actor->bgCheckFlags |= (0x40 | 0x20); + actor->bgCheckFlags &= ~(BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH); + } else if (!(actor->bgCheckFlags & BGCHECKFLAG_WATER)) { + actor->bgCheckFlags |= (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH); if (!(flags & 0x40)) { Vec3f sp64; @@ -1637,10 +1638,10 @@ void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight, EffectSsGRipple_Spawn(play, &sp64, 100, 500, 8); } } else { - actor->bgCheckFlags &= ~0x40; + actor->bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH; } } else { - actor->bgCheckFlags &= ~(0x40 | 0x20); + actor->bgCheckFlags &= ~(BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH); actor->depthInWater = BGCHECK_Y_MIN; } } @@ -1653,9 +1654,9 @@ void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight, actor->depthInWater = y - actor->world.pos.y; if (actor->depthInWater < 0.0f) { - actor->bgCheckFlags &= ~(0x40 | 0x20); - } else if (!(actor->bgCheckFlags & 0x20)) { - actor->bgCheckFlags |= (0x40 | 0x20); + actor->bgCheckFlags &= ~(BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH); + } else if (!(actor->bgCheckFlags & BGCHECKFLAG_WATER)) { + actor->bgCheckFlags |= (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH); if (!(flags & 0x40)) { Vec3f sp50; @@ -1668,10 +1669,10 @@ void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight, EffectSsGRipple_Spawn(play, &sp50, 100, 500, 8); } } else { - actor->bgCheckFlags &= ~0x40; + actor->bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH; } } else { - actor->bgCheckFlags &= ~(0x40 | 0x20); + actor->bgCheckFlags &= ~(BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH); actor->depthInWater = BGCHECK_Y_MIN; } } @@ -2152,7 +2153,7 @@ void Actor_PlaySfx(Actor* actor, u16 sfxId) { void func_800B8EF4(PlayState* play, Actor* actor) { u32 sfxId; - if (actor->bgCheckFlags & 0x20) { + if (actor->bgCheckFlags & BGCHECKFLAG_WATER) { if (actor->depthInWater < 20.0f) { sfxId = NA_SE_PL_WALK_WATER0 - SFX_FLAG; } else { @@ -3680,7 +3681,7 @@ s16 Actor_TestFloorInDirection(Actor* actor, PlayState* play, f32 distance, s16 Actor_UpdateBgCheckInfo(play, actor, 0.0f, 0.0f, 0.0f, 4); Math_Vec3f_Copy(&actor->world.pos, &actorPos); - ret = actor->bgCheckFlags & 1; + ret = actor->bgCheckFlags & BGCHECKFLAG_GROUND; actor->bgCheckFlags = bgCheckFlags; diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index eda6437aff..6d4414c38f 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -1955,7 +1955,7 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul } posResult->z = posIntersect.z; if (actor != NULL) { - actor->bgCheckFlags |= 0x1000; + actor->bgCheckFlags |= BGCHECKFLAG_PLAYER_1000; } } // poly is wall @@ -2001,7 +2001,7 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul result = true; if (poly->normal.y * COLPOLY_NORMAL_FRAC > 0.5f) { if (actor != NULL) { - actor->bgCheckFlags |= 0x1000; + actor->bgCheckFlags |= BGCHECKFLAG_PLAYER_1000; } } } else { diff --git a/src/code/z_en_hy_code.c b/src/code/z_en_hy_code.c index 1affc8df7c..2f508bb948 100644 --- a/src/code/z_en_hy_code.c +++ b/src/code/z_en_hy_code.c @@ -254,7 +254,7 @@ s32 EnHy_PlayWalkingSound(EnHy* enHy, PlayState* play, f32 distAboveThreshold) { u16 sfxId; u8 isFootOnGround; - if (enHy->actor.bgCheckFlags & 0x20) { + if (enHy->actor.bgCheckFlags & BGCHECKFLAG_WATER) { if (enHy->actor.depthInWater < 20.0f) { waterSfxId = NA_SE_PL_WALK_WATER0 - SFX_FLAG; } else { diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 987f8b10eb..4423a184d5 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -362,7 +362,7 @@ void func_800A640C(EnItem00* this, PlayState* play) { } } - if ((this->actor.gravity != 0.0f) && !(this->actor.bgCheckFlags & 1)) { + if ((this->actor.gravity != 0.0f) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actionFunc = func_800A6650; } } @@ -387,12 +387,12 @@ void func_800A6650(EnItem00* this, PlayState* play) { EffectSsKirakira_SpawnSmall(play, &pos, &sEffectVelocity, &sEffectAccel, &sEffectPrimColor, &sEffectEnvColor); } - if (this->actor.bgCheckFlags & 3) { + if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) { if (this->actor.velocity.y > -2.0f) { this->actionFunc = func_800A640C; } else { this->actor.velocity.y = this->actor.velocity.y * -0.8f; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; } } } @@ -444,7 +444,7 @@ void func_800A6780(EnItem00* this, PlayState* play) { EffectSsKirakira_SpawnSmall(play, &pos, &sEffectVelocity, &sEffectAccel, &sEffectPrimColor, &sEffectEnvColor); } - if (this->actor.bgCheckFlags & 3) { + if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) { this->actionFunc = func_800A640C; this->actor.shape.rot.z = 0; this->actor.speed = 0.0f; diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index a52a7a5c44..4bdd22e0ad 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -495,7 +495,8 @@ s32 func_801234D4(PlayState* play) { return (player->stateFlags2 & PLAYER_STATE2_8) || (player->actor.speed != 0.0f) || ((player->transformation != PLAYER_FORM_ZORA) && (player->stateFlags1 & PLAYER_STATE1_8000000)) || ((player->transformation == PLAYER_FORM_ZORA) && (player->stateFlags1 & PLAYER_STATE1_8000000) && - (!(player->actor.bgCheckFlags & 1) || (player->currentBoots < PLAYER_BOOTS_ZORA_UNDERWATER))); + (!(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + (player->currentBoots < PLAYER_BOOTS_ZORA_UNDERWATER))); } s32 func_80123590(PlayState* play, Actor* actor) { @@ -1274,7 +1275,7 @@ void func_80123DA4(Player* player) { } void func_80123DC0(Player* player) { - if ((player->actor.bgCheckFlags & 1) || + if ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (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))) { @@ -1461,7 +1462,7 @@ s32 Player_GetEnvironmentalHazard(PlayState* play) { envHazard = PLAYER_ENV_HAZARD_UNDERWATER_FREE - 1; } else if (player->stateFlags1 & PLAYER_STATE1_8000000) { if ((player->transformation == PLAYER_FORM_ZORA) && (player->currentBoots >= PLAYER_BOOTS_ZORA_UNDERWATER) && - (player->actor.bgCheckFlags & 1)) { + (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { envHazard = PLAYER_ENV_HAZARD_UNDERWATER_FLOOR - 1; } else { envHazard = PLAYER_ENV_HAZARD_SWIMMING - 1; 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 0e8c0f493d..5a16e6845f 100644 --- a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c +++ b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c @@ -163,9 +163,9 @@ void BgIcicle_Shiver(BgIcicle* this, PlayState* play) { } void BgIcicle_Fall(BgIcicle* this, PlayState* play) { - if ((this->collider.base.atFlags & AT_HIT) || (this->dyna.actor.bgCheckFlags & 1)) { + if ((this->collider.base.atFlags & AT_HIT) || (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->collider.base.atFlags &= ~AT_HIT; - this->dyna.actor.bgCheckFlags &= ~1; + this->dyna.actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; if (this->dyna.actor.world.pos.y < this->dyna.actor.floorHeight) { this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; 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 18eb983259..e76d7217aa 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 @@ -119,7 +119,7 @@ void BgIkanaDharma_Init(Actor* thisx, PlayState* play2) { this->dyna.actor.unk20, NULL); } - this->dyna.actor.bgCheckFlags |= 1; + this->dyna.actor.bgCheckFlags |= BGCHECKFLAG_GROUND; } BgIkanaDharma_SetupWaitForHit(this); @@ -227,7 +227,7 @@ void BgIkanaDharma_Update(Actor* thisx, PlayState* play) { if (actorBelow == NULL) { Actor_MoveWithGravity(&this->dyna.actor); Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4); - if (this->dyna.actor.bgCheckFlags & 2) { + if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); Quake_SetSpeed(quakeIndex, 21536); 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 3a0107e11c..8b91992daa 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 @@ -647,7 +647,7 @@ void func_80B814B8(BgIkanaRotaryroom* this, PlayState* play) { Player* player = GET_PLAYER(play); if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) { - if (player->actor.bgCheckFlags & 0x100) { + if (player->actor.bgCheckFlags & BGCHECKFLAG_CRUSHED) { Player_PlaySfx(player, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->voiceSfxIdOffset); func_80169EFC(&play->state); Player_PlaySfx(player, NA_SE_VO_LI_TAKEN_AWAY + player->ageProperties->voiceSfxIdOffset); 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 55940f3fa7..67fedd58c6 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -228,7 +228,7 @@ void func_809541B8(BgIngate* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->unk160 & 0x4) { - if ((player->transformation == PLAYER_FORM_HUMAN) && (player->actor.bgCheckFlags & 1) && + if ((player->transformation == PLAYER_FORM_HUMAN) && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->dyna.actor.xzDistToPlayer < 40.0f)) { if (this->dyna.actor.playerHeightRel > 15.0f) { func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_7); 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 5a23089a21..7bc3e8544d 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 @@ -283,7 +283,7 @@ void BgKin2Picture_Fall(BgKin2Picture* this, PlayState* play) { Actor_MoveWithGravity(&this->dyna.actor); Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4); - if (this->dyna.actor.bgCheckFlags & 1) { + if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_StepToS(&this->step, 0x7D0, 0x78); if (this->landTimer < 3) { 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 2ef6227375..9bb3cdf759 100644 --- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c +++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c @@ -996,7 +996,7 @@ void func_809DAB78(Boss02* this, PlayState* play) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 150.0f, 100.0f, 4); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->unk_0144 = 23; this->actor.speed = 0.0f; this->unk_0170 = this->unk_017C; 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 fba59ca515..a13e18ec12 100644 --- a/src/overlays/actors/ovl_Boss_03/z_boss_03.c +++ b/src/overlays/actors/ovl_Boss_03/z_boss_03.c @@ -584,7 +584,7 @@ void func_809E34B8(Boss03* this, PlayState* play) { Math_ApproachF(&this->actor.speed, this->unk_278, 1.0f, this->unk_27C); Math_ApproachF(&this->unk_260, sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f); - if ((this->workTimer[WORK_TIMER_UNK2_A] == 0) && (this->actor.bgCheckFlags & 8)) { + if ((this->workTimer[WORK_TIMER_UNK2_A] == 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { Matrix_MultVecZ(-500.0f, &this->unk_268); this->unk_268.y = Rand_ZeroFloat(100.0f) + 150.0f; this->workTimer[WORK_TIMER_UNK2_A] = 60; @@ -618,7 +618,7 @@ void func_809E34B8(Boss03* this, PlayState* play) { if (this->workTimer[WORK_TIMER_UNK1_A] == 0) { // Player is above water && Player is standing on ground - if ((this->waterHeight < player->actor.world.pos.y) && (player->actor.bgCheckFlags & 1)) { + if ((this->waterHeight < player->actor.world.pos.y) && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Boss03_SetupPrepareCharge(this, play); } else if ((player->transformation != PLAYER_FORM_GORON) && (player->transformation != PLAYER_FORM_DEKU)) { if (KREG(70) == 0) { @@ -678,7 +678,8 @@ void Boss03_ChasePlayer(Boss03* this, PlayState* play) { // If either (Player is standing on ground && Player is above water) or (WORK_TIMER_CURRENT_ACTION timer runs out), // then stop chasing - if (((player->actor.bgCheckFlags & 1) && (player->actor.shape.feetPos[0].y >= WATER_HEIGHT + 8.0f)) || + if (((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + (player->actor.shape.feetPos[0].y >= WATER_HEIGHT + 8.0f)) || (this->workTimer[WORK_TIMER_CURRENT_ACTION] == 0)) { if (&this->actor == player->actor.parent) { player->unk_AE8 = 101; @@ -773,7 +774,8 @@ void Boss03_CatchPlayer(Boss03* this, PlayState* play) { // If either (Player is standing on ground && Player is above water) or (WORK_TIMER_CURRENT_ACTION timer runs out) // then stop trying to catch Player - if (((player->actor.bgCheckFlags & 1) && (player->actor.shape.feetPos[FOOT_LEFT].y >= WATER_HEIGHT + 8.0f)) || + if (((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + (player->actor.shape.feetPos[FOOT_LEFT].y >= WATER_HEIGHT + 8.0f)) || (this->workTimer[WORK_TIMER_CURRENT_ACTION] == 0)) { if (&this->actor == player->actor.parent) { player->unk_AE8 = 101; @@ -985,7 +987,7 @@ void Boss03_PrepareCharge(Boss03* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); // Player is above water && Player is standing on ground - if ((this->waterHeight < player->actor.world.pos.y) && (player->actor.bgCheckFlags & 1)) { + if ((this->waterHeight < player->actor.world.pos.y) && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->workTimer[WORK_TIMER_CURRENT_ACTION] == 0) { Boss03_SetupCharge(this, play); } @@ -1046,14 +1048,14 @@ void Boss03_Charge(Boss03* this, PlayState* play) { } // Attack platform - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { play_sound(NA_SE_IT_BIG_BOMB_EXPLOSION); func_800BC848(&this->actor, play, 20, 15); Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WATER_EFFECT, 0.0f, this->waterHeight, 0.0f, 0, 0, 0x96, ENWATEREFFECT_TYPE_GYORG_SHOCKWAVE); // Player is above water && Player is standing on ground - if ((this->waterHeight < player->actor.world.pos.y) && (player->actor.bgCheckFlags & 1)) { + if ((this->waterHeight < player->actor.world.pos.y) && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { func_800B8D50(play, NULL, 7.0f, Math_Atan2S_XY(player->actor.world.pos.z, player->actor.world.pos.x), 7.0f, 0); } @@ -1451,7 +1453,8 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) { this->unk_2BE = Math_Atan2S_XY(this->actor.world.pos.z, this->actor.world.pos.x); // Player is above water && Player is standing on ground - if ((this->waterHeight < player->actor.world.pos.y) && (player->actor.bgCheckFlags & 1)) { + if ((this->waterHeight < player->actor.world.pos.y) && + (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { player->actor.world.pos.x = 0.0f; player->actor.world.pos.z = -200.0f; } @@ -1768,7 +1771,7 @@ void Boss03_Stunned(Boss03* this, PlayState* play) { if ((this->waterHeight + 30.0f) < this->actor.world.pos.y) { this->actor.gravity = -2.0f; Actor_MoveWithGravity(&this->actor); - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { play_sound(NA_SE_IT_WALL_HIT_HARD); func_800BC848(&this->actor, play, 10, 10); } @@ -2095,7 +2098,8 @@ void Boss03_Update(Actor* thisx, PlayState* play2) { } // Player is standing on ground && Player is above water - if ((player->actor.bgCheckFlags & 1) && (player->actor.shape.feetPos[FOOT_LEFT].y >= WATER_HEIGHT + 8.0f)) { + if ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + (player->actor.shape.feetPos[FOOT_LEFT].y >= WATER_HEIGHT + 8.0f)) { if (this->wetSpotEffectSpawnCount != 0) { this->wetSpotEffectSpawnCount--; @@ -2514,7 +2518,7 @@ void Boss03_SeaweedUpdate(Actor* thisx, PlayState* play) { disturbanceFactor = player->actor.speed * 3.0f + 70.0f; // Player is standing on ground - if (player->actor.bgCheckFlags & 1) { + if (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { maxBendSpeed = 0; } else { maxBendSpeed = player->actor.speed * 16.0f; 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 a78b7234ec..709ef43f87 100644 --- a/src/overlays/actors/ovl_Boss_04/z_boss_04.c +++ b/src/overlays/actors/ovl_Boss_04/z_boss_04.c @@ -323,7 +323,7 @@ void func_809EC568(Boss04* this, PlayState* play) { Math_ApproachF(&this->subCamAt.x, this->actor.world.pos.x, 0.5f, 1000.0f); Math_ApproachF(&this->subCamAt.y, this->actor.world.pos.y, 0.5f, 1000.0f); Math_ApproachF(&this->subCamAt.z, this->actor.world.pos.z, 0.5f, 1000.0f); - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { play_sound(NA_SE_IT_BIG_BOMB_EXPLOSION); this->unk_6F4 = 15; this->unk_708 = 13; @@ -467,7 +467,7 @@ void func_809ECEF4(Boss04* this) { void func_809ECF58(Boss04* this, PlayState* play) { Vec3f sp3C; - if ((this->unk_1FE == 14) || ((this->actor.bgCheckFlags & 8) && (this->unk_1F8 == 0))) { + if ((this->unk_1FE == 14) || ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->unk_1F8 == 0))) { this->unk_1F8 = 20; if ((Rand_ZeroOne() < 0.2f) && (this->unk_1FE == 0)) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; @@ -479,7 +479,7 @@ void func_809ECF58(Boss04* this, PlayState* play) { this->actor.speed = 0.0f; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { play_sound(NA_SE_IT_BIG_BOMB_EXPLOSION); func_800BC848(&this->actor, play, 15, 10); this->unk_6F4 = 15; 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 3ccfd26998..e4fdedaf59 100644 --- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c +++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c @@ -1529,7 +1529,7 @@ void func_80BEFAF0(EnAkindonuts* this, PlayState* play) { if (this->path != NULL) { sp34 = func_80BECEAC(this->path, this->unk_334, &this->actor.world.pos, &sp38); - if (this->actor.bgCheckFlags & 0x8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp38.y = this->actor.wallYaw; } 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 acefdf5007..11ad2a9d72 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -265,7 +265,7 @@ void EnAm_ApplyEnemyTexture(EnAm* this, PlayState* play) { void func_808B0208(EnAm* this, PlayState* play) { // If the armos is against a wall, rotate and turn away from it - if ((this->actor.speed > 0.0f) && (this->actor.bgCheckFlags & 8)) { + if ((this->actor.speed > 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { this->actor.world.rot.y = (this->actor.wallYaw * 2) - this->actor.world.rot.y; this->actor.world.pos.x += this->actor.speed * Math_SinS(this->actor.world.rot.y); this->actor.world.pos.z += this->actor.speed * Math_CosS(this->actor.world.rot.y); @@ -275,12 +275,12 @@ void func_808B0208(EnAm* this, PlayState* play) { this->actor.speed = this->speed; this->actor.velocity.y = 12.0f; } else if (this->skelAnime.curFrame > 11.0f) { - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->skelAnime.curFrame = 11.0f; } else { Math_ScaledStepToS(&this->actor.world.rot.y, this->armosYaw, 0x1F40); this->actor.speed = 0.0f; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { EnAm_SpawnEffects(this, play); } } @@ -302,7 +302,7 @@ void func_808B0358(EnAm* this) { void func_808B03C0(EnAm* this, PlayState* play) { this->armosYaw = this->actor.yawTowardsPlayer; func_808B0208(this, play); - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->explodeTimer--; } if (this->explodeTimer == 0) { @@ -334,7 +334,7 @@ void func_808B04E4(EnAm* this) { void func_808B0508(EnAm* this, PlayState* play) { func_808B0208(this, play); - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Math_StepToF(&this->actor.world.pos.x, this->actor.home.pos.x, 2.0f); Math_StepToF(&this->actor.world.pos.z, this->actor.home.pos.z, 2.0f); } 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 9d0600b2e8..b2a6456bc5 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -211,7 +211,7 @@ void EnAni_FallToGround(EnAni* this, PlayState* play) { s32 pad; s16 quakeIndex; - if (this->actor.bgCheckFlags & 1) { // hit the ground + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.flags &= ~ACTOR_FLAG_10; this->actionFunc = EnAni_LandOnFoot; this->actor.velocity.x = 0.0f; 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 fa6cd3e757..0c5ae730ff 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -273,8 +273,8 @@ void func_8088AA98(EnArrow* this, PlayState* play) { f32 temp_f0; if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp50, &sp54) && - (this->actor.world.pos.y < sp50) && !(this->actor.bgCheckFlags & 0x20)) { - this->actor.bgCheckFlags |= 0x20; + (this->actor.world.pos.y < sp50) && !(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { + this->actor.bgCheckFlags |= BGCHECKFLAG_WATER; Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.home.pos, &sp44); 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 0994ada491..630d0e599d 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 @@ -236,7 +236,7 @@ void EnAttackNiw_EnterViewFromOffscreen(EnAttackNiw* this, PlayState* play) { Actor_SetFocus(&this->actor, this->targetHeight); Actor_GetScreenPos(play, &this->actor, &posX, &posY); - if (this->actor.bgCheckFlags & 8) { // touching a wall + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->targetRotY = this->actor.yawTowardsPlayer; this->targetRotX = this->actor.world.rot.x - 3000.0f; this->hopTimer = 0; @@ -255,7 +255,7 @@ void EnAttackNiw_EnterViewFromOffscreen(EnAttackNiw* this, PlayState* play) { } else if (((this->actor.projectedPos.z > 0.0f) && (fabsf(flightTarget.x - this->actor.world.pos.x) < 50.0f) && (fabsf(flightTarget.y - this->actor.world.pos.y) < 50.0f) && (fabsf(flightTarget.z - this->actor.world.pos.z) < 50.0f)) || - (this->actor.bgCheckFlags & 1)) { // touching ground or with close distance of target + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { // reset state this->hopTimer = 0; this->unkTimer250 = this->hopTimer; @@ -286,7 +286,7 @@ void EnAttackNiw_AimAtPlayer(EnAttackNiw* this, PlayState* play) { return; } - if (this->actor.bgCheckFlags & 1) { // touching floor + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->hopTimer == 0) { this->hopTimer = 3; this->actor.velocity.y = 3.5f; @@ -316,17 +316,16 @@ void EnAttackNiw_AimAtPlayer(EnAttackNiw* this, PlayState* play) { Math_ApproachF(&this->rotStep, 10000.0f, 1.0f, 1000.0f); Math_ApproachF(&this->actor.speed, this->targetXZSpeed, 0.9f, 1.0f); - if (this->actor.gravity == -2.0f && this->unkTimer25A == 0 && - (this->actor.bgCheckFlags & 8 || this->randomAngleChangeTimer == 0)) { + if ((this->actor.gravity == -2.0f) && (this->unkTimer25A == 0) && + ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->randomAngleChangeTimer == 0))) { this->targetXZSpeed = 0.0f; this->actor.gravity = 0.0f; this->rotStep = 0.0f; this->targetRotX = this->actor.world.rot.x - 5000.0f; this->actionFunc = EnAttackNiw_FlyAway; - } else if (this->actor.bgCheckFlags & 1) { // touching floor + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EnAttackNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_SLOW_FORFLAPPING); - } else { EnAttackNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_AND_WAVING); } @@ -380,8 +379,7 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) { return; } - if ((this->actor.bgCheckFlags & 0x20) && // on or below water - (this->actionFunc != EnAttackNiw_FlyAway)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_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_Az/z_en_az.c b/src/overlays/actors/ovl_En_Az/z_en_az.c index 4c611c2734..94be4bdadf 100644 --- a/src/overlays/actors/ovl_En_Az/z_en_az.c +++ b/src/overlays/actors/ovl_En_Az/z_en_az.c @@ -274,7 +274,7 @@ void EnAz_Init(Actor* thisx, PlayState* play2) { this->collider.dim.yShift *= 1.2f; } Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 5); - if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 22.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 22.0f)) { this->unk_374 |= 0x100; this->unk_376 |= 0x100; } @@ -560,7 +560,7 @@ s32 func_80A95B34(PlayState* play, ActorPathing* actorPathing) { } else { ret = func_80A958B0(play, actorPathing); } - } else if (this->actor.bgCheckFlags & 1) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->unk_374 & 8) { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, BEAVER_ANIM_WALK, &this->animIndex); this->unk_374 &= ~8; @@ -578,21 +578,21 @@ void func_80A95C5C(EnAz* this, PlayState* play) { this->actor.gravity = -1.0f; SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, BEAVER_ANIM_IDLE, &this->animIndex); this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8); - this->actor.bgCheckFlags &= ~0x21; + this->actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_WATER); this->unk_3C0 = 0; this->actionFunc = func_80A95CEC; } void func_80A95CEC(EnAz* this, PlayState* play) { if (this->unk_374 & 0x8000) { - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.draw = EnAz_Draw; Actor_MoveWithGravity(&this->actor); func_800B9010(&this->actor, NA_SE_EV_HONEYCOMB_FALL - SFX_FLAG); } else { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_DOWN); } if (SubS_StartActorCutscene(&this->actor, 0x7C, this->unk_3D0[0], SUBS_CUTSCENE_NORMAL)) { @@ -613,7 +613,7 @@ void func_80A95DA0(EnAz* this, PlayState* play) { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, BEAVER_ANIM_SWIM_WITH_SPINNING_TAIL, &this->animIndex); this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8); - this->actor.bgCheckFlags &= ~0x21; + this->actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_WATER); this->unk_374 |= 0x1000; Math_Vec3f_Copy(&this->actor.world.pos, &sp40->curPoint); this->actionFunc = func_80A95E88; @@ -668,7 +668,7 @@ void func_80A95FE8(EnAz* this, PlayState* play) { this->actor.speed = 0.0f; Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 3, 0x1000, 0x100); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 3, 0x1038, 0x100); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.shape.rot.x = 0; this->actor.gravity = 0.0f; func_80A97C0C(this, play); @@ -1517,7 +1517,7 @@ void func_80A97EAC(EnAz* this, PlayState* play) { &this->animIndex); this->actor.flags |= ACTOR_FLAG_8000000; this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8); - this->actor.bgCheckFlags &= ~0x21; + this->actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_WATER); this->unk_374 |= 0x1000; this->unk_3C2 = 0; this->unk_3C4 = 0; @@ -1589,7 +1589,7 @@ void func_80A982E0(PlayState* play, ActorPathing* actorPathing) { Vec3f sp28; actorPathing->curPoint.x = actorPathing->points[actorPathing->curPointIndex].x; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { actorPathing->curPoint.y = actorPathing->points[actorPathing->curPointIndex].y; } else { actorPathing->curPoint.y = actorPathing->points[actorPathing->curPointIndex].y - this->unk_3A4; @@ -1627,7 +1627,7 @@ void EnAz_Update(Actor* thisx, PlayState* play2) { EnAz* this = THIS; this->unk_374 &= ~0x100; - if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 22.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 22.0f)) { if (!(this->unk_376 & 0x100)) { this->unk_374 |= 0x200; } 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 516219265a..ba4c032bf6 100644 --- a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c +++ b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c @@ -316,12 +316,14 @@ void EnBaguo_CheckForDetonation(EnBaguo* this, PlayState* play) { // the Nejiron should forcibly explode and as a loop index. i = false; if (this->action != NEJIRON_ACTION_EXPLODING && this->action != NEJIRON_ACTION_RETREATING) { - if (!(this->actor.bgCheckFlags & 1) && this->actor.world.pos.y < (this->actor.home.pos.y - 100.0f)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + this->actor.world.pos.y < (this->actor.home.pos.y - 100.0f)) { // Force a detonation if we're off the ground and have fallen // below our home position (e.g., we rolled off a ledge). i = true; } - if (this->actor.bgCheckFlags & 0x60 && this->actor.depthInWater >= 40.0f) { + if ((this->actor.bgCheckFlags & (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH)) && + (this->actor.depthInWater >= 40.0f)) { // Force a detonation if we're too far below the water's surface. i = true; } 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 519043dd83..748b337dec 100644 --- a/src/overlays/actors/ovl_En_Bat/z_en_bat.c +++ b/src/overlays/actors/ovl_En_Bat/z_en_bat.c @@ -225,8 +225,8 @@ void EnBat_FlyIdle(EnBat* this, PlayState* play) { finishedRotStep = Math_ScaledStepToS(&this->actor.shape.rot.y, this->yawTarget, 0x300); - if (this->actor.bgCheckFlags & 8) { - this->actor.bgCheckFlags &= ~8; + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL; this->yawTarget = this->actor.wallYaw; } else if (Math3D_XZDistanceSquared(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x, this->actor.home.pos.z) > SQ(300.0f)) { @@ -238,7 +238,7 @@ void EnBat_FlyIdle(EnBat* this, PlayState* play) { finishedRotStep = Math_ScaledStepToS(&this->actor.shape.rot.x, this->pitchTarget, 0x100); - if ((this->actor.bgCheckFlags & 1) || (this->actor.depthInWater > -40.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.depthInWater > -40.0f)) { this->pitchTarget = -0x1000; } else if (this->actor.world.pos.y < (this->actor.home.pos.y - 100.0f)) { this->pitchTarget = -((s32)(0x800 * Rand_ZeroOne()) + 0x800); @@ -295,7 +295,7 @@ void EnBat_DiveAttack(EnBat* this, PlayState* play) { this->timer--; if ((this->timer == 0) || (this->collider.base.atFlags & AT_HIT) || (Player_GetMask(play) == PLAYER_MASK_STONE) || - (this->actor.bgCheckFlags & 1) || (player->stateFlags1 & PLAYER_STATE1_800000) || + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (player->stateFlags1 & PLAYER_STATE1_800000) || (this->actor.depthInWater > -40.0f)) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; @@ -304,11 +304,11 @@ void EnBat_DiveAttack(EnBat* this, PlayState* play) { this->collider.base.atFlags &= ~AT_ON; sNumberAttacking--; EnBat_SetupFlyIdle(this); - } else if ((this->actor.bgCheckFlags & 8) && + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS_ALT(BINANG_SUB(this->actor.wallYaw, this->actor.yawTowardsPlayer)) > 0x6800)) { sNumberAttacking--; this->collider.base.atFlags &= ~AT_ON; - this->actor.bgCheckFlags &= ~8; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL; this->yawTarget = this->actor.wallYaw; EnBat_SetupFlyIdle(this); } @@ -318,7 +318,7 @@ void EnBat_SetupDie(EnBat* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_1; Enemy_StartFinishingBlow(play, &this->actor); this->actor.speed *= Math_CosS(this->actor.world.rot.x); - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.velocity.y = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_FFLY_DEAD); @@ -361,7 +361,7 @@ void EnBat_Die(EnBat* this, PlayState* play) { this->actor.shape.rot.z += 0x1780; } - if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) { Actor_SpawnIceEffects(play, &this->actor, this->bodyPartPoss, ARRAY_COUNT(this->bodyPartPoss), 2, 0.2f, 0.2f); @@ -407,7 +407,7 @@ void EnBat_SetupStunned(EnBat* this) { void EnBat_Stunned(EnBat* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x100); - if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { if (this->timer != 0) { this->timer--; } 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 d122c6d2e6..325b5ad6b8 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -171,14 +171,14 @@ void EnBb_Destroy(Actor* thisx, PlayState* play) { void EnBb_CheckForWall(EnBb* this) { s16 yawDiff; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { yawDiff = this->actor.shape.rot.y - this->actor.wallYaw; if (ABS_ALT(yawDiff) > 0x4000) { this->actor.shape.rot.y = ((this->actor.wallYaw * 2) - this->actor.shape.rot.y) - 0x8000; } this->targetYRotation = this->actor.shape.rot.y; - this->actor.bgCheckFlags &= ~8; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL; } } @@ -325,7 +325,7 @@ void EnBb_Down(EnBb* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); EnBb_CheckForWall(this); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); if (this->timer == 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_UP); @@ -339,7 +339,7 @@ void EnBb_Down(EnBb* this, PlayState* play) { this->actor.velocity.y = 10.0f; } - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 7.0f, 2, 2.0f, 0, 0, 0); Math_ScaledStepToS(&this->actor.shape.rot.y, BINANG_ADD(this->actor.yawTowardsPlayer, 0x8000), 0xBB8); } @@ -436,7 +436,7 @@ void EnBb_SetupDamage(EnBb* this) { void EnBb_Damage(EnBb* this, PlayState* play) { Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f); - if ((this->actor.bgCheckFlags & 1) && (this->actor.speed < 0.1f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speed < 0.1f)) { EnBb_SetupDown(this); } } 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 745ab6df51..9e246c3abb 100644 --- a/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c +++ b/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c @@ -237,14 +237,14 @@ void EnBbfall_PlaySfx(EnBbfall* this) { void EnBbfall_CheckForWall(EnBbfall* this) { s16 yawDiff; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { yawDiff = this->actor.shape.rot.y - this->actor.wallYaw; if (ABS_ALT(yawDiff) > 0x4000) { this->actor.shape.rot.y = ((this->actor.wallYaw * 2) - this->actor.shape.rot.y) - 0x8000; } - this->actor.bgCheckFlags &= ~8; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL; } } @@ -283,7 +283,7 @@ void EnBbfall_SetupWaitForPlayer(EnBbfall* this) { this->flamePos[i].y -= 47.0f; } - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.flags &= ~ACTOR_FLAG_1; this->actionFunc = EnBbfall_WaitForPlayer; } @@ -322,7 +322,7 @@ void EnBbfall_Emerge(EnBbfall* this, PlayState* play) { void EnBbfall_SetupFly(EnBbfall* this) { this->flameOpacity = 255; this->isBgCheckCollisionEnabled = true; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.speed = 5.0f; this->actor.gravity = -1.0f; this->actionFunc = EnBbfall_Fly; @@ -333,7 +333,7 @@ void EnBbfall_Fly(EnBbfall* this, PlayState* play) { Math_StepToF(&this->flameScaleY, 0.8f, 0.1f); Math_StepToF(&this->flameScaleX, 1.0f, 0.1f); EnBbfall_CheckForWall(this); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (EnBbfall_IsTouchingLava(this, play)) { EnBbfall_SetupSinkIntoLava(this); } else { @@ -343,7 +343,7 @@ void EnBbfall_Fly(EnBbfall* this, PlayState* play) { this->actor.shape.rot.y += (s16)randPlusMinusPoint5Scaled(73728.0f); } - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; } this->actor.world.rot.y = this->actor.shape.rot.y; @@ -385,7 +385,7 @@ void EnBbfall_Down(EnBbfall* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); EnBbfall_CheckForWall(this); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (EnBbfall_IsTouchingLava(this, play)) { EnBbfall_SetupSinkIntoLava(this); return; @@ -406,7 +406,7 @@ void EnBbfall_Down(EnBbfall* this, PlayState* play) { this->actor.velocity.y = 10.0f; } - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 7.0f, 2, 2.0f, 0, 0, 0); Math_ScaledStepToS(&this->actor.shape.rot.y, BINANG_ADD(this->actor.yawTowardsPlayer, 0x8000), 0xBB8); } @@ -501,7 +501,7 @@ void EnBbfall_SetupDamage(EnBbfall* this) { void EnBbfall_Damage(EnBbfall* this, PlayState* play) { Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f); - if ((this->actor.bgCheckFlags & 1) && (this->actor.speed < 0.1f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speed < 0.1f)) { if (EnBbfall_IsTouchingLava(this, play)) { EnBbfall_SetupSinkIntoLava(this); } else { 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 41fd002f51..74fbbfc511 100644 --- a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c +++ b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c @@ -500,10 +500,10 @@ void func_80A28708(EnBigpamet* this, PlayState* play) { void func_80A28760(EnBigpamet* this) { this->actor.speed = 15.0f; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { s16 temp_v1 = this->actor.yawTowardsPlayer - this->actor.wallYaw; - this->actor.bgCheckFlags &= ~8; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL; if (temp_v1 > 0x3C00) { this->actor.world.rot.y = this->actor.wallYaw + 0x3C00; @@ -539,7 +539,7 @@ void func_80A287E8(EnBigpamet* this, PlayState* play) { func_80A27FE8(this, play); } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); this->actor.velocity.y = this->unk_29E * 0.375f; @@ -627,7 +627,7 @@ void func_80A28B98(EnBigpamet* this, PlayState* play) { } this->actor.shape.rot.y = this->actor.world.rot.y; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.flags &= ~ACTOR_FLAG_1; this->actor.params = ENBIGPAMET_0; @@ -648,7 +648,7 @@ void func_80A28B98(EnBigpamet* this, PlayState* play) { void func_80A28D0C(EnBigpamet* this, PlayState* play) { SkelAnime_Update(&this->skelAnime2); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Actor_PlaySfx(&this->actor, NA_SE_EN_HIPLOOP_LAND); func_80A27FE8(this, play); func_80A28D80(this); 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 c932959a02..6af5b39051 100644 --- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c +++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c @@ -206,7 +206,7 @@ void EnBigpo_Init(Actor* thisx, PlayState* play2) { } ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 45.0f); - thisx->bgCheckFlags |= 0x400; + thisx->bgCheckFlags |= BGCHECKFLAG_PLAYER_400; this->savedHeight = thisx->home.pos.y + 100.0f; this->mainColor.r = 255; this->mainColor.g = 255; @@ -744,12 +744,12 @@ void EnBigpo_SetupLanternDrop(EnBigpo* this, PlayState* play) { this->actor.world.pos.y -= 15.0f; func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_MISC); this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4); // targetable OFF, enemy music OFF - this->actor.bgCheckFlags &= ~0x400; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_PLAYER_400; this->actionFunc = EnBigpo_LanternFalling; } void EnBigpo_LanternFalling(EnBigpo* this, PlayState* play) { - if (this->actor.bgCheckFlags & 1 || this->actor.floorHeight == BGCHECK_Y_MIN) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND || this->actor.floorHeight == BGCHECK_Y_MIN) { if (this->switchFlags != 0xFF) { Flags_SetSwitch(play, this->switchFlags); } 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 a49f161f8a..803aafc3b9 100644 --- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c +++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c @@ -536,47 +536,47 @@ void EnBigslime_CheckRoomBoundaries(EnBigslime* this, Vec3f* vtxMax, Vec3f* vtxM f32 vtxMaxZ; f32 vtxMinZ; - this->actor.bgCheckFlags &= ~(0x2 | 0x8 | 0x10); + this->actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING); if ((this->actor.world.pos.y + vtxMax->y) > GBT_ROOM_5_MAX_Y) { this->actor.world.pos.y = GBT_ROOM_5_MAX_Y - vtxMax->y; - this->actor.bgCheckFlags |= 0x10; + this->actor.bgCheckFlags |= BGCHECKFLAG_CEILING; } if ((this->actor.world.pos.y + vtxMin->y) <= GBT_ROOM_5_MIN_Y) { this->actor.world.pos.y = GBT_ROOM_5_MIN_Y - vtxMin->y; - if (!(this->actor.bgCheckFlags & 1)) { - this->actor.bgCheckFlags |= 2; + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { + this->actor.bgCheckFlags |= BGCHECKFLAG_GROUND_TOUCH; } - this->actor.bgCheckFlags |= 1; + this->actor.bgCheckFlags |= BGCHECKFLAG_GROUND; } else { - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; } - if ((this->actionFunc != EnBigslime_Freeze) || !(this->actor.bgCheckFlags & 1)) { + if ((this->actionFunc != EnBigslime_Freeze) || !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { worldPosX = this->actor.world.pos.x; vtxMaxX = vtxMax->x; if (GBT_ROOM_5_MAX_X < (worldPosX + vtxMaxX)) { - this->actor.bgCheckFlags |= 8; + this->actor.bgCheckFlags |= BGCHECKFLAG_WALL; this->actor.world.pos.x = GBT_ROOM_5_MAX_X - vtxMaxX; } else { vtxMinX = vtxMin->x; if ((worldPosX + vtxMinX) < GBT_ROOM_5_MIN_X) { this->actor.world.pos.x = GBT_ROOM_5_MIN_X - vtxMinX; - this->actor.bgCheckFlags |= 8; + this->actor.bgCheckFlags |= BGCHECKFLAG_WALL; } } worldPosZ = this->actor.world.pos.z; vtxMaxZ = vtxMax->z; if (GBT_ROOM_5_MAX_Z < (worldPosZ + vtxMaxZ)) { - this->actor.bgCheckFlags |= 8; + this->actor.bgCheckFlags |= BGCHECKFLAG_WALL; this->actor.world.pos.z = GBT_ROOM_5_MAX_Z - vtxMaxZ; } else { vtxMinZ = vtxMin->z; if ((worldPosZ + vtxMinZ) < GBT_ROOM_5_MIN_Z) { this->actor.world.pos.z = GBT_ROOM_5_MIN_Z - vtxMinZ; - this->actor.bgCheckFlags |= 8; + this->actor.bgCheckFlags |= BGCHECKFLAG_WALL; } } } @@ -769,7 +769,7 @@ void EnBigslime_BreakIntoMinislime(EnBigslime* this, PlayState* play) { this->actor.hintId = TATL_HINT_ID_GEKKO_GIANT_SLIME; this->gekkoRot.x = 0; this->gekkoRot.y = 0; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->formBigslimeTimer = 2; EnBigslime_AddIceShardEffect(this, play); Actor_PlaySfx(&this->actor, NA_SE_EN_B_SLIME_BREAK); @@ -1083,7 +1083,7 @@ void EnBigslime_Drop(EnBigslime* this, PlayState* play) { EnBigslime_GekkoSfxOutsideBigslime(this, NA_SE_EN_FROG_DOWN); this->rotation = 0; } - } else if (this->actor.bgCheckFlags & 1) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EnBigslime_SetupSquishFlat(this); } else { Math_StepToF(&this->actor.scale.x, 0.15f, 0.0025f); @@ -1820,7 +1820,7 @@ void EnBigslime_SetupFreeze(EnBigslime* this) { this->actor.speed = 0.0f; this->freezeTimer = 40; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; } else if ((this->actionFunc == EnBigslime_Rise) && (this->riseCounter < 2)) { @@ -1898,7 +1898,7 @@ void EnBigslime_Freeze(EnBigslime* this, PlayState* play) { } func_800B9010(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (this->freezeTimer == 0) { EnBigslime_BreakIntoMinislime(this, play); } else { @@ -1907,7 +1907,7 @@ void EnBigslime_Freeze(EnBigslime* this, PlayState* play) { EnBigslime_SetupSquishFlat(this); } } else if (this->freezeTimer == 0) { - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { EnBigslime_SetupFrozenFall(this); } else { EnBigslime_SetupFrozenGround(this); @@ -2019,7 +2019,7 @@ void EnBigslime_FrozenFall(EnBigslime* this, PlayState* play) { func_800B8D50(play, &this->actor, 7.0f, this->actor.yawTowardsPlayer, 5.0f, 0x10); } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EnBigslime_BreakIntoMinislime(this, play); } } @@ -2037,7 +2037,7 @@ void EnBigslime_JumpGekko(EnBigslime* this, PlayState* play) { s16 yaw; s16 yawDiff; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->gekkoCollider.base.acFlags |= AC_ON; this->actor.flags |= ACTOR_FLAG_1; } @@ -2049,7 +2049,8 @@ void EnBigslime_JumpGekko(EnBigslime* this, PlayState* play) { EnBigslime_GekkoSfxOutsideBigslime(this, NA_SE_EV_WALK_WATER); } - if (!(this->actor.bgCheckFlags & 1) || ((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + ((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) { this->actor.speed = 8.0f; } else { this->actor.speed = 0.0f; 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 134eee5190..f88f4da82b 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -205,11 +205,11 @@ void func_80871058(EnBom* this, PlayState* play) { return; } - if ((this->actor.velocity.y > 0.0f) && (this->actor.bgCheckFlags & 0x10)) { + if ((this->actor.velocity.y > 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING)) { this->actor.velocity.y = -this->actor.velocity.y; } - if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & 8)) { + if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { s16 yDiff = BINANG_SUB(this->actor.wallYaw, this->actor.world.rot.y); if (ABS_ALT(yDiff) > 0x4000) { @@ -220,10 +220,10 @@ void func_80871058(EnBom* this, PlayState* play) { Actor_PlaySfx(&this->actor, this->isPowderKeg ? NA_SE_EV_PUT_DOWN_WOODBOX : NA_SE_EV_BOMB_BOUND); Actor_MoveWithGravity(&this->actor); this->actor.speed *= 0.7f; - this->actor.bgCheckFlags &= ~8; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL; } - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Math_StepToF(&this->actor.speed, 0.0f, 0.08f); } else { Vec3f* sp58; @@ -280,7 +280,7 @@ void func_80871058(EnBom* this, PlayState* play) { this->unk_1FA += (s16)(this->actor.speed * 800.0f); } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Actor_PlaySfx(&this->actor, this->isPowderKeg ? NA_SE_EV_TRE_BOX_BOUND : NA_SE_EV_BOMB_BOUND); if (this->actor.velocity.y < sp58->y) { if ((sp54 == 4) || (sp54 == 14) || (sp54 == 15)) { @@ -288,7 +288,7 @@ void func_80871058(EnBom* this, PlayState* play) { } else { this->actor.velocity.y = this->actor.velocity.y * sp58->z; } - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; } } else if (this->timer >= 4) { Actor_LiftActor(&this->actor, play); @@ -303,7 +303,7 @@ void func_808714D4(EnBom* this, PlayState* play) { this->actionFunc = func_80871058; this->actor.room = play->roomCtx.curRoom.num; this->actor.flags &= ~ACTOR_FLAG_100000; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; Math_Vec3s_ToVec3f(&this->actor.prevPos, &this->actor.home.rot); if (this->isPowderKeg) { gSaveContext.powderKegTimer = 0; @@ -579,8 +579,8 @@ void EnBom_Update(Actor* thisx, PlayState* play) { thisx->velocity.y = (KREG(83) * 0.1f) + -2.0f; thisx->gravity = (KREG(84) * 0.1f) + -0.5f; this->unk_1FC = KREG(81) + 10; - } else if (thisx->bgCheckFlags & 0x40) { - thisx->bgCheckFlags &= ~0x40; + } else if (thisx->bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { + thisx->bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH; Actor_PlaySfx(thisx, NA_SE_EV_BOMB_DROP_WATER); } } 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 c01dea3048..40e93b861d 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 @@ -512,23 +512,23 @@ void EnBomChu_Update(Actor* thisx, PlayState* play) { this->actor.depthInWater = waterY - this->actor.world.pos.y; if (this->actor.depthInWater < 0.0f) { - if (this->actor.bgCheckFlags & 0x20) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { EnBomChu_SpawnRipplesAndSplashes(this, play, waterY, true); } - this->actor.bgCheckFlags &= ~0x20; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER; return; } - if (!(this->actor.bgCheckFlags & 0x20) && (this->timer != 120)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->timer != 120)) { EnBomChu_SpawnRipplesAndSplashes(this, play, waterY, true); } else { EffectSsBubble_Spawn(play, &this->actor.world.pos, 0.0f, 3.0f, 15.0f, 0.25f); } - this->actor.bgCheckFlags |= 0x20; + this->actor.bgCheckFlags |= BGCHECKFLAG_WATER; } else { - this->actor.bgCheckFlags &= ~0x20; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER; this->actor.depthInWater = BGCHECK_Y_MIN; } } 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 aff0579b12..d342e168fc 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -232,17 +232,17 @@ void func_808AEE3C(EnBombf* this, PlayState* play) { } this->unk_204 = 1.0f; - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.025f, 0.0f); return; } Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 1.5f, 0.0f); - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { func_800B8EF4(play, &this->actor); if (this->actor.velocity.y < -6.0f) { this->actor.velocity.y *= -0.3f; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; } } else if (this->timer >= 4) { Actor_LiftActor(&this->actor, play); @@ -252,7 +252,7 @@ void func_808AEE3C(EnBombf* this, PlayState* play) { void func_808AEF68(EnBombf* this, PlayState* play) { if (Actor_HasNoParent(&this->actor, play)) { EnBombf_SetupAction(this, func_808AEE3C); - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; func_808AEE3C(this, play); } else { this->actor.velocity.y = 0.0f; @@ -341,11 +341,11 @@ void EnBombf_Update(Actor* thisx, PlayState* play) { } if (ENBOMBF_GET(&this->actor) == ENBOMBF_0) { - if ((this->actor.velocity.y > 0.0f) && (this->actor.bgCheckFlags & 0x10)) { + if ((this->actor.velocity.y > 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING)) { this->actor.velocity.y = -this->actor.velocity.y; } - if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & 8)) { + if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { s16 yDiff = BINANG_SUB(this->actor.wallYaw, this->actor.world.rot.y); if (ABS_ALT(yDiff) > 0x4000) { @@ -358,7 +358,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 5.0f, 10.0f, 0.0f, 0x1F); DREG(6) = 0; this->actor.speed *= 0.7f; - this->actor.bgCheckFlags &= ~8; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL; } if ((this->colliderCylinder.base.acFlags & AC_HIT) || @@ -443,8 +443,8 @@ void EnBombf_Update(Actor* thisx, PlayState* play) { return; } - if (this->actor.bgCheckFlags & 0x40) { - this->actor.bgCheckFlags &= ~0x40; + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH; Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_DROP_WATER); } } 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 042b4e332b..e1a5ef42f6 100644 --- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c +++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c @@ -383,7 +383,7 @@ void func_80C01A24(EnBomjimb* this, PlayState* play) { Math_ApproachF(&this->actor.speed, 6.0f, 0.5f, 2.0f); } - if ((this->unk_2C0 != 0) && !(this->actor.bgCheckFlags & 1)) { + if ((this->unk_2C0 != 0) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { func_80C01B40(this); } } @@ -396,7 +396,7 @@ void func_80C01B40(EnBomjimb* this) { void func_80C01B74(EnBomjimb* this, PlayState* play) { Math_ApproachF(&this->actor.speed, 6.0f, 0.5f, 2.0f); - if ((this->collider.base.acFlags & AC_HIT) || (this->actor.bgCheckFlags & 1)) { + if ((this->collider.base.acFlags & AC_HIT) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->collider.base.acFlags &= ~AC_HIT; if ((this->unk_2E4 != NULL) && (this->unk_2E4->update != NULL)) { ((EnNiw*)this->unk_2E4)->unk2BC.z = 90000.0f; @@ -450,7 +450,7 @@ void func_80C01CD0(EnBomjimb* this, PlayState* play) { this->actor.draw = NULL; } - if ((this->unk_2C0 == 0) && (this->unk_2E4->bgCheckFlags & 1)) { + if ((this->unk_2C0 == 0) && (this->unk_2E4->bgCheckFlags & BGCHECKFLAG_GROUND)) { Actor_PlaySfx(&this->actor, NA_SE_EV_PUT_DOWN_WOODBOX); this->unk_2C0 = 1; } @@ -840,7 +840,7 @@ void EnBomjimb_Update(Actor* thisx, PlayState* play2) { if (this->unk_2CA == 0) { if ((this->unk_2E4 != NULL) && (this->unk_2E4->update != NULL)) { Math_Vec3f_Copy(&this->unk_2E4->world.pos, &this->actor.world.pos); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->unk_2E4->world.pos.y = this->actor.world.pos.y + 35.0f; } else { this->unk_2E4->world.pos.y = this->actor.world.pos.y + 25.0f; 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 afc91770f6..4abfad7b17 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -63,22 +63,23 @@ void EnBoom_SetupAction(EnBoom* this, EnBoomActionFunc actionFunc) { void func_808A24DC(EnBoom* this, PlayState* play) { WaterBox* sp54; f32 sp50 = this->actor.world.pos.y; - u16 sp4E = this->actor.bgCheckFlags & 0x20; + u16 sp4E = this->actor.bgCheckFlags & BGCHECKFLAG_WATER; if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp50, &sp54) && (this->actor.world.pos.y < sp50)) { Vec3f sp40; - this->actor.bgCheckFlags |= 0x20; + this->actor.bgCheckFlags |= BGCHECKFLAG_WATER; sp40.x = this->actor.world.pos.x; sp40.y = this->actor.world.pos.y - 20.0f; sp40.z = this->actor.world.pos.z; EffectSsBubble_Spawn(play, &sp40, 20.0f, 10.0f, 20.0f, 0.13f); } else { - this->actor.bgCheckFlags &= ~0x20; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER; } - if ((this->actor.bgCheckFlags & 0x40) && ((this->actor.bgCheckFlags & 0x20) != sp4E)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) && + ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) != sp4E)) { Vec3f sp34; Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.prevPos, &sp34); @@ -102,7 +103,7 @@ void func_808A24DC(EnBoom* this, PlayState* play) { EffectSsGRipple_Spawn(play, &sp34, 100, 500, 8); } - this->actor.bgCheckFlags |= 0x40; + this->actor.bgCheckFlags |= BGCHECKFLAG_WATER_TOUCH; } void EnBoom_Init(Actor* thisx, PlayState* play) { @@ -262,7 +263,7 @@ void func_808A2918(EnBoom* this, PlayState* play) { Math_Vec3f_Copy(&sp7C->world.pos, &player->actor.world.pos); if (sp7C->id == ACTOR_EN_ITEM00) { sp7C->gravity = -0.9f; - sp7C->bgCheckFlags &= ~3; + sp7C->bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH); } else { sp7C->flags &= ~ACTOR_FLAG_2000; } 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 9529b5fdf9..62767a888b 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -345,7 +345,7 @@ void EnBox_Fall(EnBox* this, PlayState* play) { this->alpha = 255; this->movementFlags &= ~ENBOX_MOVE_IMMOBILE; - if (this->dyna.actor.bgCheckFlags & 1) { + if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->movementFlags |= ENBOX_MOVE_UNUSED; if (this->movementFlags & ENBOX_MOVE_FALL_ANGLE_SIDE) { this->movementFlags &= ~ENBOX_MOVE_FALL_ANGLE_SIDE; 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 6cfb05c686..db6019b999 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -250,7 +250,7 @@ void EnBubble_Fly(EnBubble* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_AWA_BOUND); this->modelRotSpeed = 128.0f; this->modelEllipticity = 0.48f; - } else if ((this->actor.bgCheckFlags & 0x20) && (bounceDirection.y < 0.0f)) { + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (bounceDirection.y < 0.0f)) { normal.x = normal.z = 0.0f; normal.y = 1.0f; EnBubble_Vec3fNormalizedReflect(&bounceDirection, &normal, &bounceDirection); 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 0353c6b4a8..e75d11bc61 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 @@ -468,7 +468,7 @@ void EnClearTag_Init(Actor* thisx, PlayState* play) { EnClearTag_CreateFlashEffect(this, &pos, sFlashMaxScale[thisx->params], this->actor.floorHeight); // Is not underwater - if (!(this->actor.bgCheckFlags & 0x20)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { if (thisx->params < 10) { pos.y = this->actor.world.pos.y - 40.0f; 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 9dda146c39..3bf81f96e7 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 @@ -114,7 +114,7 @@ void func_80AFDD60(EnColMan* this) { } void func_80AFDE00(EnColMan* this, PlayState* play) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.params == EN_COL_MAN_HEART_PIECE) { this->actor.params = EN_COL_MAN_RECOVERY_HEART; this->actor.speed = 2.0f; @@ -161,7 +161,7 @@ void func_80AFDFB4(EnColMan* this, PlayState* play) { this->scale = (BREG(55) / 10000.0f) + 0.0015f; - if ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.velocity.y < 0.0f)) { if (!this->hasSetRandomValues) { this->actor.world.rot.y = randPlusMinusPoint5Scaled(30000.0f); this->actor.speed = 2.0f + BREG(56) + Rand_ZeroFloat(2.0f); diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index 9e8234c591..187b7c539e 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -174,7 +174,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_1; } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->yawTarget = this->actor.wallYaw; } else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { this->yawTarget = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); @@ -192,7 +192,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_CRY); } - if ((this->actor.depthInWater > -40.0f) || (this->actor.bgCheckFlags & 1)) { + if ((this->actor.depthInWater > -40.0f) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->pitchTarget = -0x1000; } else if (this->actor.world.pos.y < (this->actor.home.pos.y - 50.0f)) { this->pitchTarget = -Rand_S16Offset(0x800, 0x800); @@ -211,7 +211,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) { this->pitchTarget = CLAMP(this->pitchTarget, -0x1000, 0x1000); } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_ScaledStepToS(&this->actor.shape.rot.x, -0x100, 0x400); } @@ -273,7 +273,8 @@ void EnCrow_DiveAttack(EnCrow* this, PlayState* play) { if (((this->timer == 0) || ((&player->actor != this->actor.child) && (this->actor.child->home.rot.z != 0)) || ((&player->actor == this->actor.child) && ((Player_GetMask(play) == PLAYER_MASK_STONE) || (player->stateFlags1 & PLAYER_STATE1_800000))) || - ((this->collider.base.atFlags & AT_HIT) || (this->actor.bgCheckFlags & 9))) || + ((this->collider.base.atFlags & AT_HIT) || + (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL)))) || (this->actor.depthInWater > -40.0f)) { if (this->collider.base.atFlags & AT_HIT) { @@ -300,7 +301,7 @@ void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) { Animation_Change(&this->skelAnime, &gGuayFlyAnim, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -3.0f); this->actor.shape.yOffset = 0.0f; this->actor.targetArrowOffset = 0.0f; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; scale = (this->actor.scale.x * 100.0f); this->actor.world.pos.y += 20.0f * scale; Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_DEAD); @@ -343,7 +344,7 @@ void EnCrow_Damaged(EnCrow* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4000, 0x200); this->actor.shape.rot.z += 0x1780; } - if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { EnCrow_CheckIfFrozen(this, play); func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, this->actor.scale.x * 10000.0f, 0, 0); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 11, NA_SE_EN_EXTINCT); @@ -400,7 +401,7 @@ void EnCrow_SetupTurnAway(EnCrow* this) { void EnCrow_TurnAway(EnCrow* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->yawTarget = this->actor.wallYaw; } else { this->yawTarget = this->actor.yawTowardsPlayer + 0x8000; 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 911e711c15..d962cad81b 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -861,7 +861,8 @@ void EnDekubaba_PrunedSomersaultDie(EnDekubaba* this, PlayState* play) { EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, this->size * 3.0f, 0, (s32)(this->size * 12.0f), (s32)(this->size * 5.0f), 1, HAHEN_OBJECT_DEFAULT, 10, NULL); - if ((this->actor.scale.x > 0.005f) && ((this->actor.bgCheckFlags & 2) || (this->actor.bgCheckFlags & 8))) { + if ((this->actor.scale.x > 0.005f) && + ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) || (this->actor.bgCheckFlags & BGCHECKFLAG_WALL))) { this->actor.scale.z = 0.0f; this->actor.scale.y = 0.0f; this->actor.scale.x = 0.0f; @@ -871,7 +872,7 @@ void EnDekubaba_PrunedSomersaultDie(EnDekubaba* this, PlayState* play) { (s32)(this->size * 5.0f), 15, HAHEN_OBJECT_DEFAULT, 10, NULL); } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); this->timer = 1; } 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 580d4bb81c..72b88f1c57 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -413,9 +413,9 @@ void func_808BDFB8(EnDekunuts* this, PlayState* play) { Math_StepToF(&this->actor.speed, 7.5f, 1.0f); if (!Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_192, 1, 0xE38, 0xB6)) { - if (this->actor.bgCheckFlags & 0x20) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { this->unk_192 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->unk_192 = this->actor.wallYaw; } else if (this->unk_18D == 0) { yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); 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 4470505ec8..6df7c314c5 100644 --- a/src/overlays/actors/ovl_En_Dg/z_en_dg.c +++ b/src/overlays/actors/ovl_En_Dg/z_en_dg.c @@ -322,7 +322,7 @@ void EnDg_MoveAlongPath(EnDg* this, PlayState* play) { if (this->path != NULL) { yRotation = EnDg_GetYRotation(this->path, this->currentPoint, &this->actor.world.pos, &distSq); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { yRotation = this->actor.wallYaw; } @@ -397,7 +397,7 @@ void EnDg_PlaySfxGrowl(EnDg* this, f32 frame) { } void EnDg_SetupIdleMove(EnDg* this, PlayState* play) { - if (!(this->actor.bgCheckFlags & 0x20)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { if ((this->index == ENDG_INDEX_SWAMP_SPIDER_HOUSE) || ((this->index == ENDG_INDEX_ROMANI_RANCH) && (play->sceneId == SCENE_OMOYA))) { EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK); @@ -608,7 +608,7 @@ s32 EnDg_ShouldReactToNonHumanPlayer(EnDg* this, PlayState* play) { void EnDg_ChooseActionForForm(EnDg* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (!(this->actor.bgCheckFlags & 0x20)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { switch (player->transformation) { case PLAYER_FORM_HUMAN: if (this->behavior != DOG_BEHAVIOR_HUMAN) { @@ -680,7 +680,7 @@ void EnDg_IdleMove(EnDg* this, PlayState* play) { EnDg_CheckForBremenMaskMarch(this, play); EnDg_PlaySfxWalk(this); - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actionFunc = EnDg_Fall; } @@ -704,7 +704,7 @@ void EnDg_IdleBark(EnDg* this, PlayState* play) { EnDg_PlaySfxBark(this, 13.0f); EnDg_PlaySfxBark(this, 19.0f); - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actionFunc = EnDg_Fall; } @@ -728,7 +728,7 @@ void EnDg_BackAwayFromGoron(EnDg* this, PlayState* play) { this->actionFunc = EnDg_RunAwayFromGoron; } else { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0x3E8, 1); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.shape.rot.y = this->actor.wallYaw; } @@ -752,7 +752,7 @@ void EnDg_RunAwayFromGoron(EnDg* this, PlayState* play) { if (this->actor.xzDistToPlayer < 250.0f) { Math_ApproachS(&this->actor.shape.rot.y, -this->actor.yawTowardsPlayer, 4, 0xC00); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { yRotation = this->actor.wallYaw; } else { yRotation = 0; @@ -805,7 +805,7 @@ void EnDg_ApproachPlayerToAttack(EnDg* this, PlayState* play) { this->actor.velocity.y = 0.0f; this->actor.gravity = -3.0f; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.shape.rot.y = this->actor.wallYaw; } @@ -859,7 +859,7 @@ void EnDg_RunAfterAttacking(EnDg* this, PlayState* play) { void EnDg_SitNextToPlayer(EnDg* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actionFunc = EnDg_Fall; } @@ -966,7 +966,7 @@ void EnDg_SetupBremenMaskApproachPlayer(EnDg* this, PlayState* play) { } void EnDg_Fall(EnDg* this, PlayState* play) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN); this->actionFunc = EnDg_IdleMove; } @@ -1026,7 +1026,7 @@ void EnDg_SlowlyBackUpBeforeAttacking(EnDg* this, PlayState* play) { } Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0x3E8, 1); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.shape.rot.y = this->actor.wallYaw; EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_JUMP_ATTACK); this->actionFunc = EnDg_JumpAttack; @@ -1054,7 +1054,7 @@ void EnDg_BackAwayFromPlayer(EnDg* this, PlayState* play) { this->actionFunc = EnDg_BarkAtPlayer; } else { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0x3E8, 1); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.shape.rot.y = this->actor.wallYaw; } @@ -1158,7 +1158,7 @@ void EnDg_Swim(EnDg* this, PlayState* play) { // over. For example, if the player throws the dog at a tall wall next to some water, // this code will make the dog "skip" along the water's surface, assuming the floor // height is low enough to make it try to jump out. - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (!WaterBox_GetSurface1(play, &play->colCtx, pos.x, pos.z, &waterSurface, &waterBox)) { if (floorHeight > -100.0f) { this->dogFlags &= ~DOG_FLAG_SWIMMING; @@ -1176,7 +1176,7 @@ void EnDg_Swim(EnDg* this, PlayState* play) { } else { yRotation = this->actor.wallYaw; } - } else if ((this->actor.bgCheckFlags & 1) && !(this->actor.bgCheckFlags & 0x20)) { + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { this->actor.gravity = -3.0f; this->dogFlags &= ~DOG_FLAG_SWIMMING; this->behavior = DOG_BEHAVIOR_DEFAULT; @@ -1216,13 +1216,13 @@ void EnDg_JumpOutOfWater(EnDg* this, PlayState* play) { this->actor.velocity.y = -1.0f; } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.world.pos.y = pos.y; this->actor.velocity.y = 10.0f; EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 0, 800); } - if (!(this->actor.bgCheckFlags & 0x20)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { this->behavior = DOG_BEHAVIOR_DEFAULT; this->actor.velocity.y = 10.0f; this->actor.gravity = -3.0f; @@ -1260,7 +1260,7 @@ void EnDg_Held(EnDg* this, PlayState* play) { void EnDg_Thrown(EnDg* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->dogFlags & DOG_FLAG_THROWN) { this->dogFlags &= ~DOG_FLAG_THROWN; Actor_PlaySfx(&this->actor, NA_SE_EV_MONKEY_WALK); @@ -1350,7 +1350,7 @@ void EnDg_Update(Actor* thisx, PlayState* play) { EnDg_SetupIdleMove(this, play); } - if ((this->actor.bgCheckFlags & 0x40) && Actor_HasNoParent(&this->actor, play)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) && Actor_HasNoParent(&this->actor, play)) { EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_SWIM); this->actionFunc = EnDg_SetupSwim; } 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 f92bfb4942..3bbe343246 100644 --- a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c +++ b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c @@ -523,7 +523,7 @@ void func_8089B3D4(EnDinofos* this, PlayState* play) { } Play_SetCameraAtEye(play, this->subCamId, &subCamAt, &subCam->eye); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_8089B4A4(this); } } @@ -733,7 +733,7 @@ void func_8089BD28(EnDinofos* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xBB8); if (!func_8089AE00(this, play)) { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.speed >= 0.0f) { phi_v0 = BINANG_ADD(this->actor.shape.rot.y, 0x4000); } else { @@ -835,20 +835,20 @@ void func_8089C164(EnDinofos* this) { } } - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_JUMP); this->actionFunc = func_8089C1F8; } void func_8089C1F8(EnDinofos* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_8089C398(this); } } void func_8089C244(EnDinofos* this) { - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.speed = 8.0f; this->actor.velocity.y = 16.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_JUMP); @@ -867,7 +867,7 @@ void func_8089C2A8(EnDinofos* this, PlayState* play) { Animation_Change(&this->skelAnime, &object_dinofos_Anim_0025B4, 1.0f, 7.0f, 13.0f, ANIMMODE_ONCE, -2.0f); } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->colliderQuad.base.atFlags &= ~AT_ON; func_8089C398(this); } @@ -947,7 +947,7 @@ void func_8089C690(EnDinofos* this) { } void func_8089C724(EnDinofos* this, PlayState* play) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_StepToF(&this->actor.speed, 0.0f, 0.5f); } @@ -1002,7 +1002,7 @@ void func_8089C87C(EnDinofos* this, s32 arg1) { void func_8089C938(EnDinofos* this, PlayState* play) { Math_StepToF(&this->actor.speed, 0.0f, 0.5f); - if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) { + if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->actor.colChkInfo.health == 0) { if (this->actor.cutscene == -1) { func_8089CFAC(this); 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 f067c3988c..2641d583f0 100644 --- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c +++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c @@ -370,7 +370,7 @@ void func_80B3D3F8(EnDnp* this, PlayState* play) { } void func_80B3D47C(EnDnp* this, PlayState* play) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_SmoothStepToF(&this->actor.scale.x, 0.0085f, 0.1f, 0.01f, 0.001f); if ((s32)(this->actor.scale.x * 10000.0f) >= 85) { this->actor.flags |= ACTOR_FLAG_1; 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 7210e4cc6c..d214482171 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -272,7 +272,8 @@ s32 func_8092CC68(PlayState* play) { s32 ret = false; s16 bgId; - if (!Play_InCsMode(play) && (player->actor.bgCheckFlags & 1) && (player->transformation != PLAYER_FORM_DEKU)) { + if (!Play_InCsMode(play) && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + (player->transformation != PLAYER_FORM_DEKU)) { bgId = player->actor.floorBgId; if (SurfaceType_GetSceneExitIndex(&play->colCtx, player->actor.floorPoly, bgId) != 4) { ret = true; 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 23a60c5d45..1dc10cc8d6 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -1025,7 +1025,7 @@ void EnDodongo_Update(Actor* thisx, PlayState* play2) { this->actionFunc(this, play); Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 60.0f, 70.0f, 0x1D); - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_DOWN); } 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 573d386e59..72ac311a7a 100644 --- a/src/overlays/actors/ovl_En_Estone/z_en_estone.c +++ b/src/overlays/actors/ovl_En_Estone/z_en_estone.c @@ -121,8 +121,9 @@ void EnEstone_Active(EnEstone* this, PlayState* play) { Actor_Kill(&this->actor); return; } - if (((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f)) || (this->collider.base.atFlags & 4)) { - this->collider.base.atFlags &= ~4; + if (((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.velocity.y < 0.0f)) || + (this->collider.base.atFlags & AT_BOUNCED)) { + this->collider.base.atFlags &= ~AT_BOUNCED; if (this->actor.params == ENESTONE_TYPE_LARGE) { for (i = 0; i < 2; i++) { accel.x = 2.0f * (Rand_ZeroOne() - 0.5f); 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 dd54a3eded..13831e8a6a 100644 --- a/src/overlays/actors/ovl_En_Famos/z_en_famos.c +++ b/src/overlays/actors/ovl_En_Famos/z_en_famos.c @@ -544,7 +544,7 @@ void EnFamos_Attack(EnFamos* this, PlayState* play) { } surfaceType = func_800C9B18(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); - hitFloor = this->actor.bgCheckFlags & 1; + hitFloor = this->actor.bgCheckFlags & BGCHECKFLAG_GROUND; if (hitFloor || (this->actor.floorHeight == BGCHECK_Y_MIN) || (surfaceType == 0xC) || (surfaceType == 0xD)) { this->collider1.base.atFlags &= ~AT_ON; this->collider2.base.atFlags |= AT_ON; @@ -617,7 +617,7 @@ void EnFamos_AttackRebound(EnFamos* this, PlayState* play) { } } - if ((this->baseHeight < this->actor.world.pos.y) || (this->actor.bgCheckFlags & 0x10)) { // touching ceiling + if ((this->baseHeight < this->actor.world.pos.y) || (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING)) { this->actor.speed = 0.0f; EnFamos_SetupChase(this); } @@ -768,7 +768,7 @@ void EnFamos_Update(Actor* thisx, PlayState* play) { if (this->flippedTimer >= 0) { Actor_UpdateBgCheckInfo(play, &this->actor, 35.0f, 30.0f, 80.0f, 0x1F); if ((this->actionFunc == EnFamos_Attack) && (this->animatedMaterialIndex != FAMOS_ANIMATED_MAT_NORMAL) && - (this->actor.bgCheckFlags & 1)) { // touch floor + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actor.world.pos.y -= 60.0f; } } 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 0efbf9674c..90f90cf74a 100644 --- a/src/overlays/actors/ovl_En_Fg/z_en_fg.c +++ b/src/overlays/actors/ovl_En_Fg/z_en_fg.c @@ -275,7 +275,7 @@ void EnFg_Jump(EnFg* this, PlayState* play) { this->skelAnime.playSpeed = 0.0f; } - if ((this->actor.velocity.y <= 0.0f) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.velocity.y <= 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { EnFg_ChangeAnim(&this->skelAnime, 0); this->actionFunc = EnFg_Idle; this->actor.velocity.y = 0.0f; @@ -289,7 +289,7 @@ void EnFg_DoNothing(EnFg* this, PlayState* play) { } void EnFg_Knockback(EnFg* this, PlayState* play) { - if ((this->actor.velocity.y <= 0.0f) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.velocity.y <= 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->bounceCounter++; if (this->bounceCounter < 4) { this->actor.shape.rot.x += 0x1000; @@ -298,7 +298,7 @@ void EnFg_Knockback(EnFg* this, PlayState* play) { this->actionFunc = EnFg_DoNothing; } } else { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.world.rot.y = this->actor.wallYaw; this->actor.shape.rot = this->actor.world.rot; } 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 bd00c3cbd8..8288b9dc40 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -317,9 +317,10 @@ void EnFirefly_FlyIdle(EnFirefly* this, PlayState* play) { this->pitchTarget = 0x2154; } } else { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->pitchTarget = 0x954; - } else if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.world.pos.y)) { + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) || + (this->maxAltitude < this->actor.world.pos.y)) { this->pitchTarget = 0x2154; } } @@ -327,7 +328,7 @@ void EnFirefly_FlyIdle(EnFirefly* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.x, this->pitchTarget, 0x100); } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); } @@ -389,7 +390,7 @@ void EnFirefly_Fall(EnFirefly* this, PlayState* play) { this->actor.shape.rot.y -= 0x300; } - if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { EnFirefly_SpawnIceEffects(this, play); EnFirefly_SetupDie(this); } @@ -436,7 +437,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, PlayState* play) { Math_StepToF(&this->actor.speed, 4.0f, 0.5f); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); Math_ScaledStepToS(&this->actor.shape.rot.x, this->pitchTarget, 0x100); } else if (Actor_IsFacingPlayer(&this->actor, 0x2800)) { @@ -457,11 +458,11 @@ void EnFirefly_DiveAttack(EnFirefly* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xC00, 0x300); } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->pitchTarget = 0x954; } - if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.world.pos.y)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) || (this->maxAltitude < this->actor.world.pos.y)) { this->pitchTarget = 0x2154; } else { this->pitchTarget = 0x954; @@ -523,15 +524,15 @@ void EnFirefly_FlyAway(EnFirefly* this, PlayState* play) { Math_StepToF(&this->actor.speed, 3.0f, 0.3f); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->pitchTarget = 0x954; - } else if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.world.pos.y)) { + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) || (this->maxAltitude < this->actor.world.pos.y)) { this->pitchTarget = 0x2154; } else { this->pitchTarget = 0x954; } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); } else { Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), @@ -560,7 +561,7 @@ void EnFirefly_SetupStunned(EnFirefly* this) { void EnFirefly_Stunned(EnFirefly* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.x, 0x1554, 0x100); - if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { if (this->timer != 0) { this->timer--; } 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 60c09ebceb..6a769cdef6 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -507,10 +507,10 @@ void func_8091E880(Actor* thisx, PlayState* play) { this->unk_272 = 0x43; this->unk_268 = 0x4000; this->unk_26C = -0x4000; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->unk_240 = 400; func_8091E9A4(this); - } else if (this->actor.bgCheckFlags & 0x20) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { Actor_PlaySfx(&this->actor, NA_SE_EV_DIVE_INTO_WATER_L); func_8091D840(thisx, play, 10, 15.0f); if (func_8091DA14(this, play)) { @@ -592,13 +592,13 @@ void func_8091EAF0(Actor* thisx, PlayState* play) { } else { this->actor.draw = NULL; } - } else if (this->actor.bgCheckFlags & 0x20) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { if (func_8091DA14(this, play)) { func_8091EF30(this); } else { func_8091ECF4(this); } - } else if (this->actor.bgCheckFlags & 1) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_8091E9A4(this); } } @@ -627,7 +627,7 @@ void func_8091ED70(Actor* thisx, PlayState* play) { Math_SmoothStepToF(&thisx->speed, 2.8f, 0.1f, 0.4f, 0.0f); - if ((thisx->bgCheckFlags & 8) || !(thisx->bgCheckFlags & 0x20)) { + if ((thisx->bgCheckFlags & BGCHECKFLAG_WALL) || !(thisx->bgCheckFlags & BGCHECKFLAG_WATER)) { sp2E = Math_Vec3f_Yaw(&thisx->world.pos, &thisx->home.pos); thisx->home.rot.y = Rand_S16Offset(-100, 100) + sp2E; thisx->speed *= 0.5f; @@ -640,7 +640,7 @@ void func_8091ED70(Actor* thisx, PlayState* play) { this->unk_270 = 2000; this->unk_272 = 0x29B; - if (thisx->bgCheckFlags & 1) { + if (thisx->bgCheckFlags & BGCHECKFLAG_GROUND) { Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y - 4.0f, 2.0f); } else { Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y - 10.0f, 2.0f); @@ -706,12 +706,13 @@ void func_8091EFE8(Actor* thisx, PlayState* play) { } } - if ((this->actor.bgCheckFlags & 8) && !(this->actor.bgCheckFlags & 0x20)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && !(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { this->actor.speed *= 0.5f; } - if (((Rand_Next() >> 0x1B) == 0) || ((this->actor.bgCheckFlags & 8) && ((Rand_Next() >> 0x1E) == 0)) || - !(this->actor.bgCheckFlags & 0x20)) { + if (((Rand_Next() >> 0x1B) == 0) || + ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && ((Rand_Next() >> 0x1E) == 0)) || + !(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { temp_f0 = Rand_ZeroOne(); sp34 = (1.0f - SQ(temp_f0)) * sp3C->home.rot.x; sp30 = Rand_ZeroOne() * sp3C->home.rot.z; 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 55b6bfca06..646855f012 100644 --- a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c +++ b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c @@ -404,7 +404,7 @@ void func_80B28C14(EnFish2* this, PlayState* play) { } else if ((itemAction->update != NULL) && (itemAction->params == 0) && (fabsf(itemAction->world.pos.x - this->actor.world.pos.x) < 100.0f) && (fabsf(itemAction->world.pos.z - this->actor.world.pos.z) < 100.0f) && - (itemAction->bgCheckFlags & 0x20)) { + (itemAction->bgCheckFlags & BGCHECKFLAG_WATER)) { this->unk_350 = itemAction; if (D_80B2B2E0 == 0) { EnFish2* fish; 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 04b0752599..474957658e 100644 --- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c +++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c @@ -946,7 +946,7 @@ void EnFishing_Init(Actor* thisx, PlayState* play2) { return; } - thisx->bgCheckFlags |= 0x800; // Added in MM + thisx->bgCheckFlags |= BGCHECKFLAG_PLAYER_800; // Added in MM if ((thisx->params < 115) || (thisx->params == 200)) { SkelAnime_InitFlex(play, &this->skelAnime, &gFishingFishSkel, &gFishingFishAnim, NULL, NULL, 0); @@ -2234,10 +2234,10 @@ void EnFishing_UpdateLure(EnFishing* this, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 15.0f, 30.0f, 30.0f, 0x43); this->actor.world.pos = sp80; - if (this->actor.bgCheckFlags & 0x10) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) { D_80917238.y = -0.5f; } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (D_80917238.y > 0.0f) { D_80917238.y = 0.0f; } @@ -4104,11 +4104,11 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { this->actor.velocity.y = velocityY; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->unk_198 = 20; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.world.pos.y > WATER_SURFACE_Y(play)) { this->unk_17C = Rand_ZeroFloat(3.0f) + 3.0f; this->actor.velocity.x = this->actor.world.pos.x * -0.003f; 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 eeb1a6bc31..7b4f4dea6d 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -321,7 +321,7 @@ void func_808D0D70(EnFloormas* this, PlayState* play) { if ((this->actor.xzDistToPlayer < 320.0f) && Actor_IsFacingPlayer(&this->actor, 0x4000)) { func_808D0F50(this); - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->unk_190 = this->actor.wallYaw; func_808D108C(this); } else if ((this->actor.xzDistToPlayer < 400.0f) && !Actor_IsFacingPlayer(&this->actor, 0x4000)) { @@ -360,7 +360,7 @@ void func_808D0F80(EnFloormas* this, PlayState* play) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x71C); if ((this->actor.xzDistToPlayer < 280.0f) && Actor_IsFacingPlayer(&this->actor, 0x2000) && - !(this->actor.bgCheckFlags & 8)) { + !(this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { func_808D1380(this, play); } else if (this->actor.xzDistToPlayer > 400.0f) { func_808D0CE4(this); @@ -485,7 +485,7 @@ void func_808D1650(EnFloormas* this, PlayState* play) { func_808D14DC(this, play); } - if ((this->actor.bgCheckFlags & 8) || (this->unk_18E == 0)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->unk_18E == 0)) { func_808D1740(this); } } @@ -502,9 +502,9 @@ void func_808D1740(EnFloormas* this) { } void func_808D17EC(EnFloormas* this, PlayState* play) { - s32 sp24 = this->actor.bgCheckFlags & 1; + s32 sp24 = this->actor.bgCheckFlags & BGCHECKFLAG_GROUND; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (this->actor.params != ENFLOORMAS_GET_7FFF_40) { func_808D0908(this); } @@ -518,7 +518,7 @@ void func_808D17EC(EnFloormas* this, PlayState* play) { } } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.speed = 0.0f; } @@ -581,7 +581,7 @@ void func_808D19D4(EnFloormas* this) { } void func_808D1B44(EnFloormas* this, PlayState* play) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (SkelAnime_Update(&this->skelAnime)) { this->actor.flags |= ACTOR_FLAG_1; this->unk_194 = 50; @@ -589,7 +589,7 @@ void func_808D1B44(EnFloormas* this, PlayState* play) { } Math_StepToF(&this->actor.speed, 0.0f, 1.0f); } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); } } @@ -612,7 +612,7 @@ void func_808D1C1C(EnFloormas* this, PlayState* play) { if (this->unk_194 == 0) { func_808D1D0C(this); - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->unk_190 = this->actor.wallYaw; func_808D108C(this); } else if (this->actor.xzDistToPlayer < 120.0f) { @@ -637,7 +637,7 @@ void func_808D1D6C(EnFloormas* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK); } - flags = this->actor.bgCheckFlags & 8; + flags = this->actor.bgCheckFlags & BGCHECKFLAG_WALL; if (flags) { this->unk_190 = this->actor.wallYaw; func_808D108C(this); @@ -699,7 +699,7 @@ void func_808D2040(EnFloormas* this, PlayState* play) { } else if (Animation_OnFrame(&this->skelAnime, 20.0f)) { this->actor.speed = 5.0f; this->actor.velocity.y = 7.0f; - } else if (this->actor.bgCheckFlags & 2) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->unk_18E = 50; this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); @@ -783,7 +783,7 @@ void func_808D24F0(EnFloormas* this, PlayState* play) { } else if (this->actor.child->params == ENFLOORMAS_GET_7FFF_40) { phi_s1 = this->actor.child; } else { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.params = ENFLOORMAS_GET_7FFF_10; func_808D1740(this); } @@ -800,7 +800,7 @@ void func_808D24F0(EnFloormas* this, PlayState* play) { (fabsf(this->actor.world.pos.z - phi_s1->world.pos.z) < 10.0f)) { func_808D2A20(this); this->collider.base.ocFlags1 |= OC1_ON; - } else if (this->actor.bgCheckFlags & 2) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speed = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); func_808D1740(this); @@ -944,7 +944,7 @@ void func_808D2B18(EnFloormas* this) { } void func_808D2C08(EnFloormas* this, PlayState* play) { - if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) { + if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->actor.colChkInfo.health == 0) { func_808D0930(this, play); } else { 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 f43d244323..fc687f9193 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -254,7 +254,7 @@ void func_80961D7C(PlayState* play) { Actor* explosive = play->actorCtx.actorLists[ACTORCAT_EXPLOSIVES].first; while (explosive != NULL) { - if ((explosive->id == ACTOR_EN_BOM) && (explosive->bgCheckFlags & 1)) { + if ((explosive->id == ACTOR_EN_BOM) && (explosive->bgCheckFlags & BGCHECKFLAG_GROUND)) { EnBom* bomb = (EnBom*)explosive; if (bomb->actor.floorBgId != BGCHECK_SCENE) { @@ -776,7 +776,7 @@ void func_80962F4C(EnFu* this, PlayState* play) { } if ((!DynaPolyActor_IsInRidingRotatingState((DynaPolyActor*)this->actor.child) && - (player->actor.bgCheckFlags & 1)) || + (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) || (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] <= SECONDS_TO_TIMER(0)) || (this->unk_548 == this->unk_54C)) { player->stateFlags3 &= ~PLAYER_STATE3_400000; func_80961E88(play); 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 712a20428d..88a2c63b27 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 @@ -187,7 +187,7 @@ void func_80ACE718(EnFuMato* this, PlayState* play) { Actor_UpdatePos(&this->dyna.actor); Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 15.0f, 30.0f, 60.0f, 5); - if ((this->dyna.actor.bgCheckFlags & 1) || (this->dyna.actor.world.pos.y < -500.0f)) { + if ((this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->dyna.actor.world.pos.y < -500.0f)) { Vec3f sp3C = { 0.0f, 0.0f, 0.0f }; Vec3f sp30 = { 0.0f, 2.0f, 0.0f }; @@ -330,7 +330,7 @@ void func_80ACECFC(EnFuMato* this, PlayState* play) { if (this->unk_302 == 1) { Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 15.0f, 30.0f, 60.0f, 5); - if (this->dyna.actor.bgCheckFlags & 1) { + if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_80ACEB2C(this); } } 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 9158009935..1d7cbbb345 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -359,9 +359,9 @@ void func_80932C98(EnFz* this, PlayState* play) { Vec3f sp3C; if (this->unk_BCD != 0) { - if ((this->actor.bgCheckFlags & 8) || + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || !Actor_TestFloorInDirection(&this->actor, play, 60.0f, this->actor.world.rot.y)) { - this->actor.bgCheckFlags &= ~0x8; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL; this->unk_BCD = 0; this->unk_BBC = 0.0f; this->actor.speed = 0.0f; 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 403a160660..54836f0716 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -405,7 +405,7 @@ void EnGe2_Charge(EnGe2* this, PlayState* play) { if (this->picto.actor.xzDistToPlayer < 50.0f) { EnGe2_SetupCapturePlayer(this); - } else if (!(this->picto.actor.bgCheckFlags & 1)) { + } else if (!(this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->picto.actor.world.pos = this->picto.actor.prevPos; EnGe2_SetupCapturePlayer(this); } 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 ba84c4f56e..d005c5a39c 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.c +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.c @@ -222,7 +222,7 @@ void func_80BB178C(EnGeg* this, PlayState* play) { } s32 func_80BB18FC(EnGeg* this, Actor* actor) { - if (actor->bgCheckFlags & 1) { + if (actor->bgCheckFlags & BGCHECKFLAG_GROUND) { f32 sp24 = Math_Vec3f_DistXZ(&this->actor.world.pos, &actor->world.pos); f32 sp20 = Math_Vec3f_DiffY(&this->actor.world.pos, &actor->world.pos); @@ -739,7 +739,7 @@ void func_80BB2F7C(EnGeg* this, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; if ((this->actor.xzDistToPlayer < 150.0f) && (fabsf(this->actor.playerHeightRel) < 10.0f) && - (this->actor.bgCheckFlags & 1)) { + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->unk_4AC = 2; this->actor.speed = 0.0f; this->unk_230 &= ~1; @@ -751,7 +751,7 @@ void func_80BB2F7C(EnGeg* this, PlayState* play) { Actor_MoveWithGravity(&this->actor); } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->unk_230 & 0x80) { func_800B9010(&this->actor, NA_SE_EN_GOLON_SIRLOIN_ROLL - SFX_FLAG); } else { diff --git a/src/overlays/actors/ovl_En_Gg/z_en_gg.c b/src/overlays/actors/ovl_En_Gg/z_en_gg.c index bb14b0dd07..a2ece1010f 100644 --- a/src/overlays/actors/ovl_En_Gg/z_en_gg.c +++ b/src/overlays/actors/ovl_En_Gg/z_en_gg.c @@ -652,7 +652,7 @@ void EnGg_Init(Actor* thisx, PlayState* play) { } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); - this->actor.bgCheckFlags |= 0x400; + this->actor.bgCheckFlags |= BGCHECKFLAG_PLAYER_400; SkelAnime_InitFlex(play, &this->skelAnime, &object_gg_Skel_00F6C0, &object_gg_Anim_00F578, this->jointTable, this->morphTable, 20); 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 fe3e2fb463..d30dd6bd88 100644 --- a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c +++ b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c @@ -366,7 +366,7 @@ void EnGg2_Init(Actor* thisx, PlayState* play2) { } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); - this->actor.bgCheckFlags |= 0x400; + this->actor.bgCheckFlags |= BGCHECKFLAG_PLAYER_400; SkelAnime_InitFlex(play, &this->skelAnime, &object_gg_Skel_00F6C0, &object_gg_Anim_00F578, this->jointTable, this->morphTable, 20); this->unk_1D8 = SubS_GetPathByIndex(play, ENGG2_GET_FC00(&this->actor), 0x3F); 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 f0c8508853..431e674ad8 100644 --- a/src/overlays/actors/ovl_En_Gk/z_en_gk.c +++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.c @@ -816,7 +816,7 @@ void func_80B51EA4(EnGk* this, PlayState* play) { } } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp38.y = this->actor.wallYaw; } 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 8e62b499b9..3f6fee7657 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -1012,7 +1012,7 @@ s32 func_80A13564(EnGo* this, f32 arg1, f32 arg2, s32 arg3) { f32 temp_f14 = this->actor.velocity.y + this->actor.gravity; s32 ret; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { ret = true; } else { if (temp_f14 > 0.0f) { @@ -1801,7 +1801,7 @@ void func_80A153FC(EnGo* this, PlayState* play) { Math_ApproachS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&sp50, &sp44), 4, 0x38E); this->actor.shape.rot.y = this->actor.world.rot.y; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Actor_PlaySfx(&this->actor, NA_SE_EV_BIGBALL_ROLL - SFX_FLAG); func_800AE930(&play->colCtx, Effect_GetByIndex(this->unk_3E8), &this->actor.world.pos, 18.0f, this->actor.shape.rot.y, this->actor.floorPoly, this->actor.floorBgId); 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 9ba8582786..312e1a9d93 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -1207,7 +1207,7 @@ void func_80941A10(EnGoroiwa* this, PlayState* play) { } } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Actor_PlaySfx(&this->actor, D_80942E9C[this->unk_1E4][this->actor.home.rot.x & 1]); } } @@ -1225,7 +1225,7 @@ void func_80941DB4(EnGoroiwa* this) { void func_80941E28(EnGoroiwa* this, PlayState* play) { func_8093F34C(this); - if ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.velocity.y < 0.0f)) { if ((this->unk_1E5 & 8) && ((this->actor.home.rot.z & 3) == 1)) { func_8093EDB0(this); } @@ -1440,7 +1440,7 @@ void EnGoroiwa_Update(Actor* thisx, PlayState* play) { this->unk_1CC--; } - if ((ENGOROIWA_GET_3000(&this->actor) == ENGOROIWA_3000_2) && (this->actor.bgCheckFlags & 1) && + if ((ENGOROIWA_GET_3000(&this->actor) == ENGOROIWA_3000_2) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actionFunc == func_80941A10) && (this->actor.speed > 2.0f)) { Math_StepToF(&this->actor.scale.x, 0.16f, (this->actor.xzDistToPlayer < 400.0f) ? this->unk_1E0 * 1.4f : this->unk_1E0); @@ -1497,12 +1497,12 @@ void EnGoroiwa_Update(Actor* thisx, PlayState* play) { if (this->actor.floorHeight > BGCHECK_Y_MIN) { this->actor.floorBgId = bgId; if (this->actor.world.pos.y <= (this->actor.floorHeight + 2.0f)) { - this->actor.bgCheckFlags |= 1; + this->actor.bgCheckFlags |= BGCHECKFLAG_GROUND; } else { - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; } } else { - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.floorBgId = 50; } break; 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 9a506c0ba5..e3278cf259 100644 --- a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c +++ b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c @@ -450,7 +450,8 @@ void EnGrasshopper_RoamInCircles(EnGrasshopper* this, PlayState* play) { collisionCheckPos.y = this->actor.world.pos.y; collisionCheckPos.z = (Math_CosS(this->actor.shape.rot.y) * 100.0f) + this->actor.world.pos.z; - if ((this->actor.bgCheckFlags & 8) || BgCheck_SphVsFirstPoly(&play->colCtx, &collisionCheckPos, 10.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || + BgCheck_SphVsFirstPoly(&play->colCtx, &collisionCheckPos, 10.0f)) { EnGrasshopper_SetupBank(this); } else if (player->stateFlags1 & PLAYER_STATE1_8000000) { this->collider.elements[0].info.toucherFlags |= (TOUCH_ON | TOUCH_SFX_WOOD); 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 4ff4c1d1b4..935d3aaa3e 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -843,7 +843,7 @@ s32 func_809995A4(EnGs* this, PlayState* play) { if (this->unk_19D == 4) { Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 60.0f, 3); - if (this->actor.bgCheckFlags & (0x10 | 0x8)) { + if (this->actor.bgCheckFlags & (BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING)) { Vec3f sp54; sp54.x = this->actor.world.pos.x; 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 a540da68a4..dc5610896f 100644 --- a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c +++ b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c @@ -165,7 +165,7 @@ void func_80B21EA4(EnHakurock* this, s32 arg1) { } void func_80B21FFC(EnHakurock* this) { - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->collider.base.atFlags &= ~AT_HIT; this->collider.base.ocFlags1 &= ~OC1_HIT; this->actor.draw = NULL; @@ -210,7 +210,7 @@ void func_80B221E8(EnHakurock* this, PlayState* play) { this->actor.shape.rot.z += 0xB00; if ((this->collider.base.atFlags & AT_HIT) || ((this->counter == 0) && (this->collider.base.ocFlags1 & OC1_HIT)) || - ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f))) { + ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.velocity.y < 0.0f))) { Actor_PlaySfx(&this->actor, NA_SE_EV_ROCK_BROKEN); func_80B21EA4(this, 0); func_80B21FFC(this); @@ -244,7 +244,7 @@ void func_80B2242C(EnHakurock* this, PlayState* play) { if ((this->collider.base.ocFlags1 & OC1_HIT) && (this->collider.base.oc == this->actor.parent)) { func_80B21EA4(this, 1); func_80B21FFC(this); - } else if ((this->actor.bgCheckFlags & 1)) { + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { func_80B21EA4(this, 2); Actor_PlaySfx(&this->actor, NA_SE_EV_OBJECT_STICK); func_80B224C0(this); 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 d9df702ce0..863e607428 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 @@ -241,7 +241,7 @@ void func_80C200B8(EnHintSkb* this, PlayState* play) { } void func_80C2011C(EnHintSkb* this) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = 0.0f; } Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); @@ -249,15 +249,15 @@ void func_80C2011C(EnHintSkb* this) { } void func_80C2016C(EnHintSkb* this, PlayState* play) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speed = 0.0f; - } else if (this->actor.bgCheckFlags & 1) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.speed < 0.0f) { this->actor.speed += 0.05f; } } - if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->actor.colChkInfo.health == 0) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD); func_80C20484(this); @@ -280,7 +280,7 @@ void func_80C20274(EnHintSkb* this) { } else { this->actor.world.rot.y = this->actor.yawTowardsPlayer; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = -4.0f; } } @@ -289,7 +289,7 @@ void func_80C20274(EnHintSkb* this) { } void func_80C20334(EnHintSkb* this, PlayState* play) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { s32 i; for (i = 0; i < 10; i++) { @@ -298,7 +298,7 @@ void func_80C20334(EnHintSkb* this, PlayState* play) { this->actor.speed = 0.0f; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.speed < 0.0f) { this->actor.speed += 0.05f; } else if (this->actor.speed != 0.0f) { @@ -309,7 +309,8 @@ void func_80C20334(EnHintSkb* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 16, 2000, 100); - if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (this->actor.bgCheckFlags & 1)) { + if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actor.world.rot = this->actor.shape.rot; func_80C1FE30(this); } @@ -318,7 +319,7 @@ void func_80C20334(EnHintSkb* this, PlayState* play) { void func_80C20484(EnHintSkb* this) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); this->unk_3E8 |= 4; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = -6.0f; } this->actionFunc = func_80C204F0; @@ -334,7 +335,7 @@ void func_80C204F0(EnHintSkb* this, PlayState* play) { } void func_80C20540(EnHintSkb* this) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = 0.0f; } Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); @@ -362,7 +363,7 @@ void func_80C20590(EnHintSkb* this, PlayState* play) { } void func_80C2066C(EnHintSkb* this) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = 0.0f; } this->actionFunc = func_80C2069C; @@ -452,7 +453,7 @@ void func_80C208D0(EnHintSkb* this, PlayState* play) { } if (this->unk_3E6 == 0x1147) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { s32 i; this->actor.speed = 0.0f; @@ -470,7 +471,7 @@ void func_80C208D0(EnHintSkb* this, PlayState* play) { } } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 5, 0x71C, 0xB6); this->actor.shape.rot.y = this->actor.world.rot.y; } @@ -611,7 +612,8 @@ void func_80C20D64(EnHintSkb* this, PlayState* play) { void func_80C20E90(EnHintSkb* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((this->actor.bgCheckFlags & 0x60) && (this->actor.depthInWater >= 40.0f)) { + if ((this->actor.bgCheckFlags & (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH)) && + (this->actor.depthInWater >= 40.0f)) { this->actor.colChkInfo.health = 0; SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD); func_80C20484(this); 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 8e5d7a06f1..8c1c771bf7 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -345,7 +345,7 @@ void func_8087B7C0(EnHorse* this, PlayState* play, Path* path) { func_8017D7C0(this->actor.world.pos.x, this->actor.world.pos.z, sp80.x, sp80.z, sp8C.x, sp8C.z, &sp70); - if ((this->actor.bgCheckFlags & 8) || (this->unk_1EC & 4)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->unk_1EC & 4)) { EnHorse_RotateToPoint(this, play, &sp8C, 0xC80); if (this->unk_1EC & 4) { this->unk_1EC &= ~4; @@ -3744,7 +3744,8 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 40.0f, 35.0f, 100.0f, 0x1C); } - if ((this->actor.bgCheckFlags & 8) && (Math_CosS(this->actor.wallYaw - this->actor.world.rot.y) < -0.3f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && + (Math_CosS(this->actor.wallYaw - this->actor.world.rot.y) < -0.3f)) { if (this->actor.speed > 4.0f) { this->actor.speed -= 1.0f; if (this->type == HORSE_TYPE_2) { 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 727e0f782d..62dab2268a 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -410,7 +410,7 @@ void EnIk_WalkTowardsPlayer(EnIk* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_WALK); } yawDiff = this->actor.wallYaw - this->actor.shape.rot.y; - if ((this->actor.bgCheckFlags & 8) && (ABS_ALT(yawDiff) >= 0x4000)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS_ALT(yawDiff) >= 0x4000)) { yawDiff = (this->actor.yawTowardsPlayer > 0) ? this->actor.wallYaw - 0x4000 : this->actor.wallYaw + 0x4000; Math_ScaledStepToS(&this->actor.shape.rot.y, yawDiff, 0x320); } else { @@ -438,7 +438,7 @@ void EnIk_RunTowardsPlayer(EnIk* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_WALK); } yawDiff = this->actor.wallYaw - this->actor.shape.rot.y; - if ((this->actor.bgCheckFlags & 8) && (ABS_ALT(yawDiff) >= 0x4000)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS_ALT(yawDiff) >= 0x4000)) { yawDiff = (this->actor.yawTowardsPlayer > 0) ? this->actor.wallYaw - 0x4000 : this->actor.wallYaw + 0x4000; Math_ScaledStepToS(&this->actor.shape.rot.y, yawDiff, 0x4B0); } else { 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 69e3c8eb8d..96ebd83db6 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -201,7 +201,7 @@ void func_8091ACC4(EnInsect* this, PlayState* play) { if ((this->unk_30C & 4) && (this->unk_314 <= 0)) { func_8091B3D0(this); - } else if ((this->unk_30C & 1) && (this->actor.bgCheckFlags & 0x40)) { + } else if ((this->unk_30C & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH)) { func_8091B618(this); } else if (this->actor.xzDistToPlayer < 40.0f) { func_8091B030(this); @@ -241,7 +241,7 @@ void func_8091AE5C(EnInsect* this, PlayState* play) { if ((this->unk_30C & 4) && (this->unk_314 <= 0)) { func_8091B3D0(this); - } else if ((this->unk_30C & 1) && (this->actor.bgCheckFlags & 0x40)) { + } else if ((this->unk_30C & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH)) { func_8091B618(this); } else if (this->actor.xzDistToPlayer < 40.0f) { func_8091B030(this); @@ -290,7 +290,7 @@ void func_8091B07C(EnInsect* this, PlayState* play) { if ((this->unk_312 <= 0) || !sp38) { func_8091AC78(this); - } else if ((this->unk_30C & 1) && (this->actor.bgCheckFlags & 0x40)) { + } else if ((this->unk_30C & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH)) { func_8091B618(this); } } @@ -409,7 +409,7 @@ void func_8091B670(EnInsect* this, PlayState* play) { if ((this->unk_312 <= 0) || ((this->unk_30C & 4) && (this->unk_314 <= 0))) { func_8091B928(this); - } else if (!(this->actor.bgCheckFlags & 0x40)) { + } else if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH)) { func_8091AC78(this); } } @@ -462,7 +462,7 @@ void EnInsect_Update(Actor* thisx, PlayState* play) { Actor_MoveWithGravity(&this->actor); if (this->unk_30C & 0x100) { if (this->unk_30C & 1) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_8091A9E4(this); } } else { 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 ecc6a57c43..2b4bdd09f4 100644 --- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c +++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c @@ -1076,10 +1076,10 @@ void func_80B447C0(EnInvadepoh* this, PlayState* play) { } void func_80B44A90(EnInvadepoh* this, PlayState* play) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.velocity.y *= 0.3f; this->actor.speed *= 0.8f; - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.velocity.y *= 0.8f; this->actor.speed *= 0.3f; } else { 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 b27111ca01..c9c42a10b1 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -191,11 +191,11 @@ void func_8095D804(Actor* thisx, PlayState* play) { spB8.z = ((Rand_ZeroOne() - 0.5f) * 8.0f) + this->actor.world.pos.z; Math_Vec3f_Copy(&spC4, &this->actor.velocity); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { spC4.x *= 0.6f; spC4.y *= -0.3f; spC4.z *= 0.6f; - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { spC4.x *= -0.5f; spC4.y *= 0.5f; spC4.z *= -0.5f; @@ -230,11 +230,11 @@ void func_8095DABC(Actor* thisx, PlayState* play) { Math_Vec3f_Copy(&spD8, &this->actor.velocity); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { spD8.x *= 0.9f; spD8.y *= -0.8f; spD8.z *= 0.9f; - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { spD8.x *= -0.9f; spD8.y *= 0.8f; spD8.z *= -0.9f; @@ -265,11 +265,11 @@ void func_8095DDA8(EnIshi* this, PlayState* play) { Vec3f sp2C; Math_Vec3f_Copy(&sp2C, &this->actor.world.pos); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { sp2C.x += 2.0f * this->actor.velocity.x; sp2C.y -= 2.0f * this->actor.velocity.y; sp2C.z += 2.0f * this->actor.velocity.z; - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp2C.x -= 2.0f * this->actor.velocity.x; sp2C.y += 2.0f * this->actor.velocity.y; sp2C.z -= 2.0f * this->actor.velocity.z; @@ -281,11 +281,11 @@ void func_8095DE9C(EnIshi* this, PlayState* play) { Vec3f sp2C; Math_Vec3f_Copy(&sp2C, &this->actor.world.pos); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { sp2C.x += 2.0f * this->actor.velocity.x; sp2C.y -= 2.0f * this->actor.velocity.y; sp2C.z += 2.0f * this->actor.velocity.z; - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp2C.x -= 2.0f * this->actor.velocity.x; sp2C.y += 2.0f * this->actor.velocity.y; sp2C.z -= 2.0f * this->actor.velocity.z; @@ -585,11 +585,11 @@ void func_8095EBDC(EnIshi* this, PlayState* play) { this->unk_194--; - if ((this->actor.bgCheckFlags & 9) || temp_v0 || (this->unk_194 <= 0)) { + if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL)) || temp_v0 || (this->unk_194 <= 0)) { func_8095DF90(this, play); D_8095F6D8[sp70](&this->actor, play); - if (!(this->actor.bgCheckFlags & 0x20)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, D_8095F6D4[sp70], D_8095F6D0[sp70]); D_8095F6E0[sp70](this, play); } @@ -608,7 +608,7 @@ void func_8095EBDC(EnIshi* this, PlayState* play) { return; } - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { if (sp70 == 0) { sp58.x = this->actor.world.pos.x; sp58.y = this->actor.world.pos.y + this->actor.depthInWater; @@ -639,7 +639,7 @@ void func_8095EBDC(EnIshi* this, PlayState* play) { D_8095F694 >>= 2; SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); - this->actor.bgCheckFlags &= ~0x40; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH; } Math_StepToF(&this->actor.shape.yOffset, 0.0f, 2.0f); 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 6aea8641b8..5b009f424b 100644 --- a/src/overlays/actors/ovl_En_Jg/z_en_jg.c +++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.c @@ -445,7 +445,7 @@ void EnJg_Walk(EnJg* this, PlayState* play) { if (this->path != NULL) { yRotation = EnJg_GetWalkingYRotation(this->path, this->currentPoint, &this->actor.world.pos, &distSQ); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { yRotation = this->actor.wallYaw; } 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 59e860c200..babafb5a04 100644 --- a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c +++ b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c @@ -189,11 +189,12 @@ void func_80C13BB8(EnJgameTsn* this, PlayState* play) { func_800B8614(&this->actor, play, 80.0f); } - 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)) { + if ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !(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); - } else if (!(player->actor.bgCheckFlags & 1)) { + } else if (!(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->unk_2FE = 0; } @@ -334,7 +335,7 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) { this->unk_2FC++; - if ((player->actor.bgCheckFlags & 2) && func_80C149B0(play, &this->unk_200)) { + if ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && func_80C149B0(play, &this->unk_200)) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); Message_StartTextbox(play, 0x109F, &this->actor); this->unk_300 = 0x109F; @@ -342,7 +343,8 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) { *this->unk_208[this->unk_218] &= ~OBJLUPYGAMELIFT_IGNITE_FIRE; func_801A2C20(); func_80C14030(this); - } else if ((player->actor.bgCheckFlags & 0x40) || (player->actor.bgCheckFlags & 0x20)) { + } else if ((player->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) || + (player->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); Message_StartTextbox(play, 0x10A0, &this->actor); this->unk_300 = 0x10A0; @@ -549,7 +551,7 @@ s32 func_80C14BCC(EnJgameTsn* this, PlayState* play) { s32 i; s32 phi_s3 = -1; - if (player->actor.bgCheckFlags & 2) { + if (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { for (i = 0; i < ARRAY_COUNT(this->unk_1D8); i++) { if (func_80C149B0(play, &this->unk_1D8[i])) { phi_s3 = i; 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 49928a3695..d9d4000c55 100644 --- a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c +++ b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c @@ -371,7 +371,7 @@ s32 func_80B85A00(EnKaizoku* this, PlayState* play, s16 arg2) { } } else if (func_800BE184(play, &this->picto.actor, 100.0f, 0x5DC0, 0x2AA8, this->picto.actor.shape.rot.y)) { this->picto.actor.shape.rot.y = this->picto.actor.world.rot.y = this->picto.actor.yawTowardsPlayer; - if ((this->picto.actor.bgCheckFlags & 8) && (ABS_ALT(sp32) < 0x2EE0) && + if ((this->picto.actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS_ALT(sp32) < 0x2EE0) && (this->picto.actor.xzDistToPlayer < 90.0f)) { if (this->action != KAIZOKU_ACTION_6) { func_80B87C7C(this); @@ -393,7 +393,8 @@ s32 func_80B85A00(EnKaizoku* this, PlayState* play, s16 arg2) { if (explosiveActor != NULL) { this->picto.actor.shape.rot.y = this->picto.actor.world.rot.y = this->picto.actor.yawTowardsPlayer; - if (((this->picto.actor.bgCheckFlags & 8) && (sp32 < 0x2EE0)) || (explosiveActor->id == ACTOR_EN_BOM_CHU)) { + if (((this->picto.actor.bgCheckFlags & BGCHECKFLAG_WALL) && (sp32 < 0x2EE0)) || + (explosiveActor->id == ACTOR_EN_BOM_CHU)) { if ((explosiveActor->id == ACTOR_EN_BOM_CHU) && (Actor_WorldDistXYZToActor(&this->picto.actor, explosiveActor) < 80.0f) && (BINANG_ADD(this->picto.actor.shape.rot.y - explosiveActor->world.rot.y, 0x8000) < 0x4000)) { @@ -531,7 +532,7 @@ void func_80B85FA8(EnKaizoku* this, PlayState* play) { break; case 2: - if (this->picto.actor.bgCheckFlags & 1) { + if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->unk_2D8 != 0) { this->unk_2D8 = 0; this->picto.actor.world.pos.y = this->picto.actor.floorHeight; @@ -951,10 +952,10 @@ void func_80B8760C(EnKaizoku* this, PlayState* play) { s32 temp_ft1; this->picto.actor.world.rot.y = this->picto.actor.yawTowardsPlayer + 0x3A98; - if ((this->picto.actor.bgCheckFlags & 8) || + if ((this->picto.actor.bgCheckFlags & BGCHECKFLAG_WALL) || !Actor_TestFloorInDirection(&this->picto.actor, play, this->picto.actor.speed, this->picto.actor.shape.rot.y + 0x4000)) { - if (this->picto.actor.bgCheckFlags & 8) { + if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->picto.actor.speed >= 0.0f) { var_v0 = this->picto.actor.shape.rot.y + 0x4000; } else { @@ -1120,7 +1121,8 @@ void func_80B87D3C(EnKaizoku* this, PlayState* play) { } this->unk_2D8 = 0; - if ((this->frameCount <= curFrame) && (this->picto.actor.bgCheckFlags & 3)) { + if ((this->frameCount <= curFrame) && + (this->picto.actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH))) { this->bodyCollider.info.elemType = ELEMTYPE_UNK1; this->bodyCollider.base.colType = COLTYPE_HIT3; this->swordCollider.info.elemType = ELEMTYPE_UNK2; @@ -1485,11 +1487,11 @@ void func_80B88D6C(EnKaizoku* this, PlayState* play) { } } - if ((this->picto.actor.bgCheckFlags & 8) || + if ((this->picto.actor.bgCheckFlags & BGCHECKFLAG_WALL) || !Actor_TestFloorInDirection(&this->picto.actor, play, this->picto.actor.speed, this->picto.actor.shape.rot.y + 0x4000)) { - if (this->picto.actor.bgCheckFlags & 8) { + if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->picto.actor.speed >= 0.0f) { yaw = this->picto.actor.shape.rot.y + 0x4000; } else { @@ -1550,7 +1552,7 @@ void func_80B88D6C(EnKaizoku* this, PlayState* play) { // EnKaizoku_SetupStunned void func_80B891B8(EnKaizoku* this) { - if (this->picto.actor.bgCheckFlags & 1) { + if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->picto.actor.speed = 0.0f; } @@ -1585,18 +1587,18 @@ void func_80B89280(EnKaizoku* this, PlayState* play) { } } - if (this->picto.actor.bgCheckFlags & 2) { + if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->picto.actor.speed = 0.0f; } - if (this->picto.actor.bgCheckFlags & 1) { + if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->picto.actor.speed < 0.0f) { this->picto.actor.speed += 0.05f; } } if ((this->unk_2B6 == 0) && (this->unk_2B8 == 0) && !CHECK_FLAG_ALL(this->picto.actor.flags, ACTOR_FLAG_2000) && - (this->picto.actor.bgCheckFlags & 1)) { + (this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->unk_2D8 = 0; func_80B85A00(this, play, true); @@ -1644,7 +1646,7 @@ void func_80B894C0(EnKaizoku* this, PlayState* play) { if (!func_80B85858(this, play) && !func_80B85A00(this, play, false) && (this->unk_3C4.x < 1.0f) && (this->unk_3C4.z < 1.0f)) { temp_v0 = this->picto.actor.wallYaw - this->picto.actor.shape.rot.y; - if (this->picto.actor.bgCheckFlags & 8) { + if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (ABS_ALT(temp_v0) < 0x3000 && (this->picto.actor.xzDistToPlayer < 90.0f)) { func_80B87C7C(this); return; @@ -1692,11 +1694,11 @@ void func_80B8971C(EnKaizoku* this, PlayState* play) { f32 curFrame = this->skelAnime.curFrame; Player* player; - if (this->picto.actor.bgCheckFlags & 2) { + if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->picto.actor.speed = 0.0f; } - if (this->picto.actor.bgCheckFlags & 1) { + if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_SmoothStepToF(&this->picto.actor.speed, 0.0f, 1.0f, 0.5f, 0.0f); } @@ -1809,7 +1811,7 @@ void func_80B89A08(EnKaizoku* this, PlayState* play) { } } - if ((this->picto.actor.bgCheckFlags & 8) && (this->picto.actor.wallBgId != BG_ACTOR_MAX) && + if ((this->picto.actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->picto.actor.wallBgId != BG_ACTOR_MAX) && ((this->action == KAIZOKU_ACTION_2) || (this->action == KAIZOKU_ACTION_3) || (this->action == KAIZOKU_ACTION_4) || (this->action == KAIZOKU_ACTION_1))) { func_80B87F70(this); @@ -2015,7 +2017,7 @@ void EnKaizoku_Update(Actor* thisx, PlayState* play2) { } } - if (this->picto.actor.bgCheckFlags & 1) { + if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Matrix_RotateYS(this->picto.actor.shape.rot.y + this->unk_2F4, 0); Matrix_MultVecZ(this->unk_2F0, &sp34); this->picto.actor.world.pos.x += this->unk_3C4.x + sp34.x; 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 234d865bde..dfdd18d7d5 100644 --- a/src/overlays/actors/ovl_En_Kame/z_en_kame.c +++ b/src/overlays/actors/ovl_En_Kame/z_en_kame.c @@ -287,7 +287,7 @@ void func_80AD75A8(EnKame* this, PlayState* play) { static Color_RGBA8 D_80AD8E58 = { 180, 180, 180, 255 }; static Vec3f D_80AD8E5C = { 0.0f, 0.75f, 0.0f }; - if ((this->actor.bgCheckFlags & 1) && (this->actor.speed >= 3.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speed >= 3.0f)) { if ((play->gameplayFrames % 2) == 0) { u32 temp_v0 = func_800C9BB8(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); @@ -367,7 +367,7 @@ void func_80AD7948(EnKame* this, PlayState* play) { temp_v1 = ABS_ALT(temp_v0); - if ((this->actor.bgCheckFlags & 8) || (temp_v1 > 0x3000) || + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (temp_v1 > 0x3000) || (Actor_WorldDistXZToPoint(&this->actor, &this->unk_2BC) < 50.0f)) { s8 pad; @@ -554,7 +554,7 @@ void func_80AD8148(EnKame* this, PlayState* play) { func_800BE504(&this->actor, &this->collider); } } - this->actor.bgCheckFlags &= ~0x1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.flags &= ~ACTOR_FLAG_1; this->actor.flags |= ACTOR_FLAG_10; Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_DEAD); @@ -564,7 +564,7 @@ void func_80AD8148(EnKame* this, PlayState* play) { void func_80AD825C(EnKame* this, PlayState* play) { SkelAnime_Update(&this->skelAnime1); - if ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.velocity.y < 0.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EN_HIPLOOP_LAND); func_80AD8364(this); } else { 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 ad14e2c189..ba1cf165c0 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -423,7 +423,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { f32 tempY; f32 tempZ; f32 tempWaterDepth; - u16 tempBgFlags; + u16 bgCheckFlags; u8 onGround; if (this->unk_198 != 0) { @@ -438,7 +438,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { tempX = this->actor.world.pos.x; tempY = this->actor.world.pos.y; tempZ = this->actor.world.pos.z; - tempBgFlags = this->actor.bgCheckFlags; + bgCheckFlags = this->actor.bgCheckFlags; tempWaterDepth = this->actor.depthInWater; this->actor.world.pos.z += ((this->actor.world.pos.y - this->actor.floorHeight) * -50.0f) / 100.0f; @@ -448,12 +448,12 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { this->actor.world.pos.x = tempX; this->actor.world.pos.y = tempY; this->actor.world.pos.z = tempZ; - this->actor.bgCheckFlags = tempBgFlags; + this->actor.bgCheckFlags = bgCheckFlags; this->actor.depthInWater = tempWaterDepth; if (1) {} - onGround = (this->actor.bgCheckFlags & 1); + onGround = (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND); if (this->spinXFlag != 0) { this->spinRot.x += this->spinVel.x; @@ -495,14 +495,14 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { this->spinVel.z = -0xC00; } - if (this->actor.bgCheckFlags & 8) { - if (!(this->actor.bgCheckFlags & 1)) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Actor_PlaySfx(&this->actor, NA_SE_EV_WOODPLATE_BOUND); } this->actor.speed *= -0.5f; } - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { this->actionState = ENKANBAN_WATER; Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_DROP_WATER); this->bounceX = this->bounceZ = 0; @@ -542,7 +542,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { this->actor.speed = 0.0f; } else if ((this->floorRot.x > 0.1f) || (this->floorRot.z > 0.1f)) { this->airTimer = 10; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actionState = ENKANBAN_GROUND; this->actor.speed = 0.0f; goto nextCase; @@ -702,7 +702,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { } } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = 0.0f; } @@ -710,7 +710,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { if (this->actor.speed != 0.0f) { Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 50.0f, 5); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.speed *= -0.5f; if (this->spinVel.y > 0) { this->spinVel.y = -2000; 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 7a3658e2ae..e4e2bba998 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -413,7 +413,8 @@ void EnKarebaba_Dying(EnKarebaba* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C); EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); - if ((this->actor.scale.x > 0.005f) && ((this->actor.bgCheckFlags & 2) || (this->actor.bgCheckFlags & 8))) { + if ((this->actor.scale.x > 0.005f) && ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) || + (this->actor.bgCheckFlags & BGCHECKFLAG_WALL))) { this->actor.scale.z = 0.0f; this->actor.scale.y = 0.0f; this->actor.scale.x = 0.0f; @@ -423,7 +424,7 @@ void EnKarebaba_Dying(EnKarebaba* this, PlayState* play) { NULL); } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); this->timer = 1; } 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 fb8c87cf1a..11dac60026 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -552,8 +552,9 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) { this->collider.base.atFlags &= ~AT_HIT; } this->timer++; - if ((this->actor.bgCheckFlags & 0xB) || wasHit || (this->timer >= 100)) { - if (!(this->actor.bgCheckFlags & 0x20)) { + if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL)) || wasHit || + (this->timer >= 100)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN); } EnKusa_SpawnFragments(this, play); @@ -571,7 +572,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) { } } else { - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { contactPos.y = this->actor.world.pos.y + this->actor.depthInWater; for (angleOffset = 0, i = 0; i < 4; i++, angleOffset += 0x4000) { contactPos.x = @@ -593,7 +594,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) { rotSpeedXtarget >>= 1; rotSpeedY >>= 1; rotSpeedYtarget >>= 1; - this->actor.bgCheckFlags &= ~0x40; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH; SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); } EnKusa_UpdateVelY(this); 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 108b9e9ae7..30740f563c 100644 --- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c +++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c @@ -1087,12 +1087,12 @@ void func_80A5DC98(EnKusa2* this, PlayState* play) { func_80A5BF38(this, 4); func_80A5BF84(this, play); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_80A5CD0C(this); func_80A5BB40(this, play, 1); Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK); func_80A5DE18(this); - } else if (this->actor.bgCheckFlags & 0x20) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { func_80A5BDB0(this, play); func_80A5E418(this); } else if (this->unk_1CA > 0) { @@ -1157,7 +1157,7 @@ void func_80A5DEB4(EnKusa2* this, PlayState* play) { func_80A5CD0C(this); } - if (this->actor.bgCheckFlags & 0x20) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { func_80A5BDB0(this, play); func_80A5E418(this); } else { @@ -1168,7 +1168,7 @@ void func_80A5DEB4(EnKusa2* this, PlayState* play) { this->actor.speed += 4.0f; this->actor.velocity.y = (Rand_ZeroOne() * 4.0f) + 15.0f; func_80A5E1D8(this); - } else if (this->actor.bgCheckFlags & 1) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->unk_1CA--; if (this->unk_1CA <= 0) { func_80A5CD0C(this); @@ -1200,9 +1200,9 @@ void func_80A5E1D8(EnKusa2* this) { void func_80A5E210(EnKusa2* this, PlayState* play) { Math_StepToF(&this->actor.gravity, -4.0f, 0.5f); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed *= 0.4f; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { func_80A5D178(this); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_KUSAMUSHI_HIDE); } @@ -1229,7 +1229,7 @@ void func_80A5E210(EnKusa2* this, PlayState* play) { if (this->actor.velocity.y > 1.0f) { Math_StepToF(&this->actor.scale.y, 0.24000001f, 0.080000006f); Math_StepToF(&this->actor.scale.x, 0.32000002f, 0.040000003f); - } else if (this->actor.bgCheckFlags & 1) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_StepToF(&this->actor.scale.y, 0.0f, 0.120000005f); Math_StepToF(&this->actor.scale.x, 0.48000002f, 0.120000005f); } else { @@ -1269,7 +1269,8 @@ void func_80A5E4BC(EnKusa2* this, PlayState* play) { this->actor.shape.rot.x -= 0x5DC; this->actor.shape.rot.y += this->unk_1CC; - if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 5.0f) && (Rand_ZeroOne() < 0.8f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 5.0f) && + (Rand_ZeroOne() < 0.8f)) { EffectSsBubble_Spawn(play, &this->actor.world.pos, 20.0f, 10.0f, 20.0f, (Rand_ZeroOne() * 0.08f) + 0.04f); } 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 ae7ad360ce..88aabcdc96 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 @@ -772,7 +772,7 @@ void func_80AEB280(EnLiftNuts* this) { void func_80AEB294(EnLiftNuts* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (((player->actor.bgCheckFlags & 1) && (player->actor.floorBgId == BG_ACTOR_MAX) && + if (((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (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; 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 bfe805cb1e..ef3764a773 100644 --- a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c +++ b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c @@ -187,14 +187,14 @@ void EnMinifrog_Jump(EnMinifrog* this) { switch (this->jumpState) { case MINIFROG_STATE_JUMP: if (Animation_OnFrame(&this->skelAnime, 4.0f)) { - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.velocity.y = 6.0f; Actor_PlaySfx(&this->actor, NA_SE_EV_FROG_JUMP); this->jumpState = MINIFROG_STATE_AIR; } break; case MINIFROG_STATE_AIR: - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->jumpState = MINIFROG_STATE_GROUND; Animation_MorphToLoop(&this->skelAnime, &object_fr_Anim_001534, -2.5f); SkelAnime_Update(&this->skelAnime); 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 02a085e548..4aa052549f 100644 --- a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c +++ b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c @@ -140,36 +140,36 @@ void EnMinislime_CheckBackgroundCollision(EnMinislime* this) { f32 scaleY = this->actor.scale.y * 400.0f; f32 scaleZ = this->actor.scale.z * 400.0f; - this->actor.bgCheckFlags &= ~(0x10 | 0x8 | 0x2); + this->actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING); if ((this->actor.world.pos.y + scaleY) > GBT_ROOM_5_MAX_Y) { - this->actor.bgCheckFlags |= 0x10; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags |= BGCHECKFLAG_CEILING; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.world.pos.y = GBT_ROOM_5_MAX_Y - scaleY; } else if ((this->actor.world.pos.y - scaleY) < GBT_ROOM_5_MIN_Y) { this->actor.world.pos.y = GBT_ROOM_5_MIN_Y + scaleY; - if (!(this->actor.bgCheckFlags & 1)) { - this->actor.bgCheckFlags |= 2; + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { + this->actor.bgCheckFlags |= BGCHECKFLAG_GROUND_TOUCH; } - this->actor.bgCheckFlags |= 1; + this->actor.bgCheckFlags |= BGCHECKFLAG_GROUND; } else { - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; } if ((this->actor.world.pos.x + scaleX) > GBT_ROOM_5_MAX_X) { - this->actor.bgCheckFlags |= 8; + this->actor.bgCheckFlags |= BGCHECKFLAG_WALL; this->actor.world.pos.x = GBT_ROOM_5_MAX_X - scaleX; } else if ((this->actor.world.pos.x - scaleX) < GBT_ROOM_5_MIN_X) { this->actor.world.pos.x = GBT_ROOM_5_MIN_X + scaleX; - this->actor.bgCheckFlags |= 8; + this->actor.bgCheckFlags |= BGCHECKFLAG_WALL; } if ((this->actor.world.pos.z + scaleZ) > GBT_ROOM_5_MAX_Z) { - this->actor.bgCheckFlags |= 8; + this->actor.bgCheckFlags |= BGCHECKFLAG_WALL; this->actor.world.pos.z = GBT_ROOM_5_MAX_Z - scaleZ; } else if ((this->actor.world.pos.z - scaleZ) < GBT_ROOM_5_MIN_Z) { this->actor.world.pos.z = GBT_ROOM_5_MIN_Z + scaleZ; - this->actor.bgCheckFlags |= 8; + this->actor.bgCheckFlags |= BGCHECKFLAG_WALL; } } @@ -259,7 +259,7 @@ void EnMinislime_Fall(EnMinislime* this, PlayState* play) { Math_StepToF(&this->actor.scale.x, 0.17999999f, 0.003f); Math_StepToF(&this->actor.scale.y, 0.05f, 0.003f); this->actor.scale.z = this->actor.scale.x; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EnMinislime_SetupGrowAndShrink(this); } } @@ -271,7 +271,7 @@ void EnMinislime_SetupBreakFromBigslime(EnMinislime* this) { this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.speed = Math_CosS(this->actor.world.rot.x) * 15.0f; velY = Math_SinS(this->actor.world.rot.x) * 15.0f; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.velocity.y = velY + 2.0f; this->actor.gravity = -1.0f; this->frozenScale = 0.1f; @@ -289,7 +289,7 @@ void EnMinislime_BreakFromBigslime(EnMinislime* this, PlayState* play) { this->actor.shape.rot.x += this->actor.world.rot.x; if (this->actor.velocity.y < 0.0f) { this->collider.base.ocFlags1 |= OC1_ON; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EnMinislime_AddIceShardEffect(this); this->attackTimer = 40; EnMinislime_SetupGrowAndShrink(this); @@ -341,7 +341,7 @@ void EnMinislime_IceArrowDamage(EnMinislime* this, PlayState* play) { return; } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { EnMinislime_AddIceShardEffect(this); EnMinislime_SetupGrowAndShrink(this); } @@ -478,7 +478,7 @@ void EnMinislime_Bounce(EnMinislime* this, PlayState* play) { } else { Math_StepToF(&this->actor.scale.x, 0.17999999f, 0.003f); Math_StepToF(&this->actor.scale.y, 0.05f, 0.003f); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EnMinislime_SetupGrowAndShrink(this); return; } @@ -661,7 +661,7 @@ void EnMinislime_SetupGekkoThrow(EnMinislime* this) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.gravity = -1.0f; this->actor.velocity.y = ((xzDistToPlayer - 200.0f) * 0.01f) + 3.0f; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->throwTimer = 10; this->actionFunc = EnMinislime_GekkoThrow; } @@ -678,7 +678,7 @@ void EnMinislime_GekkoThrow(EnMinislime* this, PlayState* play) { this->throwTimer = 10; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EnMinislime_SetupGrowAndShrink(this); } } @@ -713,7 +713,7 @@ void EnMinislime_Update(Actor* thisx, PlayState* play) { s32 pad; Vec3f vec1; - if ((this->actor.params == MINISLIME_DEFEAT_IDLE) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.params == MINISLIME_DEFEAT_IDLE) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { EnMinislime_SetupDefeatIdle(this); } else if (this->actor.params == MINISLIME_DEFEAT_MELT) { EnMinislime_SetupDefeatMelt(this, play); @@ -761,7 +761,7 @@ void EnMinislime_Update(Actor* thisx, PlayState* play) { this->attackTimer--; } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { player = GET_PLAYER(play); vec1.x = this->actor.world.pos.x; vec1.z = this->actor.world.pos.z; 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 59cc5249fa..7da0b46e30 100644 --- a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c +++ b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c @@ -256,7 +256,7 @@ void func_80A4E2E8(EnMkk* this, PlayState* play) { s32 sp20; this->unk_14E--; - if ((this->actor.params == 1) && (this->actor.bgCheckFlags & 1) && (this->actor.speed > 2.5f) && + if ((this->actor.params == 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speed > 2.5f) && ((play->gameplayFrames % 3) == 0)) { func_80A4E22C(this, play); } @@ -280,7 +280,7 @@ void func_80A4E2E8(EnMkk* this, PlayState* play) { this->unk_14B &= ~2; func_80A4E190(this); } else if ((this->unk_149 == 0) && (!(player->stateFlags3 & 0x100)) && - (Player_GetMask(play) != PLAYER_MASK_STONE) && (this->actor.bgCheckFlags & 1) && + (Player_GetMask(play) != PLAYER_MASK_STONE) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (Actor_IsFacingPlayer(&this->actor, 0x1800)) && (this->actor.xzDistToPlayer < 120.0f) && (fabsf(this->actor.playerHeightRel) < 100.0f)) { func_80A4E58C(this); @@ -301,7 +301,7 @@ void func_80A4E60C(EnMkk* this, PlayState* play) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~(AT_ON | AT_HIT); } - if ((this->actor.velocity.y < 0.0f) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.velocity.y < 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->unk_149 = 2; this->collider.base.atFlags &= ~AT_ON; func_80A4E2B8(this); @@ -320,14 +320,14 @@ void func_80A4E67C(EnMkk* this) { this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.velocity.y = 5.0f; this->actor.gravity = -1.3f; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actionFunc = func_80A4E72C; } void func_80A4E72C(EnMkk* this, PlayState* play) { Vec3f temp; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.velocity.y > -1.0f) { temp.x = this->actor.world.pos.x; temp.y = this->actor.world.pos.y + 15.0f; @@ -341,7 +341,7 @@ void func_80A4E72C(EnMkk* this, PlayState* play) { func_80A4EEF4(this); } else { this->actor.velocity.y *= -0.8f; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; } } } 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 bd8472a4e9..9cef987d6b 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -126,11 +126,11 @@ void func_80965DB4(EnMm* this, PlayState* play) { func_80965BBC(this); Actor_PlaySfx(&this->actor, NA_SE_PL_PULL_UP_ROCK); } else { - if ((this->actor.velocity.y > 0.0f) && (this->actor.bgCheckFlags & 0x10)) { + if ((this->actor.velocity.y > 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING)) { this->actor.velocity.y = 0.0f; } - if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & 8)) { + if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { angle = BINANG_SUB(this->actor.world.rot.y, BINANG_ROT180(this->actor.wallYaw)); this->actor.world.rot.y += BINANG_SUB(0x8000, (s16)(angle * 2)); this->actor.speed *= 0.5f; @@ -138,7 +138,7 @@ void func_80965DB4(EnMm* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EV_HUMAN_BOUND); } - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Math_StepToF(&this->actor.speed, 0.0f, 0.08f); } else { temp_f14 = Math_SinS(this->actor.world.rot.y) * this->actor.speed; @@ -163,10 +163,10 @@ void func_80965DB4(EnMm* this, PlayState* play) { this->unk_190 += (s16)(this->actor.speed * 800.0f); } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (this->actor.velocity.y < -6.0f) { this->actor.velocity.y *= -0.3f; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; } Actor_PlaySfx(&this->actor, NA_SE_EV_HUMAN_BOUND); @@ -186,7 +186,7 @@ void func_8096611C(EnMm* this, PlayState* play) { if (Actor_HasNoParent(&this->actor, play)) { EnMm_SetupAction(this, func_80965DB4); this->actor.room = play->roomCtx.curRoom.num; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; Math_Vec3s_ToVec3f(&this->actor.prevPos, &this->actor.home.rot); gSaveContext.unk_1014 = 0; } else { 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 7b2dc9db6a..c7791dea7d 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 @@ -220,7 +220,8 @@ s32 EnMttag_UpdateCheckpoints(EnMttag* this, PlayState* play) { } if ((currentCheckpoints[0] > 0) && (currentCheckpoints[0] < highestCurrentCheckpoint) && - (player->actor.bgCheckFlags & 1) && ((highestCurrentCheckpoint - currentCheckpoints[0]) >= 24)) { + (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + ((highestCurrentCheckpoint - currentCheckpoints[0]) >= 24)) { playerIsLikelyToLose = true; } 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 2490c5cc6f..90c3ea51fd 100644 --- a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c +++ b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c @@ -820,9 +820,9 @@ void func_80A6A36C(EnMushi2* this, PlayState* play) { return; } - if (this->actor.bgCheckFlags & 0x20) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { func_80A6AAA4(this); - } else if (this->actor.bgCheckFlags & 1) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_WALK); func_80A68F24(this); func_80A691EC(this, this->actor.floorPoly, -1.0f); @@ -1005,7 +1005,7 @@ void func_80A6AB08(EnMushi2* this, PlayState* play) { func_80A6A094(this); func_80A6A0D8(this); func_80A6AE14(this); - } else if (!(this->actor.bgCheckFlags & 0x20)) { + } else if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { func_80A6A794(this); } } 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 abaf6c3e07..9c91d7092c 100644 --- a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c +++ b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c @@ -81,7 +81,7 @@ void EnNimotsu_Update(Actor* thisx, PlayState* play) { Actor_MoveWithGravity(&this->actor); - if (!(this->dustDone & 1) && (this->actor.bgCheckFlags & 1)) { + if (!(this->dustDone & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (DECR(this->timer) == 0) { this->dustDone |= 1; } 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 87fcf5a4d5..37da82a913 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -319,8 +319,8 @@ void EnNiw_UpdateRunning(EnNiw* this, PlayState* play, s32 isStormCucco) { if (this->hopTimer == 0) { this->hopTimer = 3; - if (this->actor.bgCheckFlags & 1) { // hit floor - this->actor.velocity.y = 3.5f; // hopping up while running away + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { + this->actor.velocity.y = 3.5f; // hopping up while running away } } @@ -336,8 +336,7 @@ void EnNiw_UpdateRunning(EnNiw* this, PlayState* play, s32 isStormCucco) { runningDirection = -runningAngles[isStormCucco]; } - if (isStormCucco == true && - (this->runAwayTimer == 0 || (this->actor.bgCheckFlags & 8))) { // bgCheckFlags 8: hit a wall + if (isStormCucco == true && (this->runAwayTimer == 0 || (this->actor.bgCheckFlags & BGCHECKFLAG_WALL))) { this->runAwayTimer = 150; if (this->yawTimer == 0) { this->yawTimer = 70; @@ -414,7 +413,7 @@ void EnNiw_Idle(EnNiw* this, PlayState* play) { } else { this->unkIdleTimer = 4; - if (this->actor.bgCheckFlags & 1) { // hit floor + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = 0.0f; this->actor.velocity.y = 3.5f; // hopping up and down } @@ -494,7 +493,7 @@ void EnNiw_Held(EnNiw* this, PlayState* play) { void EnNiw_Thrown(EnNiw* this, PlayState* play) { if (this->unk2EC == 0) { - if (this->actor.bgCheckFlags & 1) { // hit floor + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->unk2EC = 1; this->hoppingTimer = 80; // hop timer this->actor.speed = 0.0f; @@ -503,7 +502,7 @@ void EnNiw_Thrown(EnNiw* this, PlayState* play) { return; // wait until back on floor } } else { - if (this->actor.bgCheckFlags & 1) { // hit floor + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->sfxTimer1 = 0; this->actor.velocity.y = 4.0f; // vertical hop this->unk29E = 1; @@ -545,7 +544,7 @@ void EnNiw_Swimming(EnNiw* this, PlayState* play) { } this->actor.speed = 2.0f; - if (this->actor.bgCheckFlags & 0x20) { // touching water + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { this->actor.gravity = 0.0f; if (this->actor.depthInWater > 15.0f) { this->actor.world.pos.y += 2.0f; @@ -557,13 +556,13 @@ void EnNiw_Swimming(EnNiw* this, PlayState* play) { EffectSsGRipple_Spawn(play, &ripplePos, 100, 500, 30); } - if (this->actor.bgCheckFlags & 8) { // hit a wall + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.velocity.y = 10.0f; // fly up in straight line this->actor.speed = 1.0f; } } else { this->actor.gravity = -2.0f; - if (this->actor.bgCheckFlags & 8) { // hit a wall + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.velocity.y = 10.0f; // fly up in straight line this->actor.speed = 1.0f; this->actor.gravity = 0.0f; @@ -571,7 +570,7 @@ void EnNiw_Swimming(EnNiw* this, PlayState* play) { this->actor.speed = 4.0f; } - if (this->actor.bgCheckFlags & 1) { // hit floor + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.gravity = -2.0f; this->runAwayTimer = 100; this->swimRippleTimer = 0; @@ -702,7 +701,7 @@ void EnNiw_RunAway(EnNiw* this, PlayState* play) { } void EnNiw_LandBeforeIdle(EnNiw* this, PlayState* play) { - if (this->actor.bgCheckFlags & 1) { // hit floor + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EnNiw_SetupIdle(this); } } @@ -890,8 +889,8 @@ void EnNiw_Update(Actor* thisx, PlayState* play) { return; } - if ((this->actor.bgCheckFlags & 0x20) && // touching water - this->actor.depthInWater > 15.0f && this->niwState != NIW_STATE_SWIMMING) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 15.0f) && + (this->niwState != NIW_STATE_SWIMMING)) { this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; Math_Vec3f_Copy(&pos, &this->actor.world.pos); 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 37872a491f..193334ff18 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -107,9 +107,9 @@ void EnNutsball_Update(Actor* thisx, PlayState* play2) { this->actor.world.rot.x = Math_Atan2S_XY(spdXZ, this->actor.velocity.y); } this->actor.home.rot.z += 0x2AA8; - if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->actor.bgCheckFlags & 16) || - (this->collider.base.atFlags & AT_HIT) || (this->collider.base.acFlags & AC_HIT) || - (this->collider.base.ocFlags1 & OC1_HIT)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) || (this->collider.base.atFlags & AT_HIT) || + (this->collider.base.acFlags & AC_HIT) || (this->collider.base.ocFlags1 & OC1_HIT)) { if ((player->currentShield == PLAYER_SHIELD_HEROS_SHIELD) && (this->collider.base.atFlags & AT_HIT) && (this->collider.base.atFlags & AT_TYPE_ENEMY) && (this->collider.base.atFlags & AT_BOUNCED)) { EnNutsball_InitColliderParams(this); @@ -138,16 +138,16 @@ void EnNutsball_Update(Actor* thisx, PlayState* play2) { Math_Vec3f_Copy(&worldPos, &this->actor.world.pos); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 5.0f, 10.0f, 0x7); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (func_800C9A4C(&play->colCtx, this->actor.wallPoly, this->actor.wallBgId) & 0x30) { - this->actor.bgCheckFlags &= ~8; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL; if (BgCheck_EntityLineTest1(&play->colCtx, &this->actor.prevPos, &worldPos, &this->actor.world.pos, &poly, true, false, false, true, &bgId)) { if (func_800C9A4C(&play->colCtx, poly, bgId) & 0x30) { this->actor.world.pos.x += this->actor.velocity.x * 0.01f; this->actor.world.pos.z += this->actor.velocity.z * 0.01f; } else { - this->actor.bgCheckFlags |= 8; + this->actor.bgCheckFlags |= BGCHECKFLAG_WALL; } } else { Math_Vec3f_Copy(&this->actor.world.pos, &worldPos); 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 193d90ed3f..8c19472672 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c @@ -382,7 +382,7 @@ void EnNwc_HopForward(EnNwc* this, PlayState* play) { } // they only move forward while off the ground, which gives the visual of them hopping to move - if (this->actor.bgCheckFlags & 0x1) { // touching floor + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = 0.0f; } else { this->actor.speed = 2.0f; @@ -408,7 +408,7 @@ void EnNwc_RunAway(EnNwc* this, PlayState* play) { } this->actor.speed = 2.0f; - if (this->actor.bgCheckFlags & 0x8) { // touching wall + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { EnNwc_ToggleState(this); } } @@ -433,7 +433,7 @@ void EnNwc_Turn(EnNwc* this, PlayState* play) { } // they only rotate when off the ground, giving the visual that they turn by hopping - if (!(this->actor.bgCheckFlags & 0x1)) { // NOT touching floor + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->fallingRotY, 0xA, 0x1000, 0x800); this->actor.world.rot.y = this->actor.shape.rot.y; } 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 8f5824bb02..ffa4b52016 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -534,7 +534,7 @@ void func_80B5C6DC(EnOt* this, PlayState* play) { this->unk_360->unk_3A0 = this->unk_3A0; func_80B5C9A8(this, play); func_80B5D114(this, play); - } else if ((player->actor.bgCheckFlags & 1) && !func_801242B4(player) && + } else if ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !func_801242B4(player) && (this->actor.xzDistToPlayer < 130.0f)) { func_800B8614(&this->actor, play, 130.0f); } @@ -695,7 +695,8 @@ void func_80B5CEC8(EnOt* this, PlayState* play) { func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_IA_NONE); } else { this->actor.flags &= ~ACTOR_FLAG_10000; - if ((player->actor.bgCheckFlags & 1) && !func_801242B4(player) && (this->actor.xzDistToPlayer < 130.0f)) { + if ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !func_801242B4(player) && + (this->actor.xzDistToPlayer < 130.0f)) { func_800B8614(&this->actor, play, 130.0f); } } @@ -933,7 +934,7 @@ void EnOt_Update(Actor* thisx, PlayState* play) { } this->actionFunc(this, play); - if (this->actor.bgCheckFlags & 0x20) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { if (DECR(this->unk_354) == 0) { if (this->actor.flags & ACTOR_FLAG_40) { s32 i; 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 743feb0825..927c709949 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -1078,7 +1078,7 @@ void func_8095CCF4(Actor* thisx, PlayState* play) { this->actor.world.pos.y -= 1.0f; Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 10.0f, 4); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->unk_3DA = (this->unk_3DA >> 3) * 7; if (this->unk_3DC > 0) { this->unk_3DC--; 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 54888a7d82..b3d7453c42 100644 --- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c +++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c @@ -525,7 +525,7 @@ void EnPametfrog_FallOffSnapper(EnPametfrog* this, PlayState* play) { sin = sin_rad(this->timer * (M_PI / 3)) * ((0.02f * (this->timer * (1.0f / 6.0f))) + 0.005f) + 1.0f; EnPametfrog_ShakeCamera(this, play, 300.0f * sin, 100.0f * sin); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EnPametfrog_StopCutscene(this, play); EnPametfrog_SetupJumpToWall(this); } @@ -535,7 +535,7 @@ void EnPametfrog_SetupJumpToWall(EnPametfrog* this) { Animation_Change(&this->skelAnime, &gGekkoJumpForwardAnim, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -2.0f); this->actor.shape.rot.x = 0; this->actor.shape.rot.z = 0; - this->actor.bgCheckFlags &= ~8; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL; Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_VOICE2); this->actionFunc = EnPametfrog_JumpToWall; } @@ -543,10 +543,10 @@ void EnPametfrog_SetupJumpToWall(EnPametfrog* this) { void EnPametfrog_JumpToWall(EnPametfrog* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); EnPametfrog_JumpOnGround(this, play); - if ((this->actor.bgCheckFlags & 1) && (this->actor.bgCheckFlags & 8) && (this->actor.wallBgId == BGCHECK_SCENE) && - (COLPOLY_GET_NORMAL(this->actor.wallPoly->normal.y) < 0.5f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && + (this->actor.wallBgId == BGCHECK_SCENE) && (COLPOLY_GET_NORMAL(this->actor.wallPoly->normal.y) < 0.5f)) { EnPametfrog_SetupWallCrawl(this); - } else if (!(this->actor.bgCheckFlags & 1) || + } else if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || ((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) { this->actor.speed = 12.0f; } else { @@ -712,7 +712,7 @@ void EnPametfrog_SetupClimbDownWall(EnPametfrog* this) { yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); this->actor.world.pos.x += 30.0f * Math_SinS(yaw); this->actor.world.pos.z += 30.0f * Math_CosS(yaw); - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.params = GEKKO_RETURN_TO_SNAPPER; this->actionFunc = EnPametfrog_ClimbDownWall; } @@ -720,7 +720,7 @@ void EnPametfrog_SetupClimbDownWall(EnPametfrog* this) { void EnPametfrog_ClimbDownWall(EnPametfrog* this, PlayState* play) { s16 yaw; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EnPametfrog_SetupRunToSnapper(this); } else if (this->actor.floorHeight == BGCHECK_Y_MIN) { yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); @@ -743,7 +743,8 @@ void EnPametfrog_RunToSnapper(EnPametfrog* this, PlayState* play) { EnPametfrog_JumpOnGround(this, play); this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, this->actor.child); this->actor.world.rot.y = this->actor.shape.rot.y; - if (!(this->actor.bgCheckFlags & 1) || ((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + ((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) { this->actor.speed = 12.0f; } else { this->actor.speed = 0.0f; @@ -860,7 +861,7 @@ void EnPametfrog_FallInAir(EnPametfrog* this, PlayState* play) { &Play_GetCamera(play, this->subCamId)->eye); } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EnPametfrog_SetupFallOnGround(this, play); } } @@ -1053,7 +1054,8 @@ void EnPametfrog_JumpToLink(EnPametfrog* this, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; SkelAnime_Update(&this->skelAnime); EnPametfrog_JumpOnGround(this, play); - if (!(this->actor.bgCheckFlags & 1) || (this->skelAnime.curFrame > 1.0f && this->skelAnime.curFrame < 12.0f)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + (this->skelAnime.curFrame > 1.0f && this->skelAnime.curFrame < 12.0f)) { this->actor.speed = 8.0f; } else { this->actor.speed = 0.0f; 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 2ab3024f20..bd1ea7b3f9 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -432,10 +432,10 @@ void func_80897A94(EnPeehat* this, PlayState* play) { this->colliderTris.base.atFlags &= ~(AT_BOUNCED | AT_ON); this->actor.colChkInfo.health = 0; func_808982E0(this); - } else if ((this->colliderCylinder.base.acFlags & AC_HIT) || (this->actor.bgCheckFlags & 1)) { + } else if ((this->colliderCylinder.base.acFlags & AC_HIT) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, 40, 7, 0); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 11, NA_SE_EN_EXTINCT); - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_PIHAT_SM_DEAD); } Actor_Kill(&this->actor); 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 14c5c62078..78d304094f 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 @@ -373,7 +373,7 @@ void EnPoSisters_AimlessIdleFlying(EnPoSisters* this, PlayState* play) { EnPoSisters_SetupAimlessIdleFlying2(this); } - if (this->actor.bgCheckFlags & 8) { // touching a wall + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x71C); } else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 600.0f) { @@ -573,7 +573,7 @@ void EnPoSisters_Flee(EnPoSisters* this, PlayState* play) { DECR(this->fleeTimer); } - if (this->actor.bgCheckFlags & 8) { // touching a wall + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.world.rot.y = this->actor.shape.rot.y; this->poSisterFlags |= POE_SISTERS_FLAG_UPDATE_SHAPE_ROT; EnPoSisters_SetupSpinToInvis(this); 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 aeb741bbc9..7e0a7d8868 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -167,7 +167,7 @@ void EnPoh_Init(Actor* thisx, PlayState* play) { 255, 255, 255, 0); SkelAnime_Init(play, &this->skelAnime, &object_po_Skel_0050D0, &object_po_Anim_000A60, this->jointTable, this->morphTable, 21); - this->actor.bgCheckFlags |= 0x400; + this->actor.bgCheckFlags |= BGCHECKFLAG_PLAYER_400; func_80B2D0E8(this); } @@ -582,7 +582,7 @@ void func_80B2DC50(EnPoh* this, PlayState* play) { } void func_80B2DD2C(EnPoh* this, PlayState* play) { - if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight <= BGCHECK_Y_MIN)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight <= BGCHECK_Y_MIN)) { EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, OBJECT_PO, 10, object_po_DL_002D28); func_80B2E0B0(this); } 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 bf9f242b44..da634ab952 100644 --- a/src/overlays/actors/ovl_En_Pp/z_en_pp.c +++ b/src/overlays/actors/ovl_En_Pp/z_en_pp.c @@ -836,7 +836,7 @@ void EnPp_Jump(EnPp* this, PlayState* play) { Math_SmoothStepToS(&this->actor.world.rot.y, this->targetRotY, 1, 0x1388, 0); if (!this->actionVar.hasLandedFromJump) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actionVar.hasLandedFromJump = true; EnPp_ChangeAnim(this, EN_PP_ANIM_LAND); } @@ -1224,7 +1224,7 @@ void EnPp_BodyPart_Move(EnPp* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EV_BOMB_DROP_WATER); } - if ((this->timer == 0) || (this->actor.bgCheckFlags & 1)) { + if ((this->timer == 0) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Actor_Kill(&this->actor); } } @@ -1413,7 +1413,7 @@ void EnPp_Update(Actor* thisx, PlayState* play) { if (this->action != EN_PP_ACTION_BODY_PART_MOVE) { EnPp_UpdateDamage(this, play); Actor_SetFocus(&this->actor, 40.0f); - if ((this->action == EN_PP_ACTION_DEAD) || (this->actor.bgCheckFlags & 1)) { + if ((this->action == EN_PP_ACTION_DEAD) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actor.world.pos.x += this->damagedVelocity.x; this->actor.world.pos.z += this->damagedVelocity.z; Math_ApproachZeroF(&this->damagedVelocity.x, 1.0f, 2.0f); 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 ab4aa43150..dd0f308d82 100644 --- a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c +++ b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c @@ -173,7 +173,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)) { + if (!(this->actor.bgCheckFlags & (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH))) { Actor_Kill(&this->actor); } } @@ -398,7 +398,8 @@ void func_80A748E8(EnPr2* this, PlayState* play) { sp3C.x += Math_SinS(this->actor.world.rot.y) * 20.0f; sp3C.z += Math_CosS(this->actor.world.rot.y) * 20.0f; if (fabsf(this->actor.world.rot.y - this->unk_1EE) < 100.0f) { - if (BgCheck_SphVsFirstPoly(&play->colCtx, &sp3C, 20.0f) || (this->actor.bgCheckFlags & 8)) { + if (BgCheck_SphVsFirstPoly(&play->colCtx, &sp3C, 20.0f) || + (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { this->unk_1DC = 0; this->unk_1F2++; Math_Vec3f_Copy(&this->unk_21C, &this->unk_228); 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 c235c61a0d..a284f240ad 100644 --- a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c +++ b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c @@ -393,7 +393,7 @@ void EnRacedog_Race(EnRacedog* this, PlayState* play) { this->collider.dim.radius = 15; if (this->path != NULL) { yRotation = EnRacedog_GetYRotation(this->path, this->currentPoint, &this->actor.world.pos, &distSq); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { yRotation = this->actor.wallYaw; } @@ -701,7 +701,7 @@ void EnRacedog_Update(Actor* thisx, PlayState* play) { } } - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->skelAnime.curFrame = 0.0f; } 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 12af47c7e4..b3ee0d4abb 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 @@ -625,7 +625,7 @@ void func_80B71BB8(EnRailSkb* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_22C->dyna.actor.world.pos), 1, 0x71C, 0xB6); - if ((this->actor.bgCheckFlags & 1) && (this->unk_22C->dyna.actor.colChkInfo.health == 0)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->unk_22C->dyna.actor.colChkInfo.health == 0)) { Actor_MoveWithGravity(&this->actor); } else { this->actor.velocity.y += this->actor.gravity; @@ -634,12 +634,12 @@ void func_80B71BB8(EnRailSkb* this, PlayState* play) { Math_SmoothStepToF(&this->actor.world.pos.z, this->unk_22C->dyna.actor.world.pos.z, 0.6f, 1.6f, 0.1f); } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Actor_Kill(&this->actor); return; } - if ((sp34 < 50.0f) && (this->actor.bgCheckFlags & 1)) { + if ((sp34 < 50.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9); this->actor.velocity.y = 10.0f; 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 0690278f2b..3904ce3b5c 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c @@ -907,7 +907,7 @@ void EnRailgibud_MoveGrabbedPlayerAwayFromWall(EnRailgibud* this, PlayState* pla } if ((this->actionFunc == EnRailgibud_Grab) && (this->grabState == EN_RAILGIBUD_GRAB_START) && - (this->actor.bgCheckFlags & 8)) { + (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { targetPos = player->actor.world.pos; targetPos.x += 10.0f * Math_SinS(this->actor.wallYaw); targetPos.z += 10.0f * Math_CosS(this->actor.wallYaw); 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 6d54407895..041199193a 100644 --- a/src/overlays/actors/ovl_En_Rat/z_en_rat.c +++ b/src/overlays/actors/ovl_En_Rat/z_en_rat.c @@ -718,7 +718,7 @@ void EnRat_SetupBounced(EnRat* this) { this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000; this->actor.gravity = -1.0f; EnRat_UpdateSparkOffsets(this); - this->actor.bgCheckFlags &= ~(0x10 | 0x8 | 0x1); + this->actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING); this->actionFunc = EnRat_Bounced; } @@ -733,7 +733,7 @@ void EnRat_Bounced(EnRat* this, PlayState* play) { this->timer = 30; } - if (this->actor.bgCheckFlags & (0x10 | 0x8 | 0x1)) { + if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING)) { EnRat_Explode(this, play); } } 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 83cdde9a30..7d6ad87a14 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -1004,7 +1004,7 @@ void EnRd_Crouch(EnRd* this, PlayState* play) { void EnRd_SetupDamage(EnRd* this) { this->actor.shape.yOffset = 0.0f; Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadDamageAnim, -6.0f); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = -2.0f; } diff --git a/src/overlays/actors/ovl_En_Rg/z_en_rg.c b/src/overlays/actors/ovl_En_Rg/z_en_rg.c index 58f8f706d9..caa24e8db6 100644 --- a/src/overlays/actors/ovl_En_Rg/z_en_rg.c +++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.c @@ -318,7 +318,7 @@ void func_80BF40F4(EnRg* this) { } s32 func_80BF416C(EnRg* this, PlayState* play) { - if ((this->actor.bgCheckFlags & 1) && (this->actor.speed >= 0.01f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speed >= 0.01f)) { Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_ROLLING - SFX_FLAG); func_800AE930(&play->colCtx, Effect_GetByIndex(this->unk_340), &this->actor.world.pos, 18.0f, this->actor.shape.rot.y, this->actor.floorPoly, this->actor.floorBgId); @@ -410,7 +410,7 @@ s32 func_80BF45B4(EnRg* this) { s16 temp_v0; s16 temp_v1; - if ((this->actor.bgCheckFlags & 8) && (this->actor.speed >= 5.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->actor.speed >= 5.0f)) { temp_v1 = this->actor.world.rot.y; temp_v0 = temp_v1 - BINANG_ROT180(this->actor.wallYaw); @@ -533,7 +533,7 @@ void func_80BF4964(EnRg* this) { } if (!(this->unk_310 & 0x400) && !(this->unk_310 & 0x1000) && (this->unk_322 == 0) && (this->unk_324 == 0) && - (this->actor.bgCheckFlags & 1)) { + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->unk_18C == NULL) { Math_Vec3s_ToVec3f(&sp30, &sp3C[this->unk_33C]); } else { @@ -676,7 +676,7 @@ void func_80BF4FC4(EnRg* this, PlayState* play) { this->unk_344 = func_80BF4560(this, play); if (!Play_InCsMode(play)) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (this->unk_310 & 0x400) { this->unk_310 &= ~0x400; this->actor.speed = 0.0f; @@ -688,7 +688,7 @@ void func_80BF4FC4(EnRg* this, PlayState* play) { this->unk_33C++; } } - } else if ((this->actor.bgCheckFlags & 1) && !(this->unk_310 & 0x1000) && + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !(this->unk_310 & 0x1000) && func_80BF4D64(&this->actor.world.pos)) { this->unk_310 |= 0x1000; } 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 fabf053597..0f8c458725 100644 --- a/src/overlays/actors/ovl_En_Ru/z_en_ru.c +++ b/src/overlays/actors/ovl_En_Ru/z_en_ru.c @@ -145,7 +145,7 @@ s32 EnRu_PlayWalkingSound(EnRu* this, PlayState* play) { leftWasGrounded = this->isLeftFootGrounded; rightWasGrounded = this->isRightFootGrounded; - if (this->actor.bgCheckFlags & 0x20) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { if (this->actor.depthInWater < 20.0f) { waterSfxId = NA_SE_PL_WALK_WATER0 - SFX_FLAG; } else { 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 8f231ccfae..bd50d96b17 100644 --- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c +++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c @@ -329,7 +329,7 @@ void EnRuppecrow_UpdatePosition(EnRuppecrow* this, PlayState* play) { Vec3s nextPointDirection; EnRuppecrow_GetPointDirection(this->path, this->currentPoint, &this->actor.world, &nextPointDirection); - if (this->actor.bgCheckFlags & 0x8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { nextPointDirection.y = this->actor.wallYaw; } @@ -444,7 +444,7 @@ void EnRuppecrow_HandleDeath(EnRuppecrow* this) { this->actor.shape.yOffset = 0.0f; this->actor.targetArrowOffset = 0.0f; - this->actor.bgCheckFlags &= ~0x1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; scale = this->actor.scale.x * 100.0f; this->actor.world.pos.y += 20.0f * scale; @@ -492,7 +492,7 @@ void EnRuppecrow_HandleSong(EnRuppecrow* this, PlayState* play) { Player* player = GET_PLAYER(play); EnRuppecrow_UpdatePosition(this, play); - if (this->actor.xzDistToPlayer < 1000.0f && EnRuppecrow_CheckPlayedMatchingSong(play)) { + if ((this->actor.xzDistToPlayer < 1000.0f) && EnRuppecrow_CheckPlayedMatchingSong(play)) { // If Link is in front, the guay will turn around and go the other way if (Actor_IsFacingPlayer(&this->actor, 0x4000)) { this->isGoingCounterClockwise |= 1; @@ -569,7 +569,7 @@ void EnRuppecrow_FlyWhileDroppingRupees(EnRuppecrow* this, PlayState* play) { } void EnRuppecrow_FlyToDespawn(EnRuppecrow* this, PlayState* play) { - if (this->actor.bgCheckFlags & 0x8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.world.rot.y *= -0x1; } @@ -608,7 +608,7 @@ void EnRuppecrow_FallToDespawn(EnRuppecrow* this, PlayState* play) { this->actor.shape.rot.z += 0x1780; } - if (this->actor.bgCheckFlags & 0x1 || this->actor.floorHeight == BGCHECK_Y_MIN) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { EnRuppecrow_ShatterIce(this, play); func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, (this->actor.scale.x * 10000.0f), 0x0, 0x0); 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 1a2f84536b..d743318465 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -268,11 +268,11 @@ void EnSb_TurnAround(EnSb* this, PlayState* play) { void EnSb_Lunge(EnSb* this, PlayState* play) { Math_StepToF(&this->actor.speed, 0.0f, 0.2f); - if (this->actor.velocity.y <= -0.1f || this->actor.bgCheckFlags & 2) { + if ((this->actor.velocity.y <= -0.1f) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH)) { if (!(this->actor.depthInWater > 0.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } - this->actor.bgCheckFlags &= ~2; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH; EnSb_SetupBounce(this); } } @@ -298,8 +298,8 @@ void EnSb_Bounce(EnSb* this, PlayState* play) { } EnSb_SpawnBubbles(play, this); EnSb_SetupLunge(this); - } else if (this->actor.bgCheckFlags & 1) { - this->actor.bgCheckFlags &= ~2; + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH; this->actor.speed = 0.0f; this->attackTimer = 1; EnSb_SetupWaitClosed(this); @@ -310,12 +310,12 @@ void EnSb_Bounce(EnSb* this, PlayState* play) { void EnSb_ReturnToIdle(EnSb* this, PlayState* play) { if (this->attackTimer != 0) { this->attackTimer--; - if (this->actor.bgCheckFlags & 1) { - this->actor.bgCheckFlags &= ~1; + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.speed = 0.0f; } - } else if (this->actor.bgCheckFlags & 1) { - this->actor.bgCheckFlags &= ~1; + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actionFunc = EnSb_Idle; this->actor.speed = 0.0f; } 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 4d3c3b7b7d..d7a1df7001 100644 --- a/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c +++ b/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c @@ -236,7 +236,7 @@ void func_80BCD640(EnScopecrow* this, PlayState* play) { if (this->path != NULL) { func_80BCD4D0(this->path, this->unk_1FC, &this->actor.world.pos, &sp30); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp30.y = this->actor.wallYaw; } 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 bb52f4425e..a8803b2585 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c @@ -208,7 +208,7 @@ void func_80BCB078(EnScopenuts* this, PlayState* play) { if (this->path != NULL) { func_80BCC448(this->path, this->unk_334, &this->actor.world.pos, &sp30); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp30.y = this->actor.wallYaw; } Math_SmoothStepToS(&this->actor.world.rot.y, sp30.y, 10, 300, 0); @@ -238,7 +238,7 @@ void func_80BCB078(EnScopenuts* this, PlayState* play) { void func_80BCB1C8(EnScopenuts* this, PlayState* play) { this->unk_350 *= 0.92f; Actor_SetScale(&this->actor, this->unk_350); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { SET_WEEKEVENTREG(WEEKEVENTREG_52_40); Actor_Kill(&this->actor); } @@ -564,7 +564,7 @@ void func_80BCBFFC(EnScopenuts* this, PlayState* play) { if (this->path != NULL) { sp34 = func_80BCC448(this->path, this->unk_334, &this->actor.world.pos, &sp38); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp38.y = this->actor.wallYaw; } 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 d0a3fc0e98..bfa90e0f71 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c @@ -649,7 +649,7 @@ void func_80ADC37C(EnSellnuts* this, PlayState* play) { this->actor.gravity = 0.0f; if (this->path != NULL) { sp2C = func_80ADCFE8(this->path, this->unk_334, &this->actor.world.pos, &sp30); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp30.y = this->actor.wallYaw; } Math_SmoothStepToS(&this->actor.world.rot.y, sp30.y, 0xA, 0x12C, 0); @@ -780,7 +780,7 @@ void func_80ADC8C4(EnSellnuts* this, PlayState* play) { if (this->path != NULL) { func_80ADCFE8(this->path, this->unk_334, &this->actor.world.pos, &sp30); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp30.y = this->actor.wallYaw; } Math_SmoothStepToS(&this->actor.world.rot.y, sp30.y, 0xA, 0x12C, 0); 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 f127902b69..80c9d9e401 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -526,7 +526,7 @@ void func_80995818(EnSkb* this, PlayState* play) { func_80995A30(this); } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speed = 0.0f; for (i = 0; i < 10; i++) { func_809947B0(play, this, &this->actor.world.pos); @@ -635,7 +635,7 @@ void func_80995DC4(EnSkb* this, PlayState* play) { } void func_80995E08(EnSkb* this) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = 0.0f; } Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE); @@ -645,17 +645,17 @@ void func_80995E08(EnSkb* this) { } void func_80995E64(EnSkb* this, PlayState* play) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speed = 0.0f; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.speed < 0.0f) { this->actor.speed += 0.05f; } } - if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->unk_3DC == 0) { if (this->actor.colChkInfo.health == 0) { func_809961E4(this, play); @@ -693,7 +693,7 @@ void func_80995F98(EnSkb* this) { } else { this->actor.world.rot.y = this->actor.yawTowardsPlayer; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = -4.0f; } } @@ -703,7 +703,7 @@ void func_80995F98(EnSkb* this) { } void func_809960AC(EnSkb* this, PlayState* play) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { s32 i; for (i = 0; i < 10; i++) { @@ -712,7 +712,7 @@ void func_809960AC(EnSkb* this, PlayState* play) { this->actor.speed = 0.0f; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.speed < 0.0f) { this->actor.speed += 0.05f; } @@ -720,7 +720,8 @@ void func_809960AC(EnSkb* this, PlayState* play) { } Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 0x10, 0x7D0, 0x64); - if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (this->actor.bgCheckFlags & 1)) { + if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actor.shape.rot.x = 0; this->actor.world.rot = this->actor.shape.rot; func_80994DA8(this, play); @@ -730,7 +731,7 @@ void func_809960AC(EnSkb* this, PlayState* play) { void func_809961E4(EnSkb* this, PlayState* play) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); this->unk_3D8 |= 0x40; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = -6.0f; } this->unk_3E4 = 0; @@ -873,7 +874,8 @@ void func_8099672C(EnSkb* this, PlayState* play) { Player* player = GET_PLAYER(play); if ((this->unk_3DE != 6) && (this->unk_3DE != 7)) { - if ((this->actor.bgCheckFlags & 0x60) && (this->actor.depthInWater >= 40.0f)) { + if ((this->actor.bgCheckFlags & (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH)) && + (this->actor.depthInWater >= 40.0f)) { this->actor.colChkInfo.health = 0; this->unk_3E4 = 0; func_809961E4(this, play); 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 0c4d0d465d..e96f30bd13 100644 --- a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c +++ b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c @@ -403,7 +403,7 @@ void EnSnowman_MoveSnowPile(EnSnowman* this, PlayState* play) { } this->actor.world.rot.y = this->actor.shape.rot.y; - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->snowPileTargetRotY = this->actor.wallYaw; } else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 200.0f) { this->snowPileTargetRotY = @@ -1081,9 +1081,9 @@ void EnSnowman_UpdateSnowball(Actor* thisx, PlayState* play) { this->collider.base.ocFlags1 |= OC1_ON; } - if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->actor.bgCheckFlags & 0x10) || - (this->collider.base.atFlags & AT_HIT) || (this->collider.base.acFlags & AC_HIT) || - (this->collider.base.ocFlags1 & OC1_HIT)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) || (this->collider.base.atFlags & AT_HIT) || + (this->collider.base.acFlags & AC_HIT) || (this->collider.base.ocFlags1 & OC1_HIT)) { if (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_SMALL_SNOWBALL) { scale = 10; for (i = 0; i < 3; i++) { 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 ff34769625..b3ed297221 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -776,7 +776,7 @@ void func_808A6E24(EnSt* this, PlayState* play) { this->unk_2CC = 0.0f; this->unk_2D4 = 0.0f; } else { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.shape.yOffset = 400.0f; this->actor.world.rot.x = 0x4000; this->actor.shape.rot.x = this->actor.world.rot.x; 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 997db1cf12..15d4c78c75 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -632,7 +632,7 @@ void func_80BABA90(EnSuttari* this, s32 arg1, u8 arg2) { if (this->paths[arg1] != NULL) { target = EnSuttari_GetDistSqAndOrient(this->paths[arg1], this->unk1F4[arg1], &this->actor.world.pos, &dist); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (arg2 == 2) { this->unk1F4[arg1] = -0x63; } else { @@ -661,7 +661,7 @@ void func_80BABB90(EnSuttari* this, s32 arg1) { if (this->paths[arg1] != NULL) { target = EnSuttari_GetDistSqAndOrient(this->paths[arg1], this->unk1F4[arg1], &this->actor.world.pos, &sp30); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { target = this->actor.wallYaw; } Math_SmoothStepToS(&this->actor.world.rot.y, target, 1, 0xBB8, 0); @@ -1045,7 +1045,7 @@ void func_80BACBB0(EnSuttari* this, PlayState* play) { this->actionFunc = func_80BACA14; } if ((this->actor.playerHeightRel < 60.0f) && (this->actor.xzDistToPlayer < 500.0f)) { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { target = this->actor.wallYaw; } else if (func_80BAA904(this, play)) { target = -this->actor.world.rot.y; @@ -1060,7 +1060,7 @@ void func_80BACBB0(EnSuttari* this, PlayState* play) { this->actor.speed = 0.0f; } Actor_MoveWithGravity(&this->actor); - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actor.world.pos = this->actor.prevPos; this->actor.world.rot.y = -this->actor.world.rot.y; this->actionFunc = func_80BACE4C; @@ -1082,7 +1082,7 @@ void func_80BACD2C(EnSuttari* this, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; } Actor_MoveWithGravity(&this->actor); - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actor.world.pos = this->actor.prevPos; this->actor.world.rot.y = -this->actor.world.rot.y; this->actionFunc = func_80BACE4C; 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 9606e3d080..41337848a8 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -873,7 +873,7 @@ void func_808DA89C(EnSw* this, PlayState* play) { } else if (ENSW_GET_3(&this->actor)) { this->actionFunc = func_808DAEB4; } else { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { f32 temp_f2; this->actor.shape.yOffset = 400.0f; @@ -1103,7 +1103,7 @@ void func_808DB25C(EnSw* this, PlayState* play) { void func_808DB2E0(EnSw* this, PlayState* play) { f32 temp_f2; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_808D9F78(this, play, 0); temp_f2 = fabsf(this->actor.velocity.y) * 0.6f; this->actor.velocity.x *= 0.5f; 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 ffc8e9d9b9..390a2896f1 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 @@ -225,7 +225,7 @@ void EnSyatekiCrow_SetupDead(EnSyatekiCrow* this) { this->actor.speed *= Math_CosS(this->actor.world.rot.x); this->actor.velocity.y = 0.0f; Animation_Change(&this->skelAnime, &gGuayFlyAnim, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -3.0f); - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_DEAD); Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40); this->actionFunc = EnSyatekiCrow_Dead; 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 7dd26d9a93..7c32612bf4 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 @@ -291,15 +291,15 @@ void EnSyatekiWf_Run(EnSyatekiWf* this, PlayState* play) { targetPoint.z = this->pathPoints[this->currentPointIndex].z; wallYawDiff = (this->actor.wallYaw - this->actor.world.rot.y) + 0x8000; - if (this->actor.bgCheckFlags & 1) { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if ((ABS(wallYawDiff) < 0x1555) && (this->actor.wallPoly != this->actor.floorPoly)) { EnSyatekiWf_SetupJump(this); return; } } - if (this->actor.bgCheckFlags & 4) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_LEAVE) { this->actor.velocity.y = 2.0f; } @@ -345,7 +345,7 @@ void EnSyatekiWf_SetupJump(EnSyatekiWf* this) { } void EnSyatekiWf_Jump(EnSyatekiWf* this, PlayState* play) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { EnSyatekiWf_SetupLand(this); } } @@ -428,7 +428,7 @@ void EnSyatekiWf_Update(Actor* thisx, PlayState* play2) { Actor_UpdateBgCheckInfo(play, &this->actor, 32.0f, 30.0f, 60.0f, 5); this->actionFunc(this, play); - if (this->actor.bgCheckFlags & 3) { + if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) { func_800BE3D0(&this->actor, this->actor.shape.rot.y, &this->actor.shape.rot); } else { Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 1, 0x3E8, 0); 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 ac65fbbe61..691290a078 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 @@ -1113,7 +1113,7 @@ void EnTalkGibud_MoveGrabbedPlayerAwayFromWall(EnTalkGibud* this, PlayState* pla Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 20.0f, 35.0f, 29); if (this->actionFunc == EnTalkGibud_Grab && this->grabState == EN_TALK_GIBUD_GRAB_START && - (this->actor.bgCheckFlags & 8)) { + (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { targetPos = player->actor.world.pos; targetPos.x += 10.0f * Math_SinS(this->actor.wallYaw); targetPos.z += 10.0f * Math_CosS(this->actor.wallYaw); 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 1ff73fd9f5..bc8fee2fd8 100644 --- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c +++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c @@ -180,7 +180,7 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) { Player* player = GET_PLAYER(play); this->skelAnime.curFrame = 4.0f; - if ((player->actor.bgCheckFlags & 1) && player->actor.shape.feetPos[0].y >= 438.0f) { + if ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && player->actor.shape.feetPos[0].y >= 438.0f) { // Player is standing on the central platform, so stop chasing them this->isNonHostile = true; } else if (this->isNonHostile && this->workTimer[WORK_TIMER_WAIT] == 0 && !(this->timer & 0x1F)) { @@ -275,13 +275,13 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) { this->targetPosWithDeviation.y = this->waterSurfaceYPos - 50.0f; this->workTimer[WORK_TIMER_OUT_OF_WATER] = 25; Math_ApproachS(&this->actor.world.rot.x, 0x3000, 5, 0xBD0); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.speed = 0.0f; if (this->actor.velocity.y > 0.0f) { this->actor.velocity.y = -1.0f; } } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { // Fish has touched land this->isBeached = true; } @@ -289,7 +289,7 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) { case true: this->nextRotationAngle = 0x3A98; this->actor.gravity = -1.5f; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { // Fish is still touching land, so it's still beached. Randomly flop around this->actor.velocity.y = Rand_ZeroFloat(5.0f) + 5.0f; this->actor.speed = Rand_ZeroFloat(2.0f) + 2.0f; 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 dc33f7a650..e285869a56 100644 --- a/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c +++ b/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c @@ -425,7 +425,7 @@ void func_80BE5818(Actor* thisx, PlayState* play2) { this->actor.shape.rot.y += this->unk_19A; sp6C = 1225.0f; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (ENTANRON5_GET(&this->actor) < ENTANRON5_108) { Math_Vec3f_Copy(&sp5C, &this->actor.world.pos); sp5C.y = this->actor.floorHeight; @@ -441,7 +441,7 @@ void func_80BE5818(Actor* thisx, PlayState* play2) { } else { sp6C = 400.0f; this->unk_198 += 0x2000; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->unk_198 = 0; this->actor.speed = 0.0f; } 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 81b8000484..174b798691 100644 --- a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c +++ b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c @@ -484,7 +484,7 @@ void func_80C11590(EnThiefbird* this, PlayState* play) { sp38 = Animation_OnFrame(&this->skelAnime, 0.0f); this->actor.speed = (Rand_ZeroOne() * 1.5f) + 3.0f; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->unk_192 = this->actor.wallYaw; } else { if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { @@ -504,7 +504,7 @@ void func_80C11590(EnThiefbird* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_THIEFBIRD_VOICE); } - if ((this->actor.depthInWater > -40.0f) || (this->actor.bgCheckFlags & 1)) { + if ((this->actor.depthInWater > -40.0f) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->unk_190 = -4096; } else if (this->actor.world.pos.y < (this->actor.home.pos.y - 75.0f)) { this->unk_190 = -Rand_S16Offset(2048, 2048); @@ -557,7 +557,7 @@ void func_80C1193C(EnThiefbird* this, PlayState* play) { pitch = Actor_WorldPitchTowardActor(&this->actor, &player->actor); pitch = CLAMP(pitch, -0x2800, 0x2800); Math_SmoothStepToS(&this->actor.shape.rot.x, pitch, 4, 0x800, 0x80); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 6, 0x1000, 0x100); } else if (Actor_IsFacingPlayer(&this->actor, 0x3C00) || (this->actor.xzDistToPlayer > 120.0f)) { s16 rot = BINANG_ROT180(this->actor.yawTowardsPlayer - player->actor.shape.rot.y); @@ -574,7 +574,7 @@ void func_80C1193C(EnThiefbird* this, PlayState* play) { 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)) { + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.depthInWater > -40.0f)) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; Actor_PlaySfx(&this->actor, NA_SE_EN_THIEFBIRD_VOICE); @@ -602,7 +602,7 @@ void func_80C11C60(EnThiefbird* this) { this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; Animation_PlayOnce(&this->skelAnime, &gTakkuriDeathAnim); - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.shape.rot.x = 0; this->unk_18E = 40; this->actor.velocity.y = 0.0f; @@ -654,7 +654,7 @@ void func_80C11DF0(EnThiefbird* this, PlayState* play) { this->actor.shape.rot.y += this->unk_192; } - if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { for (i = 0; i < ARRAY_COUNT(this->limbPos); i++) { func_800B3030(play, &this->limbPos[i], &gZeroVec3f, &gZeroVec3f, 0x8C, 0, 0); } @@ -732,7 +732,7 @@ void func_80C1215C(EnThiefbird* this, PlayState* play) { } SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->unk_192 = this->actor.wallYaw; } else if (this->unk_3E8 == 0) { this->unk_192 = BINANG_ROT180(this->actor.yawTowardsPlayer); @@ -771,7 +771,7 @@ void func_80C12378(EnThiefbird* this, PlayState* play) { } SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->unk_192 = this->actor.wallYaw; } else { this->unk_192 = BINANG_ROT180(this->actor.yawTowardsPlayer); @@ -798,7 +798,7 @@ void func_80C124B0(EnThiefbird* this, PlayState* play) { s16 temp_v1; SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->unk_192 = this->actor.wallYaw; } else { this->unk_192 = Actor_WorldYawTowardPoint(&this->actor, &D_80C13920); @@ -881,7 +881,7 @@ void func_80C127F4(EnThiefbird* this, PlayState* play) { } if (this->unk_3EC != NULL) { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 3, 0x2000, 0x100); } else { Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &this->unk_3EC->actor), @@ -909,7 +909,7 @@ void func_80C127F4(EnThiefbird* this, PlayState* play) { } } else { this->actor.speed = 4.0f; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 6, 0x1000, 0x100); } else { Math_SmoothStepToS(&this->actor.shape.rot.y, BINANG_ROT180(this->actor.yawTowardsPlayer), 6, 0x1000, 0x100); 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 7c04554b63..349c02bda7 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -195,7 +195,7 @@ void func_80893A18(EnTite* this) { } s32 func_80893A34(EnTite* this, PlayState* play) { - if ((this->actor.params == ENTITE_MINUS_2) && (this->actor.bgCheckFlags & 1) && + if ((this->actor.params == ENTITE_MINUS_2) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (func_800C99D4(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) == 5)) { return true; } @@ -211,7 +211,7 @@ void func_80893A9C(EnTite* this, PlayState* play) { } s32 func_80893ADC(EnTite* this) { - if ((this->actor.params == ENTITE_MINUS_2) && (this->actor.bgCheckFlags & 0x20)) { + if ((this->actor.params == ENTITE_MINUS_2) && (this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { return true; } return false; @@ -224,7 +224,7 @@ s32 func_80893B10(EnTite* this) { void func_80893B70(EnTite* this) { if (this->actor.params == ENTITE_MINUS_2) { - if (this->actor.bgCheckFlags & 0x20) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { this->actor.gravity = 0.0f; func_80893B10(this); } else { @@ -238,7 +238,7 @@ void func_80893BCC(EnTite* this, PlayState* play) { s32 i; s32 j; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { u32 surface = func_800C9BB8(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); if ((surface == COLPOLY_SURFACE_GROUND) || (surface == COLPOLY_SURFACE_SAND)) { @@ -356,7 +356,8 @@ void func_8089408C(EnTite* this, PlayState* play) { this->actor.velocity.y = 8.0f; } - this->actor.bgCheckFlags &= ~(0x40 | 0x20 | 0x2 | 0x1); + this->actor.bgCheckFlags &= + ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH); this->actor.gravity = -1.0f; this->actor.speed = 4.0f; this->actionFunc = func_808942B4; @@ -364,7 +365,8 @@ void func_8089408C(EnTite* this, PlayState* play) { void func_808942B4(EnTite* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (((this->actor.bgCheckFlags & 1) || (func_80893ADC(this) && (this->actor.depthInWater > 0.0f))) && + if (((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + (func_80893ADC(this) && (this->actor.depthInWater > 0.0f))) && (this->actor.velocity.y <= 0.0f)) { this->actor.speed = 0.0f; this->collider.base.atFlags &= ~AT_HIT; @@ -463,7 +465,8 @@ void func_80894638(EnTite* this, PlayState* play) { if ((Player_GetMask(play) == PLAYER_MASK_STONE) || (this->actor.xzDistToPlayer > 450.0f) || (this->actor.playerHeightRel > 80.0f)) { func_80893ED4(this); - } else if (((this->actor.bgCheckFlags & 1) || (func_80893ADC(this) && (this->actor.depthInWater < 10.0f))) && + } else if (((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + (func_80893ADC(this) && (this->actor.depthInWater < 10.0f))) && Actor_IsFacingPlayer(&this->actor, 0xE38)) { if ((this->actor.xzDistToPlayer <= 180.0f) && (this->actor.playerHeightRel <= 80.0f)) { func_80893A9C(this, play); @@ -495,7 +498,7 @@ void func_80894910(EnTite* this, PlayState* play) { Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.1f, 1.0f, 0.0f); SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_LAND_WATER); if (func_80893ADC(this)) { @@ -508,7 +511,8 @@ void func_80894910(EnTite* this, PlayState* play) { func_80893BCC(this, play); } - if (((this->actor.bgCheckFlags & 1) || (func_80893ADC(this) && (this->actor.depthInWater > 0.0f))) && + if (((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + (func_80893ADC(this) && (this->actor.depthInWater > 0.0f))) && (this->actor.velocity.y <= 0.0f)) { this->actor.speed = 0.0f; Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4000); @@ -556,13 +560,13 @@ void func_80894BC8(EnTite* this, PlayState* play) { this->actor.world.pos.y += this->actor.depthInWater - 1.0f; } - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); } else { func_80893BCC(this, play); } - if ((this->actor.speed == 0.0f) && ((this->actor.bgCheckFlags & 1) || func_80893ADC(this))) { + if ((this->actor.speed == 0.0f) && ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || func_80893ADC(this))) { this->actor.world.rot.y = this->actor.shape.rot.y; this->collider.base.acFlags |= AC_ON; if ((Player_GetMask(play) == PLAYER_MASK_STONE) || @@ -598,7 +602,7 @@ void func_80894E0C(EnTite* this, PlayState* play) { this->actor.world.pos.y += this->actor.depthInWater; } - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); } else { func_80893BCC(this, play); @@ -688,7 +692,7 @@ void func_808952EC(EnTite* this) { this->actor.speed = 0.0f; this->actor.gravity = -1.0f; this->unk_2B8 = Rand_ZeroOne() * 50.0f; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.velocity.y = 11.0f; this->actionFunc = func_80895424; } @@ -704,9 +708,9 @@ void func_80895424(EnTite* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->collider.base.acFlags |= AC_ON; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 20.0f, 11, 4.0f, 0, 0, 0); Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } @@ -725,7 +729,7 @@ void func_808955E4(EnTite* this) { this->unk_2B9 = 0; this->actor.velocity.y = 13.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_LAST1_GROW_HEAD); - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->collider.base.acFlags &= ~AC_ON; this->actionFunc = func_80895640; } @@ -733,7 +737,7 @@ void func_808955E4(EnTite* this) { void func_80895640(EnTite* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.z, 0, 4000); SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->collider.base.acFlags |= AC_ON; this->actor.shape.yOffset = 0.0f; func_80893BCC(this, play); @@ -752,7 +756,7 @@ void func_808956B8(EnTite* this) { void func_808956FC(EnTite* this) { this->unk_2BC = -1; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.velocity.y = 7.5f; func_80893A18(this); } @@ -765,13 +769,13 @@ void func_80895738(EnTite* this, PlayState* play) { if (this->collider.base.atFlags & AT_BOUNCED) { func_808956FC(this); } - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.world.rot.y = BINANG_SUB((this->actor.wallYaw * 2) - this->actor.world.rot.y, 0x8000); } if (this->unk_2BC == -1) { Math_StepToF(&this->actor.speed, 0.0f, 0.3f); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.world.rot.y = this->actor.shape.rot.y; func_80893ED4(this); this->unk_2BC = 100; @@ -832,7 +836,7 @@ void func_80895AC0(EnTite* this, PlayState* play) { } if ((this->unk_2BC == 1) || (this->unk_2BC == -1)) { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { temp_v1 = this->actor.shape.rot.y - this->actor.wallYaw; temp_v0 = ABS_ALT(temp_v1); if (temp_v0 > 0x3000) { @@ -1012,7 +1016,7 @@ void func_80895FF8(EnTite* this, PlayState* play) { } } } - } else if ((this->actor.bgCheckFlags & 1) && (this->collider.base.acFlags & AC_ON) && + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->collider.base.acFlags & AC_ON) && (this->actor.colChkInfo.health != 0) && (play->actorCtx.unk2 != 0) && (this->actor.xyzDistToPlayerSq < SQ(200.0f))) { this->actor.flags |= ACTOR_FLAG_1; @@ -1032,13 +1036,13 @@ void func_808963B4(EnTite* this, PlayState* play) { s32 i; Vec3f sp48; - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { for (i = 5; i < ARRAY_COUNT(this->limbPos); i++) { Math_Vec3f_Copy(&sp48, &this->limbPos[i]); sp48.y = this->actor.world.pos.y + this->actor.depthInWater; EffectSsGRipple_Spawn(play, &sp48, 0, 220, 0); } - } else if (this->actor.bgCheckFlags & 0x20) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { s32 temp = play->gameplayFrames & 7; if (!(temp & 1) && (this->actor.depthInWater < 10.0f)) { @@ -1060,7 +1064,7 @@ void EnTite_Update(Actor* thisx, PlayState* play) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 25.0f, 40.0f, 20.0f, this->unk_2C0); func_808963B4(this, play); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_800BE3D0(&this->actor, this->actor.shape.rot.y, &this->actor.shape.rot); if (this->unk_2B9 != 0) { this->actor.shape.rot.z = BINANG_ROT180(this->actor.shape.rot.z); 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 57ad2b8fc1..59d69dd5a3 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -1321,9 +1321,9 @@ void EnTk_Update(Actor* thisx, PlayState* play) { } if (!(this->unk_2CA & 0x200)) { - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { func_800B9010(&this->actor, NA_SE_EV_HONEYCOMB_FALL - SFX_FLAG); - } else if (this->actor.bgCheckFlags & 2) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Actor_PlaySfx(&this->actor, NA_SE_EV_HUMAN_BOUND); } } 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 aefa6383fc..09b748597e 100644 --- a/src/overlays/actors/ovl_En_Toto/z_en_toto.c +++ b/src/overlays/actors/ovl_En_Toto/z_en_toto.c @@ -190,7 +190,7 @@ void EnToto_Init(Actor* thisx, PlayState* play) { return; } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); - this->actor.bgCheckFlags |= 0x400; + this->actor.bgCheckFlags |= BGCHECKFLAG_PLAYER_400; SkelAnime_InitFlex(play, &this->skelAnime, &object_zm_Skel_00A978, ((play->sceneId == SCENE_SONCHONOIE) ? &object_zm_Anim_003AA8 : &object_zm_Anim_00C880), this->jointTable, this->morphTable, 18); @@ -515,7 +515,7 @@ s32 func_80BA4530(EnToto* this, PlayState* play) { this->unk2B6 = 1; return this->text->unk1; } - if (player->actor.bgCheckFlags & 1) { + if (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { temp_s0 = &D_80BA50DC[gSaveContext.save.playerForm - 1]; if (func_80BA44D4(temp_s0, player)) { Math_Vec3s_ToVec3f(&player->actor.world.pos, &temp_s0->unk6); 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 4693183de2..4059e7fbbb 100644 --- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c +++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c @@ -164,7 +164,7 @@ void func_80AD3530(EnTrt2* this, PlayState* play) { func_80AD46F8(this); if (this->path != NULL) { phi_a1 = func_80AD48F8(this->path, this->unk_1E4, &this->actor.world.pos, &sp30); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { phi_a1 = this->actor.wallYaw; } Math_SmoothStepToS(&this->actor.world.rot.y, phi_a1, 4, 1000, 1); @@ -269,7 +269,7 @@ void func_80AD38B8(EnTrt2* this, PlayState* play) { } } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->unk_1E4 >= (this->path->count - 1)) { ActorCutscene_Stop(this->unk_3DA); this->unk_3D9 = 2; @@ -332,7 +332,7 @@ void func_80AD3BE4(EnTrt2* this, PlayState* play) { void func_80AD3C94(EnTrt2* this, PlayState* play) { if (this->actor.world.pos.y < 5.0f) { func_80AD4A78(this, play); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->unk_3B2 = 0xF; } } @@ -666,7 +666,7 @@ s32 func_80AD4B4C(EnTrt2* this, PlayState* play) { this->actor.speed = 0.0f; func_80AD349C(this); this->unk_3B4 = this->unk_3B2; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if ((player->transformation != PLAYER_FORM_HUMAN) && (player->transformation != PLAYER_FORM_FIERCE_DEITY)) { this->unk_3A8 = 0x84F; } @@ -686,7 +686,7 @@ s32 func_80AD4B4C(EnTrt2* this, PlayState* play) { } s32 func_80AD4C4C(EnTrt2* this) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.xzDistToPlayer < 100.0f) { return true; } @@ -700,7 +700,8 @@ s32 func_80AD4CCC(EnTrt2* this, PlayState* play) { s16 sp1E = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; Player* player = GET_PLAYER(play); - if (((this->unk_3B2 == 4) || (this->unk_3B2 == 5)) && this->actor.isTargeted && !(this->actor.bgCheckFlags & 1) && + if (((this->unk_3B2 == 4) || (this->unk_3B2 == 5)) && this->actor.isTargeted && + !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && ((player->transformation == PLAYER_FORM_HUMAN) || (player->transformation == PLAYER_FORM_FIERCE_DEITY))) { this->actor.speed = 0.0f; this->actor.velocity.y = 1.5f; 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 8ed93d9659..48d7b4330d 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 @@ -173,7 +173,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { Player* player = GET_PLAYER(play); Player* player2 = GET_PLAYER(play); - if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 15.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 15.0f)) { EnTuboTrap_SpawnEffectsInWater(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_BOMB_DROP_WATER); EnTuboTrap_DropCollectible(this, play); @@ -214,7 +214,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { } } - if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { EnTuboTrap_SpawnEffectsOnLand(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, play); 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 5843357ee8..8573c956d8 100644 --- a/src/overlays/actors/ovl_En_Twig/z_en_twig.c +++ b/src/overlays/actors/ovl_En_Twig/z_en_twig.c @@ -67,7 +67,7 @@ void EnTwig_Init(Actor* thisx, PlayState* play2) { if (sColHeaders[this->unk_160] != NULL) { DynaPolyActor_LoadMesh(play, &this->dyna, sColHeaders[this->unk_160]); } - this->dyna.actor.bgCheckFlags |= 0x400; + this->dyna.actor.bgCheckFlags |= BGCHECKFLAG_PLAYER_400; switch (this->unk_160) { case 0: Actor_Kill(&this->dyna.actor); 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 d70d2c43a9..033ed1ff7a 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -180,7 +180,7 @@ void EnVm_Init(Actor* thisx, PlayState* play) { this->unk_21C = params * 40.0f; thisx->params &= 0xFF; - this->actor.bgCheckFlags |= 0x400; + this->actor.bgCheckFlags |= BGCHECKFLAG_PLAYER_400; if (!D_808CD5B8) { for (i = 0; i < ARRAY_COUNT(D_808CD58C); i++) { 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 38eb630a37..ae056ffa94 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -245,7 +245,7 @@ void EnWallmas_WaitToDrop(EnWallmas* this, PlayState* play) { 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) || + !(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || ((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); @@ -635,7 +635,7 @@ void EnWallmas_Update(Actor* thisx, PlayState* play) { if ((this->actionFunc != EnWallmas_Die) && (this->actionFunc != EnWallmas_Drop)) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - if ((this->actionFunc != EnWallmas_Damage) && (this->actor.bgCheckFlags & 1) && + if ((this->actionFunc != EnWallmas_Damage) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.freezeTimer == 0)) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } 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 f647f570fa..45bf5cc887 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -419,7 +419,7 @@ s32 func_80990948(PlayState* play, EnWf* this, s16 arg2) { if (func_800BE184(play, &this->actor, 100.0f, 24000, 0x2AA8, this->actor.shape.rot.y)) { this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if ((this->actor.bgCheckFlags & 8) && (sp38 < 12000)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (sp38 < 12000)) { func_809926D0(this); return true; } @@ -499,7 +499,7 @@ void func_80990C6C(EnWf* this, PlayState* play, s32 arg2) { } void func_80990E4C(EnWf* this, PlayState* play) { - if (Animation_OnFrame(&this->skelAnime, 1.0f) && (this->actor.bgCheckFlags & 1)) { + if (Animation_OnFrame(&this->skelAnime, 1.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { func_80990C6C(this, play, 2); Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_WALK); } @@ -776,7 +776,7 @@ void func_809919F4(EnWf* this, PlayState* play) { if (!func_8099408C(play, this) && !func_80990948(play, this, 0)) { this->actor.world.rot.y = this->actor.shape.rot.y; sp26 = BINANG_ROT180(player->actor.shape.rot.y + this->unk_29A); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { temp_v0 = (this->actor.wallYaw - this->actor.yawTowardsPlayer) - this->unk_29A; if (ABS_ALT(temp_v0) > 0x2EE0) { this->unk_29A = -this->unk_29A; @@ -974,7 +974,7 @@ void func_809923E4(EnWf* this, PlayState* play) { void func_8099245C(EnWf* this) { this->collider2.base.acFlags &= ~AC_ON; Animation_MorphToPlayOnce(&this->skelAnime, &gWolfosDamagedAnim, -4.0f); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = -4.0f; } this->unk_298 = 0; @@ -986,11 +986,11 @@ void func_8099245C(EnWf* this) { void func_809924EC(EnWf* this, PlayState* play) { s16 sp26; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speed = 0.0f; } - if ((this->actor.bgCheckFlags & 1) && (this->actor.speed < 0.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speed < 0.0f)) { this->actor.speed += 0.05f; } @@ -1002,7 +1002,8 @@ void func_809924EC(EnWf* this, PlayState* play) { return; } - if ((this->actor.bgCheckFlags & 8) && (ABS_ALT(sp26) < 0x2EE0) && (this->actor.xzDistToPlayer < 120.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS_ALT(sp26) < 0x2EE0) && + (this->actor.xzDistToPlayer < 120.0f)) { func_809926D0(this); } else if (!func_8099408C(play, this)) { if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsTargeted(play, &this->actor) && @@ -1033,7 +1034,8 @@ void func_809926D0(EnWf* this) { void func_80992784(EnWf* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2500); - if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & (2 | 1))) { + if (SkelAnime_Update(&this->skelAnime) && + (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH))) { this->actor.shape.rot.x = 0; this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; @@ -1115,7 +1117,7 @@ void func_80992B8C(EnWf* this, PlayState* play) { Player* player = GET_PLAYER(play); Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + this->unk_29A, 2000); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp2C = BINANG_SUB((this->actor.wallYaw - this->actor.yawTowardsPlayer), this->unk_29A); if (ABS_ALT(sp2C) > 0x2EE0) { this->unk_29A = -this->unk_29A; @@ -1155,7 +1157,7 @@ void func_80992D6C(EnWf* this) { this->collider2.base.acFlags &= ~AC_ON; Animation_MorphToPlayOnce(&this->skelAnime, &gWolfosRearUpFallOverAnim, -4.0f); this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = -6.0f; } this->actor.flags &= ~ACTOR_FLAG_1; @@ -1167,11 +1169,11 @@ void func_80992D6C(EnWf* this) { void func_80992E0C(EnWf* this, PlayState* play) { static Vec3f D_809942F0 = { 0.0f, 0.5f, 0.0f }; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speed = 0.0f; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_StepToF(&this->actor.speed, 0.0f, 0.5f); } @@ -1337,7 +1339,7 @@ void func_8099357C(EnWf* this, PlayState* play) { return; } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (BINANG_SUB(sp2E, this->actor.wallYaw) > 0) { sp2E = this->actor.wallYaw - 0x4000; } else { @@ -1486,7 +1488,7 @@ void EnWf_Update(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 32.0f, 30.0f, 60.0f, 0x1D); func_80993738(this, play); - if (this->actor.bgCheckFlags & (2 | 1)) { + if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) { func_800BE3D0(&this->actor, this->actor.shape.rot.y, &this->actor.shape.rot); } else { Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 600); 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 daa71ac7b5..f15c34f221 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 @@ -206,15 +206,15 @@ void EnWiz_MoveMagicProjectile(EnWizFire* this, PlayState* play) { Math_ApproachF(&this->scale, this->targetScale, 0.2f, 0.01f); if (this->wallCheckTimer == 0) { - if ((this->actor.bgCheckFlags & 8) && (this->type == EN_WIZ_FIRE_TYPE_MAGIC_PROJECTILE) && (this->timer != 0) && - (this->actor.bgCheckFlags & 8)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->type == EN_WIZ_FIRE_TYPE_MAGIC_PROJECTILE) && + (this->timer != 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { sPoolHitByIceArrow = false; this->timer = 0; this->targetScale = 0.0f; } } - if ((this->actor.bgCheckFlags & 1) && (this->poolTimer == 0)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->poolTimer == 0)) { s32 i; s16 arcingProjectileRotY; s32 pad; 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 8c1c9d4937..0e282656c2 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -129,7 +129,7 @@ s32 EnZo_PlayWalkingSound(EnZo* this, PlayState* play) { leftWasGrounded = this->isLeftFootGrounded; rightWasGrounded = this->isRightFootGrounded; - if (this->actor.bgCheckFlags & 0x20) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { if (this->actor.depthInWater < 20.0f) { waterSfxId = NA_SE_PL_WALK_WATER0 - SFX_FLAG; } else { 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 81d5583058..0d6c11e0e5 100644 --- a/src/overlays/actors/ovl_En_Zog/z_en_zog.c +++ b/src/overlays/actors/ovl_En_Zog/z_en_zog.c @@ -894,7 +894,7 @@ void func_80B94E34(EnZog* this, PlayState* play) { this->actionFunc = func_80B94D0C; this->actor.speed = 0.0f; this->unk_300 = 2; - } else if (this->actor.bgCheckFlags & 1) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.home.rot.z = 1; this->actionFunc = func_80B94C5C; this->actor.speed = 0.0f; 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 6dd9103707..b4eb2de2fe 100644 --- a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c +++ b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c @@ -579,7 +579,7 @@ void func_80B32BB8(EnZoraegg* this, PlayState* play) { func_80B31C40(this, play); func_80B31D64(this, play, 13, 0.0f); - if (this->actor.bgCheckFlags & 0x1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actionFunc = func_80B32B70; } 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 c4ef1aaffc..1f61075e1b 100644 --- a/src/overlays/actors/ovl_En_Zow/z_en_zow.c +++ b/src/overlays/actors/ovl_En_Zow/z_en_zow.c @@ -420,7 +420,7 @@ void func_80BDD350(EnZow* this, PlayState* play) { } } - if ((this->actor.bgCheckFlags & 1) || (this->actor.depthInWater > 180.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.depthInWater > 180.0f)) { this->actor.velocity.y = 0.0f; this->actionFunc = func_80BDD79C; } 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 b5a335d920..97c8bb7d94 100644 --- a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c +++ b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c @@ -175,8 +175,8 @@ void func_80ACBC70(ObjAqua* this) { } void func_80ACBC8C(ObjAqua* this, PlayState* play) { - if (this->actor.bgCheckFlags & 0x21) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WATER)) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_80ACB7F4(this, play); func_80ACBA10(this); Actor_PlaySfx(&this->actor, NA_SE_EV_BOTTLE_WATERING); 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 5f46b6596f..05544da0e6 100644 --- a/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c +++ b/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c @@ -325,7 +325,7 @@ void ObjArmos_Update(Actor* thisx, PlayState* play2) { if (this->unk_24C != 0) { Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 30.0f, 0.0f, this->unk_24C); - if ((this->actionFunc == func_809A54E0) && (this->dyna.actor.bgCheckFlags & 1) && + if ((this->actionFunc == func_809A54E0) && (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (DynaPoly_GetActor(&play->colCtx, this->dyna.actor.floorBgId) == NULL)) { this->unk_24C = 0; } 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 b4c53a4381..04871bae56 100644 --- a/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c +++ b/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c @@ -256,7 +256,7 @@ void func_80AE9258(ObjBigicicle* this, PlayState* play) { itemAction = itemAction->next; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actionFunc = func_80AE939C; } else { Collider_UpdateCylinder(&this->actor, &this->collider1); 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 24b4188975..f37a15a80b 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -437,9 +437,9 @@ void func_8098DE58(ObjComb* this) { void func_8098DEA0(ObjComb* this, PlayState* play) { this->unk_1B4--; - if ((this->actor.bgCheckFlags & 1) || (this->unk_1B4 <= 0)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->unk_1B4 <= 0)) { func_8098DA74(this, play); - if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 30.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 30.0f)) { func_8098D47C(this, play); } else { func_8098D19C(this, play); @@ -447,11 +447,11 @@ void func_8098DEA0(ObjComb* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_HONEYCOMB_BROKEN); func_8098E098(this); } else { - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { func_8098D6E0(this, play); } - if (this->actor.bgCheckFlags & 0x20) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { this->actor.gravity = -0.5f; this->actor.velocity.y *= 0.8f; this->unk_1AE >>= 1; 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 c09362936b..cb1e17eaf5 100644 --- a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c +++ b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c @@ -456,7 +456,7 @@ void func_80A1C838(ObjFlowerpot* this, PlayState* play) { //! @bug: This function should only pass Player*: it uses *(this + 0x153), which is meant to be //! player->currentMask, but in this case is garbage in the collider Player_PlaySfx((Player*)&this->actor, NA_SE_PL_PULL_UP_POT); - } else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 19.0f)) { + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 19.0f)) { if (!(this->unk_1EA & 2)) { func_80A1B914(this, play); func_80A1C328(this, play); @@ -491,7 +491,7 @@ void func_80A1C838(ObjFlowerpot* this, PlayState* play) { if (this->unk_1EA & 1) { Actor_MoveWithGravity(&this->actor); func_80A1C5E8(this, play); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.colChkInfo.mass == MASS_IMMOVABLE) { if (DynaPoly_GetActor(&play->colCtx, this->actor.floorBgId) == NULL) { this->actor.flags &= ~ACTOR_FLAG_10; @@ -602,7 +602,8 @@ void func_80A1CEF4(ObjFlowerpot* this2, PlayState* play) { func_80A1C62C(this, play); - if ((this->actor.bgCheckFlags & (0x8 | 0x2 | 0x1)) || sp28 || (this->unk_1E8 <= 0)) { + if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL)) || sp28 || + (this->unk_1E8 <= 0)) { if (!(this->unk_1EA & 2)) { func_80A1B914(this, play); func_80A1C0FC(this, play); @@ -615,7 +616,7 @@ void func_80A1CEF4(ObjFlowerpot* this2, PlayState* play) { return; } - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { if (!(this->unk_1EA & 2)) { func_80A1B914(this, play); func_80A1C328(this, play); 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 b0557d483a..9d37e37786 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 @@ -283,7 +283,8 @@ void func_809AB77C(ObjGrassCarry* this, PlayState* play) { this->unk_19A--; - if ((this->actor.bgCheckFlags & (1 | 2 | 8)) || temp_v0 || (this->unk_19A <= 0)) { + if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL)) || temp_v0 || + (this->unk_19A <= 0)) { func_809AAFE8(&this->actor.world.pos, play); func_809AAF9C(&this->actor.world.pos, this->unk_198, play); @@ -294,14 +295,14 @@ void func_809AB77C(ObjGrassCarry* this, PlayState* play) { this->actor.room = this->unk_190->actor.room; } - if (!(this->actor.bgCheckFlags & 0x20)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN); } func_809AB428(this); return; } - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { sp5C.y = this->actor.world.pos.y + this->actor.depthInWater; for (phi_s0 = 0, i = 0; i < 4; i++, phi_s0 += 0x4000) { @@ -326,7 +327,7 @@ void func_809AB77C(ObjGrassCarry* this, PlayState* play) { D_809ABBFC = D_809ABBFC >> 1; D_809ABC08 = D_809ABC08 >> 1; D_809ABC04 = D_809ABC04 >> 1; - this->actor.bgCheckFlags &= ~0x40; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH; SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); } 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 9d390b2ab0..6ea21bdd78 100644 --- a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c +++ b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c @@ -403,7 +403,7 @@ void func_80B15330(ObjHakaisi* this, PlayState* play) { this->dyna.actor.velocity.y += this->dyna.actor.gravity; Actor_UpdatePos(&this->dyna.actor); - if (this->dyna.actor.bgCheckFlags & 2) { + if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { func_80B14B6C(this, play, this->dyna.actor.world.pos, 40); func_80B14CF8(play, this->dyna.actor.world.pos, 100, 30, 10); Actor_Kill(&this->dyna.actor); 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 f3860b960e..4d5845d458 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 @@ -382,7 +382,7 @@ void ObjKendoKanban_HandlePhysics(ObjKendoKanban* this, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 4); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { // When on the ground, apply some friction. this->actor.velocity.x *= 0.8f; this->actor.velocity.z *= 0.8f; @@ -401,12 +401,12 @@ void ObjKendoKanban_HandlePhysics(ObjKendoKanban* this, PlayState* play) { return; } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { // Upon touching the ground... Actor_PlaySfx(&this->actor, NA_SE_EV_WOODPLATE_BOUND); this->hasNewRootCornerPos = false; this->actor.velocity.y *= 0.5f; - } else if (this->actor.bgCheckFlags & 1) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { // When on the ground... this->numBounces++; this->hasNewRootCornerPos = false; 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 977ed92c89..11dba9ef00 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -279,7 +279,7 @@ void ObjKibako_Idle(ObjKibako* this, PlayState* play) { //! @bug: This function should only pass Player*: it uses *(this + 0x153), which is meant to be //! player->currentMask, but in this case is garbage in the collider Player_PlaySfx((Player*)&this->actor, NA_SE_PL_PULL_UP_WOODBOX); - } else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 19.0f)) { + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 19.0f)) { ObjKibako_WaterBreak(this, play); ObjKibako_SpawnCollectible(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); @@ -384,13 +384,14 @@ void ObjKibako_Thrown(ObjKibako* this, PlayState* play) { if (this->timer > 0) { this->timer--; } - if ((this->actor.bgCheckFlags & 0xB) || (atHit) || (this->timer <= 0)) { + if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL)) || atHit || + (this->timer <= 0)) { ObjKibako_AirBreak(this, play); ObjKibako_SpawnCollectible(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); Actor_Kill(&this->actor); } else { - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { ObjKibako_WaterBreak(this, play); ObjKibako_SpawnCollectible(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); 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 e2b17e48f8..51eadfadca 100644 --- a/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c +++ b/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c @@ -351,7 +351,8 @@ void func_809A3E58(Actor* thisx, PlayState* play) { if (this->unk_160 != 0) { Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 15.0f, 30.0f, 0.0f, this->unk_160); if (((this->actionFunc == func_809A3A74) || (this->actionFunc == func_809A3D38)) && - (this->dyna.actor.bgCheckFlags & 1) && !DynaPoly_GetActor(&play->colCtx, this->dyna.actor.floorBgId)) { + (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + !DynaPoly_GetActor(&play->colCtx, this->dyna.actor.floorBgId)) { this->unk_160 = 0; } } 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 fde4204a97..17d8592d2c 100644 --- a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c +++ b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c @@ -358,7 +358,7 @@ void func_80B39C9C(ObjSnowball2* this, PlayState* play) { func_80B38EFC(this, play); Player_PlaySfx(GET_PLAYER(play), NA_SE_PL_PULL_UP_SNOWBALL); func_80B39F60(this); - } else if ((this->actor.bgCheckFlags & 0x20) && + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && ((this->actor.shape.yOffset * this->actor.scale.y) < this->actor.depthInWater)) { func_80B3A498(this); } else if (sp38 && (this->collider.elements->info.acHitInfo->toucher.dmgFlags & 0x0583FFBC)) { @@ -375,7 +375,8 @@ void func_80B39C9C(ObjSnowball2* this, PlayState* play) { if (this->unk_1AD == 0) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 15.0f, 15.0f, 0.0f, 0x44); - if ((this->actor.bgCheckFlags & 1) && (DynaPoly_GetActor(&play->colCtx, this->actor.floorBgId) == NULL)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + (DynaPoly_GetActor(&play->colCtx, this->actor.floorBgId) == NULL)) { this->unk_1AD = 1; this->actor.flags &= ~ACTOR_FLAG_10; } @@ -460,7 +461,9 @@ void func_80B3A13C(ObjSnowball2* this, PlayState* play) { func_80B39B28(this, play); - if ((((this->actor.bgCheckFlags & 9) || sp38) && !(this->actor.bgCheckFlags & 0x20)) || (this->unk_1AC <= 0)) { + if ((((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL)) || sp38) && + !(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) || + (this->unk_1AC <= 0)) { func_80B38E88(this, play); func_80B39108(this, play); func_80B39B5C(this, play); @@ -469,13 +472,13 @@ void func_80B3A13C(ObjSnowball2* this, PlayState* play) { } sp30 = false; - if (this->actor.bgCheckFlags & 0x60) { - if ((this->actor.bgCheckFlags & 0x40) || (this->actor.speed > 3.0f)) { + if (this->actor.bgCheckFlags & (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) || (this->actor.speed > 3.0f)) { if (this->actor.depthInWater < (1200.0f * this->actor.scale.y)) { func_80B39470(&this->actor, play); func_80B395EC(&this->actor, play); } - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_DROP_WATER); } } else if ((((play->gameplayFrames % 16) == 0) || ((Rand_Next() >> 0x10) == 0)) && 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 b8be7538b2..feb0652a4f 100644 --- a/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c +++ b/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c @@ -246,7 +246,7 @@ void func_809A48AC(ObjToge* this, PlayState* play) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, D_809A4D0C[OBJTOGE_GET_4000(&this->actor)] * 30.0f, 0.0f, 0x81); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.world.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_198[this->unk_194]); this->unk_194 = sp30; if (this->unk_1B4 && (this->unk_194 == 0)) { 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 d9a0239994..cc4c7c8e8d 100644 --- a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c +++ b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c @@ -318,7 +318,7 @@ void ObjTokeidai_RotateOnMinuteChange(ObjTokeidai* this, s32 playSfx) { } void ObjTokeidai_ExteriorGear_Collapse(ObjTokeidai* this, PlayState* play) { - if ((this->actor.bgCheckFlags & 1) || this->actor.world.pos.y < 0.0f) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || this->actor.world.pos.y < 0.0f) { this->actionFunc = ObjTokeidai_DoNothing; } else { this->actor.shape.rot.x += 0x50; 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 30c9fef03f..534fae4936 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -473,7 +473,7 @@ void func_809289E4(ObjTsubo* this, PlayState* play) { (acHit && (this->cylinderCollider.info.acHitInfo->toucher.dmgFlags & 0x058BFFBC))) { typeData = &sPotTypeData[type]; this->unk_19B = 0; - if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 15.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 15.0f)) { typeData->breakPot3(this, play); } else { typeData->breakPot1(this, play); @@ -494,7 +494,8 @@ void func_809289E4(ObjTsubo* this, PlayState* play) { if (!this->unk_195) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 15.0f, 15.0f, 0.0f, 0x44); - if ((this->actor.bgCheckFlags & 1) && (DynaPoly_GetActor(&play->colCtx, this->actor.floorBgId) == NULL)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + (DynaPoly_GetActor(&play->colCtx, this->actor.floorBgId) == NULL)) { this->unk_195 = true; this->actor.flags &= ~ACTOR_FLAG_10; } @@ -568,7 +569,8 @@ void func_80928F18(ObjTsubo* this, PlayState* play) { this->unk_194--; } typeData = &sPotTypeData[type]; - if ((this->actor.bgCheckFlags & 0xB) || atHit || (this->unk_194 <= 0)) { + if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL)) || atHit || + (this->unk_194 <= 0)) { typeData->breakPot1(this, play); if (type == OBJ_TSUBO_TYPE_3) { func_8092762C(this, play); @@ -582,7 +584,7 @@ void func_80928F18(ObjTsubo* this, PlayState* play) { } func_809291DC(this); - } else if (this->actor.bgCheckFlags & 0x40) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { typeData->breakPot2(this, play); if (type == OBJ_TSUBO_TYPE_3) { func_8092762C(this, play); From e50ab59cf789deb7aef4ccc3e4e5c69eb217b3c2 Mon Sep 17 00:00:00 2001 From: Isghj <42048411+isghj5@users.noreply.github.com> Date: Tue, 7 Mar 2023 15:54:12 -0800 Subject: [PATCH 22/29] Documented `object_sth` and `object_ahg`, both used by `EnSth` (Moon gazer who wants to buy Ocean spiderhouse) (#1169) * object_sth/object_ahg: docs * Ssh: formatter * Apply suggestions from code review Co-authored-by: Anghelo Carvajal * Oops missed one Co-authored-by: Anghelo Carvajal * Seth: fixes * Sth: more requested changes * Apply suggestions from code review Co-authored-by: Tom Overton * Sth/Ahg: requested changes * Apply suggestions from code review Co-authored-by: Tom Overton * Sth: further function name requested changes * Sth: minor note * Sth: fix animation name * Sth: forgot to rename saved flag * Seth: change ocean wallet week reg name * Sth: some requested changes * Sth: fixed week event reg, added more * Sth/Ssh/Si: changed from two defines to 1 * Si/Sth/Ssh: mistook fanfare for sfx, token define renamed * Sth/Ssh/Sekihi: requested changes and some weekregflag docs * Sekihi: fix missing header for skull count * Sekihi: moved flag description to z64save * Sekihi: moved flag description to z64save * Sth: removed flag * Update include/z64save.h Co-authored-by: Tom Overton --------- Co-authored-by: Anghelo Carvajal Co-authored-by: Tom Overton --- assets/xml/objects/object_ahg.xml | 107 ++-- assets/xml/objects/object_sth.xml | 87 +-- assets/xml/overlays/ovl_En_Sth.xml | 21 +- include/z64save.h | 19 +- .../actors/ovl_En_Sekihi/z_en_sekihi.c | 5 +- .../actors/ovl_En_Sekihi/z_en_sekihi.h | 2 + src/overlays/actors/ovl_En_Si/z_en_si.c | 6 +- src/overlays/actors/ovl_En_Si/z_en_si.h | 2 + src/overlays/actors/ovl_En_Ssh/z_en_ssh.c | 32 +- src/overlays/actors/ovl_En_Ssh/z_en_ssh.h | 2 + src/overlays/actors/ovl_En_Sth/z_en_sth.c | 580 ++++++++++-------- src/overlays/actors/ovl_En_Sth/z_en_sth.h | 47 +- src/overlays/actors/ovl_En_Sth2/z_en_sth2.c | 11 +- src/overlays/actors/ovl_En_Sth2/z_en_sth2.h | 4 +- tools/disasm/functions.txt | 48 +- tools/weekeventregconvert.py | 10 +- 16 files changed, 547 insertions(+), 436 deletions(-) diff --git a/assets/xml/objects/object_ahg.xml b/assets/xml/objects/object_ahg.xml index 7eb4c71263..8233a5b27e 100644 --- a/assets/xml/objects/object_ahg.xml +++ b/assets/xml/objects/object_ahg.xml @@ -1,53 +1,62 @@  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_sth.xml b/assets/xml/objects/object_sth.xml index b176cd8cc4..53040ae053 100644 --- a/assets/xml/objects/object_sth.xml +++ b/assets/xml/objects/object_sth.xml @@ -1,42 +1,53 @@  + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/overlays/ovl_En_Sth.xml b/assets/xml/overlays/ovl_En_Sth.xml index 51b29870da..a0d90d9e86 100644 --- a/assets/xml/overlays/ovl_En_Sth.xml +++ b/assets/xml/overlays/ovl_En_Sth.xml @@ -1,14 +1,15 @@ - - - - - - - - - - + + + + + + + + + + + diff --git a/include/z64save.h b/include/z64save.h index 1b5531540b..60d3a9a2b2 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -622,9 +622,18 @@ typedef enum SunsSongState { #define WEEKEVENTREG_13_04 PACK_WEEKEVENTREG_FLAG(13, 0x04) #define WEEKEVENTREG_13_08 PACK_WEEKEVENTREG_FLAG(13, 0x08) #define WEEKEVENTREG_13_10 PACK_WEEKEVENTREG_FLAG(13, 0x10) -#define WEEKEVENTREG_13_20 PACK_WEEKEVENTREG_FLAG(13, 0x20) -#define WEEKEVENTREG_13_40 PACK_WEEKEVENTREG_FLAG(13, 0x40) -#define WEEKEVENTREG_13_80 PACK_WEEKEVENTREG_FLAG(13, 0x80) + +// This flag marks that the player has finished the Oceanside Spider House and has exited. +// Used to identify if EnSth should be moved deeper into the house. +// This does NOT flag: +// A) that the player has completed the house (Inventory_GetSkullTokenCount(play->sceneId)) +// B) that the player has collected a reward (WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_COLLECTED_REWARD) +// C) that the player has collected the wallet (WEEKEVENTREG_RECEIVED_OCEANSIDE_WALLET_UPGRADE) +#define WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_BUYER_MOVED_IN PACK_WEEKEVENTREG_FLAG(13, 0x20) + +#define WEEKEVENTREG_RECEIVED_OCEANSIDE_WALLET_UPGRADE PACK_WEEKEVENTREG_FLAG(13, 0x40) +// You only get a wallet if completed on Day 1: repeat gets silver rupee, other days get less +#define WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_COLLECTED_REWARD PACK_WEEKEVENTREG_FLAG(13, 0x80) // PlayedMilkMinigame // Attempted Cremia Cart Ride @@ -830,10 +839,10 @@ typedef enum SunsSongState { #define WEEKEVENTREG_34_02 PACK_WEEKEVENTREG_FLAG(34, 0x02) #define WEEKEVENTREG_34_04 PACK_WEEKEVENTREG_FLAG(34, 0x04) -#define WEEKEVENTREG_34_08 PACK_WEEKEVENTREG_FLAG(34, 0x08) +#define WEEKEVENTREG_SWAMP_SPIDER_HOUSE_TALKED PACK_WEEKEVENTREG_FLAG(34, 0x08) #define WEEKEVENTREG_34_10 PACK_WEEKEVENTREG_FLAG(34, 0x10) #define WEEKEVENTREG_34_20 PACK_WEEKEVENTREG_FLAG(34, 0x20) -#define WEEKEVENTREG_34_40 PACK_WEEKEVENTREG_FLAG(34, 0x40) +#define WEEKEVENTREG_RECEIVED_MASK_OF_TRUTH PACK_WEEKEVENTREG_FLAG(34, 0x40) // Cremia did Milk Run alone. Player didn't interact or didn't accept the ride #define WEEKEVENTREG_34_80 PACK_WEEKEVENTREG_FLAG(34, 0x80) 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 88fab32987..aa780cddfb 100644 --- a/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c +++ b/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c @@ -59,8 +59,9 @@ void EnSekihi_Init(Actor* thisx, PlayState* play) { return; } - if ((params == SEKIHI_TYPE_4) && (((gSaveContext.save.skullTokenCount & 0xFFFF)) >= 30)) { - SET_WEEKEVENTREG(WEEKEVENTREG_13_20); + if ((params == SEKIHI_TYPE_4) && (((gSaveContext.save.skullTokenCount & 0xFFFF)) >= SPIDER_HOUSE_TOKENS_REQUIRED)) { + // For some reason the mikau grave sets the flag instead of something in the spider house on exit. + SET_WEEKEVENTREG(WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_BUYER_MOVED_IN); } objectIndex = Object_GetIndex(&play->objectCtx, sObjectIds[params]); 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 fb4ad7e608..0c26dab71b 100644 --- a/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.h +++ b/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.h @@ -2,6 +2,8 @@ #define Z_EN_SEKIHI_H #include "global.h" +#include "overlays/actors/ovl_En_Si/z_en_si.h" + #define ENSIKIHI_GET_TYPE(thisx) ((thisx)->params & 0xF) 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 74a55261f7..cf44d641b7 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -104,11 +104,11 @@ void EnSi_GiveToken(EnSi* this, PlayState* play) { Flags_SetTreasure(play, chestFlag); } Item_Give(play, ITEM_SKULL_TOKEN); - if (Inventory_GetSkullTokenCount(play->sceneId) >= 30) { - Message_StartTextbox(play, 0xFC, NULL); + if (Inventory_GetSkullTokenCount(play->sceneId) >= SPIDER_HOUSE_TOKENS_REQUIRED) { + Message_StartTextbox(play, 0xFC, NULL); // You collected all tokens, curse lifted Audio_PlayFanfare(NA_BGM_GET_ITEM | 0x900); } else { - Message_StartTextbox(play, 0x52, NULL); + Message_StartTextbox(play, 0x52, NULL); // You got one more gold token, your [count] one! Audio_PlayFanfare(NA_BGM_GET_SMALL_ITEM); } } 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 07628bf86e..f1b089ddda 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.h +++ b/src/overlays/actors/ovl_En_Si/z_en_si.h @@ -5,6 +5,8 @@ #define ENSI_GET_CHEST_FLAG(thisx) (((thisx)->params & 0xFC) >> 2) +#define SPIDER_HOUSE_TOKENS_REQUIRED 30 + struct EnSi; typedef void (*EnSiActionFunc)(struct EnSi*, PlayState*); 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 d47d665886..14617e2aec 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -654,7 +654,7 @@ void EnSsh_Init(Actor* thisx, PlayState* play) { this->actor.gravity = 0.0f; this->initialYaw = this->actor.world.rot.y; EnSsh_SetupAction(this, EnSsh_Start); - if (Inventory_GetSkullTokenCount(play->sceneId) >= 30) { + if (Inventory_GetSkullTokenCount(play->sceneId) >= SPIDER_HOUSE_TOKENS_REQUIRED) { Actor_Kill(&this->actor); } } @@ -686,18 +686,18 @@ void EnSsh_Talk(EnSsh* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { switch (play->msgCtx.currentTextId) { - case 0x904: - case 0x905: - case 0x906: - case 0x908: - case 0x910: - case 0x911: - case 0x912: - case 0x914: + case 0x904: // (does not exist) + case 0x905: // (does not exist) + case 0x906: // (does not exist) + case 0x908: // (does not exist) + case 0x910: // Help me! I am not a monster, I was cursed this way + case 0x911: // Find all in here and defeat them + case 0x912: // Don't forget to collect their token + case 0x914: // In here, cursed spiders, defeat them to make me normal func_80151938(play, play->msgCtx.currentTextId + 1); break; - default: + default: // intended case 0x915 from above (914+1) func_801477B4(play); this->actionFunc = EnSsh_Idle; break; @@ -706,15 +706,15 @@ void EnSsh_Talk(EnSsh* this, PlayState* play) { } void func_809756D0(EnSsh* this, PlayState* play) { - u16 phi_a1; + u16 nextTextId; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_34_08)) { - phi_a1 = 0x914; + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_SWAMP_SPIDER_HOUSE_TALKED)) { + nextTextId = 0x914; // In here, cursed spiders, defeat them to make me normal } else { - phi_a1 = 0x910; - SET_WEEKEVENTREG(WEEKEVENTREG_34_08); + nextTextId = 0x910; // Help me! I am not a monster, I was cursed this way + SET_WEEKEVENTREG(WEEKEVENTREG_SWAMP_SPIDER_HOUSE_TALKED); } - Message_StartTextbox(play, phi_a1, &this->actor); + Message_StartTextbox(play, nextTextId, &this->actor); } void EnSsh_Idle(EnSsh* this, PlayState* play) { 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 094c63f7e7..6f19a5e51a 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h @@ -2,6 +2,8 @@ #define Z_EN_SSH_H #include "global.h" +#include "overlays/actors/ovl_En_Si/z_en_si.h" +#include "overlays/actors/ovl_En_Sth/z_en_sth.h" struct EnSsh; 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 5d1bd14714..4cca2770fd 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -1,13 +1,13 @@ /* * File: z_en_sth.c * Overlay: ovl_En_Sth - * Description: Guy looking at moon in South Clock Town + * Description: Guy looking at moon in South Clock Town, + * And the Cured Swamp Spider House man who gives you Mask of Truth + * (the cursed version is EnSsh) + * And the man who wants to buy Oceanside Spider House from you with rupees or Wallet */ #include "z_en_sth.h" -#include "objects/object_sth/object_sth.h" -#include "objects/object_ahg/object_ahg.h" -#include "objects/object_mask_truth/object_mask_truth.h" #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8) @@ -15,17 +15,17 @@ void EnSth_Init(Actor* thisx, PlayState* play); void EnSth_Destroy(Actor* thisx, PlayState* play); -void EnSth_Update(Actor* thisx, PlayState* play); +void EnSth_UpdateWaitForObject(Actor* thisx, PlayState* play); -void func_80B67208(EnSth* this, PlayState* play); -void func_80B67540(EnSth* this, PlayState* play); -void func_80B677BC(EnSth* this, PlayState* play); -void func_80B678A8(EnSth* this, PlayState* play); -void func_80B67958(EnSth* this, PlayState* play); -void func_80B67C1C(EnSth* this, PlayState* play); -void func_80B67DA0(EnSth* this, PlayState* play); -void func_80B680A8(Actor* thisx, PlayState* play); -void func_80B6849C(Actor* thisx, PlayState* play); +void EnSth_PanicIdle(EnSth* this, PlayState* play); +void EnSth_HandleOceansideSpiderHouseConversation(EnSth* this, PlayState* play); +void EnSth_OceansideSpiderHouseIdle(EnSth* this, PlayState* play); +void EnSth_MoonLookingIdle(EnSth* this, PlayState* play); +void EnSth_DefaultIdle(EnSth* this, PlayState* play); +void EnSth_HandleSwampSpiderHouseConversation(EnSth* this, PlayState* play); +void EnSth_SwampSpiderHouseIdle(EnSth* this, PlayState* play); +void EnSth_Update(Actor* thisx, PlayState* play); +void EnSth_Draw(Actor* thisx, PlayState* play); ActorInit En_Sth_InitVars = { ACTOR_EN_STH, @@ -35,7 +35,7 @@ ActorInit En_Sth_InitVars = { sizeof(EnSth), (ActorFunc)EnSth_Init, (ActorFunc)EnSth_Destroy, - (ActorFunc)EnSth_Update, + (ActorFunc)EnSth_UpdateWaitForObject, (ActorFunc)NULL, }; @@ -61,21 +61,48 @@ static ColliderCylinderInit sCylinderInit = { { 30, 40, 0, { 0, 0, 0 } }, }; -AnimationHeader* D_80B6D1C8[] = { - &ovl_En_Sth_Anim_003F50, &ovl_En_Sth_Anim_0045B4, &ovl_En_Sth_Anim_004CC0, &ovl_En_Sth_Anim_00533C, - &ovl_En_Sth_Anim_0059B8, &ovl_En_Sth_Anim_005E40, &ovl_En_Sth_Anim_006354, &ovl_En_Sth_Anim_00645C, +typedef enum { + /* 0 */ STH_ANIM_SIGNALLING, // default, waving arms at you from telescope, OOT: cured happy animation + /* 1 */ STH_ANIM_BENDING_DOWN, // default anim of cured spider house, but never seen before wait overrides it + /* 2 */ STH_ANIM_TALK, + /* 3 */ STH_ANIM_WAIT, + /* 4 */ STH_ANIM_LOOK_UP, // South Clock Town, looking at moon + /* 5 */ STH_ANIM_LOOK_AROUND, // checking out Oceanside Spider House + /* 6 */ STH_ANIM_PLEAD, // wants to buy Oceanside Spider House + /* 7 */ STH_ANIM_PANIC, // after buying Oceanside Spider House, can be found at bottom of slide, + /* 8 */ STH_ANIM_START, // set in init, not an actual index to the array +} EnSthAnimation; + +static AnimationHeader* sAnimationInfo[] = { + &gEnSthSignalAnim, &gEnSthBendDownAnim, &gEnSthTalkWithHandUpAnim, &gEnSthWaitAnim, + &gEnSthLookUpAnim, &gEnSthLookAroundAnim, &gEnSthPleadAnim, &gEnSthPanicAnim, }; -u16 D_80B6D1E8[] = { 0x1144, 0x1145, 0x1146 }; +// three slightly different variants of "Only a little time left, oh goddess please save me" +static u16 sSthOceanspiderhousePanicText[] = { 0x1144, 0x1145, 0x1146 }; -u16 D_80B6D1F0[] = { 0x1139, 0x113E, 0x1143 }; +static u16 sSthFirstOceansideSpiderHouseGreet2TextIds[] = { + 0x1139, // I thought I heard noises... I'm glad I found it early + 0x113E, // I had no idea this place was here, perhaps it can keep me safe + 0x1143 // There's no time we have to hide! +}; -u16 D_80B6D1F8[] = { 0x1132, 0x113A, 0x113F }; +static u16 sSthFirstOceansideSpiderHouseGreet1TextIds[] = { + 0x1132, // I thought I heard some noise.. is this some sort of underground shelter? + 0x113A, // I had no idea there was a basement here.. + 0x113F // I heard loud noises.. I never thought I'd find a place like this.. +}; -Vec3f D_80B6D200 = { 700.0f, 400.0f, 0.0f }; +static Vec3f sFocusOffset = { 700.0f, 400.0f, 0.0f }; -Color_RGB8 D_80B6D20C[] = { - { 190, 110, 0 }, { 0, 180, 110 }, { 0, 255, 0x50 }, { 255, 160, 60 }, { 190, 230, 250 }, { 240, 230, 120 }, +// Sth is hardcoded to only use element [1]. +static Color_RGB8 sShirtColors[] = { + { 190, 110, 0 }, // darker orange + { 0, 180, 110 }, // green + { 0, 255, 80 }, // lime green + { 255, 160, 60 }, // brighter orange + { 190, 230, 250 }, // white + { 240, 230, 120 }, // pale yellow }; void EnSth_Init(Actor* thisx, PlayState* play) { @@ -83,82 +110,88 @@ void EnSth_Init(Actor* thisx, PlayState* play) { EnSth* this = THIS; s32 objectId; - if (ENSTH_GET_100(&this->actor)) { + // this actor can draw two separate bodies that use different objects + if (STH_GET_SWAMP_BODY(&this->actor)) { objectId = Object_GetIndex(&play->objectCtx, OBJECT_AHG); } else { objectId = Object_GetIndex(&play->objectCtx, OBJECT_STH); } - this->unk_29E = objectId; - this->unk_29F = Object_GetIndex(&play->objectCtx, OBJECT_MASK_TRUTH); + this->mainObjectId = objectId; + this->maskOfTruthObjectId = Object_GetIndex(&play->objectCtx, OBJECT_MASK_TRUTH); Actor_SetScale(&this->actor, 0.01f); Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->actor.colChkInfo.mass = MASS_IMMOVABLE; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); - this->unk_29C = 0; - this->unk_29A = 8; + this->sthFlags = 0; // clear + this->animIndex = STH_ANIM_START; this->actor.terminalVelocity = -9.0f; this->actor.gravity = -1.0f; - switch (ENSTH_GET_F(&this->actor)) { - case ENSTH_F_1: + switch (STH_GET_TYPE(&this->actor)) { + case STH_TYPE_UNUSED_1: if (play->actorCtx.flags & ACTORCTX_FLAG_1) { this->actor.flags |= (ACTOR_FLAG_10 | ACTOR_FLAG_20); - this->actionFunc = func_80B67958; + this->actionFunc = EnSth_DefaultIdle; } else { Actor_Kill(&this->actor); return; } break; - case ENSTH_F_2: - if (Inventory_GetSkullTokenCount(play->sceneId) >= 30) { - this->actionFunc = func_80B67DA0; + case STH_TYPE_SWAMP_SPIDER_HOUSE_CURED: + if (Inventory_GetSkullTokenCount(play->sceneId) >= SPIDER_HOUSE_TOKENS_REQUIRED) { + this->actionFunc = EnSth_SwampSpiderHouseIdle; } else { Actor_Kill(&this->actor); } this->actor.textId = 0; - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_34_40) || !CHECK_WEEKEVENTREG(WEEKEVENTREG_34_08)) { - this->unk_29C |= 1; + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_MASK_OF_TRUTH) || + !CHECK_WEEKEVENTREG(WEEKEVENTREG_SWAMP_SPIDER_HOUSE_TALKED)) { + this->sthFlags |= STH_FLAG_DRAW_MASK_OF_TRUTH; } break; - case ENSTH_F_3: - if ((gSaveContext.save.skullTokenCount & 0xFFFF) >= 30) { + case STH_TYPE_MOON_LOOKING: // South Clock Town + if ((gSaveContext.save.skullTokenCount & 0xFFFF) >= SPIDER_HOUSE_TOKENS_REQUIRED) { Actor_Kill(&this->actor); return; } - this->actionFunc = func_80B678A8; - this->unk_29C |= 8; + + this->actionFunc = EnSth_MoonLookingIdle; + this->sthFlags |= STH_FLAG_DISABLE_HEAD_TRACK; this->actor.targetMode = 3; this->actor.uncullZoneForward = 800.0f; break; - case ENSTH_F_4: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_13_20)) { + case STH_TYPE_OCEANSIDE_SPIDER_HOUSE_GREET: + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_BUYER_MOVED_IN)) { + // The player has already exited the house after complete; EnSth has moved deeper into the house. Actor_Kill(&this->actor); return; } this->actor.textId = 0; - this->actionFunc = func_80B677BC; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_13_80)) { - this->unk_29C |= 2; + this->actionFunc = EnSth_OceansideSpiderHouseIdle; + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_COLLECTED_REWARD)) { + this->sthFlags |= STH_FLAG_OCEANSIDE_SPIDER_HOUSE_GREET; } break; - case ENSTH_F_5: - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_13_20) || (Inventory_GetSkullTokenCount(play->sceneId) < 30)) { + case STH_TYPE_OCEANSIDE_SPIDER_HOUSE_PANIC: + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_BUYER_MOVED_IN) || + (Inventory_GetSkullTokenCount(play->sceneId) < SPIDER_HOUSE_TOKENS_REQUIRED)) { + // Has not moved in, and has not completed the house; do NOT spawn yet. Actor_Kill(&this->actor); return; } - this->actionFunc = func_80B67208; + this->actionFunc = EnSth_PanicIdle; this->actor.textId = 0; - this->unk_29C |= 8; + this->sthFlags |= STH_FLAG_DISABLE_HEAD_TRACK; break; default: - this->actionFunc = func_80B67958; + this->actionFunc = EnSth_DefaultIdle; break; } } @@ -169,142 +202,144 @@ void EnSth_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->collider); } -s32 func_80B6703C(EnSth* this, PlayState* play) { +s32 EnSth_CanSpeakToPlayer(EnSth* this, PlayState* play) { if ((this->actor.xzDistToPlayer < 100.0f) && Player_IsFacingActor(&this->actor, 0x3000, play) && Actor_IsFacingPlayer(&this->actor, 0x2000)) { return true; - } - return false; -} - -void func_80B670A4(EnSth* this, s16 arg1) { - if ((arg1 >= 0) && (arg1 < ARRAY_COUNT(D_80B6D1C8)) && (arg1 != this->unk_29A)) { - Animation_Change(&this->skelAnime, D_80B6D1C8[arg1], 1.0f, 0.0f, Animation_GetLastFrame(D_80B6D1C8[arg1]), - ANIMMODE_LOOP, -5.0f); - this->unk_29A = arg1; + } else { + return false; } } -void func_80B67148(EnSth* this, PlayState* play) { +void EnSth_ChangeAnim(EnSth* this, s16 animIndex) { + if ((animIndex >= 0) && (animIndex < ARRAY_COUNT(sAnimationInfo)) && (animIndex != this->animIndex)) { + Animation_Change(&this->skelAnime, sAnimationInfo[animIndex], 1.0f, 0.0f, + Animation_GetLastFrame(sAnimationInfo[animIndex]), ANIMMODE_LOOP, -5.0f); + this->animIndex = animIndex; + } +} + +void EnSth_GetInitialPanicText(EnSth* this, PlayState* play) { s32 day = CURRENT_DAY - 1; - u16 val; + u16 nextTextId; if (day < 0) { day = 0; } - val = D_80B6D1E8[day]; + nextTextId = sSthOceanspiderhousePanicText[day]; - Message_StartTextbox(play, val, &this->actor); + Message_StartTextbox(play, nextTextId, &this->actor); } -void func_80B671A0(EnSth* this, PlayState* play) { +void EnSth_HandlePanicConversation(EnSth* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { - this->actionFunc = func_80B67208; + this->actionFunc = EnSth_PanicIdle; func_801477B4(play); } } -void func_80B67208(EnSth* this, PlayState* play) { +void EnSth_PanicIdle(EnSth* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - func_80B67148(this, play); - this->actionFunc = func_80B671A0; + EnSth_GetInitialPanicText(this, play); + this->actionFunc = EnSth_HandlePanicConversation; } else if ((this->actor.xzDistToPlayer < 100.0f) && Player_IsFacingActor(&this->actor, 0x3000, play)) { func_800B8614(&this->actor, play, 110.0f); } } -void func_80B672A4(EnSth* this, PlayState* play) { - u16 sp1E; +void EnSth_GetInitialOceansideSpiderHouseText(EnSth* this, PlayState* play) { + u16 nextTextId; s32 day = CURRENT_DAY - 1; if (day < 0) { day = 0; } - if (this->unk_29C & 2) { + if (this->sthFlags & STH_FLAG_OCEANSIDE_SPIDER_HOUSE_GREET) { s32 pad; - sp1E = D_80B6D1F0[day]; + nextTextId = sSthFirstOceansideSpiderHouseGreet2TextIds[day]; if (day == 2) { - func_80B670A4(this, 5); + EnSth_ChangeAnim(this, STH_ANIM_LOOK_AROUND); } } else { - sp1E = D_80B6D1F8[day]; + nextTextId = sSthFirstOceansideSpiderHouseGreet1TextIds[day]; } - Message_StartTextbox(play, sp1E, &this->actor); + Message_StartTextbox(play, nextTextId, &this->actor); } -void func_80B67348(EnSth* this, PlayState* play) { - u16 phi_a1; +void EnSth_PostOceanspiderhouseReward(EnSth* this, PlayState* play) { + u16 nextTextId; SkelAnime_Update(&this->skelAnime); if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actor.flags &= ~ACTOR_FLAG_10000; - this->actionFunc = func_80B67540; + this->actionFunc = EnSth_HandleOceansideSpiderHouseConversation; - switch (this->actor.home.rot.z) { - case 8: - case 9: - phi_a1 = 0x1137; + switch (STH_GI_ID(&this->actor)) { + case GI_WALLET_ADULT: + case GI_WALLET_GIANT: + nextTextId = 0x1137; // I'm just glad it was something you needed break; - case 6: - phi_a1 = 0x1138; + case GI_RUPEE_SILVER: + // unused code, as he only gives wallet, purple and red, silver is never assigned to STH_GI_ID + nextTextId = 0x1138; // That's my life's fortune break; - case 5: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_13_40)) { - phi_a1 = 0x113D; + case GI_RUPEE_PURPLE: + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_OCEANSIDE_WALLET_UPGRADE)) { + nextTextId = 0x113D; // That's my life's savings } else { - phi_a1 = 0x113C; + nextTextId = 0x113C; // That's my life's savings (2) } break; default: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_13_40)) { - phi_a1 = 0x1142; + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_OCEANSIDE_WALLET_UPGRADE)) { + nextTextId = 0x1142; // Well, thats all I have on me } else { - phi_a1 = 0x1141; + nextTextId = 0x1141; // Well, thats all I have on me } break; } - Message_StartTextbox(play, phi_a1, &this->actor); + Message_StartTextbox(play, nextTextId, &this->actor); } else { func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } } -void func_80B67458(EnSth* this, PlayState* play) { +void EnSth_GiveOceansideSpiderHouseReward(EnSth* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Actor_HasParent(&this->actor, play)) { this->actor.parent = NULL; - this->actionFunc = func_80B67348; + this->actionFunc = EnSth_PostOceanspiderhouseReward; this->actor.flags |= ACTOR_FLAG_10000; func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); if (CURRENT_DAY == 3) { - func_80B670A4(this, 6); + EnSth_ChangeAnim(this, STH_ANIM_PLEAD); } else { - func_80B670A4(this, 3); + EnSth_ChangeAnim(this, STH_ANIM_WAIT); } } else { - Actor_PickUp(&this->actor, play, this->actor.home.rot.z, 10000.0f, 500.0f); + Actor_PickUp(&this->actor, play, STH_GI_ID(&this->actor), 10000.0f, 500.0f); } } -void func_80B67540(EnSth* this, PlayState* play) { - s32 sp2C = CURRENT_DAY - 1; +void EnSth_HandleOceansideSpiderHouseConversation(EnSth* this, PlayState* play) { + s32 day = CURRENT_DAY - 1; - if (sp2C < 0) { - sp2C = 0; + if (day < 0) { + day = 0; } - if (this->unk_29A == 6) { + if (this->animIndex == STH_ANIM_PLEAD) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x1000, 0x200); this->actor.world.rot.y = this->actor.shape.rot.y; } @@ -315,313 +350,329 @@ void func_80B67540(EnSth* this, PlayState* play) { case TEXT_STATE_5: if (Message_ShouldAdvance(play)) { switch (play->msgCtx.currentTextId) { - case 0x1134: + case 0x1134: // (does not exist) func_80151938(play, play->msgCtx.currentTextId + 1); break; - case 0x1132: - case 0x113A: - case 0x113F: - func_80151938(play, 0x1133); + case 0x1132: // Heard noise, came in to see + case 0x113A: // Had no idea there was a basement here + case 0x113F: // Heard noise... I never thought I'd find a place like this + func_80151938(play, 0x1133); // did you find this place? break; - case 0x1133: - func_80151938(play, 0x1136); - func_80B670A4(this, 6); + case 0x1133: // did you find this place? + func_80151938(play, 0x1136); // I want to buy this place from you + EnSth_ChangeAnim(this, STH_ANIM_PLEAD); break; - case 0x1136: - SET_WEEKEVENTREG(WEEKEVENTREG_13_80); + case 0x1136: // I want to buy this house from you + // This flag prevents multiple rewards, switching to secondary dialogue after + SET_WEEKEVENTREG(WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_COLLECTED_REWARD); - switch (sp2C) { - case 0: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_13_40)) { - this->actor.home.rot.z = 6; + switch (day) { + case 0: // first day + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_OCEANSIDE_WALLET_UPGRADE)) { + STH_GI_ID(&this->actor) = GI_RUPEE_SILVER; } else { - SET_WEEKEVENTREG(WEEKEVENTREG_13_40); + // This flag prevents getting two wallets from the same place. + // Instead, getting silver rupee above. + SET_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_OCEANSIDE_WALLET_UPGRADE); switch (CUR_UPG_VALUE(UPG_WALLET)) { case 0: - this->actor.home.rot.z = 8; + STH_GI_ID(&this->actor) = GI_WALLET_ADULT; break; case 1: - this->actor.home.rot.z = 9; + STH_GI_ID(&this->actor) = GI_WALLET_GIANT; break; } } break; - case 1: - this->actor.home.rot.z = 5; + case 1: // second day + STH_GI_ID(&this->actor) = GI_RUPEE_PURPLE; break; - default: - this->actor.home.rot.z = 4; + default: // final day + STH_GI_ID(&this->actor) = GI_RUPEE_RED; break; } func_801477B4(play); - this->actionFunc = func_80B67458; - func_80B67458(this, play); + this->actionFunc = EnSth_GiveOceansideSpiderHouseReward; + EnSth_GiveOceansideSpiderHouseReward(this, play); break; - case 0x113C: - func_80151938(play, 0x113B); + case 0x113C: // (Second day) I am giving you my life savings + func_80151938(play, 0x113B); // If only I had gotten here yesterday... break; - case 0x1141: - func_80151938(play, 0x1140); - func_80B670A4(this, 3); + case 0x1141: // (Final day) This is all I have + func_80151938(play, 0x1140); // If only I had gotten here two days ago... + EnSth_ChangeAnim(this, STH_ANIM_WAIT); break; default: - this->actionFunc = func_80B677BC; + this->actionFunc = EnSth_OceansideSpiderHouseIdle; func_801477B4(play); - this->unk_29C |= 2; + this->sthFlags |= STH_FLAG_OCEANSIDE_SPIDER_HOUSE_GREET; break; } } break; case TEXT_STATE_CLOSING: - this->actionFunc = func_80B677BC; - this->unk_29C |= 2; + this->actionFunc = EnSth_OceansideSpiderHouseIdle; + this->sthFlags |= STH_FLAG_OCEANSIDE_SPIDER_HOUSE_GREET; break; } } -void func_80B677BC(EnSth* this, PlayState* play) { +void EnSth_OceansideSpiderHouseIdle(EnSth* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - func_80B672A4(this, play); - this->actionFunc = func_80B67540; - } else if (func_80B6703C(this, play)) { + EnSth_GetInitialOceansideSpiderHouseText(this, play); + this->actionFunc = EnSth_HandleOceansideSpiderHouseConversation; + } else if (EnSth_CanSpeakToPlayer(this, play)) { func_800B8614(&this->actor, play, 110.0f); } } -void func_80B67838(EnSth* this, PlayState* play) { +void EnSth_HandleMoonLookingConversation(EnSth* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { - this->actionFunc = func_80B678A8; + this->actionFunc = EnSth_MoonLookingIdle; func_801477B4(play); } - this->unk_294.x = -0x1388; + this->headRot.x = -0x1388; } -void func_80B678A8(EnSth* this, PlayState* play) { +void EnSth_MoonLookingIdle(EnSth* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - this->actionFunc = func_80B67838; - } else if (func_80B6703C(this, play) || this->actor.isTargeted) { + this->actionFunc = EnSth_HandleMoonLookingConversation; + } else if (EnSth_CanSpeakToPlayer(this, play) || this->actor.isTargeted) { if ((gSaveContext.save.time >= CLOCK_TIME(6, 0)) && (gSaveContext.save.time <= CLOCK_TIME(18, 0))) { - this->actor.textId = 0x1130; + this->actor.textId = 0x1130; // Huh? The Moon... } else { - this->actor.textId = 0x1131; + this->actor.textId = 0x1131; // (The Moon) gotten bigger again } func_800B8614(&this->actor, play, 110.0f); } - this->unk_294.x = -0x1388; + this->headRot.x = -0x1388; } -void func_80B67958(EnSth* this, PlayState* play) { +// used by type: STH_TYPE_UNUSED_1 and undefined types +void EnSth_DefaultIdle(EnSth* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); } -void func_80B67984(EnSth* this, PlayState* play) { - u16 sp1E; +void EnSth_GetInitialSwampSpiderHouseText(EnSth* this, PlayState* play) { + u16 nextTextId; if (CHECK_WEEKEVENTREG(WEEKEVENTREG_34_10)) { - sp1E = 0x903; - func_80B670A4(this, 2); + nextTextId = 0x903; // (does not exist) + EnSth_ChangeAnim(this, STH_ANIM_TALK); } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_34_20)) { - sp1E = 0x90F; - func_80B670A4(this, 2); - } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_34_40)) { - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_34_08)) { - sp1E = 0x91B; + nextTextId = 0x90F; // (does not exist) + EnSth_ChangeAnim(this, STH_ANIM_TALK); + } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_MASK_OF_TRUTH)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_SWAMP_SPIDER_HOUSE_TALKED)) { + nextTextId = 0x91B; // As soon as I calm down, getting rid of it } else { - sp1E = 0x918; + nextTextId = 0x918; // I've had enough of this, going home } - func_80B670A4(this, 2); - } else if (Inventory_GetSkullTokenCount(play->sceneId) >= 30) { + EnSth_ChangeAnim(this, STH_ANIM_TALK); + } else if (Inventory_GetSkullTokenCount(play->sceneId) >= SPIDER_HOUSE_TOKENS_REQUIRED) { if (INV_CONTENT(ITEM_MASK_TRUTH) == ITEM_MASK_TRUTH) { - this->unk_29C |= 4; - sp1E = 0x919; + this->sthFlags |= STH_FLAG_SWAMP_SPIDER_HOUSE_SAVED; + nextTextId = 0x919; // I've been saved! } else { - sp1E = 0x916; + nextTextId = 0x916; // I've been saved! (Duplicate) } } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_34_02)) { - sp1E = 0x8FF; + nextTextId = 0x8FF; // (does not exist) } else { - sp1E = 0x8FC; + nextTextId = 0x8FC; // (does not exist) SET_WEEKEVENTREG(WEEKEVENTREG_34_02); } - Message_StartTextbox(play, sp1E, &this->actor); + + Message_StartTextbox(play, nextTextId, &this->actor); } -void func_80B67AB4(EnSth* this, PlayState* play) { +void EnSth_TalkAfterSwampSpiderHouseGiveMask(EnSth* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - this->actionFunc = func_80B67C1C; - SET_WEEKEVENTREG(WEEKEVENTREG_34_40); - Message_StartTextbox(play, 0x918, &this->actor); + this->actionFunc = EnSth_HandleSwampSpiderHouseConversation; + SET_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_MASK_OF_TRUTH); + Message_StartTextbox(play, 0x918, &this->actor); // I've had enough of this, going home } else { func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } } -void func_80B67B50(EnSth* this, PlayState* play) { +void EnSth_SwampSpiderHouseGiveMask(EnSth* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Actor_HasParent(&this->actor, play)) { this->actor.parent = NULL; - this->actionFunc = func_80B67AB4; + this->actionFunc = EnSth_TalkAfterSwampSpiderHouseGiveMask; this->actor.flags |= ACTOR_FLAG_10000; func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); } else { - this->unk_29C &= ~1; - SET_WEEKEVENTREG(WEEKEVENTREG_34_08); + this->sthFlags &= ~STH_FLAG_DRAW_MASK_OF_TRUTH; + // This flag is used to keep track if the player has already spoken to the actor, triggering secondary dialogue. + SET_WEEKEVENTREG(WEEKEVENTREG_SWAMP_SPIDER_HOUSE_TALKED); Actor_PickUp(&this->actor, play, GI_MASK_TRUTH, 10000.0f, 50.0f); } } -void func_80B67C1C(EnSth* this, PlayState* play) { +void EnSth_HandleSwampSpiderHouseConversation(EnSth* this, PlayState* play) { s32 pad; SkelAnime_Update(&this->skelAnime); if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { switch (play->msgCtx.currentTextId) { - case 0x90C: - func_80B670A4(this, 2); + case 0x90C: // (does not exist) + EnSth_ChangeAnim(this, STH_ANIM_TALK); func_80151938(play, play->msgCtx.currentTextId + 1); break; - case 0x916: - case 0x919: - func_80B670A4(this, 3); + case 0x916: // I have been saved! I thought I was doomed + case 0x919: // I have been saved! I thought I was doomed (duplicate) + EnSth_ChangeAnim(this, STH_ANIM_WAIT); func_80151938(play, play->msgCtx.currentTextId + 1); break; - case 0x8FC: - case 0x8FD: - case 0x900: - case 0x90A: - case 0x90D: + case 0x8FC: // (does not exist) + case 0x8FD: // (does not exist) + case 0x900: // (does not exist) + case 0x90A: // (does not exist) + case 0x90D: // (does not exist) func_80151938(play, play->msgCtx.currentTextId + 1); break; - case 0x901: - case 0x90B: - case 0x917: + case 0x901: // (does not exist) + case 0x90B: // (does not exist) + case 0x917: // Someone gave me this mask and said it would make me rich, Take it func_801477B4(play); - this->actionFunc = func_80B67B50; - func_80B67B50(this, play); + this->actionFunc = EnSth_SwampSpiderHouseGiveMask; + EnSth_SwampSpiderHouseGiveMask(this, play); break; - case 0x91A: - SET_WEEKEVENTREG(WEEKEVENTREG_34_40); - CLEAR_WEEKEVENTREG(WEEKEVENTREG_34_08); + case 0x91A: // Someone gave me this mask and said it would make me rich, getting rid of it + SET_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_MASK_OF_TRUTH); + CLEAR_WEEKEVENTREG(WEEKEVENTREG_SWAMP_SPIDER_HOUSE_TALKED); - case 0x902: - case 0x903: - case 0x90E: - case 0x90F: - case 0x918: - case 0x91B: - func_80B670A4(this, 3); + case 0x902: // (does not exist) + case 0x903: // (does not exist) + case 0x90E: // (does not exist) + case 0x90F: // (does not exist) + case 0x918: // I have had enough, going home + case 0x91B: // As soon as I calm down, getting rid of it + EnSth_ChangeAnim(this, STH_ANIM_WAIT); default: this->actor.flags &= ~ACTOR_FLAG_10000; func_801477B4(play); - this->actionFunc = func_80B67DA0; + this->actionFunc = EnSth_SwampSpiderHouseIdle; break; } } } -void func_80B67DA0(EnSth* this, PlayState* play) { +void EnSth_SwampSpiderHouseIdle(EnSth* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - func_80B67984(this, play); - this->actionFunc = func_80B67C1C; - } else if (func_80B6703C(this, play)) { + EnSth_GetInitialSwampSpiderHouseText(this, play); + this->actionFunc = EnSth_HandleSwampSpiderHouseConversation; + } else if (EnSth_CanSpeakToPlayer(this, play)) { this->actor.textId = 0; func_800B8614(&this->actor, play, 110.0f); } } -void func_80B67E20(Actor* thisx, PlayState* play) { +/** + * Oceanside Spider House EnSth shows up after you collect all 30 tokens. + * Here we wait invisible until the player has finished. + */ +void EnSth_UpdateOceansideSpiderHouseWaitForTokens(Actor* thisx, PlayState* play) { EnSth* this = THIS; - if (Inventory_GetSkullTokenCount(play->sceneId) >= 30) { - this->actor.update = func_80B680A8; - this->actor.draw = func_80B6849C; + if (Inventory_GetSkullTokenCount(play->sceneId) >= SPIDER_HOUSE_TOKENS_REQUIRED) { + this->actor.update = EnSth_Update; + this->actor.draw = EnSth_Draw; this->actor.flags |= ACTOR_FLAG_1; } } -void EnSth_Update(Actor* thisx, PlayState* play) { +/** + * Dual object actors have to wait for the object to finish loading. + * This dev chose to use a temporary update instead of temporary actionFunc. + */ +void EnSth_UpdateWaitForObject(Actor* thisx, PlayState* play) { s32 pad; EnSth* this = THIS; - if (Object_IsLoaded(&play->objectCtx, this->unk_29E)) { - this->actor.objBankIndex = this->unk_29E; + if (Object_IsLoaded(&play->objectCtx, this->mainObjectId)) { + this->actor.objBankIndex = this->mainObjectId; Actor_SetObjectDependency(play, &this->actor); - if (ENSTH_GET_100(&this->actor)) { - SkelAnime_InitFlex(play, &this->skelAnime, &object_ahg_Skel_005998, &ovl_En_Sth_Anim_0045B4, - this->jointTable, this->morphTable, 16); - Animation_PlayLoop(&this->skelAnime, &ovl_En_Sth_Anim_0045B4); - this->unk_29A = 1; + if (STH_GET_SWAMP_BODY(&this->actor)) { + SkelAnime_InitFlex(play, &this->skelAnime, &gAhgSkel, &gEnSthBendDownAnim, this->jointTable, + this->morphTable, AHG_LIMB_MAX); + Animation_PlayLoop(&this->skelAnime, &gEnSthBendDownAnim); + this->animIndex = STH_ANIM_BENDING_DOWN; if (CHECK_WEEKEVENTREG(WEEKEVENTREG_34_10) || CHECK_WEEKEVENTREG(WEEKEVENTREG_34_20) || - CHECK_WEEKEVENTREG(WEEKEVENTREG_34_40) || (Inventory_GetSkullTokenCount(play->sceneId) >= 30)) { - func_80B670A4(this, 3); + CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_MASK_OF_TRUTH) || + (Inventory_GetSkullTokenCount(play->sceneId) >= SPIDER_HOUSE_TOKENS_REQUIRED)) { + EnSth_ChangeAnim(this, STH_ANIM_WAIT); } } else { - SkelAnime_InitFlex(play, &this->skelAnime, &object_sth_Skel_0031F8, &ovl_En_Sth_Anim_003F50, - this->jointTable, this->morphTable, 16); - Animation_PlayLoop(&this->skelAnime, &ovl_En_Sth_Anim_003F50); + SkelAnime_InitFlex(play, &this->skelAnime, &gSthSkel, &gEnSthSignalAnim, this->jointTable, this->morphTable, + STH_LIMB_MAX); + Animation_PlayLoop(&this->skelAnime, &gEnSthSignalAnim); } - this->actor.update = func_80B680A8; - this->actor.draw = func_80B6849C; + this->actor.update = EnSth_Update; + this->actor.draw = EnSth_Draw; - switch (ENSTH_GET_F(&this->actor)) { - case ENSTH_F_3: - func_80B670A4(this, 4); + switch (STH_GET_TYPE(&this->actor)) { + case STH_TYPE_MOON_LOOKING: + EnSth_ChangeAnim(this, STH_ANIM_LOOK_UP); break; - case ENSTH_F_4: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_13_80)) { - func_80B670A4(this, 5); + case STH_TYPE_OCEANSIDE_SPIDER_HOUSE_GREET: + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_COLLECTED_REWARD)) { + EnSth_ChangeAnim(this, STH_ANIM_LOOK_AROUND); } else { - func_80B670A4(this, 5); + EnSth_ChangeAnim(this, STH_ANIM_LOOK_AROUND); } break; - case ENSTH_F_5: - func_80B670A4(this, 7); + case STH_TYPE_OCEANSIDE_SPIDER_HOUSE_PANIC: + EnSth_ChangeAnim(this, STH_ANIM_PANIC); break; } - if ((ENSTH_GET_F(&this->actor) == ENSTH_F_4) && (Inventory_GetSkullTokenCount(play->sceneId) < 30)) { - this->actor.update = func_80B67E20; + // not ready to appear yet + if ((STH_GET_TYPE(&this->actor) == STH_TYPE_OCEANSIDE_SPIDER_HOUSE_GREET) && + (Inventory_GetSkullTokenCount(play->sceneId) < SPIDER_HOUSE_TOKENS_REQUIRED)) { + this->actor.update = EnSth_UpdateOceansideSpiderHouseWaitForTokens; this->actor.draw = NULL; this->actor.flags &= ~ACTOR_FLAG_1; } } } -void func_80B680A8(Actor* thisx, PlayState* play) { +void EnSth_Update(Actor* thisx, PlayState* play) { s32 pad; EnSth* this = THIS; - Vec3s sp38; Actor_MoveWithGravity(&this->actor); Collider_UpdateCylinder(&this->actor, &this->collider); @@ -630,59 +681,66 @@ void func_80B680A8(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - if (func_80B6703C(this, play) && !(this->unk_29C & 8) && (this->unk_29A != 5)) { - sp38.x = sp38.y = sp38.z = 0; + if (EnSth_CanSpeakToPlayer(this, play) && !(this->sthFlags & STH_FLAG_DISABLE_HEAD_TRACK) && + (this->animIndex != STH_ANIM_LOOK_AROUND)) { + Vec3s torsoRot; - Actor_TrackPlayer(play, &this->actor, &this->unk_294, &sp38, this->actor.focus.pos); + torsoRot.x = torsoRot.y = torsoRot.z = 0; // this should block torso rot from working + + Actor_TrackPlayer(play, &this->actor, &this->headRot, &torsoRot, this->actor.focus.pos); } else { - Math_SmoothStepToS(&this->unk_294.x, 0, 6, 6200, 100); - Math_SmoothStepToS(&this->unk_294.y, 0, 6, 6200, 100); + Math_SmoothStepToS(&this->headRot.x, 0, 6, 6200, 100); + Math_SmoothStepToS(&this->headRot.y, 0, 6, 6200, 100); } } -s32 func_80B681E8(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { +s32 EnSth_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { s32 pad; EnSth* this = THIS; - if (limbIndex == 15) { - rot->x += this->unk_294.y; - rot->z += this->unk_294.x; - *dList = ovl_En_Sth_DL_0034A0; + if (limbIndex == STH_LIMB_HEAD) { + rot->x += this->headRot.y; + rot->z += this->headRot.x; + + // object_sth body has no head by default, forced here from overlay data + *dList = gEnSthHeadDL; } - if ((limbIndex == 8) || (limbIndex == 10) || (limbIndex == 13)) { + if ((limbIndex == STH_LIMB_CHEST) || (limbIndex == STH_LIMB_LEFT_FOREARM) || + (limbIndex == STH_LIMB_RIGHT_FOREARM)) { rot->y += (s16)(Math_SinS(play->state.frames * ((limbIndex * 50) + 0x814)) * 200.0f); rot->z += (s16)(Math_CosS(play->state.frames * ((limbIndex * 50) + 0x940)) * 200.0f); } + return false; } -void func_80B68310(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { +void EnSth_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { EnSth* this = THIS; - if (limbIndex == 15) { + if (limbIndex == STH_LIMB_HEAD) { s32 pad; - Matrix_MultVec3f(&D_80B6D200, &this->actor.focus.pos); + Matrix_MultVec3f(&sFocusOffset, &this->actor.focus.pos); - if (!ENSTH_GET_100(&this->actor)) { + if (!STH_GET_SWAMP_BODY(&this->actor)) { OPEN_DISPS(play->state.gfxCtx); - gSPDisplayList(POLY_OPA_DISP++, ovl_En_Sth_DL_0037C0); + gSPDisplayList(POLY_OPA_DISP++, gEnSthExtraHairDL); CLOSE_DISPS(play->state.gfxCtx); } else { OPEN_DISPS(play->state.gfxCtx); - if (this->unk_29C & 1) { - if (Object_IsLoaded(&play->objectCtx, this->unk_29F)) { + if (this->sthFlags & STH_FLAG_DRAW_MASK_OF_TRUTH) { + if (Object_IsLoaded(&play->objectCtx, this->maskOfTruthObjectId)) { Matrix_Push(); Matrix_RotateZS(0x3A98, MTXMODE_APPLY); Matrix_Translate(0.0f, 190.0f, 0.0f, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPSegment(POLY_OPA_DISP++, 0x0A, play->objectCtx.status[this->unk_29F].segment); + gSPSegment(POLY_OPA_DISP++, 0x0A, play->objectCtx.status[this->maskOfTruthObjectId].segment); gSPDisplayList(POLY_OPA_DISP++, object_mask_truth_DL_0001A0); Matrix_Pop(); @@ -694,7 +752,7 @@ void func_80B68310(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Acto } } -void func_80B6849C(Actor* thisx, PlayState* play) { +void EnSth_Draw(Actor* thisx, PlayState* play) { s32 pad; EnSth* this = THIS; @@ -703,11 +761,11 @@ void func_80B6849C(Actor* thisx, PlayState* play) { func_8012C28C(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, - Gfx_EnvColor(play->state.gfxCtx, D_80B6D20C[1].r, D_80B6D20C[1].g, D_80B6D20C[1].b, 255)); + Gfx_EnvColor(play->state.gfxCtx, sShirtColors[1].r, sShirtColors[1].g, sShirtColors[1].b, 255)); gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_EnvColor(play->state.gfxCtx, 90, 110, 130, 255)); SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, - func_80B681E8, func_80B68310, &this->actor); + EnSth_OverrideLimbDraw, EnSth_PostLimbDraw, &this->actor); CLOSE_DISPS(play->state.gfxCtx); } 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 857b925053..1c8c92852d 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.h +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.h @@ -2,33 +2,48 @@ #define Z_EN_STH_H #include "global.h" +#include "overlays/actors/ovl_En_Si/z_en_si.h" +#include "objects/object_sth/object_sth.h" +#include "objects/object_ahg/object_ahg.h" +#include "objects/object_mask_truth/object_mask_truth.h" struct EnSth; typedef void (*EnSthActionFunc)(struct EnSth*, PlayState*); -#define ENSTH_GET_F(thisx) ((thisx)->params & 0xF) -#define ENSTH_GET_100(thisx) ((thisx)->params & 0x100) +typedef enum { + /* 1 */ STH_TYPE_UNUSED_1 = 1, + /* 2 */ STH_TYPE_SWAMP_SPIDER_HOUSE_CURED, // cursed is EnSsh + /* 3 */ STH_TYPE_MOON_LOOKING, // South Clock Town, looking up at the moon + /* 4 */ STH_TYPE_OCEANSIDE_SPIDER_HOUSE_GREET, // looking for shelter + /* 5 */ STH_TYPE_OCEANSIDE_SPIDER_HOUSE_PANIC, // shelter was not enough + // Other values: Actor will spawn and animate with arm waving, no further interaction. +} EnSthTypes; -enum { - /* 1 */ ENSTH_F_1 = 1, - /* 2 */ ENSTH_F_2, - /* 3 */ ENSTH_F_3, - /* 4 */ ENSTH_F_4, - /* 5 */ ENSTH_F_5, -}; +// Note: Vanilla types usually have 0xFEXX typing, but this upper section is unused by the code, reason unknown +#define STH_GET_TYPE(thisx) ((thisx)->params & 0xF) +#define STH_GET_SWAMP_BODY(thisx) ((thisx)->params & 0x100) + +// The get item ID for the reward for Oceanside Spider House (wallet, or rupees) is set here +#define STH_GI_ID(thisx) ((thisx)->home.rot.z) + +// This actor has its own flags system +#define STH_FLAG_DRAW_MASK_OF_TRUTH (1 << 0) +#define STH_FLAG_OCEANSIDE_SPIDER_HOUSE_GREET (1 << 1) +#define STH_FLAG_SWAMP_SPIDER_HOUSE_SAVED (1 << 2) // set, but not read +#define STH_FLAG_DISABLE_HEAD_TRACK (1 << 3) typedef struct EnSth { /* 0x000 */ Actor actor; /* 0x144 */ ColliderCylinder collider; /* 0x190 */ SkelAnime skelAnime; - /* 0x1D4 */ Vec3s jointTable[16]; - /* 0x234 */ Vec3s morphTable[16]; - /* 0x294 */ Vec3s unk_294; - /* 0x29A */ s16 unk_29A; - /* 0x29C */ u16 unk_29C; - /* 0x29E */ u8 unk_29E; - /* 0x29F */ u8 unk_29F; + /* 0x1D4 */ Vec3s jointTable[STH_LIMB_MAX]; + /* 0x234 */ Vec3s morphTable[STH_LIMB_MAX]; + /* 0x294 */ Vec3s headRot; + /* 0x29A */ s16 animIndex; + /* 0x29C */ u16 sthFlags; + /* 0x29E */ u8 mainObjectId; + /* 0x29F */ u8 maskOfTruthObjectId; /* 0x2A0 */ EnSthActionFunc actionFunc; } EnSth; // size = 0x2A4 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 ac615a8dd8..ba6d72cb61 100644 --- a/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c +++ b/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c @@ -63,8 +63,8 @@ void EnSth2_Update(Actor* thisx, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->objIndex)) { this->actor.objBankIndex = this->objIndex; Actor_SetObjectDependency(play, &this->actor); - SkelAnime_InitFlex(play, &this->skelAnime, &object_sth_Skel_0031F8, &gEnSth2WavingHandAnim, this->jointTable, - this->morphTable, OBJECT_STH_LIMB_MAX); + SkelAnime_InitFlex(play, &this->skelAnime, &gSthSkel, &gEnSth2WavingHandAnim, this->jointTable, + this->morphTable, STH_LIMB_MAX); Animation_PlayLoop(&this->skelAnime, &gEnSth2WavingHandAnim); this->actor.update = EnSth2_UpdateActionFunc; this->actor.draw = EnSth2_Draw; @@ -80,10 +80,11 @@ void EnSth2_UpdateActionFunc(Actor* thisx, PlayState* play) { s32 EnSth2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { s32 pad; - if (limbIndex == OBJECT_STH_LIMB_0F) { + if (limbIndex == STH_LIMB_HEAD) { *dList = gEnSth2HeadDL; } - if ((limbIndex == OBJECT_STH_LIMB_08) || (limbIndex == OBJECT_STH_LIMB_0A) || (limbIndex == OBJECT_STH_LIMB_0D)) { + if ((limbIndex == STH_LIMB_CHEST) || (limbIndex == STH_LIMB_LEFT_FOREARM) || + (limbIndex == STH_LIMB_RIGHT_FOREARM)) { rot->y += (s16)(Math_SinS((play->state.frames * ((limbIndex * 50) + 0x814))) * 200.0f); rot->z += (s16)(Math_CosS((play->state.frames * ((limbIndex * 50) + 0x940))) * 200.0f); } @@ -93,7 +94,7 @@ s32 EnSth2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* void EnSth2_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { static Vec3f focusOffset = { 700.0f, 400.0f, 0.0f }; - if (limbIndex == OBJECT_STH_LIMB_0F) { + if (limbIndex == STH_LIMB_HEAD) { Matrix_MultVec3f(&focusOffset, &thisx->focus.pos); OPEN_DISPS(play->state.gfxCtx); 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 265332ffd8..d8ecc9cdbe 100644 --- a/src/overlays/actors/ovl_En_Sth2/z_en_sth2.h +++ b/src/overlays/actors/ovl_En_Sth2/z_en_sth2.h @@ -11,8 +11,8 @@ typedef void (*EnSth2ActionFunc)(struct EnSth2*, PlayState*); typedef struct EnSth2 { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; - /* 0x188 */ Vec3s jointTable[OBJECT_STH_LIMB_MAX]; - /* 0x1E8 */ Vec3s morphTable[OBJECT_STH_LIMB_MAX]; + /* 0x188 */ Vec3s jointTable[STH_LIMB_MAX]; + /* 0x1E8 */ Vec3s morphTable[STH_LIMB_MAX]; /* 0x248 */ s16 unused; /* 0x24A */ u8 objIndex; /* 0x24C */ EnSth2ActionFunc actionFunc; diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 81eaf24484..0cada88236 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -14252,30 +14252,30 @@ 0x80B66BDC:("ObjHariko_Draw",), 0x80B66D30:("EnSth_Init",), 0x80B67010:("EnSth_Destroy",), - 0x80B6703C:("func_80B6703C",), - 0x80B670A4:("func_80B670A4",), - 0x80B67148:("func_80B67148",), - 0x80B671A0:("func_80B671A0",), - 0x80B67208:("func_80B67208",), - 0x80B672A4:("func_80B672A4",), - 0x80B67348:("func_80B67348",), - 0x80B67458:("func_80B67458",), - 0x80B67540:("func_80B67540",), - 0x80B677BC:("func_80B677BC",), - 0x80B67838:("func_80B67838",), - 0x80B678A8:("func_80B678A8",), - 0x80B67958:("func_80B67958",), - 0x80B67984:("func_80B67984",), - 0x80B67AB4:("func_80B67AB4",), - 0x80B67B50:("func_80B67B50",), - 0x80B67C1C:("func_80B67C1C",), - 0x80B67DA0:("func_80B67DA0",), - 0x80B67E20:("func_80B67E20",), - 0x80B67E78:("EnSth_Update",), - 0x80B680A8:("func_80B680A8",), - 0x80B681E8:("func_80B681E8",), - 0x80B68310:("func_80B68310",), - 0x80B6849C:("func_80B6849C",), + 0x80B6703C:("EnSth_CanSpeakToPlayer",), + 0x80B670A4:("EnSth_ChangeAnim",), + 0x80B67148:("EnSth_GetInitialPanicText",), + 0x80B671A0:("EnSth_HandlePanicConversation",), + 0x80B67208:("EnSth_PanicIdle",), + 0x80B672A4:("EnSth_GetInitialOceansideSpiderHouseText",), + 0x80B67348:("EnSth_PostOceanspiderhouseReward",), + 0x80B67458:("EnSth_GiveOceansideSpiderHouseReward",), + 0x80B67540:("EnSth_HandleOceansideSpiderHouseConversation",), + 0x80B677BC:("EnSth_OceansideSpiderHouseIdle",), + 0x80B67838:("EnSth_HandleMoonLookingConversation",), + 0x80B678A8:("EnSth_MoonLookingIdle",), + 0x80B67958:("EnSth_DefaultIdle",), + 0x80B67984:("EnSth_GetInitialSwampSpiderHouseText",), + 0x80B67AB4:("EnSth_TalkAfterSwampSpiderHouseGiveMask",), + 0x80B67B50:("EnSth_SwampSpiderHouseGiveMask",), + 0x80B67C1C:("EnSth_HandleSwampSpiderHouseConversation",), + 0x80B67DA0:("EnSth_SwampSpiderHouseIdle",), + 0x80B67E20:("EnSth_UpdateOceansideSpiderHouseWaitForTokens",), + 0x80B67E78:("EnSth_UpdateWaitForObject",), + 0x80B680A8:("EnSth_Update",), + 0x80B681E8:("EnSth_OverrideLimbDraw",), + 0x80B68310:("EnSth_PostLimbDraw",), + 0x80B6849C:("EnSth_Draw",), 0x80B6D660:("BgSinkaiKabe_Init",), 0x80B6D9EC:("BgSinkaiKabe_Destroy",), 0x80B6DA20:("BgSinkaiKabe_WaitForPlayer",), diff --git a/tools/weekeventregconvert.py b/tools/weekeventregconvert.py index fbefc1b3db..131dda4b82 100755 --- a/tools/weekeventregconvert.py +++ b/tools/weekeventregconvert.py @@ -113,9 +113,9 @@ weekEventReg = { (13 << 8) | 0x04: "WEEKEVENTREG_13_04", (13 << 8) | 0x08: "WEEKEVENTREG_13_08", (13 << 8) | 0x10: "WEEKEVENTREG_13_10", - (13 << 8) | 0x20: "WEEKEVENTREG_13_20", - (13 << 8) | 0x40: "WEEKEVENTREG_13_40", - (13 << 8) | 0x80: "WEEKEVENTREG_13_80", + (13 << 8) | 0x20: "WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_BUYER_MOVED_IN", + (13 << 8) | 0x40: "WEEKEVENTREG_RECEIVED_OCEANSIDE_WALLET_UPGRADE", + (13 << 8) | 0x80: "WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_COLLECTED_REWARD", (14 << 8) | 0x01: "WEEKEVENTREG_14_01", (14 << 8) | 0x02: "WEEKEVENTREG_14_02", (14 << 8) | 0x04: "WEEKEVENTREG_14_04", @@ -279,10 +279,10 @@ weekEventReg = { (34 << 8) | 0x01: "WEEKEVENTREG_34_01", (34 << 8) | 0x02: "WEEKEVENTREG_34_02", (34 << 8) | 0x04: "WEEKEVENTREG_34_04", - (34 << 8) | 0x08: "WEEKEVENTREG_34_08", + (34 << 8) | 0x08: "WEEKEVENTREG_SWAMP_SPIDER_HOUSE_TALKED", (34 << 8) | 0x10: "WEEKEVENTREG_34_10", (34 << 8) | 0x20: "WEEKEVENTREG_34_20", - (34 << 8) | 0x40: "WEEKEVENTREG_34_40", + (34 << 8) | 0x40: "WEEKEVENTREG_RECEIVED_MASK_OF_TRUTH", (34 << 8) | 0x80: "WEEKEVENTREG_34_80", (35 << 8) | 0x01: "WEEKEVENTREG_35_01", (35 << 8) | 0x02: "WEEKEVENTREG_35_02", From e8f906100b73872174004a6ca354ba459a3e9bb4 Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Tue, 7 Mar 2023 21:33:16 -0500 Subject: [PATCH 23/29] NPC Tracking (#1184) * npc tracking * fix func declaration * more cleanup * rm named var * more cleanup --- include/functions.h | 4 +- include/variables.h | 1 - include/z64.h | 13 - include/z64actor.h | 29 ++ src/code/z_actor.c | 361 ++++++++++++------ src/overlays/actors/ovl_En_Ma4/z_en_ma4.c | 32 +- src/overlays/actors/ovl_En_Ma4/z_en_ma4.h | 2 +- .../actors/ovl_En_Ma_Yto/z_en_ma_yto.c | 46 +-- .../actors/ovl_En_Ma_Yto/z_en_ma_yto.h | 2 +- .../actors/ovl_En_Ma_Yts/z_en_ma_yts.c | 30 +- .../actors/ovl_En_Ma_Yts/z_en_ma_yts.h | 2 +- tools/disasm/functions.txt | 10 +- tools/disasm/variables.txt | 2 +- tools/sizes/code_functions.csv | 10 +- 14 files changed, 338 insertions(+), 206 deletions(-) diff --git a/include/functions.h b/include/functions.h index 55b034dbdd..0313b9e233 100644 --- a/include/functions.h +++ b/include/functions.h @@ -752,8 +752,8 @@ void Actor_SetColorFilter(Actor* actor, u16 colorFlag, u16 colorIntensityMax, u1 Hilite* func_800BCBF4(Vec3f* arg0, PlayState* play); Hilite* func_800BCC68(Vec3f* arg0, PlayState* play); void Actor_GetClosestPosOnPath(Vec3s* points, s32 numPoints, Vec3f* srcPos, Vec3f* dstPos, s32 isPathLoop); -s32 func_800BD2B4(PlayState* play, Actor* actor, s16* arg2, f32 arg3, u16 (*textIdCallback)(PlayState*, Actor*), s16 (*arg5)(PlayState*, Actor*)); -void func_800BD888(Actor* actor, struct_800BD888_arg1* arg1, s16 arg2, s16 arg3); +s32 Npc_UpdateTalking(PlayState* play, Actor* actor, s16* talkState, f32 interactRange, NpcGetTextIdFunc getTextId, NpcUpdateTalkStateFunc updateTalkState); +void Npc_TrackPoint(Actor* actor, NpcInteractInfo* interactInfo, s16 presetIndex, s16 trackingMode); void func_800BD9E0(PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s16 alpha); void func_800BDAA0(PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s16 alpha); void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animationInfo, s32 animIndex); diff --git a/include/variables.h b/include/variables.h index a5752eb7f7..b64507bfa4 100644 --- a/include/variables.h +++ b/include/variables.h @@ -417,7 +417,6 @@ extern Color_RGBA8 actorDefaultHitColor; // extern UNK_TYPE4 D_801AEDD4; // extern UNK_TYPE4 D_801AEE28; // extern UNK_TYPE4 D_801AEE30; -// extern UNK_TYPE4 D_801AEE38; // extern UNK_TYPE2 D_801AEE4C; extern Gfx D_801AEF88[]; extern Gfx D_801AEFA0[]; diff --git a/include/z64.h b/include/z64.h index a26da18afb..d35265402a 100644 --- a/include/z64.h +++ b/include/z64.h @@ -839,19 +839,6 @@ typedef struct { /* 0x10 */ Color_RGBA8_u32 envColor; } Struct_80140E80; // size = 0x14 -// From OoT's struct_80034A14_arg1 -typedef struct { - /* 0x00 */ s16 unk_00; - /* 0x02 */ s16 unk_02; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; - /* 0x08 */ Vec3s unk_08; - /* 0x0E */ Vec3s unk_0E; - /* 0x14 */ f32 unk_14; - /* 0x18 */ Vec3f unk_18; // Usually setted to Player's position or Player's focus - /* 0x24 */ s16 unk_24; -} struct_800BD888_arg1; // size = 0x28 - typedef struct { /* 0x0 */ u32 type; /* 0x4 */ u32 setScissor; diff --git a/include/z64actor.h b/include/z64actor.h index d2b28cb385..e61ebd7a70 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -22,6 +22,8 @@ struct EnBox; struct EnTorch2; typedef void(*ActorFunc)(struct Actor* this, struct PlayState* play); +typedef u16 (*NpcGetTextIdFunc)(struct PlayState*, struct Actor*); +typedef s16 (*NpcUpdateTalkStateFunc)(struct PlayState*, struct Actor*); typedef struct { /* 0x00 */ Vec3f pos; @@ -639,4 +641,31 @@ typedef enum { /* 0xFF */ TATL_HINT_ID_NONE = 0xFF } TatlHintId; +typedef enum NpcTalkState { + /* 0 */ NPC_TALK_STATE_IDLE, // NPC not currently talking to player + /* 1 */ NPC_TALK_STATE_TALKING, // NPC is currently talking to player + /* 2 */ NPC_TALK_STATE_ACTION, // An NPC-defined action triggered in the conversation + /* 3 */ NPC_TALK_STATE_ITEM_GIVEN // NPC finished giving an item and text box is done +} NpcTalkState; + +typedef enum NpcTrackingMode { + /* 0 */ NPC_TRACKING_PLAYER_AUTO_TURN, // Determine tracking mode based on player position, see Npc_UpdateAutoTurn + /* 1 */ NPC_TRACKING_NONE, // Don't track the target (usually the player) + /* 2 */ NPC_TRACKING_HEAD_AND_TORSO, // Track target by turning the head and the torso + /* 3 */ NPC_TRACKING_HEAD, // Track target by turning the head + /* 4 */ NPC_TRACKING_FULL_BODY // Track target by turning the body, torso and head +} NpcTrackingMode; + +typedef struct NpcInteractInfo { + /* 0x00 */ s16 talkState; + /* 0x02 */ s16 trackingMode; + /* 0x04 */ s16 autoTurnTimer; + /* 0x06 */ s16 autoTurnState; + /* 0x08 */ Vec3s headRot; + /* 0x0E */ Vec3s torsoRot; + /* 0x14 */ f32 yOffset; // Y position offset to add to actor position when calculating angle to target + /* 0x18 */ Vec3f trackPos; + /* 0x24 */ UNK_TYPE1 unk_24[0x4]; +} NpcInteractInfo; // size = 0x28 + #endif diff --git a/src/code/z_actor.c b/src/code/z_actor.c index f6039a8edf..d00061bf52 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -4015,170 +4015,285 @@ void Actor_GetClosestPosOnPath(Vec3s* points, s32 numPoints, Vec3f* srcPos, Vec3 } } -// unused -s32 func_800BD2B4(PlayState* play, Actor* actor, s16* arg2, f32 arg3, u16 (*textIdCallback)(PlayState*, Actor*), - s16 (*arg5)(PlayState*, Actor*)) { +/** + * Updates NPC talking state. Checks for a talk request and updates + * the talkState parameter when a dialog is ongoing. Otherwise checks if + * the actor is onscreen, advertises the interaction in a range and sets + * the current text id if necessary. + * + * The talk state values are defined in the NpcTalkState enum. + * + * @see NpcTalkState + * + * @param[in,out] talkState Talk state + * @param interactRange The interact (talking) range for the actor + * @param getTextId Callback for getting the next text id + * @param updateTalkState Callback for getting the next talkState value + * @return True if a new dialog was started (player talked to the actor). False otherwise. + */ +s32 Npc_UpdateTalking(PlayState* play, Actor* actor, s16* talkState, f32 interactRange, NpcGetTextIdFunc getTextId, + NpcUpdateTalkStateFunc updateTalkState) { if (Actor_ProcessTalkRequest(actor, &play->state)) { - *arg2 = true; + *talkState = NPC_TALK_STATE_TALKING; return true; - } else if (*arg2) { - *arg2 = arg5(play, actor); - return false; - } else if (!Actor_OnScreen(play, actor)) { - return false; - } else if (!func_800B8614(actor, play, arg3)) { - return false; - } else { - actor->textId = textIdCallback(play, actor); + } + + if (*talkState != NPC_TALK_STATE_IDLE) { + *talkState = updateTalkState(play, actor); return false; } + + if (!Actor_OnScreen(play, actor)) { + return false; + } + + if (!func_800B8614(actor, play, interactRange)) { + return false; + } + + actor->textId = getTextId(play, actor); + + return false; } typedef struct { - /* 0x00 */ s16 unk_00; - /* 0x02 */ s16 unk_02; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; - /* 0x08 */ s16 unk_08; - /* 0x0A */ s16 unk_0A; - /* 0x0C */ u8 unk_0C; -} struct_801AEE38_0; // size = 0x10 + /* 0x0 */ s16 maxHeadYaw; + /* 0x2 */ s16 minHeadPitch; + /* 0x4 */ s16 maxHeadPitch; + /* 0x6 */ s16 maxTorsoYaw; + /* 0x8 */ s16 minTorsoPitch; + /* 0xA */ s16 maxTorsoPitch; + /* 0xC */ u8 rotateYaw; +} NpcTrackingRotLimits; // size = 0x10 typedef struct { - /* 0x00 */ struct_801AEE38_0 sub_00; - /* 0x10 */ f32 unk_10; - /* 0x14 */ s16 unk_14; -} struct_801AEE38; // size = 0x18 + /* 0x00 */ NpcTrackingRotLimits rotLimits; + // Fields specific to NPC_TRACKING_PLAYER_AUTO_TURN mode + /* 0x10 */ f32 autoTurnDistanceRange; // Max distance to player to enable tracking and auto-turn + /* 0x14 */ s16 maxYawForPlayerTracking; // Player is tracked if within this yaw +} NpcTrackingParams; // size = 0x18 -struct_801AEE38 D_801AEE38[] = { - { { 0x1C20, 0xE390, 0x1C70, 0x1554, 0x0000, 0x0000, 0x0000 }, 170.0f, 0x3FFC }, - { { 0x2AA8, 0xEAAC, 0x1554, 0x1554, 0xF8E4, 0x0E38, 0x0001 }, 170.0f, 0x3FFC }, - { { 0x31C4, 0xE390, 0x0E38, 0x0E38, 0xF1C8, 0x071C, 0x0001 }, 170.0f, 0x3FFC }, - { { 0x1554, 0xF1C8, 0x0000, 0x071C, 0xF8E4, 0x0000, 0x0001 }, 170.0f, 0x3FFC }, - { { 0x2AA8, 0xF8E4, 0x071C, 0x0E38, 0xD558, 0x2AA8, 0x0001 }, 170.0f, 0x3FFC }, - { { 0x0000, 0xE390, 0x2AA8, 0x3FFC, 0xF1C8, 0x0E38, 0x0001 }, 170.0f, 0x3FFC }, - { { 0x2AA8, 0xF1C8, 0x0E38, 0x0E38, 0x0000, 0x0000, 0x0001 }, 0.0f, 0x0000 }, - { { 0x2AA8, 0xF1C8, 0x0000, 0x0E38, 0x0000, 0x1C70, 0x0001 }, 0.0f, 0x0000 }, - { { 0x2AA8, 0xF1C8, 0xF1C8, 0x0000, 0x0000, 0x0000, 0x0001 }, 0.0f, 0x0000 }, - { { 0x071C, 0xF1C8, 0x0E38, 0x1C70, 0x0000, 0x0000, 0x0001 }, 0.0f, 0x0000 }, - { { 0x0E38, 0xF1C8, 0x0000, 0x1C70, 0x0000, 0x0E38, 0x0001 }, 0.0f, 0x0000 }, - { { 0x2AA8, 0xE390, 0x1C70, 0x0E38, 0xF1C8, 0x0E38, 0x0001 }, 0.0f, 0x0000 }, - { { 0x18E2, 0xF1C8, 0x0E38, 0x0E38, 0x0000, 0x0000, 0x0001 }, 0.0f, 0x0000 }, - { { 0x2A6C, 0xE390, 0x1C70, 0x1554, 0x0000, 0x0000, 0x0000 }, 170.0f, 0x3FFC }, +/** + * Npc tracking angle limit presets to use with Npc_TrackPoint. + * + * @see Npc_TrackPoint + */ +NpcTrackingParams sNpcTrackingPresets[] = { + { { 0x1C20, 0xE390, 0x1C70, 0x1554, 0x0000, 0x0000, false }, 170.0f, 0x3FFC }, + { { 0x2AA8, 0xEAAC, 0x1554, 0x1554, 0xF8E4, 0x0E38, true }, 170.0f, 0x3FFC }, + { { 0x31C4, 0xE390, 0x0E38, 0x0E38, 0xF1C8, 0x071C, true }, 170.0f, 0x3FFC }, + { { 0x1554, 0xF1C8, 0x0000, 0x071C, 0xF8E4, 0x0000, true }, 170.0f, 0x3FFC }, + { { 0x2AA8, 0xF8E4, 0x071C, 0x0E38, 0xD558, 0x2AA8, true }, 170.0f, 0x3FFC }, + { { 0x0000, 0xE390, 0x2AA8, 0x3FFC, 0xF1C8, 0x0E38, true }, 170.0f, 0x3FFC }, + { { 0x2AA8, 0xF1C8, 0x0E38, 0x0E38, 0x0000, 0x0000, true }, 0.0f, 0x0000 }, + { { 0x2AA8, 0xF1C8, 0x0000, 0x0E38, 0x0000, 0x1C70, true }, 0.0f, 0x0000 }, + { { 0x2AA8, 0xF1C8, 0xF1C8, 0x0000, 0x0000, 0x0000, true }, 0.0f, 0x0000 }, + { { 0x071C, 0xF1C8, 0x0E38, 0x1C70, 0x0000, 0x0000, true }, 0.0f, 0x0000 }, + { { 0x0E38, 0xF1C8, 0x0000, 0x1C70, 0x0000, 0x0E38, true }, 0.0f, 0x0000 }, + { { 0x2AA8, 0xE390, 0x1C70, 0x0E38, 0xF1C8, 0x0E38, true }, 0.0f, 0x0000 }, + { { 0x18E2, 0xF1C8, 0x0E38, 0x0E38, 0x0000, 0x0000, true }, 0.0f, 0x0000 }, + { { 0x2A6C, 0xE390, 0x1C70, 0x1554, 0x0000, 0x0000, false }, 170.0f, 0x3FFC }, }; -void func_800BD384(Actor* actor, struct_800BD888_arg1* arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s16 arg6, s16 arg7, - u8 arg8) { - s16 sp46; - s16 sp44; - s16 temp2; - s16 sp40; - s16 temp1; - Vec3f sp30; +/** + * Smoothly turns the actor's whole body and updates torso and head rotations in + * NpcInteractInfo so that the actor tracks the point specified in NpcInteractInfo.trackPos. + * Rotations are limited to specified angles. + * + * Head and torso rotation angles are determined by calculating the pitch and yaw + * from the actor position to the given target position. + * + * The y position of the actor is offset by NpcInteractInfo.yOffset + * before calculating the angles. It can be used to configure the height difference + * between the actor and the target. + * + * @param maxHeadYaw maximum head yaw difference from neutral position + * @param maxHeadPitch maximum head pitch angle + * @param minHeadPitch minimum head pitch angle + * @param maxTorsoYaw maximum torso yaw difference from neutral position + * @param maxTorsoPitch maximum torso pitch angle + * @param minTorsoPitch minimum torso pitch angle + * @param rotateYaw if true, the actor's yaw (shape.rot.y) is updated to turn the actor's whole body + */ +void Npc_TrackPointWithLimits(Actor* actor, NpcInteractInfo* interactInfo, s16 maxHeadYaw, s16 maxHeadPitch, + s16 minHeadPitch, s16 maxTorsoYaw, s16 maxTorsoPitch, s16 minTorsoPitch, u8 rotateYaw) { + s16 pitchTowardsTarget; + s16 yawTowardsTarget; + s16 torsoPitch; + s16 bodyYawDiff; + s16 temp; + Vec3f offsetActorPos; - sp30.x = actor->world.pos.x; - sp30.y = actor->world.pos.y + arg1->unk_14; - sp30.z = actor->world.pos.z; + offsetActorPos.x = actor->world.pos.x; + offsetActorPos.y = actor->world.pos.y + interactInfo->yOffset; + offsetActorPos.z = actor->world.pos.z; - sp46 = Math_Vec3f_Pitch(&sp30, &arg1->unk_18); - sp44 = Math_Vec3f_Yaw(&sp30, &arg1->unk_18); - sp40 = Math_Vec3f_Yaw(&actor->world.pos, &arg1->unk_18) - actor->shape.rot.y; + pitchTowardsTarget = Math_Vec3f_Pitch(&offsetActorPos, &interactInfo->trackPos); + yawTowardsTarget = Math_Vec3f_Yaw(&offsetActorPos, &interactInfo->trackPos); + bodyYawDiff = Math_Vec3f_Yaw(&actor->world.pos, &interactInfo->trackPos) - actor->shape.rot.y; - temp1 = CLAMP(sp40, -arg2, arg2); - Math_SmoothStepToS(&arg1->unk_08.y, temp1, 6, 2000, 1); + temp = CLAMP(bodyYawDiff, -maxHeadYaw, maxHeadYaw); + Math_SmoothStepToS(&interactInfo->headRot.y, temp, 6, 0x7D0, 1); - temp1 = (ABS_ALT(sp40) >= 0x8000) ? 0 : ABS_ALT(sp40); - arg1->unk_08.y = CLAMP(arg1->unk_08.y, -temp1, temp1); + temp = (ABS_ALT(bodyYawDiff) >= 0x8000) ? 0 : ABS_ALT(bodyYawDiff); + interactInfo->headRot.y = CLAMP(interactInfo->headRot.y, -temp, temp); - sp40 -= arg1->unk_08.y; + bodyYawDiff -= interactInfo->headRot.y; - temp1 = CLAMP(sp40, -arg5, arg5); - Math_SmoothStepToS(&arg1->unk_0E.y, temp1, 6, 2000, 1); + temp = CLAMP(bodyYawDiff, -maxTorsoYaw, maxTorsoYaw); + Math_SmoothStepToS(&interactInfo->torsoRot.y, temp, 6, 0x7D0, 1); - temp1 = (ABS_ALT(sp40) >= 0x8000) ? 0 : ABS_ALT(sp40); - arg1->unk_0E.y = CLAMP(arg1->unk_0E.y, -temp1, temp1); + temp = (ABS_ALT(bodyYawDiff) >= 0x8000) ? 0 : ABS_ALT(bodyYawDiff); + interactInfo->torsoRot.y = CLAMP(interactInfo->torsoRot.y, -temp, temp); - if (arg8) { - Math_SmoothStepToS(&actor->shape.rot.y, sp44, 6, 2000, 1); + if (rotateYaw) { + Math_SmoothStepToS(&actor->shape.rot.y, yawTowardsTarget, 6, 0x7D0, 1); } - temp1 = CLAMP(sp46, arg4, (s16)(u16)arg3); - Math_SmoothStepToS(&arg1->unk_08.x, temp1, 6, 2000, 1); + temp = CLAMP(pitchTowardsTarget, minHeadPitch, (s16)(u16)maxHeadPitch); + Math_SmoothStepToS(&interactInfo->headRot.x, temp, 6, 0x7D0, 1); - temp2 = sp46 - arg1->unk_08.x; + torsoPitch = pitchTowardsTarget - interactInfo->headRot.x; - temp1 = CLAMP(temp2, arg7, arg6); - Math_SmoothStepToS(&arg1->unk_0E.x, temp1, 6, 2000, 1); + temp = CLAMP(torsoPitch, minTorsoPitch, maxTorsoPitch); + Math_SmoothStepToS(&interactInfo->torsoRot.x, temp, 6, 0x7D0, 1); } // unused -s16 func_800BD6B8(s16 arg0) { - return D_801AEE38[arg0].unk_14; +s16 Npc_GetTrackingPresetMaxPlayerYaw(s16 presetIndex) { + return sNpcTrackingPresets[presetIndex].maxYawForPlayerTracking; } -s16 func_800BD6E4(Actor* actor, struct_800BD888_arg1* arg1, f32 arg2, s16 arg3, s16 flag) { +/** + * Handles NPC tracking modes and auto-turning towards the player when + * NPC_TRACKING_PLAYER_AUTO_TURN tracking mode is used. + * + * Returns a tracking mode that will determine which actor limbs + * will be rotated towards the target. + * + * When the player is behind the actor (i.e. not in the yaw range in front of the actor + * defined by maxYawForPlayerTracking), the actor will start an auto-turn sequence: + * - look forward for 30-60 frames + * - turn head to look at the player for 10-20 frames + * - look forward for 30-60 frames + * - turn the entire body to face the player + * + * @param distanceRange Max distance to player that tracking and auto-turning will be active for + * @param maxYawForPlayerTracking Maximum angle for tracking the player. + * @param trackingMode The tracking mode selected by the actor. If this is not + * NPC_TRACKING_PLAYER_AUTO_TURN this function does nothing + * + * @return The tracking mode (NpcTrackingMode) to use for the current frame. + */ +s16 Npc_UpdateAutoTurn(Actor* actor, NpcInteractInfo* interactInfo, f32 distanceRange, s16 maxYawForPlayerTracking, + s16 trackingMode) { s32 pad; + s16 yaw; + s16 yawDiff; - if (flag) { - return flag; - } else if (arg1->unk_00 != 0) { - return 4; - } else if (arg2 < Math_Vec3f_DistXYZ(&actor->world.pos, &arg1->unk_18)) { - arg1->unk_04 = 0; - arg1->unk_06 = 0; - return 1; - } else { - s16 yaw = Math_Vec3f_Yaw(&actor->world.pos, &arg1->unk_18); - s16 phi_a0 = ABS_ALT(BINANG_SUB(yaw, actor->shape.rot.y)); + if (trackingMode != NPC_TRACKING_PLAYER_AUTO_TURN) { + return trackingMode; + } - if (arg3 >= phi_a0) { - arg1->unk_04 = 0; - arg1->unk_06 = 0; - return 2; - } else if (DECR(arg1->unk_04) != 0) { - return arg1->unk_02; - } else { - switch (arg1->unk_06) { - case 0: - case 2: - arg1->unk_04 = Rand_S16Offset(30, 30); - arg1->unk_06++; - return 1; + if (interactInfo->talkState != NPC_TALK_STATE_IDLE) { + // When talking, always fully turn to face the player + return NPC_TRACKING_FULL_BODY; + } - case 1: - arg1->unk_04 = Rand_S16Offset(10, 10); - arg1->unk_06++; - return 3; + if (distanceRange < Math_Vec3f_DistXYZ(&actor->world.pos, &interactInfo->trackPos)) { + // Player is too far away, do not track + interactInfo->autoTurnTimer = 0; + interactInfo->autoTurnState = 0; + return NPC_TRACKING_NONE; + } - default: - return 4; - } - } + yaw = Math_Vec3f_Yaw(&actor->world.pos, &interactInfo->trackPos); + yawDiff = ABS_ALT(BINANG_SUB(yaw, actor->shape.rot.y)); + + if (maxYawForPlayerTracking >= yawDiff) { + // Player is in front of the actor, track with the head and the torso + interactInfo->autoTurnTimer = 0; + interactInfo->autoTurnState = 0; + return NPC_TRACKING_HEAD_AND_TORSO; + } + + // Player is behind the actor, run the auto-turn sequence. + + if (DECR(interactInfo->autoTurnTimer) != 0) { + // While the timer is still running, return the previous tracking mode + return interactInfo->trackingMode; + } + + switch (interactInfo->autoTurnState) { + case 0: + case 2: + // Just stand still, not tracking the player + interactInfo->autoTurnTimer = Rand_S16Offset(30, 30); + interactInfo->autoTurnState++; + return NPC_TRACKING_NONE; + + case 1: + // Glance at the player by only turning the head + interactInfo->autoTurnTimer = Rand_S16Offset(10, 10); + interactInfo->autoTurnState++; + return NPC_TRACKING_HEAD; + + default: + // Auto-turn sequence complete, turn towards the player + return NPC_TRACKING_FULL_BODY; } } -// This function is very similar to OoT's func_80034A14 -void func_800BD888(Actor* actor, struct_800BD888_arg1* arg1, s16 arg2, s16 arg3) { - struct_801AEE38_0 sp38; +/** + * Rotates the actor's whole body, torso and head tracking the point specified in NpcInteractInfo.trackPos. + * Uses angle limits from a preset selected from from sNpcTrackingPresets. + * + * The trackingMode parameter controls whether the head and torso are turned towards the target. + * If not, they are smoothly turned towards zero. Setting the parameter to NPC_TRACKING_FULL_BODY + * causes the actor's whole body to be rotated to face the target. + * + * If NPC_TRACKING_PLAYER_AUTO_TURN is used, the actor will track the player with its head and torso as long + * as the player is in front of the actor (within a yaw angle specified in the option preset). + * If the player is outside of this angle, the actor will turn to face the player after a while. + * + * @see Npc_UpdateAutoTurn + * @see sNpcTrackingPresets + * @see NpcTrackingMode + * + * @param presetIndex The index to a preset in sNpcTrackingPresets + * @param trackingMode A value from NpcTrackingMode enum + */ +void Npc_TrackPoint(Actor* actor, NpcInteractInfo* interactInfo, s16 presetIndex, s16 trackingMode) { + NpcTrackingRotLimits rotLimits; - arg1->unk_02 = func_800BD6E4(actor, arg1, D_801AEE38[arg2].unk_10, D_801AEE38[arg2].unk_14, arg3); - sp38 = D_801AEE38[arg2].sub_00; + interactInfo->trackingMode = + Npc_UpdateAutoTurn(actor, interactInfo, sNpcTrackingPresets[presetIndex].autoTurnDistanceRange, + sNpcTrackingPresets[presetIndex].maxYawForPlayerTracking, trackingMode); - switch (arg1->unk_02) { - case 1: - sp38.unk_00 = 0; - sp38.unk_04 = 0; - sp38.unk_02 = 0; - case 3: - sp38.unk_06 = 0; - sp38.unk_0A = 0; - sp38.unk_08 = 0; - case 2: - sp38.unk_0C = 0; + rotLimits = sNpcTrackingPresets[presetIndex].rotLimits; + + switch (interactInfo->trackingMode) { + case NPC_TRACKING_NONE: + rotLimits.maxHeadYaw = 0; + rotLimits.maxHeadPitch = 0; + rotLimits.minHeadPitch = 0; + // fallthrough + case NPC_TRACKING_HEAD: + rotLimits.maxTorsoYaw = 0; + rotLimits.maxTorsoPitch = 0; + rotLimits.minTorsoPitch = 0; + // fallthrough + case NPC_TRACKING_HEAD_AND_TORSO: + rotLimits.rotateYaw = false; + break; + + default: + break; } - func_800BD384(actor, arg1, sp38.unk_00, sp38.unk_04, sp38.unk_02, sp38.unk_06, sp38.unk_0A, sp38.unk_08, - sp38.unk_0C); + Npc_TrackPointWithLimits(actor, interactInfo, rotLimits.maxHeadYaw, rotLimits.maxHeadPitch, rotLimits.minHeadPitch, + rotLimits.maxTorsoYaw, rotLimits.maxTorsoPitch, rotLimits.minTorsoPitch, + rotLimits.rotateYaw); } Gfx D_801AEF88[] = { 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 802d112629..f189d2e9db 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c @@ -142,19 +142,21 @@ void EnMa4_ChangeAnim(EnMa4* this, s32 animIndex) { void func_80ABDD9C(EnMa4* this, PlayState* play) { Player* player = GET_PLAYER(play); - s16 flag; + s16 trackingMode; - if (this->unk_1D8.unk_00 == 0 && + if ((this->interactInfo.talkState == NPC_TALK_STATE_IDLE) && ((this->skelAnime.animation == &gRomaniRunAnim) || (this->skelAnime.animation == &gRomaniLookAroundAnim) || (this->skelAnime.animation == &gRomaniShootBowAnim))) { - flag = 1; + trackingMode = NPC_TRACKING_NONE; } else { - flag = (this->type == MA4_TYPE_ALIENS_WON && this->actionFunc != EnMa4_DialogueHandler) ? 1 : 0; + trackingMode = ((this->type == MA4_TYPE_ALIENS_WON) && (this->actionFunc != EnMa4_DialogueHandler)) + ? NPC_TRACKING_NONE + : NPC_TRACKING_PLAYER_AUTO_TURN; } - this->unk_1D8.unk_18 = player->actor.world.pos; - this->unk_1D8.unk_18.y -= -10.0f; - func_800BD888(&this->actor, &this->unk_1D8, 0, flag); + this->interactInfo.trackPos = player->actor.world.pos; + this->interactInfo.trackPos.y -= -10.0f; + Npc_TrackPoint(&this->actor, &this->interactInfo, 0, trackingMode); } void EnMa4_InitPath(EnMa4* this, PlayState* play) { @@ -192,7 +194,7 @@ void EnMa4_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); this->actor.targetMode = 0; - this->unk_1D8.unk_00 = 0; + this->interactInfo.talkState = NPC_TALK_STATE_IDLE; this->unk_334 = 0; this->hasBow = true; this->mouthTexIndex = 0; @@ -1027,17 +1029,17 @@ void EnMa4_Update(Actor* thisx, PlayState* play) { s32 EnMa4_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { EnMa4* this = THIS; - Vec3s sp4; + Vec3s limbRot; if (limbIndex == ROMANI_LIMB_HEAD) { - sp4 = this->unk_1D8.unk_08; - rot->x = rot->x + sp4.y; - rot->z = rot->z + sp4.x; + limbRot = this->interactInfo.headRot; + rot->x += limbRot.y; + rot->z += limbRot.x; } if (limbIndex == ROMANI_LIMB_TORSO) { - sp4 = this->unk_1D8.unk_0E; - rot->x = rot->x - sp4.y; - rot->z = rot->z - sp4.x; + limbRot = this->interactInfo.torsoRot; + rot->x -= limbRot.y; + rot->z -= limbRot.x; } return false; 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 3ac405b009..91876c9386 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.h +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.h @@ -13,7 +13,7 @@ typedef struct EnMa4 { /* 0x144 */ SkelAnime skelAnime; /* 0x188 */ EnMa4ActionFunc actionFunc; /* 0x18C */ ColliderCylinder collider; - /* 0x1D8 */ struct_800BD888_arg1 unk_1D8; + /* 0x1D8 */ NpcInteractInfo interactInfo; /* 0x200 */ Vec3s* pathPoints; /* 0x204 */ Vec3s jointTable[ROMANI_LIMB_MAX]; /* 0x28E */ UNK_TYPE1 unk28E[0x6]; 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 fb10d93111..d60f8fb3d0 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 @@ -1268,29 +1268,29 @@ void EnMaYto_ChangeAnim(EnMaYto* this, s32 animIndex) { void func_80B90C78(EnMaYto* this, PlayState* play) { Player* player = GET_PLAYER(play); - s16 flag; + s16 trackingMode; SkelAnime_Update(&this->skelAnime); - flag = this->unk31E == 2 ? true : false; + trackingMode = (this->unk31E == 2) ? NPC_TRACKING_NONE : NPC_TRACKING_PLAYER_AUTO_TURN; if (this->unk31E == 0) { - this->unk_1D8.unk_18 = player->actor.world.pos; - this->unk_1D8.unk_14 = 0.0f; + this->interactInfo.trackPos = player->actor.world.pos; + this->interactInfo.yOffset = 0.0f; } else if (this->unk31E == 1) { - Math_Vec3f_StepTo(&this->unk_1D8.unk_18, &this->actor.child->world.pos, 8.0f); - this->unk_1D8.unk_14 = 0.0f; + Math_Vec3f_StepTo(&this->interactInfo.trackPos, &this->actor.child->world.pos, 8.0f); + this->interactInfo.yOffset = 0.0f; } if (this->unk320 == 0) { if (this->actionFunc == EnMaYto_WarmFuzzyFeelingCs) { - this->unk_1D8.unk_08.y = 0; - this->unk_1D8.unk_08.x = 0; + this->interactInfo.headRot.y = 0; + this->interactInfo.headRot.x = 0; } else { - func_800BD888(&this->actor, &this->unk_1D8, 0xD, flag); + Npc_TrackPoint(&this->actor, &this->interactInfo, 13, trackingMode); } } else { - Math_SmoothStepToS(&this->unk_1D8.unk_08.y, 0, 3, 0x71C, 0xB6); - Math_SmoothStepToS(&this->unk_1D8.unk_08.x, 0x18E3, 5, 0x71C, 0xB6); + Math_SmoothStepToS(&this->interactInfo.headRot.y, 0, 3, 0x71C, 0xB6); + Math_SmoothStepToS(&this->interactInfo.headRot.x, 0x18E3, 5, 0x71C, 0xB6); } EnMaYto_UpdateEyes(this); @@ -1423,26 +1423,26 @@ void EnMaYto_Update(Actor* thisx, PlayState* play) { s32 EnMaYto_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { EnMaYto* this = THIS; - Vec3s sp4; + Vec3s limbRot; if (limbIndex == CREMIA_LIMB_HEAD) { - sp4 = this->unk_1D8.unk_08; + limbRot = this->interactInfo.headRot; - rot->x += sp4.y; - rot->z += sp4.x; + rot->x += limbRot.y; + rot->z += limbRot.x; } else if (limbIndex == CREMIA_LIMB_TORSO) { - if (this->skelAnime.animation != &gCremiaSittingPetCowAnim && - this->skelAnime.animation != &gCremiaSittingLookDownAnim) { - sp4 = this->unk_1D8.unk_0E; + if ((this->skelAnime.animation != &gCremiaSittingPetCowAnim) && + (this->skelAnime.animation != &gCremiaSittingLookDownAnim)) { + limbRot = this->interactInfo.torsoRot; - rot->x += sp4.y; - if (this->skelAnime.animation == &gCremiaIdleAnim || this->skelAnime.animation == &gCremiaSittingAnim || - this->skelAnime.animation == &gCremiaSittingLookDownAnim) { - rot->z += sp4.x; + rot->x += limbRot.y; + if ((this->skelAnime.animation == &gCremiaIdleAnim) || (this->skelAnime.animation == &gCremiaSittingAnim) || + (this->skelAnime.animation == &gCremiaSittingLookDownAnim)) { + rot->z += limbRot.x; } } } - return 0; + return false; } void EnMaYto_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { 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 0955cd8e8b..208e412704 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 @@ -13,7 +13,7 @@ typedef struct EnMaYto { /* 0x144 */ SkelAnime skelAnime; /* 0x188 */ EnMaYtoActionFunc actionFunc; /* 0x18C */ ColliderCylinder collider; - /* 0x1D8 */ struct_800BD888_arg1 unk_1D8; + /* 0x1D8 */ NpcInteractInfo interactInfo; /* 0x200 */ s32 unk200; // unused /* 0x204 */ s32 type; /* 0x208 */ Vec3s jointTable[CREMIA_LIMB_MAX]; 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 64a6d138cb..b52378a5a2 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 @@ -121,17 +121,17 @@ void EnMaYts_ChangeAnim(EnMaYts* this, s32 animIndex) { void func_80B8D12C(EnMaYts* this, PlayState* play) { Player* player = GET_PLAYER(play); - s16 flag = this->unk_32C == 2 ? true : false; + s16 trackingMode = (this->unk_32C == 2) ? NPC_TRACKING_NONE : NPC_TRACKING_PLAYER_AUTO_TURN; if (this->unk_32C == 0 || this->actor.parent == NULL) { - this->unk_1D8.unk_18 = player->actor.world.pos; - this->unk_1D8.unk_18.y -= -10.0f; + this->interactInfo.trackPos = player->actor.world.pos; + this->interactInfo.trackPos.y -= -10.0f; } else { - Math_Vec3f_StepTo(&this->unk_1D8.unk_18, &this->actor.parent->world.pos, 8.0f); - this->unk_1D8.unk_18.y -= -10.0f; + Math_Vec3f_StepTo(&this->interactInfo.trackPos, &this->actor.parent->world.pos, 8.0f); + this->interactInfo.trackPos.y -= -10.0f; } - func_800BD888(&this->actor, &this->unk_1D8, 0, flag); + Npc_TrackPoint(&this->actor, &this->interactInfo, 0, trackingMode); } void EnMaYts_InitAnimation(EnMaYts* this, PlayState* play) { @@ -238,7 +238,7 @@ void EnMaYts_Init(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 0x4); Actor_SetScale(&this->actor, 0.01f); - this->unk_1D8.unk_00 = 0; + this->interactInfo.talkState = NPC_TALK_STATE_IDLE; this->unk_200 = 0; this->blinkTimer = 0; @@ -248,7 +248,7 @@ void EnMaYts_Init(Actor* thisx, PlayState* play) { this->hasBow = false; } - if (CURRENT_DAY == 1 || CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { + if ((CURRENT_DAY == 1) || CHECK_WEEKEVENTREG(WEEKEVENTREG_22_01)) { this->overrideEyeTexIndex = 0; this->eyeTexIndex = 0; this->mouthTexIndex = 0; @@ -501,18 +501,18 @@ void EnMaYts_Update(Actor* thisx, PlayState* play) { s32 EnMaYts_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { EnMaYts* this = THIS; - Vec3s sp4; + Vec3s limbRot; if (limbIndex == ROMANI_LIMB_HEAD) { - sp4 = this->unk_1D8.unk_08; - rot->x += sp4.y; + limbRot = this->interactInfo.headRot; + rot->x += limbRot.y; if ((this->skelAnime.animation == &gRomaniIdleAnim) || (this->skelAnime.animation == &gRomaniSittingAnim)) { - rot->z += sp4.x; + rot->z += limbRot.x; } } else if (limbIndex == ROMANI_LIMB_TORSO) { - sp4 = this->unk_1D8.unk_0E; - rot->x += sp4.y; - rot->z += sp4.x; + limbRot = this->interactInfo.torsoRot; + rot->x += limbRot.y; + rot->z += limbRot.x; } return false; 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 eb700d8c28..65e7a0eb62 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 @@ -13,7 +13,7 @@ typedef struct EnMaYts { /* 0x144 */ SkelAnime skelAnime; /* 0x188 */ EnMaYtsActionFunc actionFunc; /* 0x18C */ ColliderCylinder collider; - /* 0x1D8 */ struct_800BD888_arg1 unk_1D8; + /* 0x1D8 */ NpcInteractInfo interactInfo; /* 0x200 */ s32 unk_200; // Set, but not used /* 0x204 */ Vec3s jointTable[ROMANI_LIMB_MAX]; /* 0x28E */ UNK_TYPE1 unk_28E[0x6]; diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 0cada88236..c488127f6a 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -868,11 +868,11 @@ 0x800BCBF4:("func_800BCBF4",), 0x800BCC68:("func_800BCC68",), 0x800BCCDC:("Actor_GetClosestPosOnPath",), - 0x800BD2B4:("func_800BD2B4",), - 0x800BD384:("func_800BD384",), - 0x800BD6B8:("func_800BD6B8",), - 0x800BD6E4:("func_800BD6E4",), - 0x800BD888:("func_800BD888",), + 0x800BD2B4:("Npc_UpdateTalking",), + 0x800BD384:("Npc_TrackPointWithLimits",), + 0x800BD6B8:("Npc_GetTrackingPresetMaxPlayerYaw",), + 0x800BD6E4:("Npc_UpdateAutoTurn",), + 0x800BD888:("Npc_TrackPoint",), 0x800BD9A0:("func_800BD9A0",), 0x800BD9E0:("func_800BD9E0",), 0x800BDAA0:("func_800BDAA0",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 420606edbd..cf91938631 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -442,7 +442,7 @@ 0x801AEDD4:("D_801AEDD4","UNK_TYPE4","",0x4), 0x801AEE28:("D_801AEE28","UNK_TYPE4","",0x4), 0x801AEE30:("D_801AEE30","UNK_TYPE4","",0x4), - 0x801AEE38:("D_801AEE38","struct_801AEE38","[14]",0x150), + 0x801AEE38:("sNpcTrackingPresets","NpcTrackingParams","[14]",0x150), 0x801AEF88:("D_801AEF88","UNK_TYPE1","",0x1), 0x801AEFA0:("D_801AEFA0","UNK_TYPE1","",0x1), 0x801AEFA8:("sElectricSparkTextures","UNK_TYPE1","",0x1), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 4cafa01156..d7332f855e 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -382,11 +382,11 @@ asm/non_matchings/code/z_actor/Actor_SetColorFilter.s,Actor_SetColorFilter,0x800 asm/non_matchings/code/z_actor/func_800BCBF4.s,func_800BCBF4,0x800BCBF4,0x1D asm/non_matchings/code/z_actor/func_800BCC68.s,func_800BCC68,0x800BCC68,0x1D asm/non_matchings/code/z_actor/Actor_GetClosestPosOnPath.s,Actor_GetClosestPosOnPath,0x800BCCDC,0x176 -asm/non_matchings/code/z_actor/func_800BD2B4.s,func_800BD2B4,0x800BD2B4,0x34 -asm/non_matchings/code/z_actor/func_800BD384.s,func_800BD384,0x800BD384,0xCD -asm/non_matchings/code/z_actor/func_800BD6B8.s,func_800BD6B8,0x800BD6B8,0xB -asm/non_matchings/code/z_actor/func_800BD6E4.s,func_800BD6E4,0x800BD6E4,0x69 -asm/non_matchings/code/z_actor/func_800BD888.s,func_800BD888,0x800BD888,0x46 +asm/non_matchings/code/z_actor/Npc_UpdateTalking.s,Npc_UpdateTalking,0x800BD2B4,0x34 +asm/non_matchings/code/z_actor/Npc_TrackPointWithLimits.s,Npc_TrackPointWithLimits,0x800BD384,0xCD +asm/non_matchings/code/z_actor/Npc_GetTrackingPresetMaxPlayerYaw.s,Npc_GetTrackingPresetMaxPlayerYaw,0x800BD6B8,0xB +asm/non_matchings/code/z_actor/Npc_UpdateAutoTurn.s,Npc_UpdateAutoTurn,0x800BD6E4,0x69 +asm/non_matchings/code/z_actor/Npc_TrackPoint.s,Npc_TrackPoint,0x800BD888,0x46 asm/non_matchings/code/z_actor/func_800BD9A0.s,func_800BD9A0,0x800BD9A0,0x10 asm/non_matchings/code/z_actor/func_800BD9E0.s,func_800BD9E0,0x800BD9E0,0x30 asm/non_matchings/code/z_actor/func_800BDAA0.s,func_800BDAA0,0x800BDAA0,0x33 From 9b33e6a3a55cbb3cb423c3b89ed4a712e34c0c4f Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Tue, 7 Mar 2023 22:14:43 -0500 Subject: [PATCH 24/29] rename audio files (#1188) --- Makefile | 4 +- spec | 48 +++++------ src/{code => }/audio/code_8019AF00.c | 0 src/{code/audio => audio/lib}/aisetnextbuf.c | 0 .../audio/audio_data.c => audio/lib/data.c} | 0 .../audio_dcache.c => audio/lib/dcache.c} | 0 .../audio_effects.c => audio/lib/effects.c} | 0 .../audio/audio_heap.c => audio/lib/heap.c} | 0 .../audio/audio_load.c => audio/lib/load.c} | 0 .../audio_playback.c => audio/lib/playback.c} | 0 .../lib/seqplayer.c} | 0 .../lib/synthesis.c} | 0 .../audio_thread.c => audio/lib/thread.c} | 0 src/audio/sequence.c | 31 +++++++ .../session_config.c} | 0 .../audio/code_801A5BD0.c => audio/sfx.c} | 0 .../audio_sfx_params.c => audio/sfx_params.c} | 0 src/audio/voice_external.c | 17 ++++ src/audio/voice_internal.c | 42 +++++++++ src/code/audio/code_801A4EB0.c | 17 ---- src/code/audio/code_801A51F0.c | 42 --------- src/code/audio/code_801A7B10.c | 31 ------- .../{code_80172BC0.c => audio_stop_all_sfx.c} | 0 .../{audioMgr.c => audio_thread_manager.c} | 0 tools/disasm/files.txt | 34 ++++---- tools/sizes/code_functions.csv | 86 +++++++++---------- 26 files changed, 176 insertions(+), 176 deletions(-) rename src/{code => }/audio/code_8019AF00.c (100%) rename src/{code/audio => audio/lib}/aisetnextbuf.c (100%) rename src/{code/audio/audio_data.c => audio/lib/data.c} (100%) rename src/{code/audio/audio_dcache.c => audio/lib/dcache.c} (100%) rename src/{code/audio/audio_effects.c => audio/lib/effects.c} (100%) rename src/{code/audio/audio_heap.c => audio/lib/heap.c} (100%) rename src/{code/audio/audio_load.c => audio/lib/load.c} (100%) rename src/{code/audio/audio_playback.c => audio/lib/playback.c} (100%) rename src/{code/audio/audio_seqplayer.c => audio/lib/seqplayer.c} (100%) rename src/{code/audio/audio_synthesis.c => audio/lib/synthesis.c} (100%) rename src/{code/audio/audio_thread.c => audio/lib/thread.c} (100%) create mode 100644 src/audio/sequence.c rename src/{code/audio/audio_init_params.c => audio/session_config.c} (100%) rename src/{code/audio/code_801A5BD0.c => audio/sfx.c} (100%) rename src/{code/audio/audio_sfx_params.c => audio/sfx_params.c} (100%) create mode 100644 src/audio/voice_external.c create mode 100644 src/audio/voice_internal.c delete mode 100644 src/code/audio/code_801A4EB0.c delete mode 100644 src/code/audio/code_801A51F0.c delete mode 100644 src/code/audio/code_801A7B10.c rename src/code/{code_80172BC0.c => audio_stop_all_sfx.c} (100%) rename src/code/{audioMgr.c => audio_thread_manager.c} (100%) diff --git a/Makefile b/Makefile index 75ad3a54c4..3a488dc84d 100644 --- a/Makefile +++ b/Makefile @@ -210,7 +210,7 @@ build/src/libultra/rmon/%.o: OPTFLAGS := -O2 build/src/libultra/flash/%.o: OPTFLAGS := -g build/src/libultra/flash/%.o: MIPS_VERSION := -mips1 -build/src/code/audio/%.o: OPTFLAGS := -O2 +build/src/audio/%.o: OPTFLAGS := -O2 build/assets/%.o: OPTFLAGS := -O1 build/assets/%.o: ASM_PROC_FLAGS := @@ -238,7 +238,7 @@ build/src/libultra/%.o: CC := $(CC_OLD) build/src/libultra/voice/%.o: CC := $(ASM_PROC) $(ASM_PROC_FLAGS) $(CC_OLD) -- $(AS) $(ASFLAGS) -- build/src/code/%.o: CC := $(ASM_PROC) $(ASM_PROC_FLAGS) $(CC) -- $(AS) $(ASFLAGS) -- -build/src/code/audio/%.o: CC := $(ASM_PROC) $(ASM_PROC_FLAGS) $(CC) -- $(AS) $(ASFLAGS) -- +build/src/audio/%.o: CC := $(ASM_PROC) $(ASM_PROC_FLAGS) $(CC) -- $(AS) $(ASFLAGS) -- build/src/overlays/%.o: CC := $(ASM_PROC) $(ASM_PROC_FLAGS) $(CC) -- $(AS) $(ASFLAGS) -- diff --git a/spec b/spec index e68cab673d..17a411dc45 100644 --- a/spec +++ b/spec @@ -558,8 +558,8 @@ beginseg include "build/data/code/PreRender.bss.o" include "build/src/code/TwoHeadGfxArena.o" include "build/src/code/TwoHeadArena.o" - include "build/src/code/code_80172BC0.o" - include "build/src/code/audioMgr.o" + include "build/src/code/audio_stop_all_sfx.o" + include "build/src/code/audio_thread_manager.o" include "build/src/code/title_setup.o" include "build/src/code/game.o" include "build/data/code/game.bss.o" @@ -600,34 +600,34 @@ beginseg pad_text pad_text pad_text - include "build/src/code/audio/audio_data.o" - include "build/src/code/audio/audio_synthesis.o" - include "build/src/code/audio/audio_heap.o" + include "build/src/audio/lib/data.o" + include "build/src/audio/lib/synthesis.o" + include "build/src/audio/lib/heap.o" include "build/data/code/audio_heap.bss.o" - include "build/src/code/audio/audio_load.o" - include "build/src/code/audio/audio_thread.o" - include "build/src/code/audio/audio_dcache.o" - include "build/src/code/audio/aisetnextbuf.o" - include "build/src/code/audio/audio_playback.o" - include "build/src/code/audio/audio_effects.o" - include "build/src/code/audio/audio_seqplayer.o" + include "build/src/audio/lib/load.o" + include "build/src/audio/lib/thread.o" + include "build/src/audio/lib/dcache.o" + include "build/src/audio/lib/aisetnextbuf.o" + include "build/src/audio/lib/playback.o" + include "build/src/audio/lib/effects.o" + include "build/src/audio/lib/seqplayer.o" include "build/data/code/audio_dramStack.data.o" include "build/asm/code/code_8019AE40.text.o" // handwritten pad_text include "build/asm/code/code_8019AEC0.text.o" // handwritten - include "build/src/code/audio/code_8019AF00.o" - include "build/src/code/audio/code_801A4EB0.o" - include "build/data/code/code_801A4EB0.data.o" - include "build/src/code/audio/code_801A51F0.o" - include "build/data/code/code_801A51F0.data.o" - include "build/data/code/code_801A51F0.bss.o" + include "build/src/audio/code_8019AF00.o" + include "build/src/audio/voice_external.o" + include "build/data/code/voice_external.data.o" + include "build/src/audio/voice_internal.o" + include "build/data/code/voice_internal.data.o" + include "build/data/code/voice_internal.bss.o" pad_text - include "build/src/code/audio/audio_sfx_params.o" - include "build/src/code/audio/code_801A5BD0.o" - include "build/src/code/audio/code_801A7B10.o" - include "build/data/code/code_801A7B10.data.o" - include "build/data/code/code_801A7B10.bss.o" - include "build/src/code/audio/audio_init_params.o" + include "build/src/audio/sfx_params.o" + include "build/src/audio/sfx.o" + include "build/src/audio/sequence.o" + include "build/data/code/sequence.data.o" + include "build/data/code/sequence.bss.o" + include "build/src/audio/session_config.o" include "build/src/code/jpegutils.o" include "build/src/code/jpegdecoder.o" include_data_with_rodata "build/src/code/z_game_over.o" diff --git a/src/code/audio/code_8019AF00.c b/src/audio/code_8019AF00.c similarity index 100% rename from src/code/audio/code_8019AF00.c rename to src/audio/code_8019AF00.c diff --git a/src/code/audio/aisetnextbuf.c b/src/audio/lib/aisetnextbuf.c similarity index 100% rename from src/code/audio/aisetnextbuf.c rename to src/audio/lib/aisetnextbuf.c diff --git a/src/code/audio/audio_data.c b/src/audio/lib/data.c similarity index 100% rename from src/code/audio/audio_data.c rename to src/audio/lib/data.c diff --git a/src/code/audio/audio_dcache.c b/src/audio/lib/dcache.c similarity index 100% rename from src/code/audio/audio_dcache.c rename to src/audio/lib/dcache.c diff --git a/src/code/audio/audio_effects.c b/src/audio/lib/effects.c similarity index 100% rename from src/code/audio/audio_effects.c rename to src/audio/lib/effects.c diff --git a/src/code/audio/audio_heap.c b/src/audio/lib/heap.c similarity index 100% rename from src/code/audio/audio_heap.c rename to src/audio/lib/heap.c diff --git a/src/code/audio/audio_load.c b/src/audio/lib/load.c similarity index 100% rename from src/code/audio/audio_load.c rename to src/audio/lib/load.c diff --git a/src/code/audio/audio_playback.c b/src/audio/lib/playback.c similarity index 100% rename from src/code/audio/audio_playback.c rename to src/audio/lib/playback.c diff --git a/src/code/audio/audio_seqplayer.c b/src/audio/lib/seqplayer.c similarity index 100% rename from src/code/audio/audio_seqplayer.c rename to src/audio/lib/seqplayer.c diff --git a/src/code/audio/audio_synthesis.c b/src/audio/lib/synthesis.c similarity index 100% rename from src/code/audio/audio_synthesis.c rename to src/audio/lib/synthesis.c diff --git a/src/code/audio/audio_thread.c b/src/audio/lib/thread.c similarity index 100% rename from src/code/audio/audio_thread.c rename to src/audio/lib/thread.c diff --git a/src/audio/sequence.c b/src/audio/sequence.c new file mode 100644 index 0000000000..613f1ef1d2 --- /dev/null +++ b/src/audio/sequence.c @@ -0,0 +1,31 @@ +#include "global.h" + +#pragma GLOBAL_ASM("asm/non_matchings/code/sequence/Audio_StartSequence.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/sequence/Audio_StopSequence.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/sequence/func_801A7D84.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/sequence/Audio_QueueSeqCmd.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/sequence/func_801A89D0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/sequence/Audio_GetActiveSequence.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/sequence/func_801A8ABC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/sequence/func_801A8B14.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/sequence/func_801A8B2C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/sequence/Audio_SetVolumeScale.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/sequence/func_801A8D5C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/sequence/func_801A9768.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/sequence/func_801A982C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/sequence/func_801A99B8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/sequence/func_801A9A74.s") diff --git a/src/code/audio/audio_init_params.c b/src/audio/session_config.c similarity index 100% rename from src/code/audio/audio_init_params.c rename to src/audio/session_config.c diff --git a/src/code/audio/code_801A5BD0.c b/src/audio/sfx.c similarity index 100% rename from src/code/audio/code_801A5BD0.c rename to src/audio/sfx.c diff --git a/src/code/audio/audio_sfx_params.c b/src/audio/sfx_params.c similarity index 100% rename from src/code/audio/audio_sfx_params.c rename to src/audio/sfx_params.c diff --git a/src/audio/voice_external.c b/src/audio/voice_external.c new file mode 100644 index 0000000000..eba2069d8f --- /dev/null +++ b/src/audio/voice_external.c @@ -0,0 +1,17 @@ +#include "global.h" + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_external/func_801A4EB0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_external/func_801A4EB8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_external/func_801A4FD8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_external/func_801A5080.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_external/func_801A50C0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_external/func_801A5100.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_external/func_801A510C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_external/func_801A5118.s") diff --git a/src/audio/voice_internal.c b/src/audio/voice_internal.c new file mode 100644 index 0000000000..e09fdd68ca --- /dev/null +++ b/src/audio/voice_internal.c @@ -0,0 +1,42 @@ +#include "global.h" + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/D_801E0EC0.s") + +UNK_TYPE func_801A51F0(UNK_TYPE arg0) { + switch (arg0) { + case 1: + case 4: + case 5: + case 11: + case 13: + case 14: + case 15: + return -1; + default: + return 0; + } +} + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A5228.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A5390.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A53DC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A53E8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A541C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A5488.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A54C4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A54D0.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A5680.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A5808.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A5A10.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A5A1C.s") diff --git a/src/code/audio/code_801A4EB0.c b/src/code/audio/code_801A4EB0.c deleted file mode 100644 index d3461c8f5e..0000000000 --- a/src/code/audio/code_801A4EB0.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "global.h" - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A4EB0/func_801A4EB0.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A4EB0/func_801A4EB8.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A4EB0/func_801A4FD8.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A4EB0/func_801A5080.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A4EB0/func_801A50C0.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A4EB0/func_801A5100.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A4EB0/func_801A510C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A4EB0/func_801A5118.s") diff --git a/src/code/audio/code_801A51F0.c b/src/code/audio/code_801A51F0.c deleted file mode 100644 index 6a40bf23a1..0000000000 --- a/src/code/audio/code_801A51F0.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "global.h" - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A51F0/D_801E0EC0.s") - -UNK_TYPE func_801A51F0(UNK_TYPE arg0) { - switch (arg0) { - case 1: - case 4: - case 5: - case 11: - case 13: - case 14: - case 15: - return -1; - default: - return 0; - } -} - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A51F0/func_801A5228.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A51F0/func_801A5390.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A51F0/func_801A53DC.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A51F0/func_801A53E8.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A51F0/func_801A541C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A51F0/func_801A5488.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A51F0/func_801A54C4.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A51F0/func_801A54D0.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A51F0/func_801A5680.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A51F0/func_801A5808.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A51F0/func_801A5A10.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A51F0/func_801A5A1C.s") diff --git a/src/code/audio/code_801A7B10.c b/src/code/audio/code_801A7B10.c deleted file mode 100644 index 3f84460362..0000000000 --- a/src/code/audio/code_801A7B10.c +++ /dev/null @@ -1,31 +0,0 @@ -#include "global.h" - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/Audio_StartSequence.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/Audio_StopSequence.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A7D84.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/Audio_QueueSeqCmd.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A89D0.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/Audio_GetActiveSequence.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A8ABC.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A8B14.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A8B2C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/Audio_SetVolumeScale.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A8D5C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A9768.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A982C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A99B8.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A9A74.s") diff --git a/src/code/code_80172BC0.c b/src/code/audio_stop_all_sfx.c similarity index 100% rename from src/code/code_80172BC0.c rename to src/code/audio_stop_all_sfx.c diff --git a/src/code/audioMgr.c b/src/code/audio_thread_manager.c similarity index 100% rename from src/code/audioMgr.c rename to src/code/audio_thread_manager.c diff --git a/tools/disasm/files.txt b/tools/disasm/files.txt index 0b15fa8345..81701e1400 100644 --- a/tools/disasm/files.txt +++ b/tools/disasm/files.txt @@ -453,8 +453,8 @@ 0x8016FCF0 : "PreRender", 0x801727F0 : "TwoHeadGfxArena", 0x80172A00 : "TwoHeadArena", - 0x80172BC0 : "code_80172BC0", - 0x80172C30 : "audioMgr", + 0x80172BC0 : "audio_stop_all_sfx", + 0x80172C30 : "audio_thread_manager", 0x80173130 : "title_setup", 0x80173360 : "game", 0x80173BF0 : "gamealloc", @@ -495,11 +495,11 @@ 0x8019AEB0 : "[PADDING]", 0x8019AEC0 : "code_8019AEC0", 0x8019AF00 : "code_8019AF00", - 0x801A4EB0 : "code_801A4EB0", - 0x801A51F0 : "code_801A51F0", + 0x801A4EB0 : "voice_external", + 0x801A51F0 : "voice_internal", 0x801A5BC0 : "[PADDING]", 0x801A5BD0 : "code_801A5BD0", - 0x801A7B10 : "code_801A7B10", + 0x801A7B10 : "sequence", 0x801A9B10 : "jpegutils", 0x801AA020 : "jpegdecoder", 0x801AA610 : "z_game_over", @@ -574,7 +574,7 @@ 0x801D0D00 : "z_fbdemo_circle", 0x801D0D50 : "z_play", 0x801D0D80 : "z_play_hireso", - 0x801D14F0 : "audioMgr", + 0x801D14F0 : "audio_thread_manager", 0x801D1500 : "game", 0x801D1510 : "graph", 0x801D1520 : "main", @@ -596,12 +596,12 @@ 0x801D61A0 : "audio_seqplayer", 0x801D6200 : "audio_dramStack", 0x801D6600 : "code_8019AF00", - 0x801D8BE0 : "code_801A4EB0", - 0x801D8E50 : "code_801A51F0", + 0x801D8BE0 : "voice_external", + 0x801D8E50 : "voice_internal", 0x801D9090 : "audio_sound_params", 0x801DB470 : "code_801A5BD0", - 0x801DB4C0 : "code_801A7B10", - 0x801DB4E0 : "audio_init_params", + 0x801DB4C0 : "sequence", + 0x801DB4E0 : "session_config", # .rodata section 0x801DBDF0 : "z_en_item00", @@ -658,8 +658,8 @@ 0x801DFA00 : "z_play", 0x801DFC50 : "z_play_hireso", 0x801DFC60 : "PreRender", - 0x801DFC70 : "code_80172BC0", - 0x801DFC80 : "audioMgr", + 0x801DFC70 : "audio_stop_all_sfx", + 0x801DFC80 : "audio_thread_manager", 0x801DFCC0 : "game", 0x801DFCE0 : "graph", 0x801DFD70 : "main", @@ -679,10 +679,10 @@ 0x801E0510 : "audio_effects", 0x801E0540 : "audio_seqplayer", 0x801E0BD0 : "code_8019AF00", - 0x801E0EC0 : "code_801A51F0", + 0x801E0EC0 : "voice_internal", 0x801E1050 : "code_801A5BD0", - 0x801E1070 : "code_801A7B10", - 0x801E1100 : "audio_init_params", + 0x801E1070 : "sequence", + 0x801E1100 : "session_config", 0x801E1110 : "z_game_over", 0x801E1180 : "audio_tables", 0x801E1E80 : "aspMain", @@ -742,9 +742,9 @@ 0x801FD120 : "audio_heap", 0x801FD140 : "audio_load", 0x801FD1F0 : "code_8019AF00", - 0x801FD5A0 : "code_801A51F0", + 0x801FD5A0 : "voice_internal", 0x801FD710 : "code_801A5BD0", - 0x801FFD00 : "code_801A7B10", + 0x801FFD00 : "sequence", 0x80208E90 : "jpegdecoder", 0x80208EA0 : "gfxbuffers", 0x8024A4C0 : "buffers", diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index d7332f855e..f29fa708cb 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -2623,13 +2623,13 @@ asm/non_matchings/code/TwoHeadArena/THA_IsCrash.s,THA_IsCrash,0x80172B18,0x9 asm/non_matchings/code/TwoHeadArena/THA_Init.s,THA_Init,0x80172B3C,0x7 asm/non_matchings/code/TwoHeadArena/THA_Ct.s,THA_Ct,0x80172B58,0x11 asm/non_matchings/code/TwoHeadArena/THA_Dt.s,THA_Dt,0x80172B9C,0x9 -asm/non_matchings/code/code_80172BC0/AudioMgr_StopAllSfxExceptSystem.s,AudioMgr_StopAllSfxExceptSystem,0x80172BC0,0x1C -asm/non_matchings/code/audioMgr/func_80172C30.s,func_80172C30,0x80172C30,0xE -asm/non_matchings/code/audioMgr/AudioMgr_HandleRetrace.s,AudioMgr_HandleRetrace,0x80172C68,0x91 -asm/non_matchings/code/audioMgr/AudioMgr_HandlePRENMI.s,AudioMgr_HandlePRENMI,0x80172EAC,0x9 -asm/non_matchings/code/audioMgr/AudioMgr_ThreadEntry.s,AudioMgr_ThreadEntry,0x80172ED0,0x5E -asm/non_matchings/code/audioMgr/AudioMgr_Unlock.s,AudioMgr_Unlock,0x80173048,0xB -asm/non_matchings/code/audioMgr/AudioMgr_Init.s,AudioMgr_Init,0x80173074,0x2F +asm/non_matchings/code/audio_stop_all_sfx/AudioMgr_StopAllSfxExceptSystem.s,AudioMgr_StopAllSfxExceptSystem,0x80172BC0,0x1C +asm/non_matchings/code/audio_thread_manager/func_80172C30.s,func_80172C30,0x80172C30,0xE +asm/non_matchings/code/audio_thread_manager/AudioMgr_HandleRetrace.s,AudioMgr_HandleRetrace,0x80172C68,0x91 +asm/non_matchings/code/audio_thread_manager/AudioMgr_HandlePRENMI.s,AudioMgr_HandlePRENMI,0x80172EAC,0x9 +asm/non_matchings/code/audio_thread_manager/AudioMgr_ThreadEntry.s,AudioMgr_ThreadEntry,0x80172ED0,0x5E +asm/non_matchings/code/audio_thread_manager/AudioMgr_Unlock.s,AudioMgr_Unlock,0x80173048,0xB +asm/non_matchings/code/audio_thread_manager/AudioMgr_Init.s,AudioMgr_Init,0x80173074,0x2F asm/non_matchings/code/title_setup/Setup_SetRegs.s,Setup_SetRegs,0x80173130,0x6B asm/non_matchings/code/title_setup/Setup_InitImpl.s,Setup_InitImpl,0x801732DC,0x14 asm/non_matchings/code/title_setup/Setup_Destroy.s,Setup_Destroy,0x8017332C,0x3 @@ -3525,27 +3525,27 @@ asm/non_matchings/code/code_8019AF00/func_801A4D50.s,func_801A4D50,0x801A4D50,0x asm/non_matchings/code/code_8019AF00/func_801A4DA4.s,func_801A4DA4,0x801A4DA4,0x14 asm/non_matchings/code/code_8019AF00/func_801A4DF4.s,func_801A4DF4,0x801A4DF4,0x1C asm/non_matchings/code/code_8019AF00/func_801A4E64.s,func_801A4E64,0x801A4E64,0x13 -asm/non_matchings/code/code_8019AF00/func_801A4EB0.s,func_801A4EB0,0x801A4EB0,0x2 -asm/non_matchings/code/code_8019AF00/func_801A4EB8.s,func_801A4EB8,0x801A4EB8,0x48 -asm/non_matchings/code/code_8019AF00/func_801A4FD8.s,func_801A4FD8,0x801A4FD8,0x2A -asm/non_matchings/code/code_8019AF00/func_801A5080.s,func_801A5080,0x801A5080,0x10 -asm/non_matchings/code/code_8019AF00/func_801A50C0.s,func_801A50C0,0x801A50C0,0x10 -asm/non_matchings/code/code_8019AF00/func_801A5100.s,func_801A5100,0x801A5100,0x3 -asm/non_matchings/code/code_8019AF00/func_801A510C.s,func_801A510C,0x801A510C,0x3 -asm/non_matchings/code/code_8019AF00/func_801A5118.s,func_801A5118,0x801A5118,0x36 -asm/non_matchings/code/code_801A51F0/func_801A51F0.s,func_801A51F0,0x801A51F0,0xE -asm/non_matchings/code/code_801A51F0/func_801A5228.s,func_801A5228,0x801A5228,0x5A -asm/non_matchings/code/code_801A51F0/func_801A5390.s,func_801A5390,0x801A5390,0x13 -asm/non_matchings/code/code_801A51F0/func_801A53DC.s,func_801A53DC,0x801A53DC,0x3 -asm/non_matchings/code/code_801A51F0/func_801A53E8.s,func_801A53E8,0x801A53E8,0xD -asm/non_matchings/code/code_801A51F0/func_801A541C.s,func_801A541C,0x801A541C,0x1B -asm/non_matchings/code/code_801A51F0/func_801A5488.s,func_801A5488,0x801A5488,0xF -asm/non_matchings/code/code_801A51F0/func_801A54C4.s,func_801A54C4,0x801A54C4,0x3 -asm/non_matchings/code/code_801A51F0/func_801A54D0.s,func_801A54D0,0x801A54D0,0x6C -asm/non_matchings/code/code_801A51F0/func_801A5680.s,func_801A5680,0x801A5680,0x62 -asm/non_matchings/code/code_801A51F0/func_801A5808.s,func_801A5808,0x801A5808,0x82 -asm/non_matchings/code/code_801A51F0/func_801A5A10.s,func_801A5A10,0x801A5A10,0x3 -asm/non_matchings/code/code_801A51F0/func_801A5A1C.s,func_801A5A1C,0x801A5A1C,0x69 +asm/non_matchings/code/voice_external/func_801A4EB0.s,func_801A4EB0,0x801A4EB0,0x2 +asm/non_matchings/code/voice_external/func_801A4EB8.s,func_801A4EB8,0x801A4EB8,0x48 +asm/non_matchings/code/voice_external/func_801A4FD8.s,func_801A4FD8,0x801A4FD8,0x2A +asm/non_matchings/code/voice_external/func_801A5080.s,func_801A5080,0x801A5080,0x10 +asm/non_matchings/code/voice_external/func_801A50C0.s,func_801A50C0,0x801A50C0,0x10 +asm/non_matchings/code/voice_external/func_801A5100.s,func_801A5100,0x801A5100,0x3 +asm/non_matchings/code/voice_external/func_801A510C.s,func_801A510C,0x801A510C,0x3 +asm/non_matchings/code/voice_external/func_801A5118.s,func_801A5118,0x801A5118,0x36 +asm/non_matchings/code/voice_internal/func_801A51F0.s,func_801A51F0,0x801A51F0,0xE +asm/non_matchings/code/voice_internal/func_801A5228.s,func_801A5228,0x801A5228,0x5A +asm/non_matchings/code/voice_internal/func_801A5390.s,func_801A5390,0x801A5390,0x13 +asm/non_matchings/code/voice_internal/func_801A53DC.s,func_801A53DC,0x801A53DC,0x3 +asm/non_matchings/code/voice_internal/func_801A53E8.s,func_801A53E8,0x801A53E8,0xD +asm/non_matchings/code/voice_internal/func_801A541C.s,func_801A541C,0x801A541C,0x1B +asm/non_matchings/code/voice_internal/func_801A5488.s,func_801A5488,0x801A5488,0xF +asm/non_matchings/code/voice_internal/func_801A54C4.s,func_801A54C4,0x801A54C4,0x3 +asm/non_matchings/code/voice_internal/func_801A54D0.s,func_801A54D0,0x801A54D0,0x6C +asm/non_matchings/code/voice_internal/func_801A5680.s,func_801A5680,0x801A5680,0x62 +asm/non_matchings/code/voice_internal/func_801A5808.s,func_801A5808,0x801A5808,0x82 +asm/non_matchings/code/voice_internal/func_801A5A10.s,func_801A5A10,0x801A5A10,0x3 +asm/non_matchings/code/voice_internal/func_801A5A1C.s,func_801A5A1C,0x801A5A1C,0x69 asm/non_matchings/code/code_801A5BD0/AudioSfx_MuteBanks.s,AudioSfx_MuteBanks,0x801A5BD0,0x16 asm/non_matchings/code/code_801A5BD0/AudioSfx_LowerBgmVolume.s,AudioSfx_LowerBgmVolume,0x801A5C28,0x19 asm/non_matchings/code/code_801A5BD0/AudioSfx_RestoreBgmVolume.s,AudioSfx_RestoreBgmVolume,0x801A5C8C,0x1C @@ -3568,21 +3568,21 @@ asm/non_matchings/code/code_801A5BD0/AudioSfx_StepBankLerp.s,AudioSfx_StepBankLe asm/non_matchings/code/code_801A5BD0/AudioSfx_ProcessActiveSfx.s,AudioSfx_ProcessActiveSfx,0x801A787C,0x1A asm/non_matchings/code/code_801A5BD0/AudioSfx_IsPlaying.s,AudioSfx_IsPlaying,0x801A78E4,0x1A asm/non_matchings/code/code_801A5BD0/AudioSfx_Reset.s,AudioSfx_Reset,0x801A794C,0x71 -asm/non_matchings/code/code_801A7B10/Audio_StartSequence.s,Audio_StartSequence,0x801A7B10,0x7D -asm/non_matchings/code/code_801A7B10/Audio_StopSequence.s,Audio_StopSequence,0x801A7D04,0x20 -asm/non_matchings/code/code_801A7B10/func_801A7D84.s,func_801A7D84,0x801A7D84,0x309 -asm/non_matchings/code/code_801A7B10/Audio_QueueSeqCmd.s,Audio_QueueSeqCmd,0x801A89A8,0xA -asm/non_matchings/code/code_801A7B10/func_801A89D0.s,func_801A89D0,0x801A89D0,0x20 -asm/non_matchings/code/code_801A7B10/Audio_GetActiveSequence.s,Audio_GetActiveSequence,0x801A8A50,0x1B -asm/non_matchings/code/code_801A7B10/func_801A8ABC.s,func_801A8ABC,0x801A8ABC,0x16 -asm/non_matchings/code/code_801A7B10/func_801A8B14.s,func_801A8B14,0x801A8B14,0x6 -asm/non_matchings/code/code_801A7B10/func_801A8B2C.s,func_801A8B2C,0x801A8B2C,0x29 -asm/non_matchings/code/code_801A7B10/Audio_SetVolumeScale.s,Audio_SetVolumeScale,0x801A8BD0,0x63 -asm/non_matchings/code/code_801A7B10/func_801A8D5C.s,func_801A8D5C,0x801A8D5C,0x283 -asm/non_matchings/code/code_801A7B10/func_801A9768.s,func_801A9768,0x801A9768,0x31 -asm/non_matchings/code/code_801A7B10/func_801A982C.s,func_801A982C,0x801A982C,0x63 -asm/non_matchings/code/code_801A7B10/func_801A99B8.s,func_801A99B8,0x801A99B8,0x2F -asm/non_matchings/code/code_801A7B10/func_801A9A74.s,func_801A9A74,0x801A9A74,0x27 +asm/non_matchings/code/sequence/Audio_StartSequence.s,Audio_StartSequence,0x801A7B10,0x7D +asm/non_matchings/code/sequence/Audio_StopSequence.s,Audio_StopSequence,0x801A7D04,0x20 +asm/non_matchings/code/sequence/func_801A7D84.s,func_801A7D84,0x801A7D84,0x309 +asm/non_matchings/code/sequence/Audio_QueueSeqCmd.s,Audio_QueueSeqCmd,0x801A89A8,0xA +asm/non_matchings/code/sequence/func_801A89D0.s,func_801A89D0,0x801A89D0,0x20 +asm/non_matchings/code/sequence/Audio_GetActiveSequence.s,Audio_GetActiveSequence,0x801A8A50,0x1B +asm/non_matchings/code/sequence/func_801A8ABC.s,func_801A8ABC,0x801A8ABC,0x16 +asm/non_matchings/code/sequence/func_801A8B14.s,func_801A8B14,0x801A8B14,0x6 +asm/non_matchings/code/sequence/func_801A8B2C.s,func_801A8B2C,0x801A8B2C,0x29 +asm/non_matchings/code/sequence/Audio_SetVolumeScale.s,Audio_SetVolumeScale,0x801A8BD0,0x63 +asm/non_matchings/code/sequence/func_801A8D5C.s,func_801A8D5C,0x801A8D5C,0x283 +asm/non_matchings/code/sequence/func_801A9768.s,func_801A9768,0x801A9768,0x31 +asm/non_matchings/code/sequence/func_801A982C.s,func_801A982C,0x801A982C,0x63 +asm/non_matchings/code/sequence/func_801A99B8.s,func_801A99B8,0x801A99B8,0x2F +asm/non_matchings/code/sequence/func_801A9A74.s,func_801A9A74,0x801A9A74,0x27 asm/non_matchings/code/jpegutils/JpegUtils_ProcessQuantizationTable.s,JpegUtils_ProcessQuantizationTable,0x801A9B10,0x1A asm/non_matchings/code/jpegutils/JpegUtils_ParseHuffmanCodesLengths.s,JpegUtils_ParseHuffmanCodesLengths,0x801A9B78,0x21 asm/non_matchings/code/jpegutils/JpegUtils_GetHuffmanCodes.s,JpegUtils_GetHuffmanCodes,0x801A9BFC,0x1B From d7af72273de2f861124d9f442bcb1a6aaf3710e8 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Wed, 8 Mar 2023 01:19:08 -0300 Subject: [PATCH 25/29] z64frameadvance.h (#1182) --- include/functions.h | 3 --- include/z64.h | 6 +----- include/z64frameadvance.h | 16 ++++++++++++++++ src/code/z_pause.c | 4 +++- 4 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 include/z64frameadvance.h diff --git a/include/functions.h b/include/functions.h index 0313b9e233..61787d83a7 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1742,9 +1742,6 @@ Path* Path_GetByIndex(PlayState* play, s16 index, s16 max); f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw); void Path_CopyLastPoint(Path* path, Vec3f* dest); -void FrameAdvance_Init(FrameAdvanceContext* frameAdvCtx); -s32 FrameAdvance_Update(FrameAdvanceContext* frameAdvCtx, Input* input); - s32 func_801226E0(PlayState* play, s32 arg1); s32 func_80122744(PlayState* play, struct_80122744_arg1* arg1, u32 arg2, Vec3s* arg3); s32 func_80122760(PlayState* play, struct_80122744_arg1* arg1, f32 arg2); diff --git a/include/z64.h b/include/z64.h index d35265402a..028162a1e0 100644 --- a/include/z64.h +++ b/include/z64.h @@ -36,6 +36,7 @@ #include "z64dma.h" #include "z64eff_footmark.h" #include "z64effect.h" +#include "z64frameadvance.h" #include "z64interface.h" #include "z64item.h" #include "z64light.h" @@ -690,11 +691,6 @@ typedef struct { /* 0x1 */ u8 ambienceId; } SequenceContext; // size = 0x2 -typedef struct { - /* 0x0 */ s32 enabled; - /* 0x4 */ s32 timer; -} FrameAdvanceContext; // size = 0x8 - typedef enum { /* 0 */ GAMEOVER_INACTIVE, /* 1 */ GAMEOVER_DEATH_START, diff --git a/include/z64frameadvance.h b/include/z64frameadvance.h new file mode 100644 index 0000000000..c0feaed597 --- /dev/null +++ b/include/z64frameadvance.h @@ -0,0 +1,16 @@ +#ifndef Z64FRAMEADVANCE_H +#define Z64FRAMEADVANCE_H + +#include "ultra64.h" +#include "io/controller.h" + +typedef struct FrameAdvanceContext { + /* 0x0 */ s32 enabled; + /* 0x4 */ s32 timer; +} FrameAdvanceContext; // size = 0x8 + + +void FrameAdvance_Init(FrameAdvanceContext* frameAdvCtx); +s32 FrameAdvance_Update(FrameAdvanceContext* frameAdvCtx, Input* input); + +#endif diff --git a/src/code/z_pause.c b/src/code/z_pause.c index bb5b33cf2f..5f212b7ae8 100644 --- a/src/code/z_pause.c +++ b/src/code/z_pause.c @@ -18,7 +18,9 @@ * * Note2: Controllers 2-4's inputs are normally zeroed out, so this would also need to be fixed to use frame advance */ -#include "global.h" + +#include "z64frameadvance.h" +#include "macros.h" void FrameAdvance_Init(FrameAdvanceContext* frameAdvCtx) { frameAdvCtx->timer = 0; From c917880261a9144ae4563ef175a536d38a2008d9 Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Tue, 7 Mar 2023 20:44:18 -0800 Subject: [PATCH 26/29] Misc cleanup 13 (#1189) * FaultAddrConv Functions * Invisible Ruppe macros * skybox * Z64 header defines * ActorId * remove i from KaleidoManager_FaultAddrConv * size_t and parens --- include/functions.h | 8 +-- include/variables.h | 8 +-- include/z64animation.h | 4 +- include/z64audio.h | 4 +- include/z64bgcheck.h | 4 +- include/z64collision_check.h | 4 +- include/z64curve.h | 4 +- include/z64dma.h | 4 +- include/z64effect.h | 4 +- include/z64jpeg.h | 4 +- include/z64skin.h | 4 +- include/z64skybox.h | 17 +++---- include/z64snap.h | 4 +- include/z_en_hy_code.h | 4 +- include/z_prenmi.h | 4 +- include/z_title_setup.h | 4 +- src/code/graph.c | 12 ++--- src/code/z_actor_dlftbls.c | 49 +++++++++---------- src/code/z_game_dlftbls.c | 2 +- src/code/z_kaleido_manager.c | 33 ++++++------- src/code/z_vr_box.c | 18 +++---- src/code/z_vr_box_draw.c | 28 +++++------ src/overlays/actors/ovl_En_Fall/z_en_fall.c | 2 +- .../z_en_invisible_ruppe.c | 4 +- .../z_en_invisible_ruppe.h | 4 +- tools/disasm/functions.txt | 6 +-- tools/disasm/variables.txt | 4 +- tools/sizes/code_functions.csv | 4 +- 28 files changed, 122 insertions(+), 129 deletions(-) diff --git a/include/functions.h b/include/functions.h index 61787d83a7..7f1dd1efaf 100644 --- a/include/functions.h +++ b/include/functions.h @@ -776,8 +776,8 @@ s32 Actor_IsSmallChest(struct EnBox* chest); void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16 limbPosCount, f32 effectScale, f32 frozenSteamScale, f32 effectAlpha, u8 type); void Actor_SpawnIceEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s32 limbPosCount, s32 effectsPerLimb, f32 scale, f32 scaleRange); -void ActorOverlayTable_FaultPrint(void* arg0, void* arg1); -void* ActorOverlayTable_FaultAddrConv(void* arg0, void* arg1); +void ActorOverlayTable_FaultClient(void* arg0, void* arg1); +void* ActorOverlayTable_FaultAddrConv(void* address, void* param); void ActorOverlayTable_Init(void); void ActorOverlayTable_Cleanup(void); @@ -2242,7 +2242,7 @@ void func_80161C0C(void); // void func_801631DC(void); // void func_80163334(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_80163660(void); -void* KaleidoManager_FaultAddrConvFunc(void* address, void* param); +void* KaleidoManager_FaultAddrConv(void* address, void* param); void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl); void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl); void KaleidoManager_Init(PlayState* play); @@ -2443,7 +2443,7 @@ void Graph_FaultClient(void); void Graph_InitTHGA(TwoHeadGfxArena* arena, Gfx* buffer, s32 size); void Graph_SetNextGfxPool(GraphicsContext* gfxCtx); GameStateOverlay* Graph_GetNextGameState(GameState* gameState); -void* Graph_FaultAddrConvFunc(void* address, void* param); +void* Graph_FaultAddrConv(void* address, void* param); void Graph_Init(GraphicsContext* gfxCtx); void Graph_Destroy(GraphicsContext* gfxCtx); void Graph_TaskSet00(GraphicsContext* gfxCtx, GameState* gameState); diff --git a/include/variables.h b/include/variables.h index b64507bfa4..f12dbe629c 100644 --- a/include/variables.h +++ b/include/variables.h @@ -490,7 +490,7 @@ extern PlayState* actorCutscenesPlayState; extern s16 actorCutsceneReturnCamera; extern s16 D_801BD8C6; extern GameStateOverlay gGameStateOverlayTable[]; -extern s32 graphNumGameStates; +extern s32 gGraphNumGameStates; // extern UNK_TYPE2 D_801BDA70; // extern UNK_TYPE2 D_801BDA74; // extern UNK_TYPE2 D_801BDA78; @@ -2304,8 +2304,8 @@ extern f32 D_801ED8D0; // extern UNK_TYPE1 D_801ED8DC; extern Mtx D_801ED8E0; // extern UNK_TYPE1 D_801ED920; -extern FaultClient D_801ED930; -extern FaultAddrConvClient D_801ED940; +extern FaultClient sActorOverlayTableFaultClient; +extern FaultAddrConvClient sActorOverlayTableFaultAddrConvClient; extern char D_801ED950[80]; extern char D_801ED9A0[80]; extern Vec3f D_801ED9F0[3]; @@ -2476,7 +2476,7 @@ extern s16 D_801F4E7A; // extern UNK_TYPE1 D_801F6B58; extern void (*sKaleidoScopeUpdateFunc)(PlayState* play); extern void (*sKaleidoScopeDrawFunc)(PlayState* play); -extern FaultAddrConvClient sKaleidoAreaFaultClient; +extern FaultAddrConvClient sKaleidoMgrFaultAddrConvClient; extern s16 sTransitionFillTimer; extern Input D_801F6C18; extern TransitionTile sTransitionTile; diff --git a/include/z64animation.h b/include/z64animation.h index 272a4fb842..0e8eb9fcb7 100644 --- a/include/z64animation.h +++ b/include/z64animation.h @@ -1,5 +1,5 @@ -#ifndef Z64_ANIMATION_H -#define Z64_ANIMATION_H +#ifndef Z64ANIMATION_H +#define Z64ANIMATION_H #include "PR/ultratypes.h" #include "PR/gbi.h" diff --git a/include/z64audio.h b/include/z64audio.h index bfb66a23a2..ca54d23451 100644 --- a/include/z64audio.h +++ b/include/z64audio.h @@ -1,5 +1,5 @@ -#ifndef Z64_AUDIO_H -#define Z64_AUDIO_H +#ifndef Z64AUDIO_H +#define Z64AUDIO_H #include "audiothread_cmd.h" diff --git a/include/z64bgcheck.h b/include/z64bgcheck.h index ad5d4c4fb6..fa0443e65b 100644 --- a/include/z64bgcheck.h +++ b/include/z64bgcheck.h @@ -1,5 +1,5 @@ -#ifndef Z64_BGCHECK_H -#define Z64_BGCHECK_H +#ifndef Z64BGCHECK_H +#define Z64BGCHECK_H struct PlayState; struct Actor; diff --git a/include/z64collision_check.h b/include/z64collision_check.h index 836fd3555c..e5032584c2 100644 --- a/include/z64collision_check.h +++ b/include/z64collision_check.h @@ -1,5 +1,5 @@ -#ifndef _Z_COLLISION_CHECK_H_ -#define _Z_COLLISION_CHECK_H_ +#ifndef Z64COLLISION_CHECK_H +#define Z64COLLISION_CHECK_H #include "PR/ultratypes.h" #include "z64math.h" diff --git a/include/z64curve.h b/include/z64curve.h index f4923e3bfd..77174be5e0 100644 --- a/include/z64curve.h +++ b/include/z64curve.h @@ -1,5 +1,5 @@ -#ifndef Z64_CURVE_H -#define Z64_CURVE_H +#ifndef Z64CURVE_H +#define Z64CURVE_H #include "PR/ultratypes.h" #include "z64math.h" diff --git a/include/z64dma.h b/include/z64dma.h index 92c0227f3d..964be9c598 100644 --- a/include/z64dma.h +++ b/include/z64dma.h @@ -1,5 +1,5 @@ -#ifndef _Z64_DMA_H_ -#define _Z64_DMA_H_ +#ifndef Z64DMA_H +#define Z64DMA_H #include "ultra64.h" diff --git a/include/z64effect.h b/include/z64effect.h index 727bf04d2a..387056941a 100644 --- a/include/z64effect.h +++ b/include/z64effect.h @@ -1,5 +1,5 @@ -#ifndef _Z64EFFECT_H_ -#define _Z64EFFECT_H_ +#ifndef Z64EFFECT_H +#define Z64EFFECT_H #include "PR/ultratypes.h" #include "color.h" diff --git a/include/z64jpeg.h b/include/z64jpeg.h index 38183bfa90..60797af988 100644 --- a/include/z64jpeg.h +++ b/include/z64jpeg.h @@ -1,5 +1,5 @@ -#ifndef Z64_JPEG_H -#define Z64_JPEG_H +#ifndef Z64JPEG_H +#define Z64JPEG_H #include "PR/ultratypes.h" #include "ultra64/message.h" diff --git a/include/z64skin.h b/include/z64skin.h index 360e265e64..a9e2ebc011 100644 --- a/include/z64skin.h +++ b/include/z64skin.h @@ -1,5 +1,5 @@ -#ifndef Z64_SKIN_H -#define Z64_SKIN_H +#ifndef Z64SKIN_H +#define Z64SKIN_H #include "z64animation.h" diff --git a/include/z64skybox.h b/include/z64skybox.h index 1664b94b13..0a981d23e6 100644 --- a/include/z64skybox.h +++ b/include/z64skybox.h @@ -1,8 +1,9 @@ -#ifndef Z64_SKYBOX_H -#define Z64_SKYBOX_H +#ifndef Z64SKYBOX_H +#define Z64SKYBOX_H #include "PR/ultratypes.h" #include "PR/gbi.h" +#include "color.h" #include "z64dma.h" #include "z64math.h" @@ -33,17 +34,11 @@ typedef struct SkyboxContext { /* 0x1E8 */ OSMesgQueue loadQueue; /* 0x200 */ OSMesg loadMsg; /* 0x204 */ s16 skyboxShouldDraw; - /* 0x208 */ f32 rotX; - /* 0x20C */ f32 rotY; - /* 0x210 */ f32 rotZ; + /* 0x208 */ Vec3f rot; /* 0x214 */ Vec3f eye; /* 0x220 */ s16 angle; - /* 0x222 */ u8 primR; - /* 0x223 */ u8 primG; - /* 0x224 */ u8 primB; - /* 0x225 */ u8 envR; - /* 0x226 */ u8 envG; - /* 0x227 */ u8 envB; + /* 0x222 */ Color_RGB8 prim; + /* 0x225 */ Color_RGB8 env; } SkyboxContext; // size = 0x228 typedef struct struct_801C5F44 { diff --git a/include/z64snap.h b/include/z64snap.h index 4f9dca9d41..8bec78c3dd 100644 --- a/include/z64snap.h +++ b/include/z64snap.h @@ -1,5 +1,5 @@ -#ifndef Z64_SNAP_H -#define Z64_SNAP_H +#ifndef Z64SNAP_H +#define Z64SNAP_H #include "PR/ultratypes.h" #include "z64actor.h" diff --git a/include/z_en_hy_code.h b/include/z_en_hy_code.h index 0620d35a04..1a2b7847ec 100644 --- a/include/z_en_hy_code.h +++ b/include/z_en_hy_code.h @@ -1,5 +1,5 @@ -#ifndef Z_EN_HY_CODE_H -#define Z_EN_HY_CODE_H +#ifndef Z64ENHY_CODE_H +#define Z64ENHY_CODE_H #include "global.h" #include "overlays/actors/ovl_En_Door/z_en_door.h" diff --git a/include/z_prenmi.h b/include/z_prenmi.h index 1aa1e6f998..04c3f5f16c 100644 --- a/include/z_prenmi.h +++ b/include/z_prenmi.h @@ -1,5 +1,5 @@ -#ifndef Z64_PRENMI_H -#define Z64_PRENMI_H +#ifndef Z64PRENMI_H +#define Z64PRENMI_H #include "global.h" diff --git a/include/z_title_setup.h b/include/z_title_setup.h index 41e3f52f84..3b299af975 100644 --- a/include/z_title_setup.h +++ b/include/z_title_setup.h @@ -1,5 +1,5 @@ -#ifndef Z64_TITLE_SETUP_H -#define Z64_TITLE_SETUP_H +#ifndef Z64TITLE_SETUP_H +#define Z64TITLE_SETUP_H #include "global.h" diff --git a/src/code/graph.c b/src/code/graph.c index be865ee61e..4bf3228783 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -90,21 +90,21 @@ GameStateOverlay* Graph_GetNextGameState(GameState* gameState) { return NULL; } -void* Graph_FaultAddrConvFunc(void* address, void* param) { +void* Graph_FaultAddrConv(void* address, void* param) { uintptr_t addr = address; GameStateOverlay* gameStateOvl = &gGameStateOverlayTable[0]; - uintptr_t ramConv; + size_t ramConv; void* ramStart; - uintptr_t diff; + size_t diff; s32 i; - for (i = 0; i < graphNumGameStates; i++, gameStateOvl++) { + for (i = 0; i < gGraphNumGameStates; i++, gameStateOvl++) { diff = VRAM_PTR_SIZE(gameStateOvl); ramStart = gameStateOvl->loadedRamAddr; ramConv = (uintptr_t)gameStateOvl->vramStart - (uintptr_t)ramStart; if (ramStart != NULL) { - if (addr >= (uintptr_t)ramStart && addr < (uintptr_t)ramStart + diff) { + if ((addr >= (uintptr_t)ramStart) && (addr < (uintptr_t)ramStart + diff)) { return addr + ramConv; } } @@ -122,7 +122,7 @@ void Graph_Init(GraphicsContext* gfxCtx) { gfxCtx->yScale = gViConfigYScale; osCreateMesgQueue(&gfxCtx->queue, gfxCtx->msgBuff, ARRAY_COUNT(gfxCtx->msgBuff)); Fault_AddClient(&sGraphFaultClient, Graph_FaultClient, NULL, NULL); - Fault_AddAddrConvClient(&sGraphFaultAddrConvClient, Graph_FaultAddrConvFunc, NULL); + Fault_AddAddrConvClient(&sGraphFaultAddrConvClient, Graph_FaultAddrConv, NULL); } void Graph_Destroy(GraphicsContext* gfxCtx) { diff --git a/src/code/z_actor_dlftbls.c b/src/code/z_actor_dlftbls.c index 5d7f30ea8b..1008cceabc 100644 --- a/src/code/z_actor_dlftbls.c +++ b/src/code/z_actor_dlftbls.c @@ -38,45 +38,44 @@ ActorOverlay gActorOverlayTable[] = { ActorId gMaxActorId = 0; -FaultClient D_801ED930; -FaultAddrConvClient D_801ED940; +FaultClient sActorOverlayTableFaultClient; +FaultAddrConvClient sActorOverlayTableFaultAddrConvClient; -void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) { +void ActorOverlayTable_FaultClient(void* arg0, void* arg1) { ActorOverlay* overlayEntry; u32 overlaySize; - ActorId i; + ActorId actorId; FaultDrawer_SetCharPad(-2, 0); FaultDrawer_Printf("actor_dlftbls %u\n", gMaxActorId); FaultDrawer_Printf("No. RamStart- RamEnd cn Name\n"); - for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxActorId; i++, overlayEntry++) { + for (actorId = 0, overlayEntry = &gActorOverlayTable[0]; actorId < gMaxActorId; actorId++, overlayEntry++) { overlaySize = VRAM_PTR_SIZE(overlayEntry); if (overlayEntry->loadedRamAddr != NULL) { - FaultDrawer_Printf("%3d %08x-%08x %3d %s\n", i, overlayEntry->loadedRamAddr, + FaultDrawer_Printf("%3d %08x-%08x %3d %s\n", actorId, overlayEntry->loadedRamAddr, (u32)overlayEntry->loadedRamAddr + overlaySize, overlayEntry->numLoaded, ""); } } } -void* ActorOverlayTable_FaultAddrConv(void* arg0, void* arg1) { - u8* ptr = arg0; - ActorOverlay* overlayEntry = &gActorOverlayTable[0]; - ActorId i; - u8* ramStart; - u8* ramEnd; - size_t size; - u32 offset; +void* ActorOverlayTable_FaultAddrConv(void* address, void* param) { + uintptr_t addr = address; + ActorOverlay* actorOvl = &gActorOverlayTable[0]; + size_t ramConv; + void* ramStart; + size_t diff; + ActorId actorId; + + for (actorId = 0; actorId < gMaxActorId; actorId++, actorOvl++) { + diff = VRAM_PTR_SIZE(actorOvl); + ramStart = actorOvl->loadedRamAddr; + ramConv = (uintptr_t)actorOvl->vramStart - (uintptr_t)ramStart; - for (i = 0; i < gMaxActorId; i++, overlayEntry++) { - size = VRAM_PTR_SIZE(overlayEntry); - ramStart = overlayEntry->loadedRamAddr; - ramEnd = ramStart + size; - offset = (u8*)overlayEntry->vramStart - ramStart; if (ramStart != NULL) { - if (ptr >= ramStart && ptr < ramEnd) { - return ptr + offset; + if ((addr >= (uintptr_t)ramStart) && (addr < (uintptr_t)ramStart + diff)) { + return addr + ramConv; } } } @@ -85,12 +84,12 @@ void* ActorOverlayTable_FaultAddrConv(void* arg0, void* arg1) { void ActorOverlayTable_Init(void) { gMaxActorId = ACTOR_ID_MAX; - Fault_AddClient(&D_801ED930, &ActorOverlayTable_FaultPrint, NULL, NULL); - Fault_AddAddrConvClient(&D_801ED940, &ActorOverlayTable_FaultAddrConv, NULL); + Fault_AddClient(&sActorOverlayTableFaultClient, ActorOverlayTable_FaultClient, NULL, NULL); + Fault_AddAddrConvClient(&sActorOverlayTableFaultAddrConvClient, ActorOverlayTable_FaultAddrConv, NULL); } void ActorOverlayTable_Cleanup(void) { - Fault_RemoveClient(&D_801ED930); - Fault_RemoveAddrConvClient(&D_801ED940); + Fault_RemoveClient(&sActorOverlayTableFaultClient); + Fault_RemoveAddrConvClient(&sActorOverlayTableFaultAddrConvClient); gMaxActorId = 0; } diff --git a/src/code/z_game_dlftbls.c b/src/code/z_game_dlftbls.c index 11d390a28d..1b82705f56 100644 --- a/src/code/z_game_dlftbls.c +++ b/src/code/z_game_dlftbls.c @@ -24,4 +24,4 @@ GameStateOverlay gGameStateOverlayTable[] = { GAMESTATE_OVERLAY(daytelop, DayTelop_Init, DayTelop_Destroy, sizeof(DayTelopState)), }; -s32 graphNumGameStates = ARRAY_COUNT(gGameStateOverlayTable); +s32 gGraphNumGameStates = ARRAY_COUNT(gGameStateOverlayTable); diff --git a/src/code/z_kaleido_manager.c b/src/code/z_kaleido_manager.c index 48e8e2ad64..3771de9c03 100644 --- a/src/code/z_kaleido_manager.c +++ b/src/code/z_kaleido_manager.c @@ -14,24 +14,23 @@ KaleidoMgrOverlay gKaleidoMgrOverlayTable[] = { void* sKaleidoAreaPtr = NULL; KaleidoMgrOverlay* gKaleidoMgrCurOvl = NULL; -FaultAddrConvClient sKaleidoAreaFaultClient; +FaultAddrConvClient sKaleidoMgrFaultAddrConvClient; -void* KaleidoManager_FaultAddrConvFunc(void* address, void* param) { - u8* ptr = address; - KaleidoMgrOverlay* ovl = &gKaleidoMgrCurOvl[0]; - u8* ramStart; - u8* ramEnd; - size_t size; - uintptr_t offset; +void* KaleidoManager_FaultAddrConv(void* address, void* param) { + uintptr_t addr = address; + KaleidoMgrOverlay* kaleidoMgrOvl = gKaleidoMgrCurOvl; + size_t ramConv; + void* ramStart; + size_t diff; + + if (kaleidoMgrOvl != NULL) { + diff = VRAM_PTR_SIZE(kaleidoMgrOvl); + ramStart = kaleidoMgrOvl->loadedRamAddr; + ramConv = (uintptr_t)kaleidoMgrOvl->vramStart - (uintptr_t)ramStart; - if (ovl != NULL) { - size = VRAM_PTR_SIZE(ovl); - ramStart = ovl->loadedRamAddr; - ramEnd = ramStart + size; - offset = (u8*)ovl->vramStart - ramStart; if (ramStart != NULL) { - if (ptr >= ramStart && ptr < ramEnd) { - return ptr + offset; + if ((addr >= (uintptr_t)ramStart) && (addr < (uintptr_t)ramStart + diff)) { + return addr + ramConv; } } } @@ -68,11 +67,11 @@ void KaleidoManager_Init(PlayState* play) { sKaleidoAreaPtr = THA_AllocEndAlign16(&play->state.heap, largestSize); gKaleidoMgrCurOvl = NULL; - Fault_AddAddrConvClient(&sKaleidoAreaFaultClient, KaleidoManager_FaultAddrConvFunc, NULL); + Fault_AddAddrConvClient(&sKaleidoMgrFaultAddrConvClient, KaleidoManager_FaultAddrConv, NULL); } void KaleidoManager_Destroy() { - Fault_RemoveAddrConvClient(&sKaleidoAreaFaultClient); + Fault_RemoveAddrConvClient(&sKaleidoMgrFaultAddrConvClient); if (gKaleidoMgrCurOvl != NULL) { KaleidoManager_ClearOvl(gKaleidoMgrCurOvl); diff --git a/src/code/z_vr_box.c b/src/code/z_vr_box.c index 2797fee3cb..4d44de0f95 100644 --- a/src/code/z_vr_box.c +++ b/src/code/z_vr_box.c @@ -188,7 +188,7 @@ void Skybox_Setup(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyboxId) size_t size; void* segment; - skyboxCtx->rotZ = 0.0f; + skyboxCtx->rot.z = 0.0f; switch (skyboxId) { case SKYBOX_NORMAL_SKY: @@ -210,17 +210,17 @@ void Skybox_Setup(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyboxId) segment = (void*)ALIGN8((uintptr_t)segment + size); DmaMgr_SendRequest0(skyboxCtx->paletteStaticSegment, SEGMENT_ROM_START(d2_fine_pal_static), size); - skyboxCtx->primR = 145; - skyboxCtx->primG = 120; - skyboxCtx->primB = 155; + skyboxCtx->prim.r = 145; + skyboxCtx->prim.g = 120; + skyboxCtx->prim.b = 155; - skyboxCtx->envR = 40; - skyboxCtx->envG = 0; - skyboxCtx->envB = 40; + skyboxCtx->env.r = 40; + skyboxCtx->env.g = 0; + skyboxCtx->env.b = 40; // Inverted Stone Tower Temple and Inverted Stone Tower if ((play->sceneId == SCENE_F41) || (play->sceneId == SCENE_INISIE_R)) { - skyboxCtx->rotZ = 3.15f; + skyboxCtx->rot.z = 3.15f; } break; @@ -289,7 +289,7 @@ void func_80143324(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) { void Skybox_Init(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyboxId) { skyboxCtx->skyboxShouldDraw = false; - skyboxCtx->rotX = skyboxCtx->rotY = skyboxCtx->rotZ = 0.0f; + skyboxCtx->rot.x = skyboxCtx->rot.y = skyboxCtx->rot.z = 0.0f; Skybox_Setup(gameState, skyboxCtx, skyboxId); diff --git a/src/code/z_vr_box_draw.c b/src/code/z_vr_box_draw.c index 2569f81fad..489f596e55 100644 --- a/src/code/z_vr_box_draw.c +++ b/src/code/z_vr_box_draw.c @@ -5,19 +5,19 @@ Mtx* sSkyboxDrawMatrix; Mtx* Skybox_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z) { Matrix_Translate(x, y, z, MTXMODE_NEW); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); - Matrix_RotateXFApply(skyboxCtx->rotX); - Matrix_RotateYF(skyboxCtx->rotY, MTXMODE_APPLY); - Matrix_RotateZF(skyboxCtx->rotZ, MTXMODE_APPLY); + Matrix_RotateXFApply(skyboxCtx->rot.x); + Matrix_RotateYF(skyboxCtx->rot.y, MTXMODE_APPLY); + Matrix_RotateZF(skyboxCtx->rot.z, MTXMODE_APPLY); return Matrix_ToMtx(sSkyboxDrawMatrix); } void Skybox_SetColors(SkyboxContext* skyboxCtx, u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB) { - skyboxCtx->primR = primR; - skyboxCtx->primG = primG; - skyboxCtx->primB = primB; - skyboxCtx->envR = envR; - skyboxCtx->envG = envG; - skyboxCtx->envB = envB; + skyboxCtx->prim.r = primR; + skyboxCtx->prim.g = primG; + skyboxCtx->prim.b = primB; + skyboxCtx->env.r = envR; + skyboxCtx->env.g = envG; + skyboxCtx->env.b = envB; } void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z) { @@ -32,9 +32,9 @@ void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId Matrix_Translate(x, y, z, MTXMODE_NEW); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); - Matrix_RotateXFApply(skyboxCtx->rotX); - Matrix_RotateYF(skyboxCtx->rotY, MTXMODE_APPLY); - Matrix_RotateZF(skyboxCtx->rotZ, MTXMODE_APPLY); + Matrix_RotateXFApply(skyboxCtx->rot.x); + Matrix_RotateYF(skyboxCtx->rot.y, MTXMODE_APPLY); + Matrix_RotateZF(skyboxCtx->rot.z, MTXMODE_APPLY); Matrix_ToMtx(sSkyboxDrawMatrix); gSPMatrix(POLY_OPA_DISP++, sSkyboxDrawMatrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -45,8 +45,8 @@ void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId gDPSetTextureConvert(POLY_OPA_DISP++, G_TC_FILT); gDPSetCombineLERP(POLY_OPA_DISP++, TEXEL1, TEXEL0, PRIMITIVE_ALPHA, TEXEL0, TEXEL1, TEXEL0, PRIMITIVE, TEXEL0, PRIMITIVE, ENVIRONMENT, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED); - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, skyboxCtx->primR, skyboxCtx->primG, skyboxCtx->primB, blend); - gDPSetEnvColor(POLY_OPA_DISP++, skyboxCtx->envR, skyboxCtx->envG, skyboxCtx->envB, 0); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, skyboxCtx->prim.r, skyboxCtx->prim.g, skyboxCtx->prim.b, blend); + gDPSetEnvColor(POLY_OPA_DISP++, skyboxCtx->env.r, skyboxCtx->env.g, skyboxCtx->env.b, 0); gSPDisplayList(POLY_OPA_DISP++, &skyboxCtx->dListBuf[0]); gSPDisplayList(POLY_OPA_DISP++, &skyboxCtx->dListBuf[2]); 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 affea4c349..b83799ea68 100644 --- a/src/overlays/actors/ovl_En_Fall/z_en_fall.c +++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.c @@ -575,7 +575,7 @@ void EnFall_Fireball_Update(Actor* thisx, PlayState* play) { EnFall* this = THIS; if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 2)) { - play->skyboxCtx.rotY -= 0.05f; + play->skyboxCtx.rot.y -= 0.05f; } if (Cutscene_CheckActorAction(play, 450)) { 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 70f77b18a3..489431bdf8 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 @@ -60,7 +60,7 @@ void func_80C258A0(EnInvisibleRuppe* this, PlayState* play) { void func_80C2590C(EnInvisibleRuppe* this, PlayState* play) { if (this->collider.base.ocFlags1 & OC1_HIT) { - switch (INVISIBLERUPPE_GET_3(this)) { + switch (INVISIBLERUPPE_GET_3(&this->actor)) { case 0: play_sound(NA_SE_SY_GET_RUPY); Item_DropCollectible(play, &this->actor.world.pos, 0x8000 | ITEM00_RUPEE_GREEN); @@ -93,7 +93,7 @@ void EnInvisibleRuppe_Init(Actor* thisx, PlayState* play) { s32 pad; EnInvisibleRuppe* this = THIS; - this->unk_190 = INVISIBLERUPPE_GET_1FC(this); + this->unk_190 = INVISIBLERUPPE_GET_1FC(&this->actor); if (this->unk_190 == 0x7F) { this->unk_190 = -1; 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 5b6f6ca64f..d703a35111 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 @@ -7,8 +7,8 @@ struct EnInvisibleRuppe; typedef void (*EnInvisibleRuppeActionFunc)(struct EnInvisibleRuppe*, PlayState*); -#define INVISIBLERUPPE_GET_3(thisx) ((thisx)->actor.params & 3) -#define INVISIBLERUPPE_GET_1FC(thisx) (((thisx)->actor.params & 0x1FC) >> 2) +#define INVISIBLERUPPE_GET_3(thisx) ((thisx)->params & 3) +#define INVISIBLERUPPE_GET_1FC(thisx) (((thisx)->params & 0x1FC) >> 2) typedef struct EnInvisibleRuppe { /* 0x000 */ Actor actor; diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index c488127f6a..ca5efdcf4a 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -895,7 +895,7 @@ 0x800BE63C:("Actor_IsSmallChest",), 0x800BE680:("Actor_DrawDamageEffects",), 0x800BF7CC:("Actor_SpawnIceEffects",), - 0x800BF9A0:("ActorOverlayTable_FaultPrint",), + 0x800BF9A0:("ActorOverlayTable_FaultClient",), 0x800BFA78:("ActorOverlayTable_FaultAddrConv",), 0x800BFAE8:("ActorOverlayTable_Init",), 0x800BFB40:("ActorOverlayTable_Cleanup",), @@ -2925,7 +2925,7 @@ 0x801631DC:("func_801631DC",), 0x80163334:("func_80163334",), 0x80163660:("func_80163660",), - 0x80163700:("KaleidoManager_FaultAddrConvFunc",), + 0x80163700:("KaleidoManager_FaultAddrConv",), 0x80163758:("KaleidoManager_LoadOvl",), 0x801637B4:("KaleidoManager_ClearOvl",), 0x80163804:("KaleidoManager_Init",), @@ -3148,7 +3148,7 @@ 0x80173DAC:("Graph_InitTHGA",), 0x80173DCC:("Graph_SetNextGfxPool",), 0x80173F98:("Graph_GetNextGameState",), - 0x80174060:("Graph_FaultAddrConvFunc",), + 0x80174060:("Graph_FaultAddrConv",), 0x801740D0:("Graph_Init",), 0x80174174:("Graph_Destroy",), 0x801741A8:("Graph_TaskSet00",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index cf91938631..57991aeb5c 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -3857,7 +3857,7 @@ 0x801ED8E0:("D_801ED8E0","Mtx","",0x40), 0x801ED920:("D_801ED920","UNK_TYPE1","",0x1), 0x801ED930:("D_801ED930","FaultClient","",0x10), - 0x801ED940:("D_801ED940","FaultAddrConvClient","",0xc), + 0x801ED940:("sActorOverlayTableFaultAddrConvClient","FaultAddrConvClient","",0xC), 0x801ED950:("D_801ED950","char","[80]",0x50), 0x801ED9A0:("D_801ED9A0","char","[80]",0x50), 0x801ED9F0:("D_801ED9F0","Vec3f","[3]",0x24), @@ -4049,7 +4049,7 @@ 0x801F6B44:("sShrinkWindowPtr","ShrinkWindow*","",0x4), 0x801F6B50:("D_801F6B50","UNK_TYPE4","",0x4), 0x801F6B58:("D_801F6B58","UNK_TYPE1","",0x1), - 0x801F6BF0:("sKaleidoAreaFaultClient","FaultAddrConvClient","",0xC), + 0x801F6BF0:("sKaleidoMgrFaultAddrConvClient","FaultAddrConvClient","",0xC), 0x801F6C00:("sKaleidoScopeUpdateFunc","void*","",0x4), 0x801F6C04:("sKaleidoScopeDrawFunc","void*","",0x4), 0x801F6C10:("sTransitionFillTimer","UNK_TYPE1","",0x1), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index f29fa708cb..2992965d77 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -409,7 +409,7 @@ asm/non_matchings/code/z_actor/func_800BE5CC.s,func_800BE5CC,0x800BE5CC,0x1C asm/non_matchings/code/z_actor/func_800BE63C.s,func_800BE63C,0x800BE63C,0x11 asm/non_matchings/code/z_actor/Actor_DrawDamageEffects.s,Actor_DrawDamageEffects,0x800BE680,0x453 asm/non_matchings/code/z_actor/Actor_SpawnIceEffects.s,Actor_SpawnIceEffects,0x800BF7CC,0x75 -asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_FaultPrint.s,ActorOverlayTable_FaultPrint,0x800BF9A0,0x36 +asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_FaultClient.s,ActorOverlayTable_FaultClient,0x800BF9A0,0x36 asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_FaultAddrConv.s,ActorOverlayTable_FaultAddrConv,0x800BFA78,0x1C asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_Init.s,ActorOverlayTable_Init,0x800BFAE8,0x16 asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_Cleanup.s,ActorOverlayTable_Cleanup,0x800BFB40,0x10 @@ -2662,7 +2662,7 @@ asm/non_matchings/code/graph/Graph_FaultClient.s,Graph_FaultClient,0x80173D30,0x asm/non_matchings/code/graph/Graph_InitTHGA.s,Graph_InitTHGA,0x80173DAC,0x8 asm/non_matchings/code/graph/Graph_SetNextGfxPool.s,Graph_SetNextGfxPool,0x80173DCC,0x73 asm/non_matchings/code/graph/Graph_GetNextGameState.s,Graph_GetNextGameState,0x80173F98,0x32 -asm/non_matchings/code/graph/Graph_FaultAddrConvFunc.s,Graph_FaultAddrConvFunc,0x80174060,0x1C +asm/non_matchings/code/graph/Graph_FaultAddrConv.s,Graph_FaultAddrConv,0x80174060,0x1C asm/non_matchings/code/graph/Graph_Init.s,Graph_Init,0x801740D0,0x29 asm/non_matchings/code/graph/Graph_Destroy.s,Graph_Destroy,0x80174174,0xD asm/non_matchings/code/graph/Graph_TaskSet00.s,Graph_TaskSet00,0x801741A8,0xC1 From 184f5858ff6bf0c3c7bd399efe592e5af497e6d9 Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Tue, 7 Mar 2023 21:06:49 -0800 Subject: [PATCH 27/29] Debug mode (#1185) * OK * Docs * PR * Format * Update include/z64debug_display.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update include/z64debug_display.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> --------- Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> --- include/functions.h | 9 -- include/z64.h | 10 -- include/z64debug_display.h | 25 ++++ include/z64debug_text.h | 36 ++++++ spec | 2 - src/code/game.c | 3 +- src/code/z_debug_display.c | 19 +-- src/code/z_debug_mode.c | 159 +++++++++++++++++++++++- src/code/z_play.c | 1 + src/overlays/actors/ovl_TG_Sw/z_tg_sw.c | 1 + tools/disasm/functions.txt | 12 +- tools/disasm/variables.txt | 4 +- tools/sizes/code_functions.csv | 12 +- 13 files changed, 241 insertions(+), 52 deletions(-) create mode 100644 include/z64debug_display.h create mode 100644 include/z64debug_text.h diff --git a/include/functions.h b/include/functions.h index 7f1dd1efaf..2781886804 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1227,15 +1227,6 @@ s32 Actor_TrackPlayerSetFocusHeight(PlayState* play, Actor* actor, Vec3s* headRo s32 Actor_TrackPlayer(PlayState* play, Actor* actor, Vec3s* headRot, Vec3s* torsoRot, Vec3f focusPos); void SaveContext_Init(void); void GameInfo_Init(void); -DebugDispObject* DebugDisplay_Init(void); -void DebugDisplay_DrawObjects(PlayState* play); -DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, f32 scaleX, f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha, s16 type, GraphicsContext* gfxCtx); -// void func_800E9C90(void); -// void func_800E9CA0(s32 param_1, UNK_TYPE1 param_2, s8* param_3); -// void func_800E9CFC(void); -// void func_800E9DBC(void); -// void func_800E9E94(void); -void func_800E9F78(GraphicsContext* gfxCtx); void Cutscene_Init(PlayState* play, CutsceneContext* csCtx); void Cutscene_Start(PlayState* play, CutsceneContext* csCtx); diff --git a/include/z64.h b/include/z64.h index 028162a1e0..732fbce3c5 100644 --- a/include/z64.h +++ b/include/z64.h @@ -858,16 +858,6 @@ typedef struct { /* 0x14 */ Gfx* dList; } VisMono; // size = 0x18 -typedef struct DebugDispObject { - /* 0x00 */ Vec3f pos; - /* 0x0C */ Vec3s rot; - /* 0x14 */ Vec3f scale; - /* 0x20 */ Color_RGBA8 color; - /* 0x24 */ s16 type; - /* 0x28 */ struct DebugDispObject* next; - /* 0x2C */ s32 pad; //Padding not in the OOT version -} DebugDispObject; // size = 0x30 - typedef struct { /* 0x0 */ f32 rangeSq; /* 0x4 */ f32 leashScale; diff --git a/include/z64debug_display.h b/include/z64debug_display.h new file mode 100644 index 0000000000..885a3839c9 --- /dev/null +++ b/include/z64debug_display.h @@ -0,0 +1,25 @@ +#ifndef Z64DEBUG_DISPLAY_H +#define Z64DEBUG_DISPLAY_H + +#include "color.h" +#include "ultra64.h" +#include "z64math.h" + +struct GraphicsContext; +struct PlayState; + +typedef struct DebugDispObject { + /* 0x00 */ Vec3f pos; + /* 0x0C */ Vec3s rot; + /* 0x14 */ Vec3f scale; + /* 0x20 */ Color_RGBA8 color; + /* 0x24 */ s16 type; + /* 0x28 */ struct DebugDispObject* next; + /* 0x2C */ s32 pad; // Padding is not in the OoT version +} DebugDispObject; // size = 0x30 + +DebugDispObject* DebugDisplay_Init(void); +void DebugDisplay_DrawObjects(struct PlayState* play); +DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, f32 scaleX, f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha, s16 type, struct GraphicsContext* gfxCtx); + +#endif diff --git a/include/z64debug_text.h b/include/z64debug_text.h new file mode 100644 index 0000000000..65595f99e8 --- /dev/null +++ b/include/z64debug_text.h @@ -0,0 +1,36 @@ +#ifndef Z64DEBUG_TEXT_H +#define Z64DEBUG_TEXT_H + +#include "ultra64.h" + +struct GraphicsContext; + +typedef enum { + /* 0 */ DEBUG_TEXT_BLACK, + /* 1 */ DEBUG_TEXT_BLUE, + /* 2 */ DEBUG_TEXT_RED, + /* 3 */ DEBUG_TEXT_PURPLE, + /* 4 */ DEBUG_TEXT_GREEN, + /* 5 */ DEBUG_TEXT_CYAN, + /* 6 */ DEBUG_TEXT_YELLOW, + /* 7 */ DEBUG_TEXT_WHITE +} DebugTextColor; + +typedef enum { + /* 0 */ DEBUG_CAM_TEXT_YELLOW, + /* 1 */ DEBUG_CAM_TEXT_PEACH, + /* 2 */ DEBUG_CAM_TEXT_BROWN, + /* 3 */ DEBUG_CAM_TEXT_ORANGE, + /* 4 */ DEBUG_CAM_TEXT_GOLD, + /* 5 */ DEBUG_CAM_TEXT_WHITE, + /* 6 */ DEBUG_CAM_TEXT_BLUE, + /* 7 */ DEBUG_CAM_TEXT_GREEN +} DebugCamTextColor; + +void Debug_ClearTextDrawFlags(void); +void Debug_ScreenText(s32 index, s32 colorIndex, const char* text); +void DebugCamera_ScreenText(u8 x, u8 y, u8 colorIndex, const char* text); +void Debug_DrawText(struct GraphicsContext* gfxCtx); + + +#endif diff --git a/spec b/spec index 17a411dc45..404d100262 100644 --- a/spec +++ b/spec @@ -458,8 +458,6 @@ beginseg include "build/src/code/z_debug.o" include "build/src/code/z_debug_display.o" include "build/src/code/z_debug_mode.o" - include "build/data/code/z_debug_mode.data.o" - include "build/data/code/z_debug_mode.bss.o" include "build/src/code/z_demo.o" include "build/src/code/z_draw.o" include "build/src/code/z_eff_footmark.o" diff --git a/src/code/game.c b/src/code/game.c index b7069d312f..f3c381e680 100644 --- a/src/code/game.c +++ b/src/code/game.c @@ -1,5 +1,6 @@ #include "global.h" #include "system_malloc.h" +#include "z64debug_text.h" #include "z64rumble.h" #include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" @@ -90,7 +91,7 @@ void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx) { { s32 requiredScopeTemp; - func_800E9F78(gfxCtx); + Debug_DrawText(gfxCtx); } if (R_ENABLE_ARENA_DBG != 0) { diff --git a/src/code/z_debug_display.c b/src/code/z_debug_display.c index f98b8636eb..d9f20d72bf 100644 --- a/src/code/z_debug_display.c +++ b/src/code/z_debug_display.c @@ -1,13 +1,14 @@ +#include "z64debug_display.h" #include "global.h" DebugDispObject* sDebugObjectListHead; typedef struct { - /* 0x00 */ s16 drawType; // indicates which draw function to use when displaying the object - /* 0x04 */ void* drawArg; // segment address (display list or texture) passed to the draw funciton when called -} DebugDispObjectInfo; // size = 0x8 + /* 0x0 */ s16 drawType; // indicates which draw function to use when displaying the object + /* 0x4 */ void* drawArg; // segment address (display list or texture) passed to the draw funciton when called +} DebugDispObjectInfo; // size = 0x8 -typedef void (*DebugDispObject_DrawFunc)(DebugDispObject*, void*, PlayState*); +typedef void (*DebugDispObjectDrawFunc)(DebugDispObject*, void*, PlayState*); void DebugDisplay_DrawSpriteI8(DebugDispObject*, void*, PlayState*); void DebugDisplay_DrawPolygon(DebugDispObject*, void*, PlayState*); @@ -44,12 +45,12 @@ DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, #include "code/debug_display/debug_display.c" -DebugDispObject_DrawFunc sDebugObjectDrawFuncTable[] = { DebugDisplay_DrawSpriteI8, DebugDisplay_DrawPolygon }; +DebugDispObjectDrawFunc sDebugObjectDrawFuncTable[] = { DebugDisplay_DrawSpriteI8, DebugDisplay_DrawPolygon }; DebugDispObjectInfo sDebugObjectInfoTable[] = { { 0, sDebugDisplayCircleTex }, { 0, sDebugDisplayCrossTex }, { 0, sDebugDisplayBallTex }, - { 0, sDebugDisplayCursorTex }, { 1, &sDebugDisplay1DL }, { 1, &sDebugDisplay3DL }, - { 1, &sDebugDisplay2DL }, + { 0, sDebugDisplayCursorTex }, { 1, sDebugDisplay1DL }, { 1, sDebugDisplay3DL }, + { 1, sDebugDisplay2DL }, }; void DebugDisplay_DrawObjects(PlayState* play) { @@ -86,7 +87,7 @@ void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, void* texture, PlayStat Lights1 sDebugDisplayLight1 = gdSPDefLights1(128, 128, 128, 255, 255, 255, 73, 73, 73); -void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* arg1, PlayState* play) { +void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* dList, PlayState* play) { OPEN_DISPS(play->state.gfxCtx); func_8012C588(play->state.gfxCtx); @@ -99,7 +100,7 @@ void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* arg1, PlayState* p Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, arg1); + gSPDisplayList(POLY_XLU_DISP++, dList); CLOSE_DISPS(play->state.gfxCtx); } diff --git a/src/code/z_debug_mode.c b/src/code/z_debug_mode.c index 0682b36930..a1b4644633 100644 --- a/src/code/z_debug_mode.c +++ b/src/code/z_debug_mode.c @@ -1,13 +1,160 @@ +#include "z64debug_text.h" #include "global.h" -#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug_mode/func_800E9C90.s") +typedef struct { + /* 0x0 */ u8 colorIndex; + /* 0x1 */ char text[11]; +} DebugTextBufferEntry; // size = 0xC -#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug_mode/func_800E9CA0.s") +typedef struct { + /* 0x0 */ u8 x; + /* 0x1 */ u8 y; + /* 0x2 */ u8 colorIndex; + /* 0x3 */ char text[41]; +} DebugCamTextBufferEntry; // size = 0x2C -#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug_mode/func_800E9CFC.s") +#define DEBUG_TEXT_DRAW_TEXT (1 << 0) +#define DEBUG_TEXT_DRAW_CAM_TEXT (1 << 1) -#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug_mode/func_800E9DBC.s") +s32 sDebugTextDrawFlags = 0; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug_mode/func_800E9E94.s") +DebugTextBufferEntry sDebugTextBuffer[] = { + { DEBUG_TEXT_BLACK, " " }, { DEBUG_TEXT_BLACK, " " }, { DEBUG_TEXT_BLACK, " " }, + { DEBUG_TEXT_BLACK, " " }, { DEBUG_TEXT_BLACK, " " }, { DEBUG_TEXT_BLACK, " " }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug_mode/func_800E9F78.s") +Color_RGBA8 sDebugTextColors[] = { + { 0, 0, 0, 64 }, // DEBUG_TEXT_BLACK + { 0, 0, 255, 64 }, // DEBUG_TEXT_BLUE + { 255, 0, 0, 64 }, // DEBUG_TEXT_RED + { 255, 0, 255, 64 }, // DEBUG_TEXT_PURPLE + { 0, 255, 0, 64 }, // DEBUG_TEXT_GREEN + { 0, 255, 255, 64 }, // DEBUG_TEXT_CYAN + { 255, 255, 0, 64 }, // DEBUG_TEXT_YELLOW + { 255, 255, 255, 64 }, // DEBUG_TEXT_WHITE +}; + +DebugCamTextBufferEntry sDebugCamTextBuffer[80]; + +s16 sDebugCamTextEntryCount = 0; + +Color_RGBA8 sDebugCamTextColors[] = { + { 255, 255, 32, 192 }, // DEBUG_CAM_TEXT_YELLOW + { 255, 150, 128, 192 }, // DEBUG_CAM_TEXT_PEACH + { 128, 96, 0, 64 }, // DEBUG_CAM_TEXT_BROWN + { 192, 128, 16, 128 }, // DEBUG_CAM_TEXT_ORANGE + { 255, 192, 32, 128 }, // DEBUG_CAM_TEXT_GOLD + { 230, 230, 220, 64 }, // DEBUG_CAM_TEXT_WHITE + { 128, 150, 255, 128 }, // DEBUG_CAM_TEXT_BLUE + { 128, 255, 32, 128 }, // DEBUG_CAM_TEXT_GREEN +}; + +void Debug_ClearTextDrawFlags(void) { + sDebugTextDrawFlags = 0; +} + +void Debug_ScreenText(s32 index, s32 colorIndex, const char* text) { + DebugTextBufferEntry* entry = &sDebugTextBuffer[index]; + char* textDest = entry->text; + + sDebugTextDrawFlags |= DEBUG_TEXT_DRAW_TEXT; + entry->colorIndex = colorIndex; + + do { + *textDest++ = *text; + } while (*text++ != '\0'); +} + +void Debug_DrawScreenText(GfxPrint* printer) { + DebugTextBufferEntry* entry; + Color_RGBA8* color; + s32 y; + + entry = sDebugTextBuffer; + for (y = 20; y < 20 + ARRAY_COUNT(sDebugTextBuffer); y++) { + GfxPrint_SetPos(printer, 26, y); + color = &sDebugTextColors[entry->colorIndex]; + GfxPrint_SetColor(printer, color->r, color->g, color->b, color->a); + GfxPrint_Printf(printer, "%s", entry->text); + *entry->text = '\0'; + entry++; + } +} + +void DebugCamera_ScreenText(u8 x, u8 y, u8 colorIndex, const char* text) { + DebugCamTextBufferEntry* entry = &sDebugCamTextBuffer[sDebugCamTextEntryCount]; + char* textDest; + s16 charCount; + + sDebugTextDrawFlags |= DEBUG_TEXT_DRAW_CAM_TEXT; + if (sDebugCamTextEntryCount < ARRAY_COUNT(sDebugCamTextBuffer)) { + entry->x = x; + entry->y = y; + entry->colorIndex = colorIndex; + + // Copy text into the entry, truncating if needed + charCount = 0; + textDest = entry->text; + + while ((*textDest++ = *text++) != '\0') { + if (charCount++ >= ARRAY_COUNT(entry->text)) { + break; + } + } + + *textDest = '\0'; + + sDebugCamTextEntryCount++; + } +} + +void DebugCamera_DrawScreenText(GfxPrint* printer) { + DebugCamTextBufferEntry* entry; + Color_RGBA8* color; + s32 i; + + for (i = 0; i < sDebugCamTextEntryCount; i++) { + entry = &sDebugCamTextBuffer[i]; + color = &sDebugCamTextColors[entry->colorIndex]; + + GfxPrint_SetColor(printer, color->r, color->g, color->b, color->a); + GfxPrint_SetPos(printer, entry->x, entry->y); + GfxPrint_Printf(printer, "%s", entry->text); + } +} + +void Debug_DrawText(GraphicsContext* gfxCtx) { + Gfx* gfx; + Gfx* gfxHead; + GfxPrint printer; + + if (THGA_GetSize(&gfxCtx->polyOpa) >= 0x2800) { + GfxPrint_Init(&printer); + + OPEN_DISPS(gfxCtx); + + gfxHead = POLY_OPA_DISP; + gfx = Graph_GfxPlusOne(gfxHead); + gSPDisplayList(DEBUG_DISP++, gfx); + + GfxPrint_Open(&printer, gfx); + + if (sDebugTextDrawFlags & DEBUG_TEXT_DRAW_CAM_TEXT) { + DebugCamera_DrawScreenText(&printer); + } + sDebugCamTextEntryCount = 0; + + if (sDebugTextDrawFlags & DEBUG_TEXT_DRAW_TEXT) { + Debug_DrawScreenText(&printer); + } + + gfx = GfxPrint_Close(&printer); + gSPEndDisplayList(gfx++); + Graph_BranchDlist(gfxHead, gfx); + POLY_OPA_DISP = gfx; + + CLOSE_DISPS(gfxCtx); + + GfxPrint_Destroy(&printer); + } +} diff --git a/src/code/z_play.c b/src/code/z_play.c index f7e3dc5214..712b94f115 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -1,4 +1,5 @@ #include "global.h" +#include "z64debug_display.h" #include "z64quake.h" #include "z64rumble.h" #include "z64shrink_window.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 5b4f80ee66..5715831147 100644 --- a/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c +++ b/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c @@ -5,6 +5,7 @@ */ #include "z_tg_sw.h" +#include "z64debug_display.h" #define FLAGS (ACTOR_FLAG_10) diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index ca5efdcf4a..39a4c7c2b8 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -1527,12 +1527,12 @@ 0x800E97D8:("DebugDisplay_DrawPolygon",), 0x800E992C:("DebugDisplay_DrawPath",), 0x800E99B0:("DebugDisplay_PathDisplayList",), - 0x800E9C90:("func_800E9C90",), - 0x800E9CA0:("func_800E9CA0",), - 0x800E9CFC:("func_800E9CFC",), - 0x800E9DBC:("func_800E9DBC",), - 0x800E9E94:("func_800E9E94",), - 0x800E9F78:("func_800E9F78",), + 0x800E9C90:("Debug_ClearTextDrawFlags",), + 0x800E9CA0:("Debug_ScreenText",), + 0x800E9CFC:("Debug_DrawScreenText",), + 0x800E9DBC:("DebugCamera_ScreenText",), + 0x800E9E94:("DebugCamera_DrawScreenText",), + 0x800E9F78:("Debug_DrawText",), 0x800EA060:("Cutscene_Init",), 0x800EA0D4:("Cutscene_Start",), 0x800EA0EC:("Cutscene_End",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 57991aeb5c..f680f6bca5 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -3926,9 +3926,7 @@ 0x801F3F5A:("D_801F3F5A","UNK_TYPE1","",0x1), 0x801F3F60:("gGameInfo","GameInfo*","",0x4), 0x801F3F70:("sDebugObjectListHead","UNK_TYPE1","",0x1), - 0x801F3F80:("D_801F3F80","UNK_TYPE1","",0x1), - 0x801F3F83:("D_801F3F83","UNK_TYPE1","",0x1), - 0x801F48C8:("D_801F48C8","UNK_TYPE1","",0x1), + 0x801F3F80:("D_801F3F80","UNK_TYPE1","",0xDC0), 0x801F4D40:("seqId","u16","",0x2), 0x801F4D42:("sCutsceneQuakeIndex","UNK_TYPE2","",0x2), 0x801F4D48:("sCutsceneCameraInfo","UNK_TYPE","",0x80), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 2992965d77..0f80073e72 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -1041,12 +1041,12 @@ asm/non_matchings/code/z_debug_display/func_800E95F4.s,func_800E95F4,0x800E95F4, asm/non_matchings/code/z_debug_display/func_800E97D8.s,func_800E97D8,0x800E97D8,0x55 asm/non_matchings/code/z_debug_display/func_800E992C.s,func_800E992C,0x800E992C,0x21 asm/non_matchings/code/z_debug_display/func_800E99B0.s,func_800E99B0,0x800E99B0,0xB8 -asm/non_matchings/code/z_debug_mode/func_800E9C90.s,func_800E9C90,0x800E9C90,0x4 -asm/non_matchings/code/z_debug_mode/func_800E9CA0.s,func_800E9CA0,0x800E9CA0,0x17 -asm/non_matchings/code/z_debug_mode/func_800E9CFC.s,func_800E9CFC,0x800E9CFC,0x30 -asm/non_matchings/code/z_debug_mode/func_800E9DBC.s,func_800E9DBC,0x800E9DBC,0x36 -asm/non_matchings/code/z_debug_mode/func_800E9E94.s,func_800E9E94,0x800E9E94,0x39 -asm/non_matchings/code/z_debug_mode/func_800E9F78.s,func_800E9F78,0x800E9F78,0x3A +asm/non_matchings/code/z_debug_mode/Debug_ClearTextDrawFlags.s,Debug_ClearTextDrawFlags,0x800E9C90,0x4 +asm/non_matchings/code/z_debug_mode/Debug_ScreenText.s,Debug_ScreenText,0x800E9CA0,0x17 +asm/non_matchings/code/z_debug_mode/Debug_DrawScreenText.s,Debug_DrawScreenText,0x800E9CFC,0x30 +asm/non_matchings/code/z_debug_mode/DebugCamera_ScreenText.s,DebugCamera_ScreenText,0x800E9DBC,0x36 +asm/non_matchings/code/z_debug_mode/DebugCamera_DrawScreenText.s,DebugCamera_DrawScreenText,0x800E9E94,0x39 +asm/non_matchings/code/z_debug_mode/Debug_DrawText.s,Debug_DrawText,0x800E9F78,0x3A asm/non_matchings/code/z_demo/Cutscene_Init.s,Cutscene_Init,0x800EA060,0x1D asm/non_matchings/code/z_demo/Cutscene_Start.s,Cutscene_Start,0x800EA0D4,0x6 asm/non_matchings/code/z_demo/Cutscene_End.s,Cutscene_End,0x800EA0EC,0x9 From 9f529aaf2a3aa2d5a10e1273babf7781ab9faabc Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Wed, 8 Mar 2023 08:54:56 -0800 Subject: [PATCH 28/29] HF progress script (#1200) --- tools/progress.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/progress.py b/tools/progress.py index dccd743d78..5a2958cd85 100755 --- a/tools/progress.py +++ b/tools/progress.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -import argparse, csv, git, json, os, re, sys +import argparse, csv, os, re, sys parser = argparse.ArgumentParser() @@ -170,6 +170,7 @@ srcCategories = [ "libultra", "code", "overlays", + "audio", ] srcCategoriesFixer = { @@ -256,6 +257,12 @@ asmTracker["boot"]["totalSize"] += asmTracker["libultra"]["totalSize"] del srcTracker["libultra"] del asmTracker["libultra"] +# Add audio to code. +srcTracker["code"]["totalSize"] += srcTracker["audio"]["totalSize"] +asmTracker["code"]["totalSize"] += asmTracker["audio"]["totalSize"] +del srcTracker["audio"] +del asmTracker["audio"] + # Calculate Non-Matching non_matching_functions_ovl = list(map(lambda x: x.split("/")[-1].split(".")[0], filter(lambda x: "/overlays/" in x, non_matching_functions))) non_matching_functions_code = list(map(lambda x: x.split("/")[-1].split(".")[0], filter(lambda x: "/code/" in x, non_matching_functions))) @@ -337,6 +344,8 @@ masks = int(src / bytes_per_mask) rupees = int((src % bytes_per_mask) / bytes_per_rupee) if args.format == 'csv': + import git + version = 2 git_object = git.Repo().head.object timestamp = str(git_object.committed_date) @@ -358,6 +367,8 @@ if args.format == 'csv': print(",".join(map(str, csv_list))) elif args.format == 'shield-json': + import json + # https://shields.io/endpoint print(json.dumps({ "schemaVersion": 1, From 2f1e7b3de8695c8f093c18ee6fe2e9e5c4c9e15a Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Wed, 8 Mar 2023 15:25:51 -0300 Subject: [PATCH 29/29] Stack cleanups (#1193) * Use STACK and STACK_TOP everywhere * format * remove fake variable * bss * review Co-authored-by: Derek Hensley * Update src/boot_O2_g3/boot_main.c Co-authored-by: Derek Hensley * review * renames * more renames * and more * whoopsie, forgot those too * hopefully the last cleanup * forgot some stuff * a * bss --------- Co-authored-by: Derek Hensley --- include/buffers.h | 20 +++++ include/stack.h | 12 +++ include/variables.h | 89 +++---------------- src/audio/lib/load.c | 1 + src/audio/session_config.c | 1 + src/boot_O2_g3/boot_main.c | 15 ++-- src/boot_O2_g3/fault.c | 18 ++-- src/boot_O2_g3/idle.c | 19 ++-- src/boot_O2_g3/z_std_dma.c | 7 +- src/buffers/gfxpools.c | 2 +- src/buffers/gfxstack.c | 4 +- src/buffers/gfxyield.c | 3 +- src/buffers/heaps.c | 2 +- src/code/PreRender.c | 14 ++- src/code/graph.c | 1 + src/code/main.c | 45 +++++++--- src/code/sys_cfb.c | 1 + src/code/sys_flashrom.c | 11 +++ src/code/z_play.c | 1 + src/code/z_sram_NES.c | 1 + src/libultra/io/pimgr.c | 11 +-- src/libultra/io/vimgr.c | 5 +- .../actors/ovl_En_Wood02/z_en_wood02.c | 29 +++--- .../actors/ovl_Obj_Grass/z_obj_grass.c | 2 - tools/disasm/variables.txt | 47 +++++----- 25 files changed, 192 insertions(+), 169 deletions(-) create mode 100644 include/buffers.h create mode 100644 include/stack.h diff --git a/include/buffers.h b/include/buffers.h new file mode 100644 index 0000000000..72615a717b --- /dev/null +++ b/include/buffers.h @@ -0,0 +1,20 @@ +#ifndef BUFFERS_H +#define BUFFERS_H + +#include "z64.h" +#include "macros.h" +#include "stack.h" + + +extern u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE]; +extern STACK(gGfxSPTaskStack, 0x400); +extern GfxPool gGfxPools[2]; +extern u8 gAudioHeap[0x138000]; +extern u8 gSystemHeap[]; + +extern u8 gPictoPhotoI8[PICTO_PHOTO_SIZE]; +extern u8 D_80784600[0x56200]; +extern u16 gFramebuffer0[SCREEN_HEIGHT][SCREEN_WIDTH]; + + +#endif diff --git a/include/stack.h b/include/stack.h new file mode 100644 index 0000000000..3667862cb6 --- /dev/null +++ b/include/stack.h @@ -0,0 +1,12 @@ +#ifndef STACK_H +#define STACK_H + +#include "alignment.h" + +#define STACK(stack, size) \ + u64 stack[ALIGN8(size) / sizeof(u64)] + +#define STACK_TOP(stack) \ + ((u8*)(stack) + sizeof(stack)) + +#endif diff --git a/include/variables.h b/include/variables.h index f12dbe629c..59779203d5 100644 --- a/include/variables.h +++ b/include/variables.h @@ -282,27 +282,12 @@ extern f64 D_800994C8; extern char gBuildTeam[]; extern char gBuildDate[]; extern char gBuildMakeOption[]; -// extern StackEntry sBootThreadInfo; -// extern OSThread sIdleThread; -// extern u8 sIdleThreadStack[0x400]; -// extern StackEntry sIdleThreadInfo; -// extern u8 sBootThreadStack[0x400]; + extern IrqMgr gIrqMgr; -// extern u8 sIrqMgrStack[0x500]; -// extern StackEntry sIrqMgrStackInfo; -// extern OSThread gMainThread; -// extern u8 sMainStack[0x900]; -// extern StackEntry sMainStackInfo; -// extern OSMesg sPiMgrCmdBuff[50]; -// extern OSMesgQueue gPiMgrCmdQ; + extern OSViMode gViConfigMode; extern u8 D_8009B290; -extern StackEntry sDmaMgrStackInfo; -extern u16 numDmaEntries; -extern OSMesgQueue sDmaMgrMsgQueue; -extern OSMesg sDmaMgrMsgs[32]; -extern OSThread sDmaMgrThread; -extern u8 sDmaMgrStack[0x500]; + extern u8 sYaz0DataBuffer[0x400]; extern u8* sYaz0CurDataEnd; extern u32 sYaz0CurRomStart; @@ -312,13 +297,9 @@ extern void* gYaz0DecompressDstEnd; // extern UNK_TYPE4 D_8009BE30; // extern UNK_TYPE4 D_8009BE34; // extern FaultClient romInfoFaultClient; -extern FaultThreadStruct* sFaultContext; -extern f32 D_8009BE54; -extern u32 faultCustomOptions; -extern u32 faultCopyToLog; -extern u8 sFaultStack[0x600]; -extern StackEntry sFaultThreadInfo; + extern FaultThreadStruct gFaultStruct; + extern FaultDrawer sFaultDrawerStruct; // extern UNK_TYPE4 D_8009CD10; extern u32 sRandFloat; @@ -333,10 +314,7 @@ extern UNK_TYPE1 D_8009CF60; extern OSThread __osThreadSave; extern OSPiHandle D_8009D130; extern OSPiHandle D_8009D1A8; -// extern OSThread D_8009D220; -// extern u8 piManagerStack[0x1000]; -// extern OSMesgQueue D_8009E3D0; -// extern OSMesg D_8009E3E8[1]; + extern OSMesg D_8009E3F0[1]; extern OSMesgQueue __osPiAccessQueue; extern __OSInode __osPfsInodeCache; @@ -348,13 +326,7 @@ extern u32 __osViIntrCount; extern u32 __osTimerCounter; extern OSPifRam __osPfsPifRam; extern OSPiHandle CartRomHandle; -extern OSThread viThread; -extern u8 viThreadStack[0x1000]; -extern OSMesgQueue viEventQueue; -// extern OSMesg viEventBuf[5]; -// extern OSIoMesg viRetraceMsg; -// extern OSIoMesg viCounterMsg; -extern u16 viRetrace; + extern DmaEntry dmadata[1568]; // extern UNK_TYPE1 D_80186028; extern u64 aspMainTextStart[]; @@ -2488,11 +2460,7 @@ extern Struct_80140E80* D_801F6D4C; extern BombersNotebook sBombersNotebook; extern u8 sBombersNotebookOpen; extern u8 sMotionBlurStatus; -extern SlowlyTask D_801F6E00; -extern s32 D_801F6FC0; -extern StackEntry slowlyStackEntry; -extern u8 slowlyStack[0x1000]; -extern UNK_TYPE1 D_801F7FE8; + extern UNK_TYPE1 D_801F7FF0; extern struct_801F8010 D_801F8010; extern struct_801F8020 D_801F8020; @@ -2503,24 +2471,12 @@ extern FaultClient sGraphFaultClient; extern GfxMasterList* gGfxMasterDL; extern CfbInfo sGraphCfbInfos[3]; extern OSTime sGraphTaskStartTime; -extern OSMesgQueue sSiIntMsgQ; -extern OSMesg sSiIntMsgBuf[1]; + extern u32 gSegments[NUM_SEGMENTS]; extern SchedContext gSchedContext; -extern IrqMgrClient irqClient; -extern OSMesgQueue irqMgrMsgQ; -extern OSMesg irqMgrMsgBuf[60]; -extern OSThread sGraphThread; -extern u8 sGraphStack[6144]; -extern u8 schedStack[1536]; -extern u8 audioStack[2048]; -extern u8 padmgrStack[1280]; -extern StackEntry sGraphStackInfo; -extern StackEntry schedStackEntry; -extern StackEntry audioStackEntry; -extern StackEntry padmgrStackEntry; -extern AudioMgr audioContext; -extern PadMgr D_801FB620; +extern OSThread gGraphThread; +extern PadMgr gPadMgr; + extern FaultClient sSchedFaultClient; extern OSTime sRSPGFXStartTime; extern OSTime sRSPAudioStartTime; @@ -2636,15 +2592,7 @@ extern Vec3f D_801FBDA4; extern Vec3f D_801FBDE8; extern MtxF* sMatrixStack; extern MtxF* sCurrentMatrix; -// extern UNK_TYPE1 D_801FBE10; -// extern UNK_TYPE1 D_801FBE28; -// extern UNK_TYPE1 D_801FBE2C; -// extern UNK_TYPE4 D_801FBE30; -extern u8 sys_flashromStack[0x1000]; -extern StackEntry sys_flashromStackEntry; -extern OSThread sys_flashromOSThread; -extern s80185D40 D_801FD008; -extern OSMesg D_801FD034; + extern s32 D_801FD120; // extern UNK_TYPE1 D_801FD140; // extern UNK_TYPE1 D_801FD158; @@ -2777,17 +2725,6 @@ extern AudioCustomSeqFunction gAudioCustomSeqFunction; extern AudioCustomReverbFunction gAudioCustomReverbFunction; extern AudioCustomSynthFunction gAudioCustomSynthFunction; -// post-code buffers -extern u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE]; -extern u8 gGfxSPTaskStack[0x400]; -extern GfxPool gGfxPools[2]; -extern u8 gAudioHeap[0x138000]; -extern u8 gSystemHeap[UNK_SIZE]; - -extern u8 gPictoPhotoI8[PICTO_PHOTO_SIZE]; -extern u8 D_80784600[0x56200]; -extern u16 gFramebuffer0[SCREEN_HEIGHT][SCREEN_WIDTH]; - // other segments extern GfxMasterList D_0E000000; extern Mtx D_01000000; diff --git a/src/audio/lib/load.c b/src/audio/lib/load.c index 28c27d2cca..6584b0a50f 100644 --- a/src/audio/lib/load.c +++ b/src/audio/lib/load.c @@ -11,6 +11,7 @@ */ #include "global.h" +#include "buffers.h" /** * SoundFont Notes: diff --git a/src/audio/session_config.c b/src/audio/session_config.c index 6bba865e9c..e0881913b8 100644 --- a/src/audio/session_config.c +++ b/src/audio/session_config.c @@ -1,4 +1,5 @@ #include "global.h" +#include "buffers.h" const s16 gAudioTatumInit[] = { 0x1C00, // unused diff --git a/src/boot_O2_g3/boot_main.c b/src/boot_O2_g3/boot_main.c index 87bee5da4f..061458a1db 100644 --- a/src/boot_O2_g3/boot_main.c +++ b/src/boot_O2_g3/boot_main.c @@ -1,21 +1,22 @@ #include "prevent_bss_reordering.h" #include "global.h" +#include "stack.h" -StackEntry sBootThreadInfo; +StackEntry sBootStackInfo; OSThread sIdleThread; -u8 sIdleThreadStack[0x400]; -StackEntry sIdleThreadInfo; -u8 sBootThreadStack[0x400]; +STACK(sIdleThreadStack, 0x400); +StackEntry sIdleStackInfo; +STACK(sBootThreadStack, 0x400); void bootproc(void) { - StackCheck_Init(&sBootThreadInfo, sBootThreadStack, sBootThreadStack + sizeof(sBootThreadStack), 0, -1, "boot"); + StackCheck_Init(&sBootStackInfo, sBootThreadStack, STACK_TOP(sBootThreadStack), 0, -1, "boot"); osMemSize = osGetMemSize(); func_800818F4(); osInitialize(); osUnmapTLBAll(); gCartHandle = osCartRomInit(); - StackCheck_Init(&sIdleThreadInfo, sIdleThreadStack, sIdleThreadStack + sizeof(sIdleThreadStack), 0, 256, "idle"); - osCreateThread(&sIdleThread, Z_THREAD_ID_IDLE, Idle_ThreadEntry, NULL, sIdleThreadStack + sizeof(sIdleThreadStack), + StackCheck_Init(&sIdleStackInfo, sIdleThreadStack, STACK_TOP(sIdleThreadStack), 0, 0x100, "idle"); + osCreateThread(&sIdleThread, Z_THREAD_ID_IDLE, Idle_ThreadEntry, NULL, STACK_TOP(sIdleThreadStack), Z_PRIORITY_IDLE); osStartThread(&sIdleThread); } diff --git a/src/boot_O2_g3/fault.c b/src/boot_O2_g3/fault.c index e648275b6f..134b120dc9 100644 --- a/src/boot_O2_g3/fault.c +++ b/src/boot_O2_g3/fault.c @@ -1,7 +1,15 @@ #include "ultra64.h" #include "global.h" +#include "stack.h" #include "vt.h" +extern FaultThreadStruct* sFaultContext; +extern f32 D_8009BE54; +extern u32 faultCustomOptions; +extern u32 faultCopyToLog; +extern STACK(sFaultStack, 0x600); +extern StackEntry sFaultStackInfo; + // data const char* sCpuExceptions[] = { "Interrupt", @@ -759,9 +767,9 @@ void Fault_SetOptionsFromController3(void) { } if (faultCustomOptions) { - graphPC = sGraphThread.context.pc; - graphRA = sGraphThread.context.ra; - graphSP = sGraphThread.context.sp; + graphPC = gGraphThread.context.pc; + graphRA = gGraphThread.context.ra; + graphSP = gGraphThread.context.sp; if (CHECK_BTN_ALL(input3->cur.button, BTN_R)) { static u32 faultCopyToLog; @@ -889,8 +897,8 @@ void Fault_Start(void) { sFaultContext->faultActive = 0; gFaultStruct.faultHandlerEnabled = 1; osCreateMesgQueue(&sFaultContext->queue, sFaultContext->msg, ARRAY_COUNT(sFaultContext->msg)); - StackCheck_Init(&sFaultThreadInfo, sFaultStack, sFaultStack + sizeof(sFaultStack), 0, 0x100, "fault"); - osCreateThread(&sFaultContext->thread, 2, Fault_ThreadEntry, NULL, sFaultStack + sizeof(sFaultStack), 0x7F); + StackCheck_Init(&sFaultStackInfo, sFaultStack, STACK_TOP(sFaultStack), 0, 0x100, "fault"); + osCreateThread(&sFaultContext->thread, 2, Fault_ThreadEntry, NULL, STACK_TOP(sFaultStack), 0x7F); osStartThread(&sFaultContext->thread); } diff --git a/src/boot_O2_g3/idle.c b/src/boot_O2_g3/idle.c index da93f13fdb..40bcf5d0e3 100644 --- a/src/boot_O2_g3/idle.c +++ b/src/boot_O2_g3/idle.c @@ -1,5 +1,7 @@ #include "prevent_bss_reordering.h" #include "global.h" +#include "stack.h" +#include "buffers.h" u8 D_80096B20 = 1; vu8 gViConfigUseDefault = 1; @@ -9,10 +11,10 @@ f32 gViConfigXScale = 1.0f; f32 gViConfigYScale = 1.0f; IrqMgr gIrqMgr; -u8 sIrqMgrStack[0x500]; +STACK(sIrqMgrStack, 0x500); StackEntry sIrqMgrStackInfo; -OSThread gMainThread; -u8 sMainStack[0x900]; +OSThread sMainThread; +STACK(sMainStack, 0x900); StackEntry sMainStackInfo; OSMesg sPiMgrCmdBuff[50]; OSMesgQueue gPiMgrCmdQ; @@ -71,8 +73,8 @@ void Idle_InitCodeAndMemory(void) { } void Main_ThreadEntry(void* arg) { - StackCheck_Init(&sIrqMgrStackInfo, sIrqMgrStack, sIrqMgrStack + sizeof(sIrqMgrStack), 0, 0x100, "irqmgr"); - IrqMgr_Init(&gIrqMgr, &sIrqMgrStackInfo, Z_PRIORITY_IRQMGR, 1); + StackCheck_Init(&sIrqMgrStackInfo, sIrqMgrStack, STACK_TOP(sIrqMgrStack), 0, 0x100, "irqmgr"); + IrqMgr_Init(&gIrqMgr, STACK_TOP(sIrqMgrStack), Z_PRIORITY_IRQMGR, 1); DmaMgr_Start(); Idle_InitCodeAndMemory(); Main(arg); @@ -108,10 +110,9 @@ void Idle_InitVideo(void) { void Idle_ThreadEntry(void* arg) { Idle_InitVideo(); osCreatePiManager(150, &gPiMgrCmdQ, sPiMgrCmdBuff, ARRAY_COUNT(sPiMgrCmdBuff)); - StackCheck_Init(&sMainStackInfo, sMainStack, sMainStack + sizeof(sMainStack), 0, 0x400, "main"); - osCreateThread(&gMainThread, Z_THREAD_ID_MAIN, Main_ThreadEntry, arg, sMainStack + sizeof(sMainStack), - Z_PRIORITY_MAIN); - osStartThread(&gMainThread); + StackCheck_Init(&sMainStackInfo, sMainStack, STACK_TOP(sMainStack), 0, 0x400, "main"); + osCreateThread(&sMainThread, Z_THREAD_ID_MAIN, Main_ThreadEntry, arg, STACK_TOP(sMainStack), Z_PRIORITY_MAIN); + osStartThread(&sMainThread); osSetThreadPri(NULL, 0); do { } while (true); } diff --git a/src/boot_O2_g3/z_std_dma.c b/src/boot_O2_g3/z_std_dma.c index 8e9d838729..dd34d9e87f 100644 --- a/src/boot_O2_g3/z_std_dma.c +++ b/src/boot_O2_g3/z_std_dma.c @@ -1,5 +1,6 @@ #include "prevent_bss_reordering.h" #include "global.h" +#include "stack.h" u32 sDmaMgrDmaBuffSize = 0x2000; @@ -8,7 +9,7 @@ u16 numDmaEntries; OSMesgQueue sDmaMgrMsgQueue; OSMesg sDmaMgrMsgs[32]; OSThread sDmaMgrThread; -u8 sDmaMgrStack[0x500]; +STACK(sDmaMgrStack, 0x500); s32 DmaMgr_DmaRomToRam(uintptr_t rom, void* ram, size_t size) { OSIoMesg ioMsg; @@ -226,8 +227,8 @@ void DmaMgr_Start(void) { } osCreateMesgQueue(&sDmaMgrMsgQueue, sDmaMgrMsgs, ARRAY_COUNT(sDmaMgrMsgs)); - StackCheck_Init(&sDmaMgrStackInfo, sDmaMgrStack, sDmaMgrStack + sizeof(sDmaMgrStack), 0, 0x100, "dmamgr"); - osCreateThread(&sDmaMgrThread, Z_THREAD_ID_DMAMGR, DmaMgr_ThreadEntry, NULL, sDmaMgrStack + sizeof(sDmaMgrStack), + StackCheck_Init(&sDmaMgrStackInfo, sDmaMgrStack, STACK_TOP(sDmaMgrStack), 0, 0x100, "dmamgr"); + osCreateThread(&sDmaMgrThread, Z_THREAD_ID_DMAMGR, DmaMgr_ThreadEntry, NULL, STACK_TOP(sDmaMgrStack), Z_PRIORITY_DMAMGR); osStartThread(&sDmaMgrThread); diff --git a/src/buffers/gfxpools.c b/src/buffers/gfxpools.c index a91c87bed9..ff4934f11a 100644 --- a/src/buffers/gfxpools.c +++ b/src/buffers/gfxpools.c @@ -1,3 +1,3 @@ -#include "global.h" +#include "buffers.h" GfxPool gGfxPools[2]; diff --git a/src/buffers/gfxstack.c b/src/buffers/gfxstack.c index 2b158d1414..8864d58ef5 100644 --- a/src/buffers/gfxstack.c +++ b/src/buffers/gfxstack.c @@ -1,3 +1,3 @@ -#include "global.h" +#include "buffers.h" -u8 gGfxSPTaskStack[0x400]; +STACK(gGfxSPTaskStack, 0x400); diff --git a/src/buffers/gfxyield.c b/src/buffers/gfxyield.c index 94a5f55c97..576cfc0bb4 100644 --- a/src/buffers/gfxyield.c +++ b/src/buffers/gfxyield.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" -#include "global.h" +#include "buffers.h" u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE]; diff --git a/src/buffers/heaps.c b/src/buffers/heaps.c index 866d51c16d..477eca03ef 100644 --- a/src/buffers/heaps.c +++ b/src/buffers/heaps.c @@ -1,4 +1,4 @@ -#include "global.h" +#include "buffers.h" u8 gAudioHeap[0x138000]; diff --git a/src/code/PreRender.c b/src/code/PreRender.c index 599f4c8d30..247325251c 100644 --- a/src/code/PreRender.c +++ b/src/code/PreRender.c @@ -1,4 +1,5 @@ #include "global.h" +#include "stack.h" /** * Assigns the "save" values in PreRender @@ -410,19 +411,24 @@ void PreRender_ApplyFilters(PreRender* this) { } } +extern SlowlyTask D_801F6E00; +extern s32 D_801F6FC0; +extern StackEntry sSlowlyStackInfo; +extern STACK(sSlowlyStack, 0x1000); + /** * Initializes `PreRender_ApplyFilters` onto a new "slowly" thread */ void PreRender_ApplyFiltersSlowlyInit(PreRender* this) { if ((this->cvgSave != NULL) && (this->fbufSave != NULL)) { if (D_801F6FC0) { - StackCheck_Cleanup(&slowlyStackEntry); + StackCheck_Cleanup(&sSlowlyStackInfo); Slowly_Stop(&D_801F6E00); } this->unk_4D = 1; - StackCheck_Init(&slowlyStackEntry, slowlyStack, &slowlyStack[4096], 0, 0x100, "slowly"); - Slowly_Start(&D_801F6E00, &D_801F7FE8, PreRender_ApplyFilters, this, NULL); + StackCheck_Init(&sSlowlyStackInfo, sSlowlyStack, STACK_TOP(sSlowlyStack), 0, 0x100, "slowly"); + Slowly_Start(&D_801F6E00, STACK_TOP(sSlowlyStack), PreRender_ApplyFilters, this, NULL); D_801F6FC0 = true; } } @@ -432,7 +438,7 @@ void PreRender_ApplyFiltersSlowlyInit(PreRender* this) { */ void PreRender_ApplyFiltersSlowlyDestroy(PreRender* this) { if (D_801F6FC0) { - StackCheck_Cleanup(&slowlyStackEntry); + StackCheck_Cleanup(&sSlowlyStackInfo); Slowly_Stop(&D_801F6E00); D_801F6FC0 = false; } diff --git a/src/code/graph.c b/src/code/graph.c index 4bf3228783..6cc8d77729 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -1,4 +1,5 @@ #include "global.h" +#include "buffers.h" #include "system_malloc.h" #include "overlays/gamestates/ovl_daytelop/z_daytelop.h" #include "overlays/gamestates/ovl_file_choose/z_file_choose.h" diff --git a/src/code/main.c b/src/code/main.c index 59ffb6a32f..b036123bea 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -3,7 +3,29 @@ * reordering than just prevent_bss_reordering.h: there is too much of it to control, and it cannot be split into * separate files since most of it is at addresses ending in 8. */ + #include "global.h" +#include "buffers.h" +#include "stack.h" + +extern OSMesgQueue sSiIntMsgQ; +extern OSMesg sSiIntMsgBuf[1]; +extern u32 gSegments[NUM_SEGMENTS]; +extern SchedContext gSchedContext; +extern IrqMgrClient irqClient; +extern OSMesgQueue irqMgrMsgQ; +extern OSMesg irqMgrMsgBuf[60]; +extern OSThread gGraphThread; +extern STACK(sGraphStack, 0x1800); +extern STACK(sSchedStack, 0x600); +extern STACK(sAudioStack, 0x800); +extern STACK(sPadMgrStack, 0x500); +extern StackEntry sGraphStackInfo; +extern StackEntry sSchedStackInfo; +extern StackEntry sAudioStackInfo; +extern StackEntry sPadMgrStackInfo; +extern AudioMgr sAudioMgr; +extern PadMgr gPadMgr; void Main(void* arg) { intptr_t fb; @@ -33,25 +55,24 @@ void Main(void* arg) { osCreateMesgQueue(&irqMgrMsgQ, irqMgrMsgBuf, ARRAY_COUNT(irqMgrMsgBuf)); - StackCheck_Init(&schedStackEntry, schedStack, schedStack + sizeof(schedStack), 0, 0x100, "sched"); - Sched_Init(&gSchedContext, schedStack + sizeof(schedStack), Z_PRIORITY_SCHED, D_8009B290, 1, &gIrqMgr); + StackCheck_Init(&sSchedStackInfo, sSchedStack, STACK_TOP(sSchedStack), 0, 0x100, "sched"); + Sched_Init(&gSchedContext, STACK_TOP(sSchedStack), Z_PRIORITY_SCHED, D_8009B290, 1, &gIrqMgr); CIC6105_AddRomInfoFaultPage(); IrqMgr_AddClient(&gIrqMgr, &irqClient, &irqMgrMsgQ); - StackCheck_Init(&audioStackEntry, audioStack, audioStack + sizeof(audioStack), 0, 0x100, "audio"); - AudioMgr_Init(&audioContext, audioStack + sizeof(audioStack), Z_PRIORITY_AUDIOMGR, 0xA, &gSchedContext, &gIrqMgr); + StackCheck_Init(&sAudioStackInfo, sAudioStack, STACK_TOP(sAudioStack), 0, 0x100, "audio"); + AudioMgr_Init(&sAudioMgr, STACK_TOP(sAudioStack), Z_PRIORITY_AUDIOMGR, 0xA, &gSchedContext, &gIrqMgr); - StackCheck_Init(&padmgrStackEntry, padmgrStack, padmgrStack + sizeof(padmgrStack), 0, 0x100, "padmgr"); - PadMgr_Init(&sSiIntMsgQ, &gIrqMgr, 7, Z_PRIORITY_PADMGR, padmgrStack + sizeof(padmgrStack)); + StackCheck_Init(&sPadMgrStackInfo, sPadMgrStack, STACK_TOP(sPadMgrStack), 0, 0x100, "padmgr"); + PadMgr_Init(&sSiIntMsgQ, &gIrqMgr, 7, Z_PRIORITY_PADMGR, STACK_TOP(sPadMgrStack)); - AudioMgr_Unlock(&audioContext); + AudioMgr_Unlock(&sAudioMgr); - StackCheck_Init(&sGraphStackInfo, sGraphStack, sGraphStack + sizeof(sGraphStack), 0, 0x100, "graph"); - osCreateThread(&sGraphThread, Z_THREAD_ID_GRAPH, Graph_ThreadEntry, arg, sGraphStack + sizeof(sGraphStack), - Z_PRIORITY_GRAPH); - osStartThread(&sGraphThread); + StackCheck_Init(&sGraphStackInfo, sGraphStack, STACK_TOP(sGraphStack), 0, 0x100, "graph"); + osCreateThread(&gGraphThread, Z_THREAD_ID_GRAPH, Graph_ThreadEntry, arg, STACK_TOP(sGraphStack), Z_PRIORITY_GRAPH); + osStartThread(&gGraphThread); exit = false; @@ -73,5 +94,5 @@ void Main(void* arg) { } IrqMgr_RemoveClient(&gIrqMgr, &irqClient); - osDestroyThread(&sGraphThread); + osDestroyThread(&gGraphThread); } diff --git a/src/code/sys_cfb.c b/src/code/sys_cfb.c index 3f198ce8fd..25d92227cb 100644 --- a/src/code/sys_cfb.c +++ b/src/code/sys_cfb.c @@ -1,4 +1,5 @@ #include "global.h" +#include "buffers.h" #include "system_malloc.h" #pragma GLOBAL_ASM("asm/non_matchings/code/sys_cfb/func_80178750.s") diff --git a/src/code/sys_flashrom.c b/src/code/sys_flashrom.c index 8b6c2fa5cc..e9ea6e21ef 100644 --- a/src/code/sys_flashrom.c +++ b/src/code/sys_flashrom.c @@ -1,6 +1,17 @@ #include "global.h" +#include "stack.h" #include "system_malloc.h" +// extern UNK_TYPE1 D_801FBE10; +// extern UNK_TYPE1 D_801FBE28; +// extern UNK_TYPE1 D_801FBE2C; +// extern UNK_TYPE4 D_801FBE30; +extern STACK(sSysFlashromStack, 0x1000); +extern StackEntry sys_flashromStackEntry; +extern OSThread sys_flashromOSThread; +extern s80185D40 D_801FD008; +extern OSMesg D_801FD034; + #pragma GLOBAL_ASM("asm/non_matchings/code/sys_flashrom/func_801857C0.s") #pragma GLOBAL_ASM("asm/non_matchings/code/sys_flashrom/func_801857D0.s") diff --git a/src/code/z_play.c b/src/code/z_play.c index 712b94f115..f6a425367f 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -1,4 +1,5 @@ #include "global.h" +#include "buffers.h" #include "z64debug_display.h" #include "z64quake.h" #include "z64rumble.h" diff --git a/src/code/z_sram_NES.c b/src/code/z_sram_NES.c index 94d0e69c31..67f8bdda6f 100644 --- a/src/code/z_sram_NES.c +++ b/src/code/z_sram_NES.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" #include "overlays/gamestates/ovl_file_choose/z_file_choose.h" diff --git a/src/libultra/io/pimgr.c b/src/libultra/io/pimgr.c index 3d618de746..fefffd6533 100644 --- a/src/libultra/io/pimgr.c +++ b/src/libultra/io/pimgr.c @@ -1,9 +1,10 @@ #include "global.h" +#include "stack.h" OSPiHandle D_8009D130; OSPiHandle D_8009D1A8; -OSThread D_8009D220; -u8 piManagerStack[0x1000]; +OSThread sPiMgrThread; +STACK(sPiMgrStack, 0x1000); OSMesgQueue D_8009E3D0; OSMesg D_8009E3E8[1]; @@ -27,14 +28,14 @@ void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgC } savedMask = __osDisableInt(); __osPiDevMgr.active = 1; - __osPiDevMgr.thread = &D_8009D220; + __osPiDevMgr.thread = &sPiMgrThread; __osPiDevMgr.cmdQueue = cmdQ; __osPiDevMgr.evtQueue = &D_8009E3D0; __osPiDevMgr.acsQueue = &__osPiAccessQueue; __osPiDevMgr.piDmaCallback = __osPiRawStartDma; __osPiDevMgr.epiDmaCallback = __osEPiRawStartDma; - osCreateThread(&D_8009D220, 0, __osDevMgrMain, (void*)&__osPiDevMgr, &piManagerStack[4096], pri); - osStartThread(&D_8009D220); + osCreateThread(&sPiMgrThread, 0, __osDevMgrMain, &__osPiDevMgr, STACK_TOP(sPiMgrStack), pri); + osStartThread(&sPiMgrThread); __osRestoreInt(savedMask); if (oldPri != -1) { osSetThreadPri(NULL, oldPri); diff --git a/src/libultra/io/vimgr.c b/src/libultra/io/vimgr.c index 07babf3517..ad9cbffd89 100644 --- a/src/libultra/io/vimgr.c +++ b/src/libultra/io/vimgr.c @@ -1,8 +1,9 @@ #include "global.h" +#include "stack.h" #include "osint.h" OSThread viThread; -u8 viThreadStack[0x1000]; +STACK(sViStack, 0x1000); OSMesgQueue viEventQueue; OSMesg viEventBuf[6]; OSIoMesg viRetraceMsg; @@ -45,7 +46,7 @@ void osCreateViManager(OSPri pri) { __osViDevMgr.piDmaCallback = NULL; __osViDevMgr.epiDmaCallback = NULL; - osCreateThread(&viThread, 0, &viMgrMain, &__osViDevMgr, viThreadStack + sizeof(viThreadStack), pri); + osCreateThread(&viThread, 0, &viMgrMain, &__osViDevMgr, STACK_TOP(sViStack), pri); __osViInit(); osStartThread(&viThread); __osRestoreInt(prevInt); 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 ccf5a374f4..9b74a97ac9 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -4,6 +4,7 @@ * Description: Trees, shrubs */ +#include "prevent_bss_reordering.h" #include "z_en_wood02.h" #include "objects/object_wood02/object_wood02.h" @@ -35,8 +36,8 @@ typedef enum { /* 5 */ WOOD_DRAW_LEAF_YELLOW } WoodDrawType; -static f32 sSpawnCos; -static f32 sSpawnSin; +f32 sWood02SpawnCos; +f32 sWood02SpawnSin; ActorInit En_Wood02_InitVars = { ACTOR_EN_WOOD02, @@ -70,9 +71,9 @@ static ColliderCylinderInit sCylinderInit = { { 18, 60, 0, { 0, 0, 0 } }, }; -static f32 sSpawnDistance[] = { 707.0f, 525.0f, 510.0f, 500.0f, 566.0f, 141.0f }; +f32 sWood02SpawnDistance[] = { 707.0f, 525.0f, 510.0f, 500.0f, 566.0f, 141.0f }; -static s16 sSpawnAngle[] = { 0x1FFF, 0x4C9E, 0x77F5, 0xA5C9, -0x293D, 0xA000 }; +s16 sWood02SpawnAngle[] = { 0x1FFF, 0x4C9E, 0x77F5, 0xA5C9, -0x293D, 0xA000 }; static InitChainEntry sInitChain[] = { ICHAIN_F32(targetArrowOffset, 5600, ICHAIN_STOP), @@ -136,12 +137,12 @@ void EnWood02_SpawnOffspring(EnWood02* this, PlayState* play) { extraRot = 0x4000; } - sSpawnCos = Math_CosS(sSpawnAngle[i] + this->actor.world.rot.y + extraRot); - sSpawnSin = Math_SinS(sSpawnAngle[i] + this->actor.world.rot.y + extraRot); + sWood02SpawnCos = Math_CosS(sWood02SpawnAngle[i] + this->actor.world.rot.y + extraRot); + sWood02SpawnSin = Math_SinS(sWood02SpawnAngle[i] + this->actor.world.rot.y + extraRot); - childPos.x = (sSpawnDistance[i] * sSpawnSin) + this->actor.home.pos.x; + childPos.x = (sWood02SpawnDistance[i] * sWood02SpawnSin) + this->actor.home.pos.x; childPos.y = this->actor.home.pos.y; - childPos.z = (sSpawnDistance[i] * sSpawnCos) + this->actor.home.pos.z; + childPos.z = (sWood02SpawnDistance[i] * sWood02SpawnCos) + this->actor.home.pos.z; if (EnWood02_SpawnZoneCheck(this, play, &childPos)) { if (this->unk_14A[i] & 0x80) { @@ -152,8 +153,8 @@ void EnWood02_SpawnOffspring(EnWood02* this, PlayState* play) { childParams = ((this->unk_144 << 8) & 0xFF00) | (this->actor.params + 1); child = (EnWood02*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_WOOD02, childPos.x, - childPos.y, childPos.z, this->actor.world.rot.x, sSpawnAngle[i], - unk, childParams); + childPos.y, childPos.z, this->actor.world.rot.x, + sWood02SpawnAngle[i], unk, childParams); if (child != NULL) { child->unk_14A[0] = i; this->unk_14A[i] |= 1; @@ -296,10 +297,10 @@ void EnWood02_Init(Actor* thisx, PlayState* play) { if (spawnType == WOOD_SPAWN_SPAWNER) { EnWood02_SpawnOffspring(this, play); - sSpawnCos = Math_CosS(sSpawnAngle[5] + this->actor.world.rot.y + extraRot); - sSpawnSin = Math_SinS(sSpawnAngle[5] + this->actor.world.rot.y + extraRot); - this->actor.world.pos.x += sSpawnSin * sSpawnDistance[5]; - this->actor.world.pos.z += sSpawnCos * sSpawnDistance[5]; + sWood02SpawnCos = Math_CosS(sWood02SpawnAngle[5] + this->actor.world.rot.y + extraRot); + sWood02SpawnSin = Math_SinS(sWood02SpawnAngle[5] + this->actor.world.rot.y + extraRot); + this->actor.world.pos.x += sWood02SpawnSin * sWood02SpawnDistance[5]; + this->actor.world.pos.z += sWood02SpawnCos * sWood02SpawnDistance[5]; } else { this->actor.flags |= ACTOR_FLAG_10; this->unk_151 = 2; 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 501fb2ee41..b1924c63be 100644 --- a/src/overlays/actors/ovl_Obj_Grass/z_obj_grass.c +++ b/src/overlays/actors/ovl_Obj_Grass/z_obj_grass.c @@ -4,11 +4,9 @@ * Description: "Master" instance of grass for unit spawned by Obj_Grass_Unit */ -#include "prevent_bss_reordering.h" #include "z_obj_grass.h" #include "overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.h" #include "objects/gameplay_keep/gameplay_keep.h" -#include "prevent_bss_reordering.h" #define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20) diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index f680f6bca5..1c59f0fe13 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -285,15 +285,15 @@ 0x800994D0:("D_800994D0","char","[]",0xc), 0x800994DC:("D_800994DC","char","[]",0x12), 0x800994F0:("D_800994F0","char","[]",0x1), - 0x80099500:("sBootThreadInfo","StackEntry","",0x1c), + 0x80099500:("sBootStackInfo","StackEntry","",0x1c), 0x80099520:("sIdleThread","OSThread","",0x1b0), 0x800996D0:("sIdleThreadStack","u8","[1024]",0x400), - 0x80099AD0:("sIdleThreadInfo","StackEntry","",0x1c), + 0x80099AD0:("sIdleStackInfo","StackEntry","",0x1c), 0x80099AF0:("sBootThreadStack","u8","[1024]",0x400), 0x80099EF0:("gIrqMgr","IrqMgr","",0x280), 0x8009A170:("sIrqMgrStack","u8","[1280]",0x500), 0x8009A670:("sIrqMgrStackInfo","StackEntry","",0x1c), - 0x8009A690:("gMainThread","OSThread","",0x1b0), + 0x8009A690:("sMainThread","OSThread","",0x1b0), 0x8009A840:("sMainStack","u8","[2304]",0x900), 0x8009B140:("sMainStackInfo","StackEntry","",0x1c), 0x8009B160:("sPiMgrCmdBuff","OSMesg","[50]",0xc8), @@ -320,7 +320,7 @@ 0x8009BE58:("faultCustomOptions","u32","",0x4), 0x8009BE5C:("faultCopyToLog","u32","",0x4), 0x8009BE60:("sFaultStack","u8","[1536]",0x600), - 0x8009C460:("sFaultThreadInfo","StackEntry","",0x1c), + 0x8009C460:("sFaultStackInfo","StackEntry","",0x1c), 0x8009C480:("gFaultStruct","FaultThreadStruct","",0x848), 0x8009CCD0:("sFaultDrawerStruct","FaultDrawer","",0x3c), 0x8009CD10:("D_8009CD10","UNK_TYPE4","",0x4), @@ -343,8 +343,8 @@ 0x8009CF80:("__osThreadSave","OSThread","",0x1b0), 0x8009D130:("D_8009D130","OSPiHandle","",0x74), 0x8009D1A8:("D_8009D1A8","OSPiHandle","",0x74), - 0x8009D220:("D_8009D220","OSThread","",0x1b0), - 0x8009D3D0:("piManagerStack","u8","[4096]",0x1000), + 0x8009D220:("sPiMgrThread","OSThread","",0x1b0), + 0x8009D3D0:("sPiMgrStack","u8","[4096]",0x1000), 0x8009E3D0:("D_8009E3D0","OSMesgQueue","",0x18), 0x8009E3E8:("D_8009E3E8","OSMesg","[1]",0x4), 0x8009E3F0:("D_8009E3F0","OSMesg","[1]",0x4), @@ -359,7 +359,7 @@ 0x8009E5D0:("__osPfsPifRam","OSPifRam","",0x40), 0x8009E610:("CartRomHandle","OSPiHandle","",0x74), 0x8009E690:("viThread","OSThread","",0x1b0), - 0x8009E840:("viThreadStack","u8","[4096]",0x1000), + 0x8009E840:("sViStack","u8","[4096]",0x1000), 0x8009F840:("viEventQueue","OSMesgQueue","",0x18), 0x8009F858:("viEventBuf","OSMesg","[5]",0x14), 0x8009F870:("viRetraceMsg","OSIoMesg","",0x18), @@ -4063,9 +4063,8 @@ 0x801F6DFD:("sMotionBlurStatus","UNK_TYPE1","",0x1), 0x801F6E00:("D_801F6E00","SlowlyTask","",0x1c0), 0x801F6FC0:("D_801F6FC0","UNK_TYPE1","",0x1), - 0x801F6FC8:("slowlyStackEntry","StackEntry","",0x1c), - 0x801F6FE8:("slowlyStack","u8","[4096]",0x1000), - 0x801F7FE8:("D_801F7FE8","UNK_TYPE1","",0x1), + 0x801F6FC8:("sSlowlyStackInfo","StackEntry","",0x1c), + 0x801F6FE8:("sSlowlyStack","u8","[4096]",0x1000), 0x801F7FF0:("D_801F7FF0","UNK_TYPE1","",0x1), 0x801F8010:("D_801F8010","struct_801F8010","",0x10), 0x801F8020:("D_801F8020","struct_801F8020","",0x10), @@ -4083,17 +4082,17 @@ 0x801F84F8:("irqClient","IrqMgrClient","",0x8), 0x801F8500:("irqMgrMsgQ","OSMesgQueue","",0x18), 0x801F8518:("irqMgrMsgBuf","OSMesg","[60]",0xf0), - 0x801F8608:("sGraphThread","OSThread","",0x1b0), + 0x801F8608:("gGraphThread","OSThread","",0x1b0), 0x801F87B8:("sGraphStack","u8","[6144]",0x1800), - 0x801F9FB8:("schedStack","u8","[1536]",0x600), - 0x801FA5B8:("audioStack","u8","[2048]",0x800), - 0x801FADB8:("padmgrStack","u8","[1280]",0x500), + 0x801F9FB8:("sSchedStack","u8","[1536]",0x600), + 0x801FA5B8:("sAudioStack","u8","[2048]",0x800), + 0x801FADB8:("sPadMgrStack","u8","[1280]",0x500), 0x801FB2B8:("sGraphStackInfo","StackEntry","",0x1c), - 0x801FB2D8:("schedStackEntry","StackEntry","",0x1c), - 0x801FB2F8:("audioStackEntry","StackEntry","",0x1c), - 0x801FB318:("padmgrStackEntry","StackEntry","",0x1c), - 0x801FB338:("audioContext","AudioMgr","",0x2e0), - 0x801FB620:("D_801FB620","PadMgr","",0x480), + 0x801FB2D8:("sSchedStackInfo","StackEntry","",0x1c), + 0x801FB2F8:("sAudioStackInfo","StackEntry","",0x1c), + 0x801FB318:("sPadMgrStackInfo","StackEntry","",0x1c), + 0x801FB338:("sAudioMgr","AudioMgr","",0x2e0), + 0x801FB620:("gPadMgr","PadMgr","",0x480), 0x801FBAA0:("sSchedFaultClient","UNK_TYPE1","",0x1), 0x801FBAB0:("sRSPGFXStartTime","OSTime","",0x8), 0x801FBAB8:("sRSPAudioStartTime","OSTime","",0x8), @@ -4216,7 +4215,7 @@ 0x801FBE28:("D_801FBE28","UNK_TYPE1","",0x1), 0x801FBE2C:("D_801FBE2C","UNK_TYPE1","",0x1), 0x801FBE30:("D_801FBE30","UNK_TYPE4","",0x4), - 0x801FBE38:("sys_flashromStack","u8","[4096]",0x1000), + 0x801FBE38:("sSysFlashromStack","u8","[4096]",0x1000), 0x801FCE38:("sys_flashromStackEntry","StackEntry","",0x1c), 0x801FCE58:("sys_flashromOSThread","OSThread","",0x1b0), 0x801FD008:("D_801FD008","s80185D40","",0x2c), @@ -6649,8 +6648,8 @@ 0x808C3BC0:("D_808C3BC0","UNK_TYPE1","",0x1), 0x808C4CE0:("En_Wood02_InitVars","UNK_TYPE1","",0x1), 0x808C4D00:("D_808C4D00","UNK_TYPE1","",0x1), - 0x808C4D2C:("D_808C4D2C","UNK_TYPE1","",0x1), - 0x808C4D44:("D_808C4D44","UNK_TYPE1","",0x1), + 0x808C4D2C:("sWood02SpawnDistance","f32","",0x1), + 0x808C4D44:("sWood02SpawnAngle","UNK_TYPE1","",0x1), 0x808C4D4E:("D_808C4D4E","UNK_TYPE2","",0x2), 0x808C4D50:("D_808C4D50","UNK_TYPE1","",0x1), 0x808C4D54:("D_808C4D54","UNK_TYPE1","",0x1), @@ -6660,8 +6659,8 @@ 0x808C4E10:("D_808C4E10","f32","",0x4), 0x808C4E14:("D_808C4E14","f32","",0x4), 0x808C4E18:("D_808C4E18","UNK_TYPE1","",0x1), - 0x808C4F70:("D_808C4F70","f32","",0x4), - 0x808C4F74:("D_808C4F74","UNK_TYPE1","",0x1), + 0x808C4F70:("sWood02SpawnCos","f32","",0x4), + 0x808C4F74:("sWood02SpawnSin","UNK_TYPE1","",0x4), 0x808C98C0:("En_Death_InitVars","UNK_TYPE1","",0x1), 0x808C98E0:("D_808C98E0","UNK_TYPE1","",0x1), 0x808C990C:("D_808C990C","UNK_TYPE1","",0x1),