diff --git a/src/overlays/actors/ovl_Boss_07/z_boss_07.c b/src/overlays/actors/ovl_Boss_07/z_boss_07.c index 9a3253b86..5f88c869a 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c @@ -34,6 +34,10 @@ typedef struct { } Boss07Effect; #if 1 // function prototypes +void func_809F4D10(Vec3f* arg0, f32 arg1); +void func_809FCBC8(Boss07* this); +void func_80A006D0(Boss07* this); + void Boss07_Init(Actor* thisx, GlobalContext* globalCtx); void Boss07_Destroy(Actor* thisx, GlobalContext* globalCtx); @@ -55,23 +59,41 @@ void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx); void Boss07_Incarnation_Draw(Actor* thisx, GlobalContext* globalCtx); void Boss07_Afterimage_Draw(Actor* thisx, GlobalContext* globalCtx); -void func_809FDEDC(Boss07* this, GlobalContext* globalCtx); -void func_809FE068(Boss07* this, GlobalContext* globalCtx); -void func_809FE2D4(Boss07* this, GlobalContext* globalCtx); -void func_809FE4B0(Boss07* this, GlobalContext* globalCtx); -void func_80A05C88(Boss07* this, GlobalContext* globalCtx); -void func_80A055E0(Boss07* this, GlobalContext* globalCtx); -void func_80A04768(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_SetupIntro(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_Intro(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_SetupDeath(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_Death(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_SetupSpawnTop(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_SpawnTop(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_SetupStunned(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_Stunned(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 damage, u8 effect); +void Boss07_Wrath_Damaged(Boss07* this, GlobalContext* globalCtx); -void Boss07_Static_UpdateEffects(GlobalContext* globalCtx); -void Boss07_Static_DrawEffects(GlobalContext* globalCtx); +void Boss07_Wrath_ThrowPlayer(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_Dodge(Boss07* this, GlobalContext* globalCtx, u8 arg2); +void Boss07_Wrath_SetupSidestep(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_SetupShock(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_SetupGrab(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_SetupAttack(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_SetupIdle(Boss07* this, GlobalContext* globalCtx, s16 delay); +void Boss07_Wrath_SetupJump(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_SetupFlip(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_Idle(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_StartJump(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_Jump(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_Flip(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_Sidestep(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_Attack(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_Grab(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_GrabPlayer(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_Shock(Boss07* this, GlobalContext* globalCtx); +void Boss07_Wrath_ShockStun(Boss07* this, GlobalContext* globalCtx); void Boss07_Wrath_MakeShadowTex(u8* shadowTex, Boss07* this, GlobalContext* globalCtx); void Boss07_Wrath_DrawShadowTex(u8* shadowTex, Boss07* this, GlobalContext* globalCtx); void Boss07_Wrath_MakeShadowCircles(Boss07* this, u8* shadowTex, f32 weight); - - void Boss07_Mask_SetupIdle(Boss07* this, GlobalContext* globalCtx); void Boss07_Mask_Idle(Boss07* this, GlobalContext* globalCtx); void Boss07_Mask_SetupSpin(Boss07* this, GlobalContext* globalCtx); @@ -87,81 +109,41 @@ void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx); void Boss07_Mask_SetupDeath(Boss07* this, GlobalContext* globalCtx); void Boss07_Mask_Death(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_SetupAttack(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_SetupHopak(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_SetupMoonwalk(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_SetupPirouette(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_Taunt(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_Stunned(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_Damaged(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_Run(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_Attack(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_Hopak(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_Moonwalk(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_Pirouette(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_Death(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3); +void Boss07_Incarnation_SetupStunned(Boss07* this, GlobalContext* globalCtx, s16 arg2); +void Boss07_Incarnation_SetupDeath(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_SetupRun(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_SetupTaunt(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_SetupIntro(Boss07* this, GlobalContext* globalCtx); +void Boss07_Incarnation_Intro(Boss07* this, GlobalContext* globalCtx); +void Boss07_Remains_SetupIntro(Boss07* this, GlobalContext* globalCtx); +void Boss07_Remains_Intro(Boss07* this, GlobalContext* globalCtx); +void Boss07_Remains_SetupFly(Boss07* this, GlobalContext* globalCtx); +void Boss07_Remains_Fly(Boss07* this, GlobalContext* globalCtx); +void Boss07_Remains_SetupStunned(Boss07* this, GlobalContext* globalCtx); +void Boss07_Remains_Stunned(Boss07* this, GlobalContext* globalCtx); -void func_809F7688(Boss07* this, GlobalContext* globalCtx); -void func_809F783C(Boss07* this, GlobalContext* globalCtx); +void Boss07_Top_Thrown(Boss07* this, GlobalContext* globalCtx); +void Boss07_Top_Ground(Boss07* this, GlobalContext* globalCtx); +void Boss07_Top_SetupThrown(Boss07* this, GlobalContext* globalCtx); +void Boss07_Top_SetupGround(Boss07* this, GlobalContext* globalCtx); -void func_809FEE70(Boss07* this, GlobalContext* globalCtx); -void func_809F51E8(Boss07* this, GlobalContext* globalCtx, u8 arg2); -void Boss07_Wrath_CheckExplosives(Boss07* this, GlobalContext* globalCtx); - -void func_809F64F4(Boss07* this, GlobalContext* globalCtx); -void func_809F7AB4(Boss07* this, GlobalContext* globalCtx); - -void func_809F8AB0(Boss07* this, GlobalContext* globalCtx); -void func_809F8E68(Boss07* this, GlobalContext* globalCtx); -void func_809F8658(Boss07* this, GlobalContext* globalCtx); -void func_809F7D2C(Boss07* this, GlobalContext* globalCtx); -void func_809F4D10(Vec3f* arg0, f32 arg1); -void Boss07_MovePlayer(GlobalContext* globalCtx); - -void Boss07_SpawnDustAtPos(GlobalContext* globalCtx, Vec3f* pos, u8 count); - -void Boss07_SpawnDust(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3); -void func_809FCBC8(Boss07* this); - -void func_80A06500(Boss07* this, GlobalContext* globalCtx); -void func_80A06990(Boss07* this, GlobalContext* globalCtx); -void func_809F9E94(Boss07* this, GlobalContext* globalCtx); -void func_809F8DEC(Boss07* this, GlobalContext* globalCtx); - -void func_809FD984(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3); -void func_809FD818(Boss07* this, GlobalContext* globalCtx, s16 arg2); -void func_809FE6B0(Boss07* this, GlobalContext* globalCtx); - -void func_809FDB2C(Boss07* this, GlobalContext* globalCtx); -void func_809F5E14(Boss07* this, GlobalContext* globalCtx); -void func_809F7400(Boss07* this, GlobalContext* globalCtx, s16 arg2); -void func_809FCC70(Boss07* this, GlobalContext* globalCtx); -void func_809FD5F8(Boss07* this, GlobalContext* globalCtx); - -void func_80A04878(Boss07* this, GlobalContext* globalCtx); -void func_80A04DE0(Boss07* this, GlobalContext* globalCtx); -void func_80A05AF8(Boss07* this, GlobalContext* globalCtx); - -void func_809F5E88(Boss07* this, GlobalContext* globalCtx); -void func_809F65F4(Boss07* this, GlobalContext* globalCtx); -void func_809F748C(Boss07* this, GlobalContext* globalCtx); -void func_809F76D0(Boss07* this, GlobalContext* globalCtx); -void func_809F77A8(Boss07* this, GlobalContext* globalCtx); -void func_809F7968(Boss07* this, GlobalContext* globalCtx); -void func_809F7BC4(Boss07* this, GlobalContext* globalCtx); -void func_809F805C(Boss07* this, GlobalContext* globalCtx); -void func_809F86B8(Boss07* this, GlobalContext* globalCtx); -void func_809F87C8(Boss07* this, GlobalContext* globalCtx); -void func_809F8908(Boss07* this, GlobalContext* globalCtx); -void func_809F8B1C(Boss07* this, GlobalContext* globalCtx); -void func_809F8D04(Boss07* this, GlobalContext* globalCtx); -void func_809F8EC8(Boss07* this, GlobalContext* globalCtx); -void func_809F91D4(Boss07* this, GlobalContext* globalCtx); -void Boss07_Wrath_Damaged(Boss07* this, GlobalContext* globalCtx); -void func_809FCCCC(Boss07* this, GlobalContext* globalCtx); -void func_809FD710(Boss07* this, GlobalContext* globalCtx); -void func_809FD89C(Boss07* this, GlobalContext* globalCtx); -void func_809FDAB0(Boss07* this, GlobalContext* globalCtx); -void func_809FDBA0(Boss07* this, GlobalContext* globalCtx); -void func_809FDF54(Boss07* this, GlobalContext* globalCtx); -void func_809FE0E4(Boss07* this, GlobalContext* globalCtx); -void func_809FE348(Boss07* this, GlobalContext* globalCtx); -void func_809FE524(Boss07* this, GlobalContext* globalCtx); -void func_809FE734(Boss07* this, GlobalContext* globalCtx); - -void func_80A04890(Boss07* this, GlobalContext* globalCtx); -void func_80A04E5C(Boss07* this, GlobalContext* globalCtx); -void func_80A05608(Boss07* this, GlobalContext* globalCtx); -void func_80A05B50(Boss07* this, GlobalContext* globalCtx); -void func_80A05DDC(Boss07* this, GlobalContext* globalCtx); +void Boss07_Static_UpdateEffects(GlobalContext* globalCtx); +void Boss07_Static_DrawEffects(GlobalContext* globalCtx); #endif #if 1 // object addresses @@ -250,182 +232,7 @@ static s16 sColorsWhite[4][3] = { { 255, 255, 255 }, // white }; -#if 1 // collision data - -static DamageTable sMaskDmgTable = { - /* Deku Nut */ DMG_ENTRY(0, 0x0), - /* Deku Stick */ DMG_ENTRY(1, 0xF), - /* Horse trample */ DMG_ENTRY(0, 0x0), - /* Explosives */ DMG_ENTRY(2, 0xF), - /* Zora boomerang */ DMG_ENTRY(1, 0xF), - /* Normal arrow */ DMG_ENTRY(1, 0xF), - /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), - /* Hookshot */ DMG_ENTRY(0, 0x0), - /* Goron punch */ DMG_ENTRY(1, 0xF), - /* Sword */ DMG_ENTRY(1, 0xF), - /* Goron pound */ DMG_ENTRY(1, 0xF), - /* Fire arrow */ DMG_ENTRY(2, 0x2), - /* Ice arrow */ DMG_ENTRY(2, 0x3), - /* Light arrow */ DMG_ENTRY(2, 0x4), - /* Goron spikes */ DMG_ENTRY(1, 0xF), - /* Deku spin */ DMG_ENTRY(1, 0xF), - /* Deku bubble */ DMG_ENTRY(1, 0xF), - /* Deku launch */ DMG_ENTRY(1, 0xF), - /* 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(1, 0xF), - /* Zora punch */ DMG_ENTRY(1, 0xF), - /* Spin attack */ DMG_ENTRY(2, 0xF), - /* Sword beam */ DMG_ENTRY(2, 0x9), - /* 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(2, 0xF), -}; - -static DamageTable sIncarnationDmgTable = { - /* Deku Nut */ DMG_ENTRY(0, 0x0), - /* Deku Stick */ DMG_ENTRY(1, 0xF), - /* Horse trample */ DMG_ENTRY(0, 0x0), - /* Explosives */ DMG_ENTRY(1, 0xC), - /* Zora boomerang */ DMG_ENTRY(1, 0xF), - /* Normal arrow */ DMG_ENTRY(1, 0xF), - /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), - /* Hookshot */ DMG_ENTRY(0, 0x0), - /* Goron punch */ DMG_ENTRY(1, 0xE), - /* Sword */ DMG_ENTRY(1, 0xE), - /* Goron pound */ DMG_ENTRY(1, 0xF), - /* Fire arrow */ DMG_ENTRY(2, 0x2), - /* Ice arrow */ DMG_ENTRY(2, 0x3), - /* Light arrow */ DMG_ENTRY(2, 0x4), - /* Goron spikes */ DMG_ENTRY(1, 0xF), - /* Deku spin */ DMG_ENTRY(1, 0xF), - /* Deku bubble */ DMG_ENTRY(1, 0xF), - /* Deku launch */ DMG_ENTRY(1, 0xF), - /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0), - /* Zora barrier */ DMG_ENTRY(0, 0xA), - /* Normal shield */ DMG_ENTRY(0, 0x0), - /* Light ray */ DMG_ENTRY(0, 0x0), - /* Thrown object */ DMG_ENTRY(1, 0xF), - /* Zora punch */ DMG_ENTRY(1, 0xF), - /* Spin attack */ DMG_ENTRY(1, 0xD), - /* Sword beam */ DMG_ENTRY(2, 0x9), - /* 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(4, 0xC), -}; - -static DamageTable sWrathDmgTable = { - /* Deku Nut */ DMG_ENTRY(0, 0x0), - /* Deku Stick */ DMG_ENTRY(1, 0xE), - /* Horse trample */ DMG_ENTRY(0, 0x0), - /* Explosives */ DMG_ENTRY(1, 0xC), - /* Zora boomerang */ DMG_ENTRY(1, 0xF), - /* Normal arrow */ DMG_ENTRY(1, 0xF), - /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), - /* Hookshot */ DMG_ENTRY(0, 0x0), - /* Goron punch */ DMG_ENTRY(1, 0xE), - /* Sword */ DMG_ENTRY(1, 0xE), - /* Goron pound */ DMG_ENTRY(1, 0xF), - /* Fire arrow */ DMG_ENTRY(2, 0x2), - /* Ice arrow */ DMG_ENTRY(2, 0x3), - /* Light arrow */ DMG_ENTRY(2, 0x4), - /* Goron spikes */ DMG_ENTRY(1, 0xE), - /* Deku spin */ DMG_ENTRY(1, 0xE), - /* Deku bubble */ DMG_ENTRY(1, 0xF), - /* Deku launch */ DMG_ENTRY(1, 0xE), - /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0), - /* Zora barrier */ DMG_ENTRY(0, 0xA), - /* Normal shield */ DMG_ENTRY(0, 0x0), - /* Light ray */ DMG_ENTRY(0, 0x0), - /* Thrown object */ DMG_ENTRY(1, 0xF), - /* Zora punch */ DMG_ENTRY(1, 0xE), - /* Spin attack */ DMG_ENTRY(1, 0xD), - /* Sword beam */ DMG_ENTRY(2, 0x9), - /* 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(2, 0xC), -}; - -static DamageTable sRemainsDmgTable = { - /* Deku Nut */ DMG_ENTRY(0, 0x0), - /* Deku Stick */ DMG_ENTRY(1, 0xF), - /* Horse trample */ DMG_ENTRY(0, 0x0), - /* Explosives */ DMG_ENTRY(2, 0xE), - /* Zora boomerang */ DMG_ENTRY(1, 0xF), - /* Normal arrow */ DMG_ENTRY(1, 0xF), - /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), - /* Hookshot */ DMG_ENTRY(0, 0x0), - /* Goron punch */ DMG_ENTRY(1, 0xE), - /* Sword */ DMG_ENTRY(1, 0xE), - /* Goron pound */ DMG_ENTRY(1, 0xF), - /* Fire arrow */ DMG_ENTRY(2, 0x2), - /* Ice arrow */ DMG_ENTRY(2, 0x3), - /* Light arrow */ DMG_ENTRY(2, 0x4), - /* Goron spikes */ DMG_ENTRY(1, 0xF), - /* Deku spin */ DMG_ENTRY(1, 0xF), - /* Deku bubble */ DMG_ENTRY(1, 0xF), - /* Deku launch */ DMG_ENTRY(1, 0xF), - /* 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(1, 0xF), - /* Zora punch */ DMG_ENTRY(1, 0xF), - /* Spin attack */ DMG_ENTRY(1, 0xD), - /* Sword beam */ DMG_ENTRY(2, 0x9), - /* 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(2, 0xE), -}; - -static DamageTable sTopDmgTable = { - /* Deku Nut */ DMG_ENTRY(0, 0x0), - /* Deku Stick */ DMG_ENTRY(1, 0xD), - /* Horse trample */ DMG_ENTRY(1, 0xE), - /* Explosives */ DMG_ENTRY(1, 0xB), - /* Zora boomerang */ DMG_ENTRY(1, 0xF), - /* Normal arrow */ DMG_ENTRY(1, 0xF), - /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), - /* Hookshot */ DMG_ENTRY(1, 0xE), - /* Goron punch */ DMG_ENTRY(1, 0xE), - /* Sword */ DMG_ENTRY(1, 0xD), - /* Goron pound */ DMG_ENTRY(0, 0x0), - /* Fire arrow */ DMG_ENTRY(1, 0xE), - /* Ice arrow */ DMG_ENTRY(1, 0xE), - /* Light arrow */ DMG_ENTRY(1, 0xE), - /* Goron spikes */ DMG_ENTRY(1, 0xC), - /* Deku spin */ DMG_ENTRY(1, 0xF), - /* Deku bubble */ DMG_ENTRY(1, 0xF), - /* Deku launch */ DMG_ENTRY(1, 0xF), - /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0), - /* Zora barrier */ DMG_ENTRY(0, 0x0), - /* Normal shield */ DMG_ENTRY(1, 0xD), - /* Light ray */ DMG_ENTRY(1, 0xD), - /* Thrown object */ DMG_ENTRY(1, 0xE), - /* Zora punch */ DMG_ENTRY(1, 0xE), - /* Spin attack */ DMG_ENTRY(1, 0xA), - /* Sword beam */ DMG_ENTRY(1, 0xA), - /* 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(2, 0xB), -}; +#include "z_boss_07_dmgtbl.c" const ActorInit Boss_07_InitVars = { ACTOR_BOSS_07, @@ -439,427 +246,7 @@ const ActorInit Boss_07_InitVars = { (ActorFunc)Boss07_Wrath_Draw, }; -static ColliderJntSphElementInit sWrathJntSphElementsInit1[11] = { - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 0, { { 0, 0, 0 }, 20 }, 100 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 30 }, 100 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 25 }, 100 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 15 }, 100 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 15 }, 100 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 15 }, 100 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 15 }, 100 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 15 }, 150 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 15 }, 150 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 15 }, 150 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 15 }, 150 }, - }, -}; - -static ColliderJntSphInit sWrathJntSphInit1 = { - { - COLTYPE_HIT3, - AT_ON | AT_TYPE_ENEMY, - AC_ON | AC_TYPE_PLAYER, - OC1_ON | OC1_TYPE_PLAYER, - OC2_TYPE_1, - COLSHAPE_JNTSPH, - }, - 11, - sWrathJntSphElementsInit1, -}; - -static ColliderCylinderInit sWrathCylInit = { - { - COLTYPE_METAL, - AT_ON | AT_TYPE_ENEMY, - AC_ON | AC_TYPE_PLAYER, - OC1_ON | OC1_TYPE_ALL, - OC2_TYPE_1, - COLSHAPE_CYLINDER, - }, - { - ELEMTYPE_UNK2, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 80, 200, 0, { 0, 0, 0 } }, -}; - -static ColliderJntSphElementInit sWrathJntSphElementsInit2[1] = { - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x04, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_HARD, - BUMP_ON, - OCELEM_ON, - }, - { 0, { { 0, 0, 0 }, 36 }, 200 }, - }, -}; - -static ColliderJntSphInit sWrathJntSphInit2 = { - { - COLTYPE_HIT3, - AT_ON | AT_TYPE_ENEMY, - AC_ON | AC_TYPE_PLAYER, - OC1_ON | OC1_TYPE_PLAYER, - OC2_TYPE_1, - COLSHAPE_JNTSPH, - }, - 1, - sWrathJntSphElementsInit2, -}; - -static ColliderQuadInit sMaskQuadInit1 = { - { - COLTYPE_METAL, - AT_ON | AT_TYPE_ENEMY, - AC_ON | AC_HARD | AC_TYPE_PLAYER, - OC1_ON | OC1_TYPE_ALL, - OC2_TYPE_1, - COLSHAPE_QUAD, - }, - { - ELEMTYPE_UNK2, - { 0xF7CFFFFF, 0x04, 0x00 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, -}; - -static ColliderQuadInit sMaskQuadInit2 = { - { - COLTYPE_HIT3, - AT_ON | AT_TYPE_ENEMY, - AC_ON | AC_TYPE_PLAYER, - OC1_ON | OC1_TYPE_ALL, - OC2_TYPE_1, - COLSHAPE_QUAD, - }, - { - ELEMTYPE_UNK2, - { 0xF7CFFFFF, 0x04, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, -}; - -static ColliderJntSphElementInit sIncarnationJntSphElementsInit[11] = { - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 0, { { 0, 0, 0 }, 25 }, 100 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 40 }, 100 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 0 }, 0 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 15 }, 100 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 15 }, 100 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 15 }, 100 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 15 }, 100 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 15 }, 150 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 15 }, 150 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 15 }, 150 }, - }, - { - { - ELEMTYPE_UNK3, - { 0xF7CFFFFF, 0x00, 0x10 }, - { 0xF7CEFFFE, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 1, { { 0, 0, 0 }, 15 }, 150 }, - }, -}; - -static ColliderJntSphInit sIncarnationJntSphInit1 = { - { - COLTYPE_HIT3, - AT_ON | AT_TYPE_ENEMY, - AC_ON | AC_TYPE_PLAYER, - OC1_ON | OC1_TYPE_PLAYER, - OC2_TYPE_1, - COLSHAPE_JNTSPH, - }, - 11, - sIncarnationJntSphElementsInit, -}; - -static ColliderCylinderInit sShotCylInit = { - { - COLTYPE_NONE, - AT_ON | AT_TYPE_ENEMY, - AC_ON | AC_TYPE_PLAYER, - OC1_ON | OC1_TYPE_ALL, - OC2_TYPE_1, - COLSHAPE_CYLINDER, - }, - { - ELEMTYPE_UNK0, - { 0xF7CFFFFF, 0x04, 0x10 }, - { 0x00300000, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON, - OCELEM_ON, - }, - { 15, 30, -15, { 0, 0, 0 } }, -}; - -static ColliderCylinderInit sRemainsCylInit = { - { - COLTYPE_METAL, - AT_ON | AT_TYPE_ENEMY, - AC_ON | AC_TYPE_PLAYER, - OC1_ON | OC1_TYPE_ALL, - OC2_TYPE_1, - COLSHAPE_CYLINDER, - }, - { - ELEMTYPE_UNK0, - { 0xF7CFFFFF, 0x04, 0x10 }, - { 0xF7CFFFFF, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON | BUMP_HOOKABLE, - OCELEM_ON, - }, - { 50, 100, -50, { 0, 0, 0 } }, -}; - -static ColliderCylinderInit sTopCylInit = { - { - COLTYPE_METAL, - AT_ON | AT_TYPE_ENEMY, - AC_ON | AC_HARD | AC_TYPE_PLAYER, - OC1_ON | OC1_TYPE_ALL, - OC2_TYPE_1, - COLSHAPE_CYLINDER, - }, - { - ELEMTYPE_UNK0, - { 0xF7CFFFFF, 0x04, 0x10 }, - { 0xF7FFFFFF, 0x00, 0x00 }, - TOUCH_ON | TOUCH_SFX_NORMAL, - BUMP_ON | BUMP_HOOKABLE, - OCELEM_ON, - }, - { 40, 20, 15, { 0, 0, 0 } }, -}; -#endif +#include "z_boss_07_colchk.c" static Vec3f sSfxPoint; static u8 sHeartbeatTimer; @@ -945,7 +332,7 @@ void Boss07_SmoothStop(Boss07* this, f32 maxStep) { } void func_809F4D10(Vec3f* dst, f32 scale) { - Matrix_InsertYRotation_f(Rand_ZeroFloat(2 * M_PI), 0); + Matrix_InsertYRotation_f(Rand_ZeroFloat(2 * M_PI), MTXMODE_NEW); Matrix_GetStateTranslationAndScaledZ(scale, dst); } @@ -954,7 +341,7 @@ void Boss07_SpawnDust(Boss07* this, GlobalContext* globalCtx, u8 spawnInterval, static Color_RGBA8 sDarkRed = { 40, 30, 30, 255 }; u8 i; - if (!(this->unk_14C & spawnInterval) && ((spawnInterval == 0) || (this->actor.speedXZ > 1.0f))) { + if (!(this->actionTimer & spawnInterval) && ((spawnInterval == 0) || (this->actor.speedXZ > 1.0f))) { for (i = 0; i < 2; i++) { Vec3f pos; Vec3f vel; @@ -973,8 +360,8 @@ void Boss07_SpawnDust(Boss07* this, GlobalContext* globalCtx, u8 spawnInterval, pos.z = this->unk_1788[i].z + randPlusMinusPoint5Scaled(20.0f); pos.x = this->unk_1788[i].x + randPlusMinusPoint5Scaled(20.0f); } - func_800B0EB0(globalCtx, &pos, &vel, &accel, &sDarkOrange, &sDarkRed, Rand_ZeroFloat(150.0f) + 350.0f, - 10, Rand_ZeroFloat(5.0f) + 14.0f); + func_800B0EB0(globalCtx, &pos, &vel, &accel, &sDarkOrange, &sDarkRed, Rand_ZeroFloat(150.0f) + 350.0f, 10, + Rand_ZeroFloat(5.0f) + 14.0f); } } } @@ -1010,16 +397,17 @@ void Boss07_SpawnDustAtPos(GlobalContext* globalCtx, Vec3f* spawnPos, u8 count) } } -void func_809F51E8(Boss07* this, GlobalContext* globalCtx, u8 arg2) { +void Boss07_Wrath_Dodge(Boss07* this, GlobalContext* globalCtx, u8 arg2) { Player* player = GET_PLAYER(globalCtx); - if ((this->unk_15C == 0) && (((this->actionFunc != func_809F7968) && (this->actionFunc != func_809F76D0) && - (this->actionFunc != func_809F77A8)) || - arg2)) { + if ((this->unk_15C == 0) && + (((this->actionFunc != Boss07_Wrath_Flip) && (this->actionFunc != Boss07_Wrath_StartJump) && + (this->actionFunc != Boss07_Wrath_Jump)) || + arg2)) { if (Rand_ZeroOne() < 0.5f) { - func_809F783C(this, globalCtx); + Boss07_Wrath_SetupFlip(this, globalCtx); } else { - func_809F7688(this, globalCtx); + Boss07_Wrath_SetupJump(this, globalCtx); } this->unk_158 = 10; this->unk_F7E = 0; @@ -1040,7 +428,7 @@ void Boss07_Wrath_CheckExplosives(Boss07* this, GlobalContext* globalCtx) { f32 dz = explosive->world.pos.z - this->actor.world.pos.z; if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 200.0f) { - func_809F51E8(this, globalCtx, false); + Boss07_Wrath_Dodge(this, globalCtx, false); break; } explosive = explosive->next; @@ -1069,7 +457,7 @@ void Boss07_Wrath_BlastWhip(Vec3f* bombPos, Vec3f* pos, Vec3f* pull) { sp50.y = push; sp50.z = push; - Matrix_InsertYRotation_f(Math_Acot2F(dz, dx), 0); + Matrix_InsertYRotation_f(Math_Acot2F(dz, dx), MTXMODE_NEW); Matrix_MultiplyVector3fByState(&sp50, pull); } } @@ -1154,9 +542,9 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.world.pos.y = 370.0f; this->actor.world.pos.z = sRemainsEnd[this->actor.params - MAJORA_REMAINS].z; this->actor.shape.rot.y = sRemainsEnd[this->actor.params - MAJORA_REMAINS].y; - func_80A04DE0(this, globalCtx); + Boss07_Remains_SetupFly(this, globalCtx); } else { - func_80A04878(this, globalCtx); + Boss07_Remains_SetupIntro(this, globalCtx); } this->actor.flags &= ~1; this->actor.colChkInfo.damageTable = &sRemainsDmgTable; @@ -1164,7 +552,7 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.update = Boss07_Top_Update; this->actor.draw = Boss07_Top_Draw; - func_80A05AF8(this, globalCtx); + Boss07_Top_SetupThrown(this, globalCtx); this->actor.colChkInfo.damageTable = &sTopDmgTable; ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, KREG(55) + 9.0f); this->actor.shape.shadowAlpha = 180; @@ -1181,7 +569,7 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { } else if ((this->actor.params == MAJORA_MASK) || (this->actor.params == MAJORA_MASK_CS)) { this->actor.colChkInfo.damageTable = &sMaskDmgTable; ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 15.0f); - SkelAnime_Init(globalCtx, &this->skelAnime, &D_06019C58, &D_06019E48, this->jointTable1, this->morphTable1, + SkelAnime_Init(globalCtx, &this->skelAnime, &D_06019C58, &D_06019E48, this->jointTable, this->morphTable, MAJORA_MASK_LIMB_COUNT); if (this->actor.params == MAJORA_MASK) { this->actor.update = Boss07_Mask_Update; @@ -1215,8 +603,8 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { } } else if ((this->actor.params == MAJORA_INCARNATION) || (this->actor.params == MAJORA_AFTERIMAGE)) { Actor_SetScale(&this->actor, 0.015000001f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060099A0, &D_0600A6AC, this->jointTable1, - this->morphTable1, MAJORA_INCARNATION_LIMB_COUNT); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060099A0, &D_0600A6AC, this->jointTable, + this->morphTable, MAJORA_INCARNATION_LIMB_COUNT); if (this->actor.params == MAJORA_AFTERIMAGE) { this->timers[0] = this->actor.world.rot.z; this->actor.world.rot.z = 0; @@ -1233,9 +621,9 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 80.0f); this->csCamIndex = this->actor.shape.rot.z; if (this->csCamIndex != 0) { - func_809FCC70(this, globalCtx); + Boss07_Incarnation_SetupIntro(this, globalCtx); } else { - func_809FD5F8(this, globalCtx); + Boss07_Incarnation_SetupTaunt(this, globalCtx); this->unk_14A = 1; this->unk_17B8[1] = 1.0f; this->unk_17B8[2] = 1.0f; @@ -1255,14 +643,14 @@ void Boss07_Init(Actor* thisx, GlobalContext* globalCtx2) { Actor_SetScale(&this->actor, 0.01f); this->csCamIndex = this->actor.shape.rot.z; if (this->csCamIndex != 0) { - func_809F5E14(this, globalCtx); + Boss07_Wrath_SetupIntro(this, globalCtx); } else { - func_809F7400(this, globalCtx, 50); + Boss07_Wrath_SetupIdle(this, globalCtx, 50); this->whipScale = whipScale; Audio_QueueSeqCmd(0x8069); } - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060335F0, &D_0603CBD0, this->jointTable1, - this->morphTable1, MAJORA_WRATH_LIMB_COUNT); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060335F0, &D_0603CBD0, this->jointTable, + this->morphTable, MAJORA_WRATH_LIMB_COUNT); Collider_InitAndSetJntSph(globalCtx, &this->sph1, &this->actor, &sWrathJntSphInit1, this->sphElems1); Collider_InitAndSetJntSph(globalCtx, &this->sph2, &this->actor, &sWrathJntSphInit2, this->sphElems2); Collider_InitAndSetCylinder(globalCtx, &this->cyl1, &this->actor, &sWrathCylInit); @@ -1298,8 +686,8 @@ void Boss07_Destroy(Actor* thisx, GlobalContext* globalCtx2) { } } -void func_809F5E14(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_809F5E88; +void Boss07_Wrath_SetupIntro(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Wrath_Intro; Animation_MorphToLoop(&this->skelAnime, &D_06023DAC, 0.0f); this->actor.flags &= ~1; this->unk_17D8 = 0x7F00; @@ -1307,7 +695,7 @@ void func_809F5E14(Boss07* this, GlobalContext* globalCtx) { this->unk_17E8 = 5120.0f; } -void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_Intro(Boss07* this, GlobalContext* globalCtx) { static f32 sCamPoints[5][3] = { { 40.0f, 400.0f, 110.0f }, { 80.0f, 450.0f, 110.0f }, { 100.0f, 400.0f, 110.0f }, { 60.0f, 390.0f, 110.0f }, { 30.0f, 430.0f, 110.0f }, @@ -1315,8 +703,8 @@ void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { this->unk_15C = 20; SkelAnime_Update(&this->skelAnime); this->unk_ABC8++; - Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0); - Matrix_RotateY(this->actor.shape.rot.y, 1); + Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); + Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY); switch (this->csState) { case 0: this->unk_ABC8 = 0; @@ -1347,13 +735,13 @@ void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { s32 dataIndex = 0; if (0) {} - if (player->transformation == 1) { + if (player->transformation == PLAYER_FORM_GORON) { dataIndex = 1; - } else if (player->transformation == 0) { + } else if (player->transformation == PLAYER_FORM_FIERCE_DEITY) { dataIndex = 2; - } else if (player->transformation == 2) { + } else if (player->transformation == PLAYER_FORM_ZORA) { dataIndex = 3; - } else if (player->transformation == 3) { + } else if (player->transformation == PLAYER_FORM_DEKU) { dataIndex = 4; } @@ -1369,10 +757,8 @@ void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { } if (this->unk_ABC8 >= 110) { Math_ApproachF(&this->whipScale, 1.0f, 1.0f, 0.05f); - this->rightWhip.stiffness = 0.79999995f; - this->leftWhip.stiffness = 0.79999995f; - this->rightWhip.drag = 1.0f; - this->leftWhip.drag = 1.0f; + this->leftWhip.stiffness = this->rightWhip.stiffness = 0.01f * 80; + this->leftWhip.drag = this->rightWhip.drag = 1.0f; } if (this->unk_ABC8 == 127) { this->whipScale = 1.0f; @@ -1394,7 +780,7 @@ void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { Camera* sp48 = Play_GetCamera(globalCtx, 0); this->csState = 0; - func_809F7400(this, globalCtx, 50); + Boss07_Wrath_SetupIdle(this, globalCtx, 50); sp48->eye = this->csCamEye; sp48->eyeNext = this->csCamEye; sp48->at = this->csCamAt; @@ -1421,40 +807,36 @@ void func_809F5E88(Boss07* this, GlobalContext* globalCtx) { } } -void func_809F64F4(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_SetupDeath(Boss07* this, GlobalContext* globalCtx) { s32 i; Audio_QueueSeqCmd(0x100100FF); Boss07_MovePlayer(globalCtx); - this->actionFunc = func_809F65F4; - this->rightWhip.stiffness = 0.7f; - this->leftWhip.stiffness = 0.7f; - this->rightWhip.drag = 2.0f; - this->leftWhip.drag = 2.0f; - this->rightWhip.tension = 0.0f; - this->leftWhip.tension = 0.0f; - this->rightWhip.gravity = -15.0f; - this->leftWhip.gravity = -15.0f; + this->actionFunc = Boss07_Wrath_Death; + this->leftWhip.stiffness = this->rightWhip.stiffness = 0.7f; + this->leftWhip.drag = this->rightWhip.drag = 2.0f; + this->leftWhip.tension = this->rightWhip.tension = 0.0f; + this->leftWhip.gravity = this->rightWhip.gravity = -15.0f; Animation_MorphToPlayOnce(&this->skelAnime, &D_06022BB4, 0.0f); this->actor.flags &= ~1; this->csState = 0; this->unk_ABC8 = 0; if (sBossRemains[REMAINS_ODOLWA] != NULL) { for (i = 0; i < 4; i++) { - sBossRemains[i]->unk_14E = 2; + sBossRemains[i]->actionState = 2; } } this->unk_15C = 1000; } -void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_Death(Boss07* this, GlobalContext* globalCtx) { s32 i; s32 spC0 = 0; Vec3f spB4; Vec3f spA8 = { 0.0f, 0.0f, 0.0f }; f32 spA4 = 0.0f, spA0 = 0.1f; Camera* camera = Play_GetCamera(globalCtx, 0); - + this->unk_15C = 1000; Boss07_SmoothStop(this, 1.0f); switch (this->csState) { @@ -1480,8 +862,8 @@ void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { this->csCamRotY = this->actor.shape.rot.y * M_PI / 0x8000; this->csCamRotVel = this->csCamSpeedMod = sMajoraStatic->unk_180C = 0.0f; Boss07_InitRand(1, 0x71AC, 0x263A); - for (i = 0; i < ARRAY_COUNT(this->unk_AB50); i++) { - this->unk_AB50[i] = Boss07_RandZeroOne() - 1.0f; + for (i = 0; i < ARRAY_COUNT(this->deathLightScale); i++) { + this->deathLightScale[i] = Boss07_RandZeroOne() - 1.0f; } func_8016566C(150); case 2: @@ -1612,8 +994,8 @@ void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&sMajoraStatic->unk_180C, 30.0f, 0.1f, 1.5f); sMajoraStatic->unk_1810 = this->bodyPartsPos[2]; Math_ApproachF(&this->unk_AB4C, 1.0f, 0.1f, 0.05f); - for (i = 0; i < ARRAY_COUNT(this->unk_AB50); i++) { - Math_ApproachF(&this->unk_AB50[i], sp98, 1.0f, sp94); + for (i = 0; i < ARRAY_COUNT(this->deathLightScale); i++) { + Math_ApproachF(&this->deathLightScale[i], sp98, 1.0f, sp94); } Math_ApproachF(&globalCtx->envCtx.unk_DC, 1.0f, 1.0f, 0.1f); } @@ -1651,7 +1033,7 @@ void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { } break; } - Matrix_InsertYRotation_f(this->csCamRotY, 0); + Matrix_InsertYRotation_f(this->csCamRotY, MTXMODE_NEW); Matrix_MultiplyVector3fByState(&spB4, &this->csCamNextEye); this->csCamNextEye.x += this->actor.focus.pos.x; this->csCamNextEye.y += this->actor.focus.pos.y; @@ -1676,97 +1058,89 @@ void func_809F65F4(Boss07* this, GlobalContext* globalCtx) { this->unk_ABC8++; } -void func_809F7400(Boss07* this, GlobalContext* globalCtx, s16 arg2) { - this->actionFunc = func_809F748C; +void Boss07_Wrath_SetupIdle(Boss07* this, GlobalContext* globalCtx, s16 delay) { + this->actionFunc = Boss07_Wrath_Idle; Animation_MorphToLoop(&this->skelAnime, &D_0603CBD0, -10.0f); - if (arg2 != 0) { - this->timers[0] = arg2; + if (delay != 0) { + this->timers[0] = delay; } else { this->timers[0] = Rand_ZeroFloat(30.0f); } this->actor.flags |= 1; } -void func_809F748C(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_Idle(Boss07* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); SkelAnime_Update(&this->skelAnime); Boss07_SmoothStop(this, 2.0f); - this->rightWhip.stiffness = 0.7f; - this->leftWhip.stiffness = 0.7f; - this->rightWhip.gravity = -15.0f; - this->leftWhip.gravity = -15.0f; - this->rightWhip.drag = 2.0f; - this->leftWhip.drag = 2.0f; - this->rightWhip.tension = 0.0f; - this->leftWhip.tension = 0.0f; + this->rightWhip.stiffness = this->leftWhip.stiffness = 0.7f; + this->rightWhip.gravity = this->leftWhip.gravity = -15.0f; + this->rightWhip.drag = this->leftWhip.drag = 2.0f; + this->leftWhip.tension = this->rightWhip.tension = 0.0f; if ((this->actor.xzDistToPlayer <= 200.0f) && (player->actor.world.pos.y < 10.0f)) { if (Rand_ZeroOne() < 0.3f) { this->actor.xzDistToPlayer = 250.0f; } - func_809F7D2C(this, globalCtx); + Boss07_Wrath_SetupAttack(this, globalCtx); } else if (this->timers[0] == 0) { if (KREG(78) == 1) { - func_809F8E68(this, globalCtx); + Boss07_Wrath_SetupSpawnTop(this, globalCtx); } else if ((s8)this->actor.colChkInfo.health >= 28) { - func_809F7D2C(this, globalCtx); + Boss07_Wrath_SetupAttack(this, globalCtx); } else if (((s8)this->actor.colChkInfo.health <= 12) && (Rand_ZeroOne() < 0.65f)) { - func_809F8E68(this, globalCtx); + Boss07_Wrath_SetupSpawnTop(this, globalCtx); } else if (Rand_ZeroOne() < 0.3f) { - func_809F8658(this, globalCtx); + Boss07_Wrath_SetupGrab(this, globalCtx); } else { - func_809F7D2C(this, globalCtx); + Boss07_Wrath_SetupAttack(this, globalCtx); } } Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); - this->unk_174 = 1; + this->unk_174 = true; } -void func_809F7688(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_809F76D0; +void Boss07_Wrath_SetupJump(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Wrath_StartJump; Animation_MorphToPlayOnce(&this->skelAnime, &D_06025878, -5.0f); - this->unk_14C = 0; + this->actionTimer = 0; } -void func_809F76D0(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_StartJump(Boss07* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - this->rightWhip.stiffness = 0.7f; - this->leftWhip.stiffness = 0.7f; - this->rightWhip.drag = 2.0f; - this->leftWhip.drag = 2.0f; - this->rightWhip.gravity = -15.0f; - this->leftWhip.gravity = -15.0f; - this->rightWhip.tension = 0.0f; - this->leftWhip.tension = 0.0f; - if (this->unk_14C == 1) { + this->leftWhip.stiffness = this->rightWhip.stiffness = 0.7f; + this->leftWhip.drag = this->rightWhip.drag = 2.0f; + this->leftWhip.gravity = this->rightWhip.gravity = -15.0f; + this->leftWhip.tension = this->rightWhip.tension = 0.0f; + if (this->actionTimer == 1) { this->actor.velocity.y = 35.0f; this->actor.world.rot.y = Math_Acot2F(-this->actor.world.pos.z, -this->actor.world.pos.x) * (0x8000 / M_PI); - this->actionFunc = func_809F77A8; + this->actionFunc = Boss07_Wrath_Jump; this->actor.speedXZ = 20.0f; } } -void func_809F77A8(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_Jump(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MIBOSS_JUMP2 - SFX_FLAG); - if (this->unk_14C == 13) { + if (this->actionTimer == 13) { func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_LAUGH_OLD); } SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & 1) { - func_809F7400(this, globalCtx, 1); + Boss07_Wrath_SetupIdle(this, globalCtx, 1); this->unk_156 = 5; } Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x4000); } -void func_809F783C(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_SetupFlip(Boss07* this, GlobalContext* globalCtx) { f32 dx; f32 dz; s16 temp; Vec3f sp30; s32 pad; - this->actionFunc = func_809F7968; + this->actionFunc = Boss07_Wrath_Flip; this->actor.velocity.y = 25.0f; dx = 0.0f - this->actor.world.pos.x; dz = 0.0f - this->actor.world.pos.z; @@ -1779,34 +1153,30 @@ void func_809F783C(Boss07* this, GlobalContext* globalCtx) { dx = -200.0f; Animation_MorphToPlayOnce(&this->skelAnime, &D_0603D7F0, -5.0f); } - Matrix_RotateY(this->actor.yawTowardsPlayer, 0); + Matrix_RotateY(this->actor.yawTowardsPlayer, MTXMODE_NEW); Matrix_GetStateTranslationAndScaledX(dx, &sp30); dx = sp30.x - this->actor.world.pos.x; dz = sp30.z - this->actor.world.pos.z; this->actor.world.rot.y = Math_Acot2F(dz, dx) * (0x8000 / M_PI); - this->unk_14C = 0; + this->actionTimer = 0; this->actor.speedXZ = 17.0f; } -void func_809F7968(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_Flip(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MIBOSS_JUMP2 - SFX_FLAG); SkelAnime_Update(&this->skelAnime); - this->rightWhip.stiffness = 0.7f; - this->leftWhip.stiffness = 0.7f; - this->rightWhip.drag = 2.0f; - this->leftWhip.drag = 2.0f; - this->rightWhip.gravity = -15.0f; - this->leftWhip.gravity = -15.0f; - this->rightWhip.tension = 0.0f; - this->leftWhip.tension = 0.0f; - if ((this->unk_14C == 10) && (Rand_ZeroOne() < 0.5f)) { + this->leftWhip.stiffness = this->rightWhip.stiffness = 0.7f; + this->leftWhip.drag = this->rightWhip.drag = 2.0f; + this->leftWhip.gravity = this->rightWhip.gravity = -15.0f; + this->leftWhip.tension = this->rightWhip.tension = 0.0f; + if ((this->actionTimer == 10) && (Rand_ZeroOne() < 0.5f)) { func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_LAUGH_OLD); } if ((this->actor.velocity.y < 0.0f) && (this->actor.bgCheckFlags & 1)) { if (Rand_ZeroOne() < 0.3f) { - func_809F51E8(this, globalCtx, true); + Boss07_Wrath_Dodge(this, globalCtx, true); } else { - func_809F7400(this, globalCtx, 1); + Boss07_Wrath_SetupIdle(this, globalCtx, 1); this->actor.speedXZ = 5.0f; } this->unk_156 = 5; @@ -1814,18 +1184,18 @@ void func_809F7968(Boss07* this, GlobalContext* globalCtx) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x4000); } -void func_809F7AB4(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_SetupSidestep(Boss07* this, GlobalContext* globalCtx) { f32 phi_f12; f32 phi_f14; s32 pad; s16 sp22; - this->actionFunc = func_809F7BC4; + this->actionFunc = Boss07_Wrath_Sidestep; Animation_MorphToLoop(&this->skelAnime, &D_0603DD1C, -5.0f); phi_f14 = -this->actor.world.pos.x; phi_f12 = -this->actor.world.pos.z; sp22 = this->actor.yawTowardsPlayer - (s16)(Math_Acot2F(phi_f12, phi_f14) * (0x8000 / M_PI)); - Matrix_RotateY(this->actor.shape.rot.y, 0); + Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW); if (sp22 < 0) { this->skelAnime.playSpeed = 1.0f; phi_f14 = 300.0f; @@ -1842,56 +1212,52 @@ void func_809F7AB4(Boss07* this, GlobalContext* globalCtx) { this->unk_ABCC = 0; } -void func_809F7BC4(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_Sidestep(Boss07* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if (this->unk_14C == 20) { + if (this->actionTimer == 20) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_VOICE_KICK_OLD); } this->unk_ABCC++; if ((this->unk_ABCC % 16) == 0) { func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST2_WALK2_OLD); } - this->rightWhip.stiffness = 0.7f; - this->leftWhip.stiffness = 0.7f; - this->rightWhip.drag = 2.0f; - this->leftWhip.drag = 2.0f; - this->rightWhip.gravity = -15.0f; - this->leftWhip.gravity = -15.0f; - this->rightWhip.tension = 0.0f; - this->leftWhip.tension = 0.0f; + this->leftWhip.stiffness = this->rightWhip.stiffness = 0.7f; + this->leftWhip.drag = this->rightWhip.drag = 2.0f; + this->leftWhip.gravity = this->rightWhip.gravity = -15.0f; + this->leftWhip.tension = this->rightWhip.tension = 0.0f; Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); Math_ApproachF(&this->actor.world.pos.x, this->unk_164.x, 0.8f, this->unk_170); Math_ApproachF(&this->actor.world.pos.z, this->unk_164.z, 0.8f, this->unk_170); Math_ApproachF(&this->unk_170, 20.0f, 1.0f, 10.0f); if (this->timers[1] == 0) { if (Rand_ZeroOne() < 0.3f) { - func_809F7AB4(this, globalCtx); + Boss07_Wrath_SetupSidestep(this, globalCtx); } else { - func_809F7400(this, globalCtx, 1); + Boss07_Wrath_SetupIdle(this, globalCtx, 1); } } } -void func_809F7D2C(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_SetupAttack(Boss07* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - this->actionFunc = func_809F805C; + this->actionFunc = Boss07_Wrath_Attack; this->timers[1] = 0; if (player->stateFlags3 & 0x100) { - this->unk_14E = 4; + this->actionState = 4; } else if (this->actor.xzDistToPlayer <= 300.0f) { if (this->actor.xzDistToPlayer <= 200.0f) { - this->unk_14E = 7; + this->actionState = 7; } else { - this->unk_14E = 4; + this->actionState = 4; } } else { - this->unk_14E = Rand_ZeroFloat(6.99f); - if (((s8)this->actor.colChkInfo.health >= 28) && ((this->unk_14E == 1) || (this->unk_14E == 2))) { - this->unk_14E = 0; + this->actionState = Rand_ZeroFloat(6.99f); + if (((s8)this->actor.colChkInfo.health >= 28) && ((this->actionState == 1) || (this->actionState == 2))) { + this->actionState = 0; } } - switch (this->unk_14E) { + switch (this->actionState) { case 0: Animation_MorphToPlayOnce(&this->skelAnime, &D_06033F80, -5.0f); this->unk_1D4 = Animation_GetLastFrame(&D_06033F80); @@ -1927,99 +1293,93 @@ void func_809F7D2C(Boss07* this, GlobalContext* globalCtx) { this->unk_1D4 = Animation_GetLastFrame(&D_06026204); break; } - this->unk_14C = 0; + this->actionTimer = 0; } -void func_809F805C(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_Attack(Boss07* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); Boss07_SmoothStop(this, 2.0f); - this->rightWhip.stiffness = 0.79999995f; - this->leftWhip.stiffness = 0.79999995f; - this->rightWhip.gravity = -5.0f; - this->leftWhip.gravity = -5.0f; - this->rightWhip.tension = 0.0f; - this->leftWhip.tension = 0.0f; - this->rightWhip.drag = 1.0f; - this->leftWhip.drag = 1.0f; - if (this->unk_14C > 20) { - this->unk_174 = 1; + this->leftWhip.stiffness = this->rightWhip.stiffness = 0.01f * 80; + this->leftWhip.gravity = this->rightWhip.gravity = -5.0f; + this->leftWhip.tension = this->rightWhip.tension = 0.0f; + this->leftWhip.drag = this->rightWhip.drag = 1.0f; + if (this->actionTimer > 20) { + this->unk_174 = true; } - switch (this->unk_14E) { + switch (this->actionState) { case 0: - if (this->unk_14C == (s16)(KREG(92) + 1)) { + if (this->actionTimer == (s16)(KREG(92) + 1)) { func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } - if ((this->unk_14C >= 15) && (this->unk_14C < 18)) { + if ((this->actionTimer >= 15) && (this->actionTimer < 18)) { this->rightWhip.tension = 500.0f; } - if (this->unk_14C == 9) { + if (this->actionTimer == 9) { this->unk_14F = 11; } - if (this->unk_14C == 1) { + if (this->actionTimer == 1) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_HOP_OLD); } - if (this->unk_14C == 10) { + if (this->actionTimer == 10) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); } break; case 1: - if (this->unk_14C == (s16)(KREG(91) + 3)) { + if (this->actionTimer == (s16)(KREG(91) + 3)) { func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_THROW_OLD); } - if ((this->unk_14C >= 8) && (this->unk_14C <= 55)) { - this->rightWhip.tension = 300.0f; - this->leftWhip.tension = 300.0f; - if ((((this->unk_14C + 2) & 3) == 0) && (Rand_ZeroOne() < 0.5f)) { + if ((this->actionTimer >= 8) && (this->actionTimer <= 55)) { + this->leftWhip.tension = this->rightWhip.tension = 300.0f; + if ((((this->actionTimer + 2) % 4) == 0) && (Rand_ZeroOne() < 0.5f)) { play_sound(NA_SE_EN_LAST3_ROD_FLOOR_OLD); } - if ((this->unk_14C % 4) == 0) { + if ((this->actionTimer % 4) == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); } Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); } break; case 2: - if (this->unk_14C == (s16)(KREG(84) + 5)) { + if (this->actionTimer == (s16)(KREG(84) + 5)) { func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } - if ((this->unk_14C >= 32) && (this->unk_14C < 39)) { + if ((this->actionTimer >= 32) && (this->actionTimer <= 38)) { this->rightWhip.tension = 300.0f; this->leftWhip.tension = 300.0f; } - if (this->unk_14C == 28) { + if (this->actionTimer == 28) { this->unk_14F = 11; } - if (this->unk_14C == 10) { + if (this->actionTimer == 10) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_HOP_OLD); } - if (this->unk_14C == 32) { + if (this->actionTimer == 32) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); } break; case 3: - if (this->unk_14C == (s16)(KREG(84) + 5)) { + if (this->actionTimer == (s16)(KREG(84) + 5)) { func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } - if ((this->unk_14C > 30) && (this->unk_14C <= 35)) { + if ((this->actionTimer > 30) && (this->actionTimer <= 35)) { this->rightWhip.tension = 1200.0f; } - if (this->unk_14C == 23) { + if (this->actionTimer == 23) { this->unk_14F = 11; } Math_ApproachF(&this->unk_184, -0.1f, 0.5f, 0.1f); Math_ApproachF(&this->unk_188, 0.3f, 0.5f, 0.1f); - if (this->unk_14C == 5) { + if (this->actionTimer == 5) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_HOP_OLD); } - if (this->unk_14C == 30) { + if (this->actionTimer == 30) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); } break; case 4: - if ((this->unk_14C > 16) && (this->unk_14C <= 40)) { - this->rightWhip.tension = 200.0f; - this->leftWhip.tension = 200.0f; - if ((this->unk_14C % 8) == 0) { + if ((this->actionTimer > 16) && (this->actionTimer <= 40)) { + this->leftWhip.tension = this->rightWhip.tension = 200.0f; + if ((this->actionTimer % 8) == 0) { func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_KOMA_OLD); } Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_DANCE_OLD - SFX_FLAG); @@ -2027,84 +1387,79 @@ void func_809F805C(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.world.pos.z, this->unk_164.z, 0.1f, this->unk_170); Math_ApproachF(&this->unk_170, 20.0f, 1.0f, 4.0f); Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x2000); - this->unk_174 = 0; + this->unk_174 = false; } break; case 7: - this->unk_174 = 0; - if (this->unk_14C == 3) { + this->unk_174 = false; + if (this->actionTimer == 3) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_VOICE_KICK_OLD); } break; case 5: - this->leftWhip.stiffness = 0.7f; - this->rightWhip.stiffness = 0.7f; - this->rightWhip.gravity = -15.0f; - this->leftWhip.gravity = -15.0f; + this->rightWhip.stiffness = this->leftWhip.stiffness = 0.7f; + this->leftWhip.gravity = this->rightWhip.gravity = -15.0f; Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); - this->unk_174 = 1; + this->unk_174 = true; break; case 6: - if (this->unk_14C == (s16)(KREG(85) + 5)) { + if (this->actionTimer == (s16)(KREG(85) + 5)) { func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } - if ((this->unk_14C >= 14) && (this->unk_14C < 19)) { + if ((this->actionTimer >= 14) && (this->actionTimer < 19)) { this->rightWhip.tension = 150.0f; } - if ((this->unk_14C >= 23) && (this->unk_14C < 29)) { + if ((this->actionTimer >= 23) && (this->actionTimer < 29)) { this->leftWhip.tension = 200.0f; } - if ((this->unk_14C >= 43) && (this->unk_14C < 49)) { + if ((this->actionTimer >= 43) && (this->actionTimer < 49)) { this->rightWhip.tension = 200.0f; } Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); - if (this->unk_14C == 20) { + if (this->actionTimer == 20) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_HOP_OLD); func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } - if (this->unk_14C == 5) { + if (this->actionTimer == 5) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_HOP2_OLD); } - if (this->unk_14C == 41) { + if (this->actionTimer == 41) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_ROD_OLD); } break; } if (Animation_OnFrame(&this->skelAnime, this->unk_1D4) || (this->timers[1] == 1)) { - func_809F7400(this, globalCtx, 0); + Boss07_Wrath_SetupIdle(this, globalCtx, 0); } } -void func_809F8658(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_809F86B8; +void Boss07_Wrath_SetupGrab(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Wrath_Grab; Animation_MorphToPlayOnce(&this->skelAnime, &D_06026EA0, -5.0f); this->unk_1D4 = Animation_GetLastFrame(&D_06026EA0); - this->unk_14C = 0; + this->actionTimer = 0; } -void func_809F86B8(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_Grab(Boss07* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer - 0x800, 3, 0x2000); Boss07_SmoothStop(this, 2.0f); - this->rightWhip.stiffness = 0.79999995f; - this->leftWhip.stiffness = 0.79999995f; - this->rightWhip.drag = 1.0f; - this->leftWhip.drag = 1.0f; + this->leftWhip.stiffness = this->rightWhip.stiffness = 0.01f * 80; + this->leftWhip.drag = this->rightWhip.drag = 1.0f; + this->leftWhip.tension = this->rightWhip.tension = 0.0f; this->rightWhip.gravity = -5.0f; - this->rightWhip.tension = 0.0f; - this->leftWhip.tension = 0.0f; this->leftWhip.gravity = -15.0f; - if ((this->unk_14C >= 0xE) && (this->unk_14C < 0x13)) { + if ((this->actionTimer >= 14) && (this->actionTimer <= 18)) { this->rightWhip.tension = 500.0f; } - if (this->unk_14C >= 0x12) { - func_809F7400(this, globalCtx, Rand_ZeroFloat(20.0f) + 20.0f); + if (this->actionTimer >= 18) { + Boss07_Wrath_SetupIdle(this, globalCtx, Rand_ZeroFloat(20.0f) + 20.0f); play_sound(NA_SE_EN_LAST3_ROD_MID_OLD); } } -void func_809F87C8(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_GrabPlayer(Boss07* this, GlobalContext* globalCtx) { s32 sp2C; Player* player = GET_PLAYER(globalCtx); @@ -2114,20 +1469,20 @@ void func_809F87C8(Boss07* this, GlobalContext* globalCtx) { this->actor.flags &= ~1; this->unk_15A = 20; this->unk_F7C++; - if (this->unk_14C > (s16)(46 - this->unk_F7E)) { + if (this->actionTimer > (s16)(46 - this->unk_F7E)) { func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST3_VOICE_THROW_OLD); play_sound(NA_SE_EN_LAST3_COIL_ATTACK_OLD); - this->actionFunc = func_809F8908; + this->actionFunc = Boss07_Wrath_ThrowPlayer; Animation_MorphToPlayOnce(&this->skelAnime, &D_06027270, -5.0f); this->unk_1D4 = Animation_GetLastFrame(&D_06027270); - this->unk_14C = 0; + this->actionTimer = 0; } if ((func_800B64FC(globalCtx, 1000.0f, &this->actor.world.pos, &sp2C) >= 0.0f) && (sp2C == 1)) { - func_809F8AB0(this, globalCtx); + Boss07_Wrath_SetupShock(this, globalCtx); } } -void func_809F8908(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_ThrowPlayer(Boss07* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); f32 phi_f0; f32 phi_f2; @@ -2135,19 +1490,19 @@ void func_809F8908(Boss07* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); this->unk_15A = 20; - if (this->unk_14C == 6) { + if (this->actionTimer == 6) { this->unk_F7E = 0; if (&this->actor == player->actor.parent) { player->unk_AE8 = 101; player->actor.parent = NULL; player->unk_394 = 0; - if (player->transformation == 3) { + if (player->transformation == PLAYER_FORM_DEKU) { phi_f0 = 23.0f; phi_f2 = 20.0f; - } else if (player->transformation == 1) { + } else if (player->transformation == PLAYER_FORM_GORON) { phi_f0 = 15.0f; phi_f2 = 10.0f; - } else if (player->transformation == 0) { + } else if (player->transformation == PLAYER_FORM_FIERCE_DEITY) { phi_f0 = 10.0f; phi_f2 = 3.0f; } else { @@ -2157,22 +1512,22 @@ void func_809F8908(Boss07* this, GlobalContext* globalCtx) { func_800B8D50(globalCtx, NULL, phi_f0, this->actor.yawTowardsPlayer + 0x9000, phi_f2, 0x10); } } - if (this->unk_14C < 7) { + if (this->actionTimer < 7) { player->actor.world.pos = this->unk_F80; if ((func_800B64FC(globalCtx, 1000.0f, &this->actor.world.pos, &sp30) >= 0.0f) && (sp30 == 1)) { - func_809F8AB0(this, globalCtx); + Boss07_Wrath_SetupShock(this, globalCtx); } } - if (Animation_OnFrame(&this->skelAnime, this->unk_1D4) != 0) { - func_809F7400(this, globalCtx, 0); + if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { + Boss07_Wrath_SetupIdle(this, globalCtx, 0); } } -void func_809F8AB0(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_SetupShock(Boss07* this, GlobalContext* globalCtx) { s32 temp_v0; s32 temp_v1; - this->actionFunc = func_809F8B1C; + this->actionFunc = Boss07_Wrath_Shock; temp_v0 = this->unk_F7E + 10; this->unk_780 = this->unk_784 = temp_v0; @@ -2181,11 +1536,11 @@ void func_809F8AB0(Boss07* this, GlobalContext* globalCtx) { if (temp_v1 < temp_v0) { this->unk_780 = this->unk_784 = temp_v1; } - this->unk_14C = 0; + this->actionTimer = 0; play_sound(NA_SE_EV_ELECTRIC_EXPLOSION); } -void func_809F8B1C(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_Shock(Boss07* this, GlobalContext* globalCtx) { s32 i; Player* player = GET_PLAYER(globalCtx); @@ -2194,7 +1549,7 @@ void func_809F8B1C(Boss07* this, GlobalContext* globalCtx) { player->actor.world.pos = this->unk_F80; this->actor.flags &= ~1; this->unk_15A = 20; - if (this->unk_14C <= (s16)(46 - this->unk_F7E)) { + if (this->actionTimer <= (s16)(46 - this->unk_F7E)) { this->unk_F7C++; } for (i = 0; i < 4; i++) { @@ -2210,7 +1565,7 @@ void func_809F8B1C(Boss07* this, GlobalContext* globalCtx) { this->unk_32C = 0.01f; } if (this->unk_32C > 4.0f) { - this->actionFunc = func_809F8D04; + this->actionFunc = Boss07_Wrath_ShockStun; Animation_MorphToPlayOnce(&this->skelAnime, &D_0603B330, -10.0f); this->unk_1D4 = Animation_GetLastFrame(&D_0603B330); this->unk_F7E = 0; @@ -2221,34 +1576,32 @@ void func_809F8B1C(Boss07* this, GlobalContext* globalCtx) { } Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.focus.pos.x, this->actor.focus.pos.y - 10.0f, this->actor.focus.pos.z, 0, 0, 0, 4); - this->unk_14C = 0; + this->actionTimer = 0; } } -void func_809F8D04(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_ShockStun(Boss07* this, GlobalContext* globalCtx) { s32 i; SkelAnime_Update(&this->skelAnime); this->unk_15A = 20; for (i = 0; i < 2; i++) { - if (this->unk_780 != 0) { - this->unk_780--; - } + DECR(this->unk_780); } - if (this->unk_14C < 70) { + if (this->actionTimer < 70) { Math_ApproachF(&this->unk_32C, 5.0f, 0.5f, 3.0f); Math_ApproachF(&this->unk_330, 2.5f, 0.5f, 2.0f); play_sound(NA_SE_EN_BIRI_SPARK - SFX_FLAG); Math_ApproachF(&globalCtx->envCtx.unk_DC, 1.0f, 1.0f, 0.3f); } if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { - func_809F51E8(this, globalCtx, true); + Boss07_Wrath_Dodge(this, globalCtx, true); } } -void func_809F8DEC(Boss07* this, GlobalContext* globalCtx) { - if (this->actionFunc != func_809F91D4) { - this->actionFunc = func_809F91D4; +void Boss07_Wrath_SetupStunned(Boss07* this, GlobalContext* globalCtx) { + if (this->actionFunc != Boss07_Wrath_Stunned) { + this->actionFunc = Boss07_Wrath_Stunned; Animation_MorphToPlayOnce(&this->skelAnime, &D_0603B330, -10.0f); this->unk_1D4 = Animation_GetLastFrame(&D_0603B330); } @@ -2256,37 +1609,37 @@ void func_809F8DEC(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_VOICE_DAMAGE_OLD); } -void func_809F8E68(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_809F8EC8; +void Boss07_Wrath_SetupSpawnTop(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Wrath_SpawnTop; Animation_MorphToPlayOnce(&this->skelAnime, &D_060269EC, -5.0f); this->unk_1D4 = Animation_GetLastFrame(&D_060269EC); - this->unk_14C = 0; + this->actionTimer = 0; } -void func_809F8EC8(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_SpawnTop(Boss07* this, GlobalContext* globalCtx) { this->unk_15A = 20; - if (this->unk_14C < (s16)(KREG(40) + 14)) { + if (this->actionTimer < (s16)(KREG(40) + 14)) { this->unk_778 += 6; if (this->unk_778 > 44) { this->unk_778 = 44; } } - if (this->unk_14C == 8) { + if (this->actionTimer == 8) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BOSS_07, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, MAJORA_TOP); } if (1) {} - if (this->unk_14C == 10) { + if (this->actionTimer == 10) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_ROD_WIND_OLD); } - if (this->unk_14C == (s16)(KREG(40) + 18)) { + if (this->actionTimer == (s16)(KREG(40) + 18)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_VOICE_KOMA_OLD); } - if ((this->unk_14C < (s16)(KREG(40) + 14)) || ((s16)(KREG(41) + 17) < this->unk_14C)) { + if ((this->actionTimer < (s16)(KREG(40) + 14)) || ((s16)(KREG(41) + 17) < this->actionTimer)) { SkelAnime_Update(&this->skelAnime); } - if ((this->unk_14C >= (s16)(KREG(40) + 14)) && - ((this->unk_14C <= (s16)(KREG(41) + 17)) || ((s16)(KREG(42) + 21) <= this->unk_14C))) { + if ((this->actionTimer >= (s16)(KREG(40) + 14)) && + ((this->actionTimer <= (s16)(KREG(41) + 17)) || ((s16)(KREG(42) + 21) <= this->actionTimer))) { this->unk_778 -= KREG(39) + 5; if (this->unk_778 < 0) { this->unk_778 = 0; @@ -2294,21 +1647,21 @@ void func_809F8EC8(Boss07* this, GlobalContext* globalCtx) { } Math_ApproachS(&this->actor.shape.rot.y, KREG(8) * 0x100 + this->actor.yawTowardsPlayer + 0xF00, 3, 0x2000); Boss07_SmoothStop(this, 2.0f); - this->leftWhip.stiffness = this->rightWhip.stiffness = 0.79999995f; + this->leftWhip.stiffness = this->rightWhip.stiffness = 0.01f * 80; this->leftWhip.drag = this->rightWhip.drag = 1.0f; this->leftWhip.tension = this->rightWhip.tension = 0.0f; this->rightWhip.gravity = -5.0f; this->leftWhip.gravity = -15.0f; - if (((s16)(KREG(43) + 12) <= this->unk_14C) && (this->unk_14C <= (s16)(KREG(44) + 17))) { + if (((s16)(KREG(43) + 12) <= this->actionTimer) && (this->actionTimer <= (s16)(KREG(44) + 17))) { this->rightWhip.tension = KREG(6) + 500.0f; } - if (this->unk_14C >= (s16)(KREG(45) + 36)) { - func_809F7400(this, globalCtx, Rand_ZeroFloat(20.0f) + 20.0f); + if (this->actionTimer >= (s16)(KREG(45) + 36)) { + Boss07_Wrath_SetupIdle(this, globalCtx, Rand_ZeroFloat(20.0f) + 20.0f); } } -void func_809F91D4(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_Stunned(Boss07* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); func_8019F1C0(&sSfxPoint, NA_SE_EN_COMMON_WEAKENED - SFX_FLAG); Boss07_SmoothStop(this, 2.0f); @@ -2317,13 +1670,13 @@ void func_809F91D4(Boss07* this, GlobalContext* globalCtx) { this->leftWhip.tension = this->rightWhip.tension = 0.0f; this->leftWhip.drag = this->rightWhip.drag = 2.0f; if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { - func_809F51E8(this, globalCtx, true); + Boss07_Wrath_Dodge(this, globalCtx, true); } } -void Boss07_Wrath_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { +void Boss07_Wrath_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 damage, u8 effect) { if ((s8)this->actor.colChkInfo.health >= 0) { - this->actor.colChkInfo.health -= arg2; + this->actor.colChkInfo.health -= damage; } if ((s8)this->actor.colChkInfo.health <= 0) { if (KREG(19) != 0) { @@ -2331,7 +1684,7 @@ void Boss07_Wrath_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 arg2, } else { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_VOICE_DEAD_OLD); } - this->unk_148 = 1; + this->unk_148 = true; Enemy_StartFinishingBlow(globalCtx, &this->actor); } else { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST3_VOICE_DAMAGE2_OLD); @@ -2340,7 +1693,7 @@ void Boss07_Wrath_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 arg2, this->actionFunc = Boss07_Wrath_Damaged; this->unk_1D4 = Animation_GetLastFrame(&D_0601DEB4); this->unk_ABCC = 0; - } else if (arg3 == 14) { + } else if (effect == 14) { if (this->skelAnime.curFrame <= (this->unk_1D4 - 5.0f)) { this->unk_158 = 30; } else { @@ -2357,16 +1710,12 @@ void Boss07_Wrath_Damaged(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_WALK2_OLD); } Boss07_SmoothStop(this, 2.0f); - this->rightWhip.stiffness = 0.7f; - this->leftWhip.stiffness = 0.7f; - this->rightWhip.gravity = -15.0f; - this->leftWhip.gravity = -15.0f; - this->rightWhip.drag = 2.0f; - this->leftWhip.drag = 2.0f; - this->rightWhip.tension = 0.0f; - this->leftWhip.tension = 0.0f; + this->leftWhip.stiffness = this->rightWhip.stiffness = 0.7f; + this->leftWhip.gravity = this->rightWhip.gravity = -15.0f; + this->leftWhip.drag = this->rightWhip.drag = 2.0f; + this->leftWhip.tension = this->rightWhip.tension = 0.0f; if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { - func_809F51E8(this, globalCtx, true); + Boss07_Wrath_Dodge(this, globalCtx, true); } } @@ -2398,7 +1747,7 @@ void Boss07_Wrath_WhipCollisionCheck(Vec3f* arg0, f32 arg1, Boss07* this, Global prop = prop->next; } } - if ((arg1 >= 50.0f) && (this->unk_15A == 0) && (!(player->stateFlags3 & 0x100) || (this->unk_14E == 4))) { + if ((arg1 >= 50.0f) && (this->unk_15A == 0) && (!(player->stateFlags3 & 0x100) || (this->actionState == 4))) { if ((func_800B64FC(globalCtx, 1000.0f, &this->actor.world.pos, &sp98) >= 0.0f) && (sp98 != 1)) { sp98 = -1; } @@ -2410,7 +1759,7 @@ void Boss07_Wrath_WhipCollisionCheck(Vec3f* arg0, f32 arg1, Boss07* this, Global dy *= 1.75f; if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 140.0f) { - if ((this->actionFunc == func_809F86B8) && (sp98 != 1) && !(player->stateFlags3 & 0x1000) && + if ((this->actionFunc == Boss07_Wrath_Grab) && (sp98 != 1) && !(player->stateFlags3 & 0x1000) && (520.0f <= this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer <= 900.0f)) { if (globalCtx->grabPlayer(globalCtx, player)) { f32 dx1; @@ -2429,8 +1778,8 @@ void Boss07_Wrath_WhipCollisionCheck(Vec3f* arg0, f32 arg1, Boss07* this, Global dxz1 = sqrtf(SQ(dx1) + SQ(dz1)); this->unk_F8C = Math_Acot2F(dz1, dx1); this->unk_F90 = -Math_Acot2F(dxz1, dy1); - this->actionFunc = func_809F87C8; - this->unk_14C = 0; + this->actionFunc = Boss07_Wrath_GrabPlayer; + this->actionTimer = 0; this->rightWhip.tension = 0.0f; play_sound(NA_SE_EN_LAST3_GET_LINK_OLD); } @@ -2459,7 +1808,7 @@ void Boss07_Wrath_WhipCollisionCheck(Vec3f* arg0, f32 arg1, Boss07* this, Global void Boss07_Wrath_CollisionCheck(Boss07* this, GlobalContext* globalCtx) { s32 i; s32 j; - u8 pad; + u8 damage; Player* player = GET_PLAYER(globalCtx); if (this->unk_15C == 0) { @@ -2500,21 +1849,21 @@ void Boss07_Wrath_CollisionCheck(Boss07* this, GlobalContext* globalCtx) { this->actor.focus.pos.y, this->actor.focus.pos.z, 0, 0, 3, 4); break; } - pad = this->actor.colChkInfo.damage; - if ((this->actionFunc == func_809F91D4) || (this->actionFunc == Boss07_Wrath_Damaged)) { - if ((this->actionFunc == func_809F91D4) && (this->actor.colChkInfo.damageEffect != 0xE) && - (this->actor.colChkInfo.damageEffect != 0xD) && (this->actor.colChkInfo.damageEffect != 9) && - (this->actor.colChkInfo.damageEffect != 0xC)) { - func_809F8DEC(this, globalCtx); + damage = this->actor.colChkInfo.damage; + if ((this->actionFunc == Boss07_Wrath_Stunned) || (this->actionFunc == Boss07_Wrath_Damaged)) { + if ((this->actionFunc == Boss07_Wrath_Stunned) && (this->actor.colChkInfo.damageEffect != 14) && + (this->actor.colChkInfo.damageEffect != 13) && (this->actor.colChkInfo.damageEffect != 9) && + (this->actor.colChkInfo.damageEffect != 12)) { + Boss07_Wrath_SetupStunned(this, globalCtx); this->unk_15C = 6; } else { this->unk_15E = 15; - this->unk_15C = (this->actor.colChkInfo.damageEffect == 0xC) ? 15 : 5; - Boss07_Wrath_SetupDamaged(this, globalCtx, pad, this->actor.colChkInfo.damageEffect); + this->unk_15C = (this->actor.colChkInfo.damageEffect == 12) ? 15 : 5; + Boss07_Wrath_SetupDamaged(this, globalCtx, damage, this->actor.colChkInfo.damageEffect); } } else { this->unk_15C = 15; - func_809F8DEC(this, globalCtx); + Boss07_Wrath_SetupStunned(this, globalCtx); this->unk_F7E = 0; if (&this->actor == player->actor.parent) { player->unk_AE8 = 101; @@ -2550,7 +1899,7 @@ void Boss07_Wrath_BreakIce(Boss07* this, GlobalContext* globalCtx) { } } -void func_809F9E94(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Wrath_DamageEffects(Boss07* this, GlobalContext* globalCtx) { DECR(this->unk_1806); switch (this->unk_1805) { @@ -2646,11 +1995,11 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { globalCtx->envCtx.unk_C2 = 0; this->actor.hintId = 52; Math_ApproachF(&globalCtx->envCtx.unk_DC, 0.0f, 1.0f, 0.03f); - this->unk_149 = 1; + this->unk_149 = true; Math_Vec3f_Copy(&sSfxPoint, &this->actor.projectedPos); if (KREG(63) == 0) { - this->unk_174 = 0; - this->unk_14C++; + this->unk_174 = false; + this->actionTimer++; Actor_SetScale(&this->actor, 0.015f); Math_ApproachZeroF(&this->unk_184, 1.0f, 0.02f); Math_ApproachZeroF(&this->unk_188, 1.0f, 0.02f); @@ -2670,7 +2019,7 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 100.0f, 100.0f, 5); if (this->unk_14F != 0) { this->unk_14F--; - if ((this->actionFunc == func_809F805C) && (this->unk_14F == 0)) { + if ((this->actionFunc == Boss07_Wrath_Attack) && (this->unk_14F == 0)) { play_sound(NA_SE_EN_LAST3_ROD_FLOOR_OLD); } } @@ -2690,36 +2039,36 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->sph1.base); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->sph1.base); - if ((this->actionFunc == func_809F805C) && (this->unk_14E == 7) && (this->unk_14C >= 6)) { + if ((this->actionFunc == Boss07_Wrath_Attack) && (this->actionState == 7) && (this->actionTimer >= 6)) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->sph2.base); } else { - if ((this->unk_174 != 0) && Boss07_IsFacingPlayer(this, globalCtx)) { + if (this->unk_174 && Boss07_IsFacingPlayer(this, globalCtx)) { if ((player->unk_D57 == 4) && (player->itemActionParam != 0xC)) { if ((this->actor.xzDistToPlayer >= 400.0f) && (Rand_ZeroOne() < 0.5f)) { - func_809F7AB4(this, globalCtx); + Boss07_Wrath_SetupSidestep(this, globalCtx); } else { - func_809F51E8(this, globalCtx, false); + Boss07_Wrath_Dodge(this, globalCtx, false); } } if ((player->unk_ADC != 0) && (this->actor.xzDistToPlayer <= 150.0f)) { - func_809F51E8(this, globalCtx, false); + Boss07_Wrath_Dodge(this, globalCtx, false); } } - if ((this->actionFunc != func_809F91D4) && (this->actionFunc != Boss07_Wrath_Damaged)) { + if ((this->actionFunc != Boss07_Wrath_Stunned) && (this->actionFunc != Boss07_Wrath_Damaged)) { if ((player->stateFlags3 & 0x00001000) && !(player->stateFlags3 & 0x00080000) && (this->actor.xzDistToPlayer <= 250.0f)) { - func_809F51E8(this, globalCtx, false); + Boss07_Wrath_Dodge(this, globalCtx, false); } } } - if (this->unk_174 != 0) { + if (this->unk_174) { Boss07_Wrath_CheckExplosives(this, globalCtx); } Boss07_Wrath_BombWhips(this, globalCtx); - if ((KREG(88) != 0) || (this->unk_148 != 0)) { - KREG(88) = 0; - this->unk_148 = 0; - func_809F64F4(this, globalCtx); + if (KREG(88) || this->unk_148) { + KREG(88) = false; + this->unk_148 = false; + Boss07_Wrath_SetupDeath(this, globalCtx); } if (this->unk_1D8 != 0) { u16* sp74 = SEGMENTED_TO_VIRTUAL(D_06040930); @@ -2738,23 +2087,21 @@ void Boss07_Wrath_Update(Actor* thisx, GlobalContext* globalCtx2) { s32 sp48; s32 sp44; - sp44 = Rand_ZeroFloat(255.99f); - sp4C = Rand_ZeroFloat(511.99f); - sp48 = Rand_ZeroFloat(1023.99f); - sp50 = Rand_ZeroFloat(2047.99f); + sp44 = Rand_ZeroFloat(0x100 - 0.01f); + sp4C = Rand_ZeroFloat(0x200 - 0.01f); + sp48 = Rand_ZeroFloat(0x400 - 0.01f); + sp50 = Rand_ZeroFloat(0x800 - 0.01f); sp74[sp44] = sp70[sp4C] = sp6C[sp48] = sp68[sp48] = sp64[sp50] = sp60[sp50] = sp5C[sp50] = sp58[sp50] = sp54[sp50] = 0; } } - func_809F9E94(this, globalCtx); + Boss07_Wrath_DamageEffects(this, globalCtx); if ((this->unk_156 == 1) || (this->unk_156 == 4)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_WALK2_OLD); } - if (player->actor.world.pos.y > 100.0f) { - if (player->actor.world.pos.z < KREG(82) + -850.0f) { - player->actor.world.pos.z = KREG(82) + -850.0f; - } + if ((player->actor.world.pos.y > 100.0f) && (player->actor.world.pos.z < KREG(82) + -850.0f)) { + player->actor.world.pos.z = KREG(82) + -850.0f; } if (player->actor.world.pos.y < -300.0f) { player->actor.world.pos.x = player->actor.world.pos.y = player->actor.world.pos.z = 0.0f; @@ -2792,14 +2139,14 @@ void Boss07_Wrath_UpdateWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* bas } } spAC.z = 20.0f; - Matrix_RotateY(baseRot->y, 0); - Matrix_InsertXRotation_s(baseRot->x, 1); - Matrix_InsertZRotation_s(baseRot->z, 1); - Matrix_RotateY(0x4000, 1); + Matrix_RotateY(baseRot->y, MTXMODE_NEW); + Matrix_InsertXRotation_s(baseRot->x, MTXMODE_APPLY); + Matrix_InsertZRotation_s(baseRot->z, MTXMODE_APPLY); + Matrix_RotateY(0x4000, MTXMODE_APPLY); Matrix_GetStateTranslationAndScaledZ(spAC.z, &sp94); if (argB != 0) { spAC.z = 200.0f; - Matrix_InsertYRotation_f(this->unk_F8C, 0); + Matrix_InsertYRotation_f(this->unk_F8C, MTXMODE_NEW); Matrix_RotateStateAroundXAxis(this->unk_F90); } else { spAC.z = tension; @@ -2836,7 +2183,7 @@ void Boss07_Wrath_UpdateWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* bas temp1 = -Math_Acot2F(sqrtf(SQ(temp_f24) + SQ(temp_f20)), temp_f26); (rot - 1)->y = temp_f22; (rot - 1)->x = temp1; - Matrix_InsertYRotation_f(temp_f22, 0); + Matrix_InsertYRotation_f(temp_f22, MTXMODE_NEW); Matrix_RotateStateAroundXAxis(temp1); Matrix_GetStateTranslationAndScaledZ(spB8.z, &spA0); if (1) {} @@ -2856,7 +2203,7 @@ void Boss07_Wrath_UpdateWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* bas this->unk_F80.x = pos->x + spA0.x; this->unk_F80.y = pos->y + spA0.y; this->unk_F80.z = pos->z + spA0.z; - } else if ((whipHand == 0) && (this->actionFunc == func_809F8EC8)) { + } else if ((whipHand == 0) && (this->actionFunc == Boss07_Wrath_SpawnTop)) { if (i == KREG(90) + sWhipSegCount - this->unk_778 + 1) { spAC.x = KREG(60); spAC.y = KREG(61); @@ -2905,13 +2252,13 @@ void Boss07_Wrath_DrawWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* pos, gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sREG(48) + 45, 35, 75, 255); phi_s6 = (hand == 0) ? this->unk_778 : 0; for (i = 0; i < (sWhipSegCount - phi_s6) - 1; i++, pos++, rot++) { - Matrix_InsertTranslation(pos->x, 0.0f, pos->z, 0); - Matrix_Scale(1.0f, 0.0f, 1.0f, 1); - Matrix_InsertYRotation_f(rot->y, 1); + Matrix_InsertTranslation(pos->x, 0.0f, pos->z, MTXMODE_NEW); + Matrix_Scale(1.0f, 0.0f, 1.0f, MTXMODE_APPLY); + Matrix_InsertYRotation_f(rot->y, MTXMODE_APPLY); Matrix_RotateStateAroundXAxis(rot->x); phi_f12 = (i > 24) ? 0.025f : ((f32)(24 - i) * 1 * 0.001f) + 0.025f; - Matrix_Scale(phi_f12, phi_f12, ((2 * arg4) + 0.5f) * 0.01f, 1); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + Matrix_Scale(phi_f12, phi_f12, ((2 * arg4) + 0.5f) * 0.01f, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, D_0602EEF8); } pos = vec2; @@ -2919,12 +2266,12 @@ void Boss07_Wrath_DrawWhips(Boss07* this, GlobalContext* globalCtx, Vec3f* pos, gSPDisplayList(POLY_OPA_DISP++, D_0602EE50); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 155, 155, 80, 255); for (i = 0; i < (sWhipSegCount - phi_s6) - 1; i++, pos++, rot++) { - Matrix_InsertTranslation(pos->x, pos->y, pos->z, 0); - Matrix_InsertYRotation_f(rot->y, 1); + Matrix_InsertTranslation(pos->x, pos->y, pos->z, MTXMODE_NEW); + Matrix_InsertYRotation_f(rot->y, MTXMODE_APPLY); Matrix_RotateStateAroundXAxis(rot->x); phi_f12 = (i > 24) ? 0.025f : ((f32)(24 - i) * 1 * 0.001f) + 0.025f; - Matrix_Scale(phi_f12, phi_f12, ((2 * arg4) + 0.5f) * 0.01f, 1); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + Matrix_Scale(phi_f12, phi_f12, ((2 * arg4) + 0.5f) * 0.01f, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, D_0602EEF8); } CLOSE_DISPS(globalCtx->state.gfxCtx); @@ -2942,10 +2289,9 @@ s32 Boss07_Wrath_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** return false; } - void Boss07_Wrath_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { static s8 sLimbColliderIndex[30] = { - -1, -1, 2, -1, 7, -1, 8, -1, -1, 9, -1, 10, -1, -1, 1, -1, 5, -1, 6, -1, -1, 3, -1, 4, -1, -1, 0, -1, -1, -1, + -1, -1, 2, -1, 7, -1, 8, -1, -1, 9, -1, 10, -1, -1, 1, -1, 5, -1, 6, -1, -1, 3, -1, 4, -1, -1, 0, -1, -1, -1, }; static Vec3f sWrathColliderOffsets[11] = { { 1000.0f, 0.0f, 500.0f }, { 2000.0f, 0.0f, 0.0f }, { 1000.0f, 0.0f, 500.0f }, { 2000.0f, 0.0f, 0.0f }, @@ -2997,13 +2343,13 @@ void Boss07_Wrath_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL } } -void Boss07_Wrath_UnkLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) { +void Boss07_Wrath_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) { Boss07* this = THIS; if ((limbIndex == 2) || (limbIndex == 4) || (limbIndex == 6) || (limbIndex == 7) || (limbIndex == 9) || - (limbIndex == 0xB) || (limbIndex == 0xC) || (limbIndex == 0x10) || (limbIndex == 0x12) || (limbIndex == 0x13) || - (limbIndex == 0x15) || (limbIndex == 0x17) || (limbIndex == 0x18) || (limbIndex == 0x1A)) { - Matrix_Scale(1.0f, this->unk_17E0, this->unk_17E0, 1); + (limbIndex == 11) || (limbIndex == 12) || (limbIndex == 16) || (limbIndex == 18) || (limbIndex == 19) || + (limbIndex == 21) || (limbIndex == 23) || (limbIndex == 24) || (limbIndex == 26)) { + Matrix_Scale(1.0f, this->unk_17E0, this->unk_17E0, MTXMODE_APPLY); } } @@ -3020,20 +2366,21 @@ void Boss07_Wrath_DrawShocks(Boss07* this, GlobalContext* globalCtx) { if (this->unk_32C > 0.0f) { gSPDisplayList(POLY_XLU_DISP++, D_04023348); for (i = 0; i < ARRAY_COUNT(this->bodyPartsPos); i++) { - Matrix_InsertTranslation(this->bodyPartsPos[i].x, this->bodyPartsPos[i].y, this->bodyPartsPos[i].z, 0); + Matrix_InsertTranslation(this->bodyPartsPos[i].x, this->bodyPartsPos[i].y, this->bodyPartsPos[i].z, + MTXMODE_NEW); Matrix_NormalizeXYZ(&globalCtx->mf_187FC); - Matrix_Scale(this->unk_32C, this->unk_32C, this->unk_32C, 1); - Matrix_InsertZRotation_f(Rand_ZeroFloat(2.0f * M_PI), 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), 2); + Matrix_Scale(this->unk_32C, this->unk_32C, this->unk_32C, MTXMODE_APPLY); + Matrix_InsertZRotation_f(Rand_ZeroFloat(2.0f * M_PI), MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_04023428); } for (i = this->unk_780; i >= this->unk_784; i--) { Matrix_InsertTranslation(this->rightWhip.pos[i].x, this->rightWhip.pos[i].y, this->rightWhip.pos[i].z, 0); Matrix_NormalizeXYZ(&globalCtx->mf_187FC); - Matrix_Scale(1.5f, 1.5f, 1.5f, 1); - Matrix_InsertZRotation_f(Rand_ZeroFloat(2.0f * M_PI), 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), 2); + Matrix_Scale(1.5f, 1.5f, 1.5f, MTXMODE_APPLY); + Matrix_InsertZRotation_f(Rand_ZeroFloat(2.0f * M_PI), MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_04023428); } } @@ -3042,11 +2389,11 @@ void Boss07_Wrath_DrawShocks(Boss07* this, GlobalContext* globalCtx) { for (i = 0; i < 2 * ARRAY_COUNT(this->bodyPartsPos); i++) { Matrix_InsertTranslation(this->bodyPartsPos[i / 2].x + randPlusMinusPoint5Scaled(30.0f), this->bodyPartsPos[i / 2].y + randPlusMinusPoint5Scaled(30.0f), - this->bodyPartsPos[i / 2].z + randPlusMinusPoint5Scaled(30.0f), 0); - Matrix_Scale(this->unk_330, this->unk_330, this->unk_330, 1); + this->bodyPartsPos[i / 2].z + randPlusMinusPoint5Scaled(30.0f), MTXMODE_NEW); + Matrix_Scale(this->unk_330, this->unk_330, this->unk_330, MTXMODE_APPLY); Matrix_RotateStateAroundXAxis(Rand_ZeroFloat(2.0f * M_PI)); - Matrix_InsertZRotation_f(Rand_ZeroFloat(2.0f * M_PI), 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), 2); + Matrix_InsertZRotation_f(Rand_ZeroFloat(2.0f * M_PI), MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_04023428); } } @@ -3067,20 +2414,20 @@ void Boss07_Wrath_DrawDeathLights(Boss07* this, GlobalContext* globalCtx, Vec3f* Boss07_InitRand(1, 0x71B8, 0x263A); POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 20); gDPSetCombineMode(POLY_XLU_DISP++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); - for (i = 0; i < ARRAY_COUNT(this->unk_AB50); i++) { + for (i = 0; i < ARRAY_COUNT(this->deathLightScale); i++) { temp = sColorsYRGB[0]; gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, temp[0], temp[1], temp[2], 40); temp_f20 = (Boss07_RandZeroOne() * 40.0f) - 30.0f; Matrix_InsertTranslation(this->bodyPartsPos[2].x, this->bodyPartsPos[2].y - 30.0f + 50.0f + temp_f20 + 25.0f, - this->bodyPartsPos[2].z, 0); - Matrix_InsertTranslation(arg2->x, arg2->y + temp_f20, arg2->z, 0); - Matrix_InsertYRotation_f(Boss07_RandZeroOne() * M_PI * 2.0f, 1); + this->bodyPartsPos[2].z, MTXMODE_NEW); + Matrix_InsertTranslation(arg2->x, arg2->y + temp_f20, arg2->z, MTXMODE_NEW); + Matrix_InsertYRotation_f(Boss07_RandZeroOne() * M_PI * 2.0f, MTXMODE_APPLY); Matrix_RotateStateAroundXAxis(-0.024999999f * temp_f20); - Matrix_InsertZRotation_f(Boss07_RandZeroOne() * M_PI * 2.0f, 1); - if (this->unk_AB50[i] > 0.0f) { - Matrix_Scale(this->unk_AB50[i], 1.0f, 12.0f, 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), 2); + Matrix_InsertZRotation_f(Boss07_RandZeroOne() * M_PI * 2.0f, MTXMODE_APPLY); + if (this->deathLightScale[i] > 0.0f) { + Matrix_Scale(this->deathLightScale[i], 1.0f, 12.0f, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_0602EFE8); } } @@ -3089,12 +2436,13 @@ void Boss07_Wrath_DrawDeathLights(Boss07* this, GlobalContext* globalCtx, Vec3f* gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, (u8)(220 + sREG(18)), (u8)(170 + sREG(16))); gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, (u8)(100 + sREG(22)), 128); - Matrix_InsertTranslation(this->bodyPartsPos[2].x, this->bodyPartsPos[2].y, this->bodyPartsPos[2].z, 0); + Matrix_InsertTranslation(this->bodyPartsPos[2].x, this->bodyPartsPos[2].y, this->bodyPartsPos[2].z, + MTXMODE_NEW); Matrix_NormalizeXYZ(&globalCtx->mf_187FC); - Matrix_InsertZRotation_s(globalCtx->gameplayFrames * 0x80, 1); + Matrix_InsertZRotation_s(globalCtx->gameplayFrames * 0x80, MTXMODE_APPLY); temp_f12_2 = (sREG(17) + 800) * 0.01f * this->unk_AB4C; - Matrix_Scale(temp_f12_2, temp_f12_2, 1.0f, 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + Matrix_Scale(temp_f12_2, temp_f12_2, 1.0f, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_04023428); } CLOSE_DISPS(gfxCtx); @@ -3116,24 +2464,24 @@ void Boss07_Static_DrawLight(Boss07* this, GlobalContext* globalCtx) { gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 0, 0); gSPDisplayList(POLY_XLU_DISP++, D_04023348); - if (player->transformation == 1) { + if (player->transformation == PLAYER_FORM_GORON) { sp54 = -10.0f; sp50 = -20.0f; } else { sp54 = sp50 = 0.0f; } - if (player->transformation == 0) { + if (player->transformation == PLAYER_FORM_FIERCE_DEITY) { sp54 -= 43.0f; } Matrix_InsertTranslation(player->actor.world.pos.x, player->actor.world.pos.y + func_800B6FC8(player) - 20.0f + sp54 + sREG(60), - player->actor.world.pos.z + sREG(61) - 15.0f + sp50, 0); + player->actor.world.pos.z + sREG(61) - 15.0f + sp50, MTXMODE_NEW); Matrix_NormalizeXYZ(&globalCtx->mf_187FC); - Matrix_Scale(this->unk_AB44, this->unk_AB44, this->unk_AB44, 1); - Matrix_InsertZRotation_s(globalCtx->gameplayFrames * 0x40, 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), 2); + Matrix_Scale(this->unk_AB44, this->unk_AB44, this->unk_AB44, MTXMODE_APPLY); + Matrix_InsertZRotation_s(globalCtx->gameplayFrames * 0x40, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_04023428); } CLOSE_DISPS(gfxCtx); @@ -3152,13 +2500,14 @@ void Boss07_Wrath_Draw(Actor* thisx, GlobalContext* globalCtx2) { if ((this->unk_15E % 2) != 0) { POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); } - Matrix_InsertYRotation_f(this->unk_184, 1); + Matrix_InsertYRotation_f(this->unk_184, MTXMODE_APPLY); Matrix_RotateStateAroundXAxis(this->unk_188); func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, (s32)this->skelAnime.dListCount, - Boss07_Wrath_OverrideLimbDraw, Boss07_Wrath_PostLimbDraw, Boss07_Wrath_UnkLimbDraw, &this->actor); + Boss07_Wrath_OverrideLimbDraw, Boss07_Wrath_PostLimbDraw, Boss07_Wrath_TransformLimbDraw, + &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); - if (((KREG(63) == 0) || (KREG(63) == 2)) && (this->unk_149 != 0)) { + if (((KREG(63) == 0) || (KREG(63) == 2)) && this->unk_149) { Boss07_Wrath_UpdateWhips(this, globalCtx, &this->rightWhip.basePos, this->rightWhip.pos, this->rightWhip.rot, this->rightWhip.pull, this->rightWhip.gravity, this->rightWhip.stiffness, this->rightWhip.drag, this->rightWhip.tension, &this->rightWhip.baseRot, this->unk_F7E, @@ -3181,7 +2530,7 @@ void Boss07_Wrath_Draw(Actor* thisx, GlobalContext* globalCtx2) { Boss07_Wrath_DrawDeathLights(this, globalCtx, &sp58); func_800BE680(globalCtx, &this->actor, this->bodyPartsPos, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, this->unk_1804); - this->unk_149 = 0; + this->unk_149 = false; CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -3190,7 +2539,7 @@ void Boss07_Wrath_MakeShadowCircles(Boss07* this, u8* shadowTex, f32 weight) { static s32 sShadowWidths7[7] = { 2, 3, 4, 4, 4, 3, 2 }; static s32 sShadowWidths8[8] = { 2, 3, 4, 4, 4, 4, 3, 2 }; static s32 sShadowWidths12[12] = { 2, 4, 5, 5, 6, 6, 6, 6, 5, 5, 4, 2 }; - static s32 sBodyPartsIndex2[15] = { 1, -1, 1, 1, 3, 4, 1, 6, 7, 2, 9, 10, 2, 12, 13 }; + static s32 sBodyPartsIndex[15] = { 1, -1, 1, 1, 3, 4, 1, 6, 7, 2, 9, 10, 2, 12, 13 }; static u8 sShadowSize[15] = { 3, 2, 2, 1, 3, 3, 1, 3, 3, 1, 0, 3, 1, 0, 3 }; s32 temp_t0; s32 temp_t1; @@ -3204,7 +2553,7 @@ void Boss07_Wrath_MakeShadowCircles(Boss07* this, u8* shadowTex, f32 weight) { Vec3f sp68; for (i = 0; i < ARRAY_COUNT(this->bodyPartsPos); i++) { - if ((weight == 0.0f) || ((j = sBodyPartsIndex2[i]) >= 0)) { + if ((weight == 0.0f) || ((j = sBodyPartsIndex[i]) >= 0)) { if (weight > 0.0f) { VEC3F_LERPIMPDST(&lerp, &this->bodyPartsPos[i], &this->bodyPartsPos[j], weight); @@ -3290,9 +2639,10 @@ void Boss07_Wrath_DrawShadowTex(u8* shadowTex, Boss07* this, GlobalContext* glob phi_f0 = CLAMP_MAX(phi_f0, 1.0f); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, (u8)(s32)(phi_f0 * 80.0f) & 0xFF); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0); - Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.floorHeight, this->actor.world.pos.z - 20.0f, 0); - Matrix_Scale(1.75f, 1.0f, 1.75f, 1); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.floorHeight, this->actor.world.pos.z - 20.0f, + MTXMODE_NEW); + Matrix_Scale(1.75f, 1.0f, 1.75f, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, D_0602EF68); gDPLoadTextureBlock(POLY_OPA_DISP++, shadowTex, G_IM_FMT_I, G_IM_SIZ_8b, 0x40, 0x40, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD); @@ -3311,8 +2661,8 @@ void func_809FCBC8(Boss07* this) { this->unk_170 = 20000.0f; } -void func_809FCC70(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_809FCCCC; +void Boss07_Incarnation_SetupIntro(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Incarnation_Intro; Animation_MorphToLoop(&this->skelAnime, &D_06002D84, 0.0f); this->actor.flags &= ~1; this->unk_17D8 = 0x6E00; @@ -3320,15 +2670,15 @@ void func_809FCC70(Boss07* this, GlobalContext* globalCtx) { #ifdef NON_MATCHING // float literals for 1.0f -void func_809FCCCC(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Incarnation_Intro(Boss07* this, GlobalContext* globalCtx) { s32 i; f32 sp58; SkelAnime_Update(&this->skelAnime); this->unk_ABC8++; - Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0); - Matrix_RotateY(this->actor.shape.rot.y, 1); - sp58 = Math_SinS(this->unk_14C * 0x4500) * 0.3f; + Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); + Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY); + sp58 = Math_SinS(this->actionTimer * 0x4500) * 0.3f; switch (this->csState) { case 0: this->unk_ABC8 = 0; @@ -3347,7 +2697,7 @@ void func_809FCCCC(Boss07* this, GlobalContext* globalCtx) { if (this->unk_ABC8 >= 20) { if (this->unk_ABC8 == 20) { this->unk_17C8[3] = 1.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_TRANSFORM); + Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_TRANSFORM); } Math_ApproachF(&this->unk_17B8[3], 1.0f + (this->unk_17C8[3] * sp58), 1.0f, 0.5f); } @@ -3449,7 +2799,7 @@ void func_809FCCCC(Boss07* this, GlobalContext* globalCtx) { Camera* sp54 = Play_GetCamera(globalCtx, 0); this->csState = 0; - func_809FD5F8(this, globalCtx); + Boss07_Incarnation_SetupTaunt(this, globalCtx); sp54->eye = this->csCamEye; sp54->eyeNext = this->csCamEye; sp54->at = this->csCamAt; @@ -3472,40 +2822,40 @@ void func_809FCCCC(Boss07* this, GlobalContext* globalCtx) { } } #else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/func_809FCCCC.s") +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_07/Boss07_Incarnation_Intro.s") #endif -void func_809FD5F8(Boss07* this, GlobalContext* globalCtx) { - static AnimationHeader* sDanceAnims[3] = { &D_0600A6AC, &D_0600AB04, &D_0600AD84 }; +void Boss07_Incarnation_SetupTaunt(Boss07* this, GlobalContext* globalCtx) { + static AnimationHeader* sTauntAnims[3] = { &D_0600A6AC, &D_0600AB04, &D_0600AD84 }; - this->actionFunc = func_809FD710; - this->unk_14E = Rand_ZeroFloat(2.999f); - Animation_MorphToLoop(&this->skelAnime, sDanceAnims[this->unk_14E], -10.0f); + this->actionFunc = Boss07_Incarnation_Taunt; + this->actionState = Rand_ZeroFloat(2.999f); + Animation_MorphToLoop(&this->skelAnime, sTauntAnims[this->actionState], -10.0f); this->actor.flags |= 1; this->timers[0] = Rand_ZeroFloat(50.0f) + 50.0f; } -void func_809FD710(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Incarnation_Taunt(Boss07* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (this->unk_14E < 2) { + if (this->actionState < 2) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_WAIT_OLD - SFX_FLAG); - } else if ((this->unk_14E == 2) && Animation_OnFrame(&this->skelAnime, 5.0f)) { + } else if ((this->actionState == 2) && Animation_OnFrame(&this->skelAnime, 5.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_JUMP_OLD); } SkelAnime_Update(&this->skelAnime); Boss07_SmoothStop(this, 2.0f); Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 5, 0x2000); if ((this->timers[0] == 0) || (player->unk_D57 == 4) || (this->actor.xzDistToPlayer <= 300.0f)) { - func_809FDB2C(this, globalCtx); + Boss07_Incarnation_SetupRun(this, globalCtx); Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_VOICE_SURPRISED_OLD); } Boss07_SpawnDust(this, globalCtx, 1, false); } -void func_809FD818(Boss07* this, GlobalContext* globalCtx, s16 arg2) { - if (this->actionFunc != func_809FD89C) { - this->actionFunc = func_809FD89C; +void Boss07_Incarnation_SetupStunned(Boss07* this, GlobalContext* globalCtx, s16 arg2) { + if (this->actionFunc != Boss07_Incarnation_Stunned) { + this->actionFunc = Boss07_Incarnation_Stunned; Animation_MorphToPlayOnce(&this->skelAnime, &D_06009C7C, -10.0f); this->unk_1D4 = Animation_GetLastFrame(&D_06009C7C); } @@ -3514,7 +2864,7 @@ void func_809FD818(Boss07* this, GlobalContext* globalCtx, s16 arg2) { this->timers[1] = 12; } -void func_809FD89C(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Incarnation_Stunned(Boss07* this, GlobalContext* globalCtx) { this->actor.shape.shadowAlpha = 0; SkelAnime_Update(&this->skelAnime); Boss07_SmoothStop(this, 1.0f); @@ -3529,14 +2879,14 @@ void func_809FD89C(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_BIRD_OLD - SFX_FLAG); } if (this->timers[0] == 0) { - func_809FD5F8(this, globalCtx); + Boss07_Incarnation_SetupTaunt(this, globalCtx); } Boss07_SpawnDust(this, globalCtx, 1, true); } -void func_809FD984(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { - if (this->actionFunc != func_809FDAB0) { - this->actionFunc = func_809FDAB0; +void Boss07_Incarnation_SetupDamaged(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { + if (this->actionFunc != Boss07_Incarnation_Damaged) { + this->actionFunc = Boss07_Incarnation_Damaged; Animation_MorphToPlayOnce(&this->skelAnime, &D_06000D0C, -2.0f); this->unk_1D4 = Animation_GetLastFrame(&D_06000D0C); } else if (arg3 == 14) { @@ -3544,7 +2894,7 @@ void func_809FD984(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { this->unk_158 = 30; this->unk_15C = 30; } else { - Animation_MorphToPlayOnce(&this->skelAnime, (AnimationHeader*)&D_06000D0C, -2.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &D_06000D0C, -2.0f); } } @@ -3552,7 +2902,7 @@ void func_809FD984(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { this->actor.colChkInfo.health -= arg2; if ((s8)this->actor.colChkInfo.health <= 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_DEAD_OLD); - this->unk_148 = 1; + this->unk_148 = true; this->unk_15C = 100; this->unk_158 = 100; Enemy_StartFinishingBlow(globalCtx, &this->actor); @@ -3562,24 +2912,24 @@ void func_809FD984(Boss07* this, GlobalContext* globalCtx, u8 arg2, u8 arg3) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_DAMAGE2_OLD); } -void func_809FDAB0(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Incarnation_Damaged(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_BIRD2_OLD - SFX_FLAG); SkelAnime_Update(&this->skelAnime); Boss07_SmoothStop(this, 2.0f); if (Animation_OnFrame(&this->skelAnime, this->unk_1D4)) { - func_809FDB2C(this, globalCtx); + Boss07_Incarnation_SetupRun(this, globalCtx); } Boss07_SpawnDust(this, globalCtx, 1, false); } -void func_809FDB2C(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Incarnation_SetupRun(Boss07* this, GlobalContext* globalCtx) { Animation_MorphToLoop(&this->skelAnime, &D_0600A400, -2.0f); - this->actionFunc = func_809FDBA0; + this->actionFunc = Boss07_Incarnation_Run; this->timers[0] = Rand_ZeroFloat(100.0f) + 150.0f; func_809FCBC8(this); } -void func_809FDBA0(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Incarnation_Run(Boss07* this, GlobalContext* globalCtx) { f32 sp34; f32 sp30; s32 sp2C; @@ -3592,7 +2942,7 @@ void func_809FDBA0(Boss07* this, GlobalContext* globalCtx) { } SkelAnime_Update(&this->skelAnime); if ((func_800B64FC(globalCtx, 5.0f, &this->actor.world.pos, &sp2C) >= 0.0f) && (sp2C == 0)) { - func_809FD818(this, globalCtx, 50); + Boss07_Incarnation_SetupStunned(this, globalCtx, 50); Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_DAMAGE_OLD); } else { sp34 = this->unk_164.x - this->actor.world.pos.x; @@ -3602,16 +2952,16 @@ void func_809FDBA0(Boss07* this, GlobalContext* globalCtx) { f32 temp_f0 = Rand_ZeroOne(); if (temp_f0 < 0.25f) { - func_809FDEDC(this, globalCtx); + Boss07_Incarnation_SetupAttack(this, globalCtx); } else if (temp_f0 < 0.5f) { - func_809FE068(this, globalCtx); + Boss07_Incarnation_SetupHopak(this, globalCtx); } else if (temp_f0 < 0.75f) { - func_809FE2D4(this, globalCtx); + Boss07_Incarnation_SetupMoonwalk(this, globalCtx); } else if (temp_f0 < 1.0f) { - func_809FE4B0(this, globalCtx); + Boss07_Incarnation_SetupPirouette(this, globalCtx); } } else if (Rand_ZeroOne() < 0.01f) { - func_809FD818(this, globalCtx, 50); + Boss07_Incarnation_SetupStunned(this, globalCtx, 50); } else { func_809F4D10(&this->unk_164, 500.0f); this->timers[1] = Rand_ZeroFloat(50.0f) + 20.0f; @@ -3622,7 +2972,7 @@ void func_809FDBA0(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&this->unk_170, 4000.0f, 1.0f, 500.0f); Math_ApproachF(&this->actor.speedXZ, 25.0f, 1.0f, 20.0f); if (this->timers[0] == 0) { - func_809FD5F8(this, globalCtx); + Boss07_Incarnation_SetupTaunt(this, globalCtx); } if ((this->actor.xzDistToPlayer < 200.0f) && (this->timers[2] == 0)) { func_809FCBC8(this); @@ -3634,14 +2984,14 @@ void func_809FDBA0(Boss07* this, GlobalContext* globalCtx) { } } -void func_809FDEDC(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_809FDF54; +void Boss07_Incarnation_SetupAttack(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Incarnation_Attack; Animation_MorphToLoop(&this->skelAnime, &D_06000428, -5.0f); this->timers[0] = Rand_ZeroFloat(50.0f) + 30.0f; this->unk_188C = 0.0f; } -void func_809FDF54(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Incarnation_Attack(Boss07* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); Boss07_SmoothStop(this, 3.0f); Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 0x3000); @@ -3654,20 +3004,20 @@ void func_809FDF54(Boss07* this, GlobalContext* globalCtx) { this->unk_17AC.z, 0, 0, 0, MAJORA_INCARNATION_SHOT); } if (this->timers[0] == 0) { - func_809FDB2C(this, globalCtx); + Boss07_Incarnation_SetupRun(this, globalCtx); } Boss07_SpawnDust(this, globalCtx, 1, false); } -void func_809FE068(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_809FE0E4; +void Boss07_Incarnation_SetupHopak(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Incarnation_Hopak; Animation_MorphToLoop(&this->skelAnime, &D_06003A64, -5.0f); this->timers[0] = Rand_ZeroFloat(100.0f) + 100.0f; this->timers[1] = 0; this->unk_ABC8 = 0; } -void func_809FE0E4(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Incarnation_Hopak(Boss07* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 5.0f)) { if ((this->unk_ABC8 % 2) == 0) { @@ -3680,7 +3030,7 @@ void func_809FE0E4(Boss07* this, GlobalContext* globalCtx) { } Math_ApproachF(&this->actor.speedXZ, KREG(67) + 10.0f, 1.0f, 3.0f); if (this->timers[1] == 0) { - if ((this->unk_14C == 0) && (Rand_ZeroOne() < 0.7f)) { + if ((this->actionTimer == 0) && (Rand_ZeroOne() < 0.7f)) { if (Rand_ZeroOne() < 0.75f) { this->unk_180 = randPlusMinusPoint5Scaled(0x10000); } else { @@ -3694,7 +3044,7 @@ void func_809FE0E4(Boss07* this, GlobalContext* globalCtx) { } Math_ApproachS(&this->actor.world.rot.y, this->unk_180, 0xA, 0x1800); if ((this->timers[0] == 0) || (this->actor.xzDistToPlayer <= 200.0f)) { - func_809FDB2C(this, globalCtx); + Boss07_Incarnation_SetupRun(this, globalCtx); if (this->timers[0] != 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_VOICE_SURPRISED_OLD); } @@ -3702,19 +3052,19 @@ void func_809FE0E4(Boss07* this, GlobalContext* globalCtx) { Boss07_SpawnDust(this, globalCtx, 7, false); } -void func_809FE2D4(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_809FE348; +void Boss07_Incarnation_SetupMoonwalk(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Incarnation_Moonwalk; Animation_MorphToLoop(&this->skelAnime, &D_0600A194, -10.0f); this->timers[0] = Rand_ZeroFloat(50.0f) + 70.0f; this->timers[1] = 0; } -void func_809FE348(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Incarnation_Moonwalk(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_MOONWALK_OLD - SFX_FLAG); SkelAnime_Update(&this->skelAnime); Math_ApproachF(&this->actor.speedXZ, KREG(69) + -10.0f, 1.0f, 3.0f); if (this->timers[1] == 0) { - if ((this->unk_14C == 0) && (Rand_ZeroOne() < 0.5f)) { + if ((this->actionTimer == 0) && (Rand_ZeroOne() < 0.5f)) { if (Rand_ZeroOne() < 0.75f) { this->unk_180 = randPlusMinusPoint5Scaled(65536.0f); } else { @@ -3728,24 +3078,24 @@ void func_809FE348(Boss07* this, GlobalContext* globalCtx) { } Math_ApproachS(&this->actor.world.rot.y, this->unk_180, 0xA, 0x1000); if (this->timers[0] == 0) { - func_809FDB2C(this, globalCtx); + Boss07_Incarnation_SetupRun(this, globalCtx); } Boss07_SpawnDust(this, globalCtx, 7, false); } -void func_809FE4B0(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_809FE524; +void Boss07_Incarnation_SetupPirouette(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Incarnation_Pirouette; Animation_MorphToPlayOnce(&this->skelAnime, &D_06000194, -10.0f); this->timers[0] = Rand_ZeroFloat(70.0f) + 70.0f; this->timers[1] = 0; } -void func_809FE524(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Incarnation_Pirouette(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_BALLET_OLD - SFX_FLAG); SkelAnime_Update(&this->skelAnime); Math_ApproachF(&this->actor.speedXZ, KREG(69) + 10.0f, 1.0f, 1.0f); if (this->timers[1] == 0) { - if (((this->unk_14C % 0x40) == 0) && (Rand_ZeroOne() < 0.5f)) { + if (((this->actionTimer % 0x40) == 0) && (Rand_ZeroOne() < 0.5f)) { if (Rand_ZeroOne() < 0.75f) { this->unk_180 = randPlusMinusPoint5Scaled(65536.0f); } else { @@ -3759,7 +3109,7 @@ void func_809FE524(Boss07* this, GlobalContext* globalCtx) { } Math_ApproachS(&this->actor.world.rot.y, this->unk_180, 0xA, 0x1000); if ((this->timers[0] == 0) || (this->actor.xzDistToPlayer <= 200.0f)) { - func_809FDB2C(this, globalCtx); + Boss07_Incarnation_SetupRun(this, globalCtx); if (this->timers[0] != 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_VOICE_SURPRISED_OLD); } @@ -3767,8 +3117,8 @@ void func_809FE524(Boss07* this, GlobalContext* globalCtx) { this->actor.shape.rot.y += 0x2000; } -void func_809FE6B0(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_809FE734; +void Boss07_Incarnation_SetupDeath(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Incarnation_Death; Boss07_MovePlayer(globalCtx); Animation_MorphToPlayOnce(&this->skelAnime, &D_06000D0C, -2.0f); this->unk_1D4 = Animation_GetLastFrame(&D_06000D0C); @@ -3778,7 +3128,7 @@ void func_809FE6B0(Boss07* this, GlobalContext* globalCtx) { this->unk_15C = 20; } -void func_809FE734(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Incarnation_Death(Boss07* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); u8 sp4B = 0; @@ -3887,8 +3237,8 @@ void func_809FE734(Boss07* this, GlobalContext* globalCtx) { } break; } - Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0); - Matrix_RotateY(this->actor.shape.rot.y, 1); + Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); + Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY); Matrix_MultiplyVector3fByState(&this->csCamNextEye, &this->csCamEye); Matrix_MultiplyVector3fByState(&this->csCamNextAt, &this->csCamAt); if (sp4B == 1) { @@ -3908,7 +3258,7 @@ void func_809FE734(Boss07* this, GlobalContext* globalCtx) { } } -void func_809FEE70(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Incarnation_CollisionCheck(Boss07* this, GlobalContext* globalCtx) { s32 i; s32 j; u8 damage; @@ -3945,14 +3295,15 @@ void func_809FEE70(Boss07* this, GlobalContext* globalCtx) { break; } - if ((this->actionFunc == func_809FD89C) || (this->actionFunc == func_809FDAB0)) { + if ((this->actionFunc == Boss07_Incarnation_Stunned) || + (this->actionFunc == Boss07_Incarnation_Damaged)) { this->unk_15C = (this->actor.colChkInfo.damageEffect == 12) ? 15 : 5; damage = this->actor.colChkInfo.damage; - func_809FD984(this, globalCtx, damage, this->actor.colChkInfo.damageEffect); + Boss07_Incarnation_SetupDamaged(this, globalCtx, damage, this->actor.colChkInfo.damageEffect); this->unk_15E = 15; } else { this->unk_15C = 15; - func_809FD818(this, globalCtx, 150); + Boss07_Incarnation_SetupStunned(this, globalCtx, 150); Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST2_DAMAGE_OLD); } break; @@ -3978,10 +3329,11 @@ void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx2) { s32 i; this->actor.hintId = 51; - this->unk_14C++; + this->actionTimer++; Math_Vec3f_Copy(&sSfxPoint, &this->actor.projectedPos); if (this->unk_14A == 1) { s32 pad; + Math_ApproachF(&globalCtx->envCtx.unk_DC, 1.0f, 1.0f, 0.1f); if (globalCtx->envCtx.unk_DC == 1.0f) { globalCtx->envCtx.unk_DC = 0.0f; @@ -3995,7 +3347,7 @@ void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx2) { } Math_ApproachF(&globalCtx->envCtx.unk_DC, 0.0f, 1.0f, 0.03f); if (KREG(63) == 0) { - this->unk_174 = 0; + this->unk_174 = false; this->actor.shape.shadowAlpha = 130; for (i = 0; i < 3; i++) { DECR(this->timers[i]); @@ -4009,28 +3361,29 @@ void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx2) { this->actionFunc(this, globalCtx); Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 200.0f, 100.0f, 5); - if ((this->unk_148 != 0) || (KREG(88) != 0)) { - KREG(88) = 0; - this->unk_148 = 0; + if (this->unk_148 || KREG(88)) { + KREG(88) = false; + this->unk_148 = false; Audio_QueueSeqCmd(0x100100FF); - func_809FE6B0(this, globalCtx); + Boss07_Incarnation_SetupDeath(this, globalCtx); } } if (this->unk_158 != 0) { for (i = 0; i < ARRAY_COUNT(this->sphElems1); i++) { - this->sph1.elements[i].info.bumperFlags &= ~2; + this->sph1.elements[i].info.bumperFlags &= ~BUMP_HIT; } } - func_809FEE70(this, globalCtx); + Boss07_Incarnation_CollisionCheck(this, globalCtx); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->sph1.base); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->sph1.base); - if (this->actionFunc != func_809FE524) { + if (this->actionFunc != Boss07_Incarnation_Pirouette) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 1, 0x1000); } - if ((this->unk_18D6 != 0) && !(this->unk_14C & 1)) { - Boss07* afterimage = (Boss07*)Actor_SpawnAsChild( - &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_BOSS_07, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, 7, 21); + if ((this->unk_18D6 != 0) && !(this->actionTimer & 1)) { + Boss07* afterimage = + (Boss07*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_BOSS_07, + this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, 7, MAJORA_AFTERIMAGE); if (afterimage != NULL) { for (i = 0; i < MAJORA_INCARNATION_LIMB_COUNT; i++) { @@ -4038,7 +3391,7 @@ void Boss07_Incarnation_Update(Actor* thisx, GlobalContext* globalCtx2) { } } } - func_809F9E94(this, globalCtx); + Boss07_Wrath_DamageEffects(this, globalCtx); } void Boss07_Afterimage_Draw(Actor* thisx, GlobalContext* globalCtx2) { @@ -4050,12 +3403,13 @@ void Boss07_Afterimage_Draw(Actor* thisx, GlobalContext* globalCtx2) { func_8012C28C(globalCtx->state.gfxCtx); POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 0, 0, 100, 155, 900, 1099); SkelAnime_DrawFlexOpa(globalCtx, sp34->skelAnime.skeleton, this->skelAnime.jointTable, sp34->skelAnime.dListCount, - NULL, NULL, &this->actor); + NULL, NULL, &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); CLOSE_DISPS(globalCtx->state.gfxCtx); } -s32 Boss07_Incarnation_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { +s32 Boss07_Incarnation_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, + Actor* thisx) { Boss07* this = THIS; if (limbIndex == 24) { @@ -4069,8 +3423,8 @@ void Boss07_Incarnation_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gf -1, -1, -1, 1, -1, 9, -1, 10, -1, -1, 5, -1, 6, -1, 1, 3, -1, 4, -1, -1, 7, -1, 8, -1, 0, -1, -1, -1, -1, -1, }; static s8 sLimbPumpIndex[30] = { - -1, -1, -1, -1, 2, -1, -1, -1, -1, 0, -1, -1, -1, -1, 1, -1, - -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 2, -1, -1, -1, -1, 0, -1, -1, -1, -1, 1, + -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }; static Vec3f sIncarnationColliderOffsets[11] = { { 2000.0f, 0.0f, 0.0f }, { 3500.0f, -1000.0f, 0.0f }, { 100000.0f, 100000.0f, 100000.0f }, @@ -4079,7 +3433,8 @@ void Boss07_Incarnation_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gf { 4000.0f, 0.0f, 0.0f }, { 4000.0f, 0.0f, 0.0f }, }; static s8 sLimbBodyPartIndex[32] = { - -1, -1, -1, 1, 2, 9, -1, 10, 11, -1, 6, -1, 7, 8, 1, 3, -1, 4, 5, -1, 12, -1, 13, 14, 0, -1, -1, -1, -1, -1, 0, 0, + -1, -1, -1, 1, 2, 9, -1, 10, 11, -1, 6, -1, 7, 8, 1, 3, + -1, 4, 5, -1, 12, -1, 13, 14, 0, -1, -1, -1, -1, -1, 0, 0, }; Boss07* this = THIS; @@ -4116,23 +3471,23 @@ void Boss07_Incarnation_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gf } i = sLimbPumpIndex[limbIndex]; if (i >= 0) { - Matrix_Scale(this->unk_17B8[i], this->unk_17B8[i], this->unk_17B8[i], 1); + Matrix_Scale(this->unk_17B8[i], this->unk_17B8[i], this->unk_17B8[i], MTXMODE_APPLY); } } -void Boss07_Incarnation_UnkActorDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) { +void Boss07_Incarnation_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) { Boss07* this = THIS; if (limbIndex == 3) { - Matrix_Scale(this->unk_17F4, this->unk_17F0, 1.0f, 1); + Matrix_Scale(this->unk_17F4, this->unk_17F0, 1.0f, MTXMODE_APPLY); } - if ((limbIndex == 0xA) || (limbIndex == 0xC) || (limbIndex == 0xD) || (limbIndex == 0xF) || (limbIndex == 0x11) || - (limbIndex == 0x12)) { - Matrix_Scale(1.0f, this->unk_17E0, this->unk_17E0, 1); + if ((limbIndex == 10) || (limbIndex == 12) || (limbIndex == 13) || (limbIndex == 15) || (limbIndex == 17) || + (limbIndex == 18)) { + Matrix_Scale(1.0f, this->unk_17E0, this->unk_17E0, MTXMODE_APPLY); } - if ((limbIndex == 5) || (limbIndex == 7) || (limbIndex == 8) || (limbIndex == 0x14) || (limbIndex == 0x16) || - (limbIndex == 0x17)) { - Matrix_Scale(1.0f, this->unk_17E4, this->unk_17E4, 1); + if ((limbIndex == 5) || (limbIndex == 7) || (limbIndex == 8) || (limbIndex == 20) || (limbIndex == 22) || + (limbIndex == 23)) { + Matrix_Scale(1.0f, this->unk_17E4, this->unk_17E4, MTXMODE_APPLY); } } @@ -4147,7 +3502,8 @@ void Boss07_Incarnation_Draw(Actor* thisx, GlobalContext* globalCtx2) { POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); } func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, - Boss07_Incarnation_OverrideLimbDraw, Boss07_Incarnation_PostLimbDraw, Boss07_Incarnation_UnkActorDraw, &this->actor); + Boss07_Incarnation_OverrideLimbDraw, Boss07_Incarnation_PostLimbDraw, + Boss07_Incarnation_TransformLimbDraw, &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); func_800BE680(globalCtx, &this->actor, this->bodyPartsPos, 0xF, this->unk_17F8, this->unk_17FC, this->unk_1800, this->unk_1804); @@ -4174,7 +3530,7 @@ void Boss07_Mask_Idle(Boss07* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_FLOAT_OLD - SFX_FLAG); if (this->timers[0] == 0) { if (this->timers[2] == 0) { - if (((s8)this->actor.colChkInfo.health < 9) && (player->transformation != 0) && (Rand_ZeroOne() < 0.75f)) { + if (((s8)this->actor.colChkInfo.health <= 8) && (player->transformation != 0) && (Rand_ZeroOne() < 0.75f)) { Boss07_Mask_SetupBeam(this, globalCtx); } else { Boss07_Mask_SetupSpin(this, globalCtx); @@ -4195,7 +3551,7 @@ void Boss07_Mask_Idle(Boss07* this, GlobalContext* globalCtx) { sp28 = this->unk_164.z - this->actor.world.pos.z; sp34 = Math_Atan2S(sp30, sp28); sp36 = Math_Atan2S(sp2C, sqrtf(SQ(sp30) + SQ(sp28))); - sp36 += (s16)(Math_SinS(this->unk_14C * 0x1388) * 4000.0f); + sp36 += (s16)(Math_SinS(this->actionTimer * 0x1388) * 4000.0f); Math_ApproachS(&this->actor.world.rot.y, sp34, 0xA, this->unk_170); Math_ApproachS(&this->actor.world.rot.x, sp36, 5, this->unk_170); Math_ApproachF(&this->unk_170, 2000.0f, 1.0f, 100.0f); @@ -4212,9 +3568,9 @@ void Boss07_Mask_Idle(Boss07* this, GlobalContext* globalCtx) { } Math_ApproachS(&this->actor.shape.rot.x, 0, 0xA, 0x200); Math_ApproachS(&this->actor.shape.rot.z, 0, 0xA, 0x400); - if ((this->unk_148 != 0) || (KREG(88) != 0)) { - KREG(88) = 0; - this->unk_148 = 0; + if (this->unk_148 || KREG(88)) { + KREG(88) = false; + this->unk_148 = false; Audio_QueueSeqCmd(0x100100FF); Boss07_Mask_SetupDeath(this, globalCtx); } @@ -4222,7 +3578,7 @@ void Boss07_Mask_Idle(Boss07* this, GlobalContext* globalCtx) { void Boss07_Mask_SetupSpin(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Mask_Spin; - this->unk_14E = 0; + this->actionState = 0; this->csState = 0; this->timers[0] = 30; this->unk_18D4 = 0; @@ -4239,14 +3595,14 @@ void Boss07_Mask_Spin(Boss07* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); this->actor.shape.rot.z -= this->unk_18D4; - switch (this->unk_14E) { + switch (this->actionState) { case 0: Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000); Boss07_SmoothStop(this, 1.0f); Math_ApproachS(&this->actor.shape.rot.x, -0x4000, 0xA, 0x100); Math_ApproachS(&this->unk_18D4, 0x2000, 1, 0x100); if (this->timers[0] == 0) { - this->unk_14E = 1; + this->actionState = 1; this->actor.world.rot.x = 0; this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->timers[0] = 100; @@ -4276,7 +3632,7 @@ void Boss07_Mask_Spin(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.speedXZ, 20.0f, 1.0f, 2.0f); if (((this->csState == 0) && (sp24 < 100.0f)) || (this->timers[0] == 0)) { if (Rand_ZeroOne() < 0.25f) { - this->unk_14E = 2; + this->actionState = 2; this->timers[0] = 30; } else { func_809F4D10(&this->unk_164, 500.0f); @@ -4315,12 +3671,12 @@ void Boss07_Mask_Stunned(Boss07* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); func_8019F1C0(&sSfxPoint, NA_SE_EN_COMMON_WEAKENED - SFX_FLAG); Boss07_SmoothStop(this, 0.5f); - Math_ApproachS(&this->actor.shape.rot.x, -0x1000 + 0x4B0 * Math_SinS(this->unk_14C * 0xBB8), 5, 0x800); - Math_ApproachS(&this->actor.shape.rot.z, -0x1000 + 0x3E8 * Math_SinS(this->unk_14C * 0x9C4), 5, 0x800); + Math_ApproachS(&this->actor.shape.rot.x, -0x1000 + 0x4B0 * Math_SinS(this->actionTimer * 0xBB8), 5, 0x800); + Math_ApproachS(&this->actor.shape.rot.z, -0x1000 + 0x3E8 * Math_SinS(this->actionTimer * 0x9C4), 5, 0x800); if (this->actor.world.pos.y > 51.0f) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_FALL_OLD - SFX_FLAG); } - Math_ApproachF(&this->actor.world.pos.y, 50.0f + 10.0f * Math_SinS(this->unk_14C * 0x5DC), 0.1f, this->unk_170); + Math_ApproachF(&this->actor.world.pos.y, 50.0f + 10.0f * Math_SinS(this->actionTimer * 0x5DC), 0.1f, this->unk_170); Math_ApproachF(&this->unk_170, 15.0f, 1.0f, 1.0f); if ((this->timers[0] > 30) || ((this->timers[0] & 2) != 0)) { @@ -4376,12 +3732,12 @@ void Boss07_Mask_Damaged(Boss07* this, GlobalContext* globalCtx) { this->unk_1884 = 1; } if ((this->timers[0] == 15) && ((s8)this->actor.colChkInfo.health < 10)) { - this->unk_774 = 1; + this->unk_774 = true; } if (this->timers[0] == 0) { Boss07_Mask_SetupIdle(this, globalCtx); if ((s8)this->actor.colChkInfo.health <= 0) { - this->unk_148 = 1; + this->unk_148 = true; Enemy_StartFinishingBlow(globalCtx, &this->actor); func_801A72CC(&this->actor.projectedPos); Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_DEAD_OLD); @@ -4408,7 +3764,7 @@ void func_80A006D0(Boss07* this) { void Boss07_Mask_SetupBeam(Boss07* this, GlobalContext* globalCtx) { this->actionFunc = Boss07_Mask_Beam; - this->unk_14E = 0; + this->actionState = 0; this->timers[0] = 30; this->unk_170 = 0.0f; } @@ -4434,9 +3790,9 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.world.pos.y, 300.0f, 0.05f, 1.0f); Math_ApproachS(&this->actor.shape.rot.z, 0, 0xA, 0x400); if ((player->unk_730 != NULL) && (player->stateFlags1 & 0x400000)) { - phi_f24 = (player->transformation == 4) ? 20 : 30.0f; + phi_f24 = (player->transformation == PLAYER_FORM_HUMAN) ? 20 : 30.0f; } else { - phi_f24 = (player->transformation == 4) ? 8.0f : 15.0f; + phi_f24 = (player->transformation == PLAYER_FORM_HUMAN) ? 8.0f : 15.0f; } phi_s0 = (player->stateFlags1 & 0x400000) ? 1 : 10; Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, phi_s0, this->unk_170); @@ -4447,13 +3803,13 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { this->unk_170); Math_ApproachF(&this->unk_170, 4000.0f, 1.0f, 200.0f); this->unk_1874 = 1; - switch (this->unk_14E) { + switch (this->actionState) { case 0: if (this->timers[0] == 25) { func_8019F1C0(&sSfxPoint, NA_SE_EN_LAST1_BLOW_OLD); } if (this->timers[0] == 0) { - this->unk_14E = 1; + this->actionState = 1; this->timers[0] = 6; this->unk_1898 = 1.0f; } @@ -4461,7 +3817,7 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { case 1: Math_ApproachF(&this->unk_188C, 1.0f, 1.0f, 0.2f); if (this->timers[0] == 0) { - this->unk_14E = 2; + this->actionState = 2; this->timers[0] = 8; } break; @@ -4469,7 +3825,7 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { play_sound(NA_SE_EN_LAST1_BEAM_OLD - SFX_FLAG); Math_ApproachF(&this->unk_1890, 1.0f, 0.2f, 0.2f); if (this->timers[0] == 0) { - this->unk_14E = 3; + this->actionState = 3; this->timers[0] = 100; } break; @@ -4486,7 +3842,7 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { if (func_800C55C4(&globalCtx->colCtx, &this->unk_189C, &this->unk_18A8, &sp14C, &sp158, 1, 1, 1, 1, &sp144) && - (this->unk_14E != 5)) { + (this->actionState != 5)) { Vec3f sp138; Vec3f sp12C; Vec3f sp120; @@ -4506,13 +3862,13 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { sp16C.x = player->actor.world.pos.x - this->unk_189C.x; sp16C.y = player->actor.world.pos.y - this->unk_189C.y + 10.0f; sp16C.z = player->actor.world.pos.z - this->unk_189C.z; - Matrix_InsertXRotation_s(-this->actor.shape.rot.x, 0); - Matrix_RotateY(-this->actor.shape.rot.y, 1); + Matrix_InsertXRotation_s(-this->actor.shape.rot.x, MTXMODE_NEW); + Matrix_RotateY(-this->actor.shape.rot.y, MTXMODE_APPLY); Matrix_MultiplyVector3fByState(&sp16C, &sp160); if ((fabsf(sp160.x) < 20.0f) && (fabsf(sp160.y) < 50.0f) && (sp160.z > 40.0f) && (sp160.z <= (this->unk_1894 * 20))) { - if (func_8012405C(globalCtx) && (player->transformation == 4) && (player->stateFlags1 & 0x400000) && - (FACING_ANGLE(&player->actor, &this->actor) < 0x2000) && + if (func_8012405C(globalCtx) && (player->transformation == PLAYER_FORM_HUMAN) && + (player->stateFlags1 & 0x400000) && (FACING_ANGLE(&player->actor, &this->actor) < 0x2000) && (FACING_ANGLE(&player->actor, &this->actor) > -0x2000)) { Vec3s sp118; @@ -4521,8 +3877,8 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { func_8018219C(&player->shieldMf, &sp118, 0); sp118.y += 0x8000; sp118.x = -sp118.x; - if (this->unk_14E == 3) { - this->unk_14E = 4; + if (this->actionState == 3) { + this->actionState = 4; this->unk_18C4 = sp118.x; this->unk_18C6 = sp118.y; } else { @@ -4537,12 +3893,12 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { sp16C.y = this->actor.world.pos.y - this->unk_18A8.y; sp16C.z = this->actor.world.pos.z - this->unk_18A8.z; sp180 = sqrtf(SQXYZ(sp16C)); - Matrix_InsertXRotation_s(-this->unk_18C4, 0); - Matrix_RotateY(-this->unk_18C6, 1); + Matrix_InsertXRotation_s(-this->unk_18C4, MTXMODE_NEW); + Matrix_RotateY(-this->unk_18C6, MTXMODE_APPLY); Matrix_StatePush(); Matrix_MultiplyVector3fByState(&sp16C, &sp160); if ((fabsf(sp160.x) < 60.0f) && (fabsf(sp160.y) < 60.0f) && (sp160.z > 40.0f) && - (sp160.z <= (this->unk_18C0 * 16.666668f)) && (this->unk_14E != 5)) { + (sp160.z <= (this->unk_18C0 * 16.666668f)) && (this->actionState != 5)) { s32 phi_s0_2; Vec3f sp108; Vec3f spFC; @@ -4590,7 +3946,7 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { } Matrix_StatePop(); for (sp178 = 0; sp178 < ARRAY_COUNT(sBossRemains); sp178++) { - if (sBossRemains[sp178]->unk_14E >= 2) { + if (sBossRemains[sp178]->actionState >= 2) { continue; } sp16C.x = sBossRemains[sp178]->actor.world.pos.x - this->unk_18A8.x; @@ -4599,7 +3955,7 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { sp180 = sqrtf(SQXYZ(sp16C)); Matrix_MultiplyVector3fByState(&sp16C, &sp160); if ((fabsf(sp160.x) < 60.0f) && (fabsf(sp160.y) < 60.0f) && (sp160.z > 40.0f) && - (sp160.z <= (this->unk_18C0 * 16.666668f)) && (this->unk_14E != 5)) { + (sp160.z <= (this->unk_18C0 * 16.666668f)) && (this->actionState != 5)) { s32 pad; Vec3f spE0; Vec3f spD4; @@ -4621,7 +3977,7 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { Boss07_SpawnEffect(globalCtx, &spE0, &spD4, &spC8, Rand_ZeroFloat(10.0f) + 25.0f); sBossRemains[sp178]->unk_15E |= 0xA; } else { - sBossRemains[sp178]->unk_14E = 2; + sBossRemains[sp178]->actionState = 2; sBossRemains[sp178]->unk_18D6 = 60; Audio_PlayActorSound2(&this->actor, NA_SE_EN_FOLLOWERS_DEAD); for (pad = 0; pad < 20; pad++) { @@ -4645,7 +4001,7 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { } if (func_800C55C4(&globalCtx->colCtx, &this->unk_18A8, &this->unk_18B4, &sp14C, &sp158, 1, 1, 1, 1, &sp144) && - (this->unk_14E != 5)) { + (this->actionState != 5)) { Vec3f spBC; Vec3f spB0; Vec3f spA4; @@ -4664,7 +4020,7 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { Boss07_SpawnEffect(globalCtx, &spBC, &spB0, &spA4, Rand_ZeroFloat(10.0f) + 25.0f); } } - } else if (!player->isBurning && (this->unk_14E != 5)) { + } else if (!player->isBurning && (this->actionState != 5)) { s32 pad2; func_800B8D50(globalCtx, &this->actor, 5.0f, this->actor.shape.rot.y, 0.0f, 0x10); @@ -4685,9 +4041,9 @@ void Boss07_Mask_Beam(Boss07* this, GlobalContext* globalCtx) { } this->unk_18E0 = sp14C; } - if (this->unk_14E != 5) { + if (this->actionState != 5) { if (this->timers[0] == 0) { - this->unk_14E = 5; + this->actionState = 5; this->timers[0] = 20; } } else { @@ -4763,7 +4119,7 @@ void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { this->csCamAt.x = player->actor.world.pos.x; this->csCamAt.y = func_800B6FC8(player) + player->actor.world.pos.y - 20.0f; this->csCamAt.z = player->actor.world.pos.z; - if (player->transformation == 0) { + if (player->transformation == PLAYER_FORM_FIERCE_DEITY) { this->csCamAt.y -= 30.0f; } if (this->unk_ABC8 == 75) { @@ -4784,10 +4140,10 @@ void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { Math_ApproachZeroF(&sMajoraStatic->unk_AB44, 1.0f, 0.05f); } if (this->unk_ABC8 == 20) { - sBossRemains[REMAINS_ODOLWA]->unk_14E = 1; - sBossRemains[REMAINS_GOHT]->unk_14E = 1; - sBossRemains[REMAINS_GYORG]->unk_14E = 1; - sBossRemains[REMAINS_TWINMOLD]->unk_14E = 1; + sBossRemains[REMAINS_ODOLWA]->actionState = 1; + sBossRemains[REMAINS_GOHT]->actionState = 1; + sBossRemains[REMAINS_GYORG]->actionState = 1; + sBossRemains[REMAINS_TWINMOLD]->actionState = 1; } if (this->unk_ABC8 == 0) { func_800B7298(globalCtx, &this->actor, 7); @@ -4801,17 +4157,17 @@ void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { } if (this->unk_ABC8 >= 160) { if (this->unk_ABC8 == 160) { - sBossRemains[REMAINS_ODOLWA]->unk_14E = 2; - sBossRemains[REMAINS_GOHT]->unk_14E = 2; - sBossRemains[REMAINS_GYORG]->unk_14E = 2; - sBossRemains[REMAINS_TWINMOLD]->unk_14E = 2; + sBossRemains[REMAINS_ODOLWA]->actionState = 2; + sBossRemains[REMAINS_GOHT]->actionState = 2; + sBossRemains[REMAINS_GYORG]->actionState = 2; + sBossRemains[REMAINS_TWINMOLD]->actionState = 2; } if (this->unk_ABC8 == 161) { - sBossRemains[REMAINS_ODOLWA]->unk_14E = 3; + sBossRemains[REMAINS_ODOLWA]->actionState = 3; } if ((this->unk_ABC8 == 180) || (this->unk_ABC8 == 200) || (this->unk_ABC8 == 220)) { this->unk_ABCC++; - sBossRemains[this->unk_ABCC]->unk_14E = 3; + sBossRemains[this->unk_ABCC]->actionState = 3; } this->csCamEye.x = sIntroCamEyes[this->unk_ABCC].x; this->csCamEye.y = sIntroCamEyes[this->unk_ABCC].y; @@ -4828,10 +4184,10 @@ void Boss07_Mask_Intro(Boss07* this, GlobalContext* globalCtx) { this->csCamAt.x = this->actor.world.pos.x; this->csCamAt.y = this->actor.world.pos.y; this->csCamAt.z = this->actor.world.pos.z; - func_80A04DE0(sBossRemains[REMAINS_ODOLWA], globalCtx); - func_80A04DE0(sBossRemains[REMAINS_GOHT], globalCtx); - func_80A04DE0(sBossRemains[REMAINS_GYORG], globalCtx); - func_80A04DE0(sBossRemains[REMAINS_TWINMOLD], globalCtx); + Boss07_Remains_SetupFly(sBossRemains[REMAINS_ODOLWA], globalCtx); + Boss07_Remains_SetupFly(sBossRemains[REMAINS_GOHT], globalCtx); + Boss07_Remains_SetupFly(sBossRemains[REMAINS_GYORG], globalCtx); + Boss07_Remains_SetupFly(sBossRemains[REMAINS_TWINMOLD], globalCtx); this->csCamSpeedMod = 0.0f; sMajoraStatic->unk_AB44 = 0.0f; Audio_QueueSeqCmd(0x100A00FF); @@ -4979,8 +4335,8 @@ void Boss07_Mask_Death(Boss07* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.world.pos.x, 0.0f, 0.05f, 5.0f); Math_ApproachF(&this->actor.world.pos.z, 0.0f, 0.05f, 5.0f); Math_ApproachF(&this->actor.world.pos.y, 130.0f, 0.05f, 3.0f); - Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0); - Matrix_RotateY(this->actor.shape.rot.y, 1); + Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); + Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY); switch (this->csState) { case 0: if (ActorCutscene_GetCurrentIndex() == -1) { @@ -5100,13 +4456,13 @@ void Boss07_Mask_Update(Actor* thisx, GlobalContext* globalCtx2) { } Math_Vec3f_Copy(&sSfxPoint, &this->actor.projectedPos); if ((sMajoraStatic == NULL) || (sMajoraStatic->csCamIndex == 0)) { - this->unk_149 = 1; + this->unk_149 = true; globalCtx->envCtx.unk_C1 = 2; globalCtx->envCtx.unk_C2 = 0; Math_ApproachF(&globalCtx->envCtx.unk_DC, this->unk_1898, 1.0f, 0.1f); - this->unk_14C += 1; + this->actionTimer++; if (KREG(63) == 0) { - this->unk_174 = 0; + this->unk_174 = false; this->unk_1884 = 0; this->unk_1874 = 0; Actor_SetScale(&this->actor, 0.1f); @@ -5234,8 +4590,8 @@ void Boss07_Mask_UpdateTentacles(Boss07* this, GlobalContext* globalCtx, Vec3f* if (this->unk_1874 != 0) { for (i = 0; i < MAJORA_TENT_LENGTH; i++) { Matrix_StatePush(); - Matrix_InsertZRotation_f(arg9, 1); - sp98.x = Math_SinS((2 * i + this->unk_14C) * 0x1600) * 10; + Matrix_InsertZRotation_f(arg9, MTXMODE_APPLY); + sp98.x = Math_SinS((2 * i + this->actionTimer) * 0x1600) * 10; sp98.y = 10.0f; sp98.z = 0.0f; Matrix_MultiplyVector3fByState(&sp98, &sp8C); @@ -5274,7 +4630,7 @@ void Boss07_Mask_UpdateTentacles(Boss07* this, GlobalContext* globalCtx, Vec3f* } else if ((arg8 != 0) && ((this->actor.world.pos.y - 30.0f) < (pos - 1)->y)) { phi_f0 = -30.0f; } else { - phi_f0 = -3.0f - ((i & 7) * 0.05f); + phi_f0 = -3.0f - ((s32)(i % 8U) * 0.05f); } phi_f2 = pos->y + pull->y + phi_f0 + sp80.y; if (phi_f2 < 2.0f) { @@ -5287,7 +4643,7 @@ void Boss07_Mask_UpdateTentacles(Boss07* this, GlobalContext* globalCtx, Vec3f* temp1 = -Math_Acot2F(temp2, temp_f22); (rot - 1)->y = temp_f26; (rot - 1)->x = temp1; - Matrix_InsertYRotation_f(temp_f26, 0); + Matrix_InsertYRotation_f(temp_f26, MTXMODE_NEW); Matrix_RotateStateAroundXAxis(temp1); Matrix_GetStateTranslationAndScaledZ(sp98.z, &sp8C); temp_f24 = pos->x; @@ -5308,17 +4664,17 @@ void Boss07_Mask_DrawTentacles(Boss07* this, GlobalContext* globalCtx, Vec3f* ar OPEN_DISPS(globalCtx->state.gfxCtx); for (i = 0; i < MAJORA_TENT_LENGTH - 1; i++, arg2++, arg3++) { - Matrix_InsertTranslation(arg2->x, arg2->y, arg2->z, 0); - Matrix_InsertYRotation_f(arg3->y, 1); + Matrix_InsertTranslation(arg2->x, arg2->y, arg2->z, MTXMODE_NEW); + Matrix_InsertYRotation_f(arg3->y, MTXMODE_APPLY); Matrix_RotateStateAroundXAxis(arg3->x); - Matrix_InsertZRotation_f(arg5, 1); + Matrix_InsertZRotation_f(arg5, MTXMODE_APPLY); if (i <= (MAJORA_TENT_LENGTH - 1) / 2) { phi_f12 = 0.035f; } else { phi_f12 = 0.035f - (i - (MAJORA_TENT_LENGTH - 1) / 2) * 60.0f * 0.0001f; } - Matrix_Scale(phi_f12, phi_f12, arg4 * 0.01f * 2.3f, 1); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + Matrix_Scale(phi_f12, phi_f12, arg4 * 0.01f * 2.3f, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, D_0600B020); } CLOSE_DISPS(globalCtx->state.gfxCtx); @@ -5330,71 +4686,75 @@ void Boss07_Mask_DrawBeam(Boss07* this, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); if (this->actionFunc == Boss07_Mask_Beam) { gSPSegment(POLY_XLU_DISP++, 12, - Gfx_TexScroll(globalCtx->state.gfxCtx, 0, ((s32)this->unk_14C * -0xF) & 0xFF, 0x20, 0x40)); + Gfx_TexScroll(globalCtx->state.gfxCtx, 0, (this->actionTimer * -15) % 0x100U, 0x20, 0x40)); gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 60, 200); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128); - Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0); - Matrix_RotateY(this->actor.shape.rot.y, 1); - Matrix_InsertXRotation_s(this->actor.shape.rot.x, 1); - Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, 1); + Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + MTXMODE_NEW); + Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY); + Matrix_InsertXRotation_s(this->actor.shape.rot.x, MTXMODE_APPLY); + Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); Matrix_StatePush(); Matrix_StatePush(); Matrix_StatePush(); - Matrix_InsertTranslation(250.0f, 0.0f, 200.0f, 1); - Matrix_RotateY(-0xA00, 1); - Matrix_Scale(this->unk_1898 * 0.05f, this->unk_1898 * 0.05f, this->unk_188C * 0.05f, 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + Matrix_InsertTranslation(250.0f, 0.0f, 200.0f, MTXMODE_APPLY); + Matrix_RotateY(-0xA00, MTXMODE_APPLY); + Matrix_Scale(this->unk_1898 * 0.05f, this->unk_1898 * 0.05f, this->unk_188C * 0.05f, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_0600C7D8); Matrix_StatePop(); - Matrix_InsertTranslation(-250.0f, 0.0f, 200.0f, 1); - Matrix_RotateY(0xA00, 1); - Matrix_Scale(this->unk_1898 * 0.05f, this->unk_1898 * 0.05f, this->unk_188C * 0.05f, 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + Matrix_InsertTranslation(-250.0f, 0.0f, 200.0f, MTXMODE_APPLY); + Matrix_RotateY(0xA00, MTXMODE_APPLY); + Matrix_Scale(this->unk_1898 * 0.05f, this->unk_1898 * 0.05f, this->unk_188C * 0.05f, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_0600C7D8); gSPDisplayList(POLY_XLU_DISP++, D_04023348); Matrix_StatePop(); - Matrix_InsertTranslation(0.0f, 0.0f, 1200.0f, 1); + Matrix_InsertTranslation(0.0f, 0.0f, 1200.0f, MTXMODE_APPLY); Matrix_NormalizeXYZ(&globalCtx->mf_187FC); - Matrix_Scale(this->unk_1890 * 40.0f * this->unk_1898, this->unk_1890 * 40.0f * this->unk_1898, 0.0f, 1); - Matrix_InsertZRotation_s(this->unk_14C * 0x100, 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + Matrix_Scale(this->unk_1890 * 40.0f * this->unk_1898, this->unk_1890 * 40.0f * this->unk_1898, 0.0f, + MTXMODE_APPLY); + Matrix_InsertZRotation_s(this->actionTimer * 0x100, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_04023428); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 60, sREG(89) + 80); - Matrix_Scale(6.0f, 6.0f, 0.0f, 1); - Matrix_InsertZRotation_s(0x4000, 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + Matrix_Scale(6.0f, 6.0f, 0.0f, MTXMODE_APPLY); + Matrix_InsertZRotation_s(0x4000, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_04023428); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 60, 200); Matrix_StatePop(); - Matrix_InsertTranslation(0.0f, 0.0f, 1150.0f, 1); + Matrix_InsertTranslation(0.0f, 0.0f, 1150.0f, MTXMODE_APPLY); Matrix_GetStateTranslation(&this->unk_189C); - Matrix_Scale(this->unk_1898 * 0.05f, this->unk_1898 * 0.05f, (this->unk_1894 * 0.01f) - 0.01f, 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + Matrix_Scale(this->unk_1898 * 0.05f, this->unk_1898 * 0.05f, (this->unk_1894 * 0.01f) - 0.01f, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_0600C7D8); Matrix_GetStateTranslationAndScaledZ(20100.0f, &this->unk_18A8); if (this->unk_18C0 > 0.0f) { Vec3f sp50; Matrix_GetStateTranslationAndScaledZ(20000.0f, &sp50); - Matrix_InsertTranslation(this->unk_18A8.x, this->unk_18A8.y, this->unk_18A8.z, 0); - Matrix_RotateY(this->unk_18C6, 1); - Matrix_InsertXRotation_s(this->unk_18C4, 1); - Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, 1); - Matrix_Scale(this->unk_1898 * 0.05f, this->unk_1898 * 0.05f, this->unk_18C0 * 0.01f, 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + Matrix_InsertTranslation(this->unk_18A8.x, this->unk_18A8.y, this->unk_18A8.z, MTXMODE_NEW); + Matrix_RotateY(this->unk_18C6, MTXMODE_APPLY); + Matrix_InsertXRotation_s(this->unk_18C4, MTXMODE_APPLY); + Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); + Matrix_Scale(this->unk_1898 * 0.05f, this->unk_1898 * 0.05f, this->unk_18C0 * 0.01f, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_0600C7D8); Matrix_GetStateTranslationAndScaledZ(20100.0f, &this->unk_18B4); - Matrix_InsertTranslation(sp50.x, sp50.y, sp50.z, 0); + Matrix_InsertTranslation(sp50.x, sp50.y, sp50.z, MTXMODE_NEW); Matrix_NormalizeXYZ(&globalCtx->mf_187FC); - Matrix_Scale(this->unk_1898 * 5.0f, this->unk_1898 * 5.0f, 0.0f, 1); - Matrix_InsertZRotation_s(this->unk_14C * 0x100, 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + Matrix_Scale(this->unk_1898 * 5.0f, this->unk_1898 * 5.0f, 0.0f, MTXMODE_APPLY); + Matrix_InsertZRotation_s(this->actionTimer * 0x100, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_04023348); gSPDisplayList(POLY_XLU_DISP++, D_04023428); } @@ -5430,7 +4790,7 @@ void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { func_8012C2DC(globalCtx->state.gfxCtx); temp_f20 = this->unk_186C * (M_PI / 4.0f) * 0.06666667f; temp_f22 = Math_SinS(this->unk_186C * 0x3500) * temp_f20 * 0.5f; - Matrix_InsertYRotation_f(Math_SinS(this->unk_186C * 0x4500) * temp_f20, 1); + Matrix_InsertYRotation_f(Math_SinS(this->unk_186C * 0x4500) * temp_f20, MTXMODE_APPLY); Matrix_RotateStateAroundXAxis(temp_f22); if ((this->unk_15E % 2) != 0) { POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); @@ -5447,9 +4807,9 @@ void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { ? 1 : 0; - Matrix_RotateY(this->actor.shape.rot.y, 0); - Matrix_InsertXRotation_s(this->actor.shape.rot.x, 1); - Matrix_InsertZRotation_s(this->actor.shape.rot.z, 1); + Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW); + Matrix_InsertXRotation_s(this->actor.shape.rot.x, MTXMODE_APPLY); + Matrix_InsertZRotation_s(this->actor.shape.rot.z, MTXMODE_APPLY); Matrix_GetStateTranslationAndScaledZ(-3.0f, &sp90); spA8.x = 0.0f; spA8.y = 20.0f; @@ -5458,7 +4818,7 @@ void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { for (i = 0; i < MAJORA_TENT_COUNT; i++) { Matrix_StatePush(); Matrix_StatePush(); - Matrix_InsertZRotation_f(phi_f24, 1); + Matrix_InsertZRotation_f(phi_f24, MTXMODE_APPLY); Matrix_MultiplyVector3fByState(&spA8, &sp9C); this->tentacles[i].base.x = this->unk_1878.x + sp9C.x; this->tentacles[i].base.y = this->unk_1878.y + sp9C.y; @@ -5466,7 +4826,7 @@ void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { pad2 = (1 - (i * 0.008f)) * this->unk_1870; Matrix_StatePop(); - if (this->unk_149 != 0) { + if (this->unk_149) { Boss07_Mask_UpdateTentacles(this, globalCtx, &this->tentacles[i].base, this->tentacles[i].pos, this->tentacles[i].rot, this->tentacles[i].pull, &sp90, pad2, phi_s6, phi_f24); } @@ -5477,7 +4837,7 @@ void Boss07_Mask_Draw(Actor* thisx, GlobalContext* globalCtx2) { Matrix_StatePop(); } Boss07_Mask_DrawBeam(this, globalCtx); - this->unk_149 = 0; + this->unk_149 = false; CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -5491,13 +4851,13 @@ void Boss07_Projectile_Update(Actor* thisx, GlobalContext* globalCtx2) { f32 pad; Player* player = GET_PLAYER(globalCtx); - this->unk_14C++; + this->actionTimer++; if (this->actor.params == MAJORA_REMAINS_SHOT) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FOLLOWERS_BEAM - SFX_FLAG); } if (KREG(63) == 0) { Actor_SetScale(&this->actor, 3.5f); - if (this->unk_14E == 0) { + if (this->actionState == 0) { sp58 = player->actor.world.pos.x - this->actor.world.pos.x; sp54 = player->actor.world.pos.y - this->actor.world.pos.y + 20.0f; sp50 = player->actor.world.pos.z - this->actor.world.pos.z; @@ -5505,7 +4865,7 @@ void Boss07_Projectile_Update(Actor* thisx, GlobalContext* globalCtx2) { this->actor.world.rot.y = Math_Atan2S(sp58, sp50); pad = sqrtf(SQ(sp58) + SQ(sp50)); this->actor.world.rot.x = Math_Atan2S(sp54, pad); - this->unk_14E = 1; + this->actionState = 1; this->actor.speedXZ = 30.0f; func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); if (this->actor.params == MAJORA_INCARNATION_SHOT) { @@ -5543,17 +4903,17 @@ void Boss07_Projectile_Draw(Actor* thisx, GlobalContext* globalCtx2) { sColorsWhite[this->unk_181C][2], 255); gDPSetEnvColor(POLY_XLU_DISP++, sColorsYRGB[this->unk_181C][0], sColorsYRGB[this->unk_181C][1], sColorsYRGB[this->unk_181C][2], 128); - Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0); - Matrix_Scale(this->actor.scale.x, this->actor.scale.y, 0.0f, 1); + Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); + Matrix_Scale(this->actor.scale.x, this->actor.scale.y, 0.0f, MTXMODE_APPLY); Matrix_NormalizeXYZ(&globalCtx->mf_187FC); - Matrix_InsertZRotation_s(this->actor.shape.rot.z, 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + Matrix_InsertZRotation_s(this->actor.shape.rot.z, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_04023348); gSPDisplayList(POLY_XLU_DISP++, D_04023428); CLOSE_DISPS(globalCtx->state.gfxCtx); } -void func_80A04768(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Remains_CollisionCheck(Boss07* this, GlobalContext* globalCtx) { Vec3f sp2C; ColliderInfo* hitbox; @@ -5562,24 +4922,24 @@ void func_80A04768(Boss07* this, GlobalContext* globalCtx) { this->unk_15C = 15; hitbox = this->cyl2.info.acHitInfo; if (hitbox->toucher.dmgFlags & 0x80) { - func_80A055E0(this, globalCtx); + Boss07_Remains_SetupStunned(this, globalCtx); } else { u8 damage = this->actor.colChkInfo.damage; this->actor.colChkInfo.health -= damage; this->unk_15E = 15; - this->actionFunc = func_80A04E5C; + this->actionFunc = Boss07_Remains_Fly; if ((s8)this->actor.colChkInfo.health <= 0) { - this->unk_14E = 2; + this->actionState = 2; this->unk_18DA = 1; Enemy_StartFinishingBlow(globalCtx, &this->actor); Audio_PlayActorSound2(&this->actor, NA_SE_EN_FOLLOWERS_DEAD); } else { - this->unk_14E = 0xA; + this->actionState = 0xA; this->timers[0] = 0xF; Boss07_Remains_DamageSfx(this); } - Matrix_RotateY(this->actor.yawTowardsPlayer, 0); + Matrix_RotateY(this->actor.yawTowardsPlayer, MTXMODE_NEW); Matrix_GetStateTranslationAndScaledZ(-20.0f, &sp2C); this->unk_18CC = sp2C.x; this->unk_18D0 = sp2C.z; @@ -5587,11 +4947,11 @@ void func_80A04768(Boss07* this, GlobalContext* globalCtx) { } } -void func_80A04878(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_80A04890; +void Boss07_Remains_SetupIntro(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Remains_Intro; } -void func_80A04890(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Remains_Intro(Boss07* this, GlobalContext* globalCtx) { f32 sp54; f32 sp50; f32 sp4C; @@ -5605,13 +4965,13 @@ void func_80A04890(Boss07* this, GlobalContext* globalCtx) { s16 sp30; Player* player = GET_PLAYER(globalCtx); - switch (this->unk_14E) { + switch (this->actionState) { case 0: Actor_SetScale(&this->actor, 0.0f); this->actor.world.pos.x = player->actor.world.pos.x; this->actor.world.pos.y = player->actor.world.pos.y + 30.0f; this->actor.world.pos.z = player->actor.world.pos.z; - if (player->transformation == 0) { + if (player->transformation == PLAYER_FORM_FIERCE_DEITY) { this->actor.world.pos.y += 30.0f + KREG(48); } this->unk_164.x = sRemainsStart[this->actor.params - MAJORA_REMAINS].x + player->actor.world.pos.x; @@ -5682,16 +5042,16 @@ void func_80A04890(Boss07* this, GlobalContext* globalCtx) { } } -void func_80A04DE0(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_80A04E5C; +void Boss07_Remains_SetupFly(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Remains_Fly; this->actor.gravity = -0.75f; ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 40.0f); Collider_InitAndSetCylinder(globalCtx, &this->cyl2, &this->actor, &sRemainsCylInit); this->actor.colChkInfo.health = 5; - this->unk_14E = 0; + this->actionState = 0; } -void func_80A04E5C(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Remains_Fly(Boss07* this, GlobalContext* globalCtx) { s16 sp7E; s16 sp7C; f32 sp78; @@ -5702,7 +5062,7 @@ void func_80A04E5C(Boss07* this, GlobalContext* globalCtx) { Vec3f sp54; Vec3f sp48; - switch (this->unk_14E) { + switch (this->actionState) { case 20: Audio_PlayActorSound2(&this->actor, NA_SE_EV_MUJURA_FOLLOWERS_FLY - SFX_FLAG); this->timers[0] = 80; @@ -5711,7 +5071,7 @@ void func_80A04E5C(Boss07* this, GlobalContext* globalCtx) { this->actor.speedXZ = 5.0f; this->unk_164 = D_801D15B0; this->actor.world.rot.y = Math_Atan2S(-this->actor.world.pos.x, -this->actor.world.pos.z); - this->unk_14E = 1; + this->actionState = 1; this->unk_1888 = 100; this->cyl2.base.colType = 3; this->actor.flags |= 0x201; @@ -5740,7 +5100,7 @@ void func_80A04E5C(Boss07* this, GlobalContext* globalCtx) { sp70 = this->unk_164.z - this->actor.world.pos.z; sp7C = Math_Atan2S(sp78, sp70); sp7E = Math_Atan2S(sp74, sqrtf(SQ(sp78) + SQ(sp70))); - sp7E += (s16)(Math_SinS(this->unk_14C * 0x1388) * 4000.0f); + sp7E += (s16)(Math_SinS(this->actionTimer * 0x1388) * 4000.0f); Math_ApproachS(&this->actor.world.rot.y, sp7C, 0xA, this->unk_170); Math_ApproachS(&this->actor.world.rot.x, sp7E, 5, this->unk_170); Math_ApproachF(&this->unk_170, 2000.0f, 1.0f, 100.0f); @@ -5757,7 +5117,7 @@ void func_80A04E5C(Boss07* this, GlobalContext* globalCtx) { } else { this->unk_1888--; } - func_80A04768(this, globalCtx); + Boss07_Remains_CollisionCheck(this, globalCtx); break; case 2: Math_ApproachS(&this->actor.shape.rot.x, -0x4000, 1, 0x500); @@ -5769,7 +5129,7 @@ void func_80A04E5C(Boss07* this, GlobalContext* globalCtx) { } Math_ApproachF(&this->actor.scale.z, 0.0f, 1.0f, 0.001f); if (this->actor.scale.z == 0.0f) { - this->unk_14E = 3; + this->actionState = 3; this->actor.draw = NULL; this->actor.flags &= ~1; } @@ -5786,13 +5146,13 @@ void func_80A04E5C(Boss07* this, GlobalContext* globalCtx) { this->actor.world.pos.y += 50.0f; this->actor.prevPos.y += 50.0f; if (this->timers[0] == 0) { - this->unk_14E = 1; + this->actionState = 1; } break; case 0: break; } - if (this->unk_14E < 2) { + if (this->actionState < 2) { Collider_UpdateCylinder(&this->actor, &this->cyl2); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->cyl2.base); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->cyl2.base); @@ -5827,20 +5187,20 @@ void func_80A04E5C(Boss07* this, GlobalContext* globalCtx) { } } -void func_80A055E0(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_80A05608; +void Boss07_Remains_SetupStunned(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Remains_Stunned; this->timers[0] = 50; this->actor.speedXZ = 0.0f; } -void func_80A05608(Boss07* this, GlobalContext* globalCtx) { - func_80A04768(this, globalCtx); +void Boss07_Remains_Stunned(Boss07* this, GlobalContext* globalCtx) { + Boss07_Remains_CollisionCheck(this, globalCtx); Collider_UpdateCylinder(&this->actor, &this->cyl2); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->cyl2.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->cyl2.base); if (this->timers[0] == 0) { - this->actionFunc = func_80A04E5C; - this->unk_14E = 1; + this->actionFunc = Boss07_Remains_Fly; + this->actionState = 1; } } @@ -5849,21 +5209,13 @@ void Boss07_Remains_Update(Actor* thisx, GlobalContext* globalCtx2) { Boss07* this = THIS; s32 i; - this->unk_14C++; + this->actionTimer++; for (i = 0; i < 3; i++) { - if (this->timers[i] != 0) { - this->timers[i]--; - } - } - if (this->unk_18D6 != 0) { - this->unk_18D6--; - } - if (this->unk_15C != 0) { - this->unk_15C--; - } - if (this->unk_15E != 0) { - this->unk_15E--; + DECR(this->timers[i]); } + DECR(this->unk_18D6); + DECR(this->unk_15C); + DECR(this->unk_15E); this->actionFunc(this, globalCtx); this->actor.focus.pos = this->actor.world.pos; this->actor.world.pos.x += this->unk_18CC; @@ -5886,9 +5238,9 @@ void Boss07_Remains_Draw(Actor* thisx, GlobalContext* globalCtx2) { } sp64 = this->unk_15C * (M_PI / 4.0f) * 0.06666667f; sp60 = Math_SinS(this->unk_15C * 0x3500) * sp64 * 0.5f; - Matrix_InsertYRotation_f(Math_SinS(this->unk_15C * 0x4500) * sp64, 1); + Matrix_InsertYRotation_f(Math_SinS(this->unk_15C * 0x4500) * sp64, MTXMODE_APPLY); Matrix_RotateStateAroundXAxis(sp60); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); switch (this->actor.params) { case MAJORA_REMAINS + REMAINS_ODOLWA: gSPDisplayList(POLY_OPA_DISP++, D_060149A0); @@ -5904,47 +5256,48 @@ void Boss07_Remains_Draw(Actor* thisx, GlobalContext* globalCtx2) { break; } POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); - if (this->actionFunc == func_80A04890) { + if (this->actionFunc == Boss07_Remains_Intro) { gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 200, 200); gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 100, 128); - Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0); - Matrix_Scale(this->unk_188C, this->unk_188C, 0.0f, 1); + Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + MTXMODE_NEW); + Matrix_Scale(this->unk_188C, this->unk_188C, 0.0f, MTXMODE_APPLY); Matrix_NormalizeXYZ(&globalCtx->mf_187FC); - Matrix_InsertZRotation_s(this->unk_18C8, 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + Matrix_InsertZRotation_s(this->unk_18C8, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_04023348); gSPDisplayList(POLY_XLU_DISP++, D_04023428); } CLOSE_DISPS(globalCtx->state.gfxCtx); } -void func_80A05AF8(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_80A05B50; +void Boss07_Top_SetupThrown(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Top_Thrown; this->actor.gravity = 0.0f; this->unk_17C = (sREG(42) * 0.01f) + 0.9f; this->timers[0] = 200; } -void func_80A05B50(Boss07* this, GlobalContext* globalCtx) { - if (sMajorasWrath->actionFunc == func_809F8EC8) { +void Boss07_Top_Thrown(Boss07* this, GlobalContext* globalCtx) { + if (sMajorasWrath->actionFunc == Boss07_Wrath_SpawnTop) { Math_Vec3f_Copy(&this->actor.world.pos, &sMajorasWrath->unk_F80); this->actor.world.pos.y -= 25.0f + sREG(78); } Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 40.0f, 50.0f, 80.0f, 1); - if ((sMajorasWrath->unk_14C >= (s16)(KREG(50) + 21)) || (sMajorasWrath->unk_15C != 0)) { - func_80A05C88(this, globalCtx); + if ((sMajorasWrath->actionTimer >= (s16)(KREG(50) + 21)) || (sMajorasWrath->unk_15C != 0)) { + Boss07_Top_SetupGround(this, globalCtx); } else if (this->actor.bgCheckFlags & 8) { - func_80A05C88(this, globalCtx); + Boss07_Top_SetupGround(this, globalCtx); this->actor.speedXZ = -15.0f; CollisionCheck_SpawnShieldParticles(globalCtx, &this->actor.focus.pos); Audio_PlayActorSound2(&this->actor, NA_SE_IT_SHIELD_REFLECT_SW); } } -void func_80A05C88(Boss07* this, GlobalContext* globalCtx) { - this->actionFunc = func_80A05DDC; +void Boss07_Top_SetupGround(Boss07* this, GlobalContext* globalCtx) { + this->actionFunc = Boss07_Top_Ground; this->actor.gravity = -2.0f; if (sMajorasWrath->unk_15C != 0) { this->timers[0] = sREG(47) + 80; @@ -5959,7 +5312,7 @@ void func_80A05C88(Boss07* this, GlobalContext* globalCtx) { this->actor.shape.rot.z = Rand_ZeroFloat((sREG(29) + 10) * 256.0f); } -void func_80A05DDC(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Top_Ground(Boss07* this, GlobalContext* globalCtx) { f32 sp4C; f32 sp48; @@ -6018,9 +5371,9 @@ void func_80A05DDC(Boss07* this, GlobalContext* globalCtx) { sp48 = this->actor.prevPos.z - this->actor.world.pos.z; func_800AE930(&globalCtx->colCtx, Effect_GetParams(this->effectIndex), &this->actor.world.pos, 3.0f, Math_Atan2S(sp4C, sp48), this->actor.floorPoly, this->actor.floorBgId); - this->unk_14E = 1; - } else if (this->unk_14E != 0) { - this->unk_14E = 0; + this->actionState = 1; + } else if (this->actionState != 0) { + this->actionState = 0; func_800AEF44(Effect_GetParams(this->effectIndex)); } this->actor.shape.rot.y = this->actor.world.rot.y; @@ -6038,7 +5391,7 @@ void func_80A05DDC(Boss07* this, GlobalContext* globalCtx) { } } -void func_80A06500(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Top_Collide(Boss07* this, GlobalContext* globalCtx) { s32 i; Boss07* top; f32 dx; @@ -6097,7 +5450,7 @@ void func_80A06500(Boss07* this, GlobalContext* globalCtx) { } } -void func_80A06990(Boss07* this, GlobalContext* globalCtx) { +void Boss07_Top_CollisionCheck(Boss07* this, GlobalContext* globalCtx) { s32 sp3C; s32 sp38 = 0; Player* player = GET_PLAYER(globalCtx); @@ -6114,7 +5467,7 @@ void func_80A06990(Boss07* this, GlobalContext* globalCtx) { } if (this->timers[0] > 40) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if (player->transformation == 0) { + if (player->transformation == PLAYER_FORM_FIERCE_DEITY) { this->actor.speedXZ = -30.0f; this->actor.velocity.y = 10.0f; if ((s16)(sREG(47) + 100) < this->timers[0]) { @@ -6158,7 +5511,7 @@ void Boss07_Top_Update(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; Boss07* this = THIS; - this->unk_14C++; + this->actionTimer++; DECR(this->timers[0]); DECR(this->timers[1]); DECR(this->unk_15E); @@ -6167,16 +5520,16 @@ void Boss07_Top_Update(Actor* thisx, GlobalContext* globalCtx2) { this->actionFunc(this, globalCtx); Math_Vec3f_Copy(&this->actor.focus.pos, &this->actor.world.pos); this->actor.focus.pos.y += 25.0f; - func_80A06990(this, globalCtx); + Boss07_Top_CollisionCheck(this, globalCtx); Collider_UpdateCylinder(&this->actor, &this->cyl2); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->cyl2.base); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->cyl2.base); - func_80A06500(this, globalCtx); + Boss07_Top_Collide(this, globalCtx); this->unk_178 -= this->unk_17C; if (this->unk_178 < -2.0f * M_PI) { this->unk_178 += 2.0f * M_PI; } - if (sMajorasWrath->actionFunc == func_809F65F4) { + if (sMajorasWrath->actionFunc == Boss07_Wrath_Death) { Actor_MarkForDeath(&this->actor); } Math_ApproachF(&this->actor.scale.x, (sREG(77) * 0.001f) + 0.06f, 1.0f, 0.012f); @@ -6192,12 +5545,12 @@ void Boss07_Top_Draw(Actor* thisx, GlobalContext* globalCtx2) { if ((this->unk_15E % 2) != 0) { POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 780, 1099); } - Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0); - Matrix_RotateY(this->actor.shape.rot.y, 1); - Matrix_InsertZRotation_s(this->actor.shape.rot.z, 1); - Matrix_InsertYRotation_f(this->unk_178, 1); - Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, 1); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), 2); + Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); + Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY); + Matrix_InsertZRotation_s(this->actor.shape.rot.z, MTXMODE_APPLY); + Matrix_InsertYRotation_f(this->unk_178, MTXMODE_APPLY); + Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, D_0602F640); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); CLOSE_DISPS(globalCtx->state.gfxCtx); @@ -6227,7 +5580,7 @@ void Boss07_Static_Update(Actor* thisx, GlobalContext* globalCtx2) { this->unk_ABC8++; switch (this->csState) { case 0: - if ((sMajorasMask != NULL) && (sMajorasMask->unk_774 != 0)) { + if ((sMajorasMask != NULL) && sMajorasMask->unk_774) { this->csState = 1; this->unk_ABC8 = 0; } @@ -6250,7 +5603,7 @@ void Boss07_Static_Update(Actor* thisx, GlobalContext* globalCtx2) { } case 2: if (this->unk_ABC8 == 20) { - sBossRemains[REMAINS_ODOLWA]->unk_14E = 20; + sBossRemains[REMAINS_ODOLWA]->actionState = 20; } this->csCamAt.x = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.x; this->csCamAt.y = sBossRemains[REMAINS_ODOLWA]->actor.world.pos.y; @@ -6266,7 +5619,7 @@ void Boss07_Static_Update(Actor* thisx, GlobalContext* globalCtx2) { } case 3: if (this->unk_ABC8 == 20) { - sBossRemains[REMAINS_GOHT]->unk_14E = 20; + sBossRemains[REMAINS_GOHT]->actionState = 20; } this->csCamAt.x = sBossRemains[REMAINS_GOHT]->actor.world.pos.x; this->csCamAt.y = sBossRemains[REMAINS_GOHT]->actor.world.pos.y; @@ -6282,7 +5635,7 @@ void Boss07_Static_Update(Actor* thisx, GlobalContext* globalCtx2) { } case 4: if (this->unk_ABC8 == 20) { - sBossRemains[REMAINS_GYORG]->unk_14E = 20; + sBossRemains[REMAINS_GYORG]->actionState = 20; } this->csCamAt.x = sBossRemains[REMAINS_GYORG]->actor.world.pos.x; this->csCamAt.y = sBossRemains[REMAINS_GYORG]->actor.world.pos.y; @@ -6298,7 +5651,7 @@ void Boss07_Static_Update(Actor* thisx, GlobalContext* globalCtx2) { } case 5: if (this->unk_ABC8 == 20) { - sBossRemains[REMAINS_TWINMOLD]->unk_14E = 20; + sBossRemains[REMAINS_TWINMOLD]->actionState = 20; } this->csCamAt.x = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.x; this->csCamAt.y = sBossRemains[REMAINS_TWINMOLD]->actor.world.pos.y; @@ -6369,7 +5722,7 @@ void Boss07_Static_UpdateEffects(GlobalContext* globalCtx) { effect->vel.z += effect->accel.z; if (effect->type == 1) { if (effect->isFading) { - effect->alpha -= (i & 7) + 13; + effect->alpha -= (i % 8U) + 13; if (effect->alpha <= 0) { effect->alpha = 0; effect->type = 0; @@ -6399,12 +5752,12 @@ void Boss07_Static_DrawEffects(GlobalContext* globalCtx) { gDPPipeSync(POLY_XLU_DISP++); gDPSetEnvColor(POLY_XLU_DISP++, 255, 215, 255, 128); gSPSegment(POLY_XLU_DISP++, 8, - Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (3 * effect->scroll) & 0x7F, - (15 * -effect->scroll) & 0xFF, 0x20, 0x40, 1, 0, 0, 0x20, 0x20)); - Matrix_InsertTranslation(effect->pos.x, effect->pos.y, effect->pos.z, 0); + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (3 * effect->scroll) % 0x80U, + (15 * -effect->scroll) % 0x100U, 0x20, 0x40, 1, 0, 0, 0x20, 0x20)); + Matrix_InsertTranslation(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_NormalizeXYZ(&globalCtx->mf_187FC); - Matrix_Scale(effect->unk_34, effect->unk_34, 1.0f, 1); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), 2); + Matrix_Scale(effect->unk_34, effect->unk_34, 1.0f, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_0600CEE8); } } diff --git a/src/overlays/actors/ovl_Boss_07/z_boss_07.h b/src/overlays/actors/ovl_Boss_07/z_boss_07.h index a59860592..f829455af 100644 --- a/src/overlays/actors/ovl_Boss_07/z_boss_07.h +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.h @@ -8,7 +8,7 @@ struct Boss07; #define MAJORA_TENT_LENGTH 10 #define MAJORA_TENT_COUNT 25 #define MAJORA_TENT_MAX 100 -#define MAJORA_WHIP_MAX 50 +#define MAJORA_WHIP_MAX_LENGTH 50 #define MAJORA_MASK_LIMB_COUNT 19 #define MAJORA_INCARNATION_LIMB_COUNT 25 @@ -31,10 +31,10 @@ typedef struct { f32 drag; f32 tension; Vec3f basePos; - Vec3f pos[MAJORA_WHIP_MAX]; - Vec3f rot[MAJORA_WHIP_MAX]; - Vec3f pull[MAJORA_WHIP_MAX]; - f32 unk_72C[MAJORA_WHIP_MAX]; // unused, probably a stretch factor + Vec3f pos[MAJORA_WHIP_MAX_LENGTH]; + Vec3f rot[MAJORA_WHIP_MAX_LENGTH]; + Vec3f pull[MAJORA_WHIP_MAX_LENGTH]; + f32 unk_72C[MAJORA_WHIP_MAX_LENGTH]; // unused, probably a stretch factor } Boss07Whip; // size = 0x7F4 (0x24 + 0x28 * max) typedef struct Boss07 { @@ -44,8 +44,8 @@ typedef struct Boss07 { /* 0x0149 */ u8 unk_149; /* 0x014A */ u8 unk_14A; /* 0x014B */ u8 unk_14B; - /* 0x014C */ s16 unk_14C; - /* 0x014E */ u8 unk_14E; + /* 0x014C */ s16 actionTimer; + /* 0x014E */ u8 actionState; /* 0x014F */ u8 unk_14F; /* 0x0150 */ s16 timers[3]; /* 0x0156 */ s16 unk_156; @@ -67,8 +67,8 @@ typedef struct Boss07 { /* 0x0190 */ SkelAnime skelAnime; /* 0x01D4 */ f32 unk_1D4; /* 0x01D8 */ s32 unk_1D8; - /* 0x01DC */ Vec3s jointTable1[MAJORA_LIMB_COUNT]; - /* 0x0284 */ Vec3s morphTable1[MAJORA_LIMB_COUNT]; + /* 0x01DC */ Vec3s jointTable[MAJORA_LIMB_COUNT]; + /* 0x0284 */ Vec3s morphTable[MAJORA_LIMB_COUNT]; /* 0x032C */ f32 unk_32C; /* 0x0330 */ f32 unk_330; /* 0x0334 */ Vec3f bodyPartsPos[15]; @@ -145,12 +145,11 @@ typedef struct Boss07 { /* 0x18F0 */ ColliderQuad quad1; /* 0x1970 */ ColliderQuad quad2; /* 0x19F0 */ Boss07Tentacle tentacles[MAJORA_TENT_MAX]; - // /* 0x3E44 */ char unk3E44[0x6CFC]; // size suggests 100 element tentacle array /* 0xAB40 */ s16 unk_AB40; /* 0xAB44 */ f32 unk_AB44; /* 0xAB48 */ u8 unk_AB48; /* 0xAB4C */ f32 unk_AB4C; - /* 0xAB50 */ f32 unk_AB50[30]; + /* 0xAB50 */ f32 deathLightScale[30]; /* 0xABC8 */ u32 unk_ABC8; /* 0xABCC */ s32 unk_ABCC; /* 0xABD0 */ s16 csState; diff --git a/src/overlays/actors/ovl_Boss_07/z_boss_07_colchk.c b/src/overlays/actors/ovl_Boss_07/z_boss_07_colchk.c new file mode 100644 index 000000000..13cdf9dc0 --- /dev/null +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07_colchk.c @@ -0,0 +1,422 @@ +#include "global.h" + +static ColliderJntSphElementInit sWrathJntSphElementsInit1[11] = { + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 25 }, 100 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 15 }, 150 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 15 }, 150 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 15 }, 150 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 15 }, 150 }, + }, +}; + +static ColliderJntSphInit sWrathJntSphInit1 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 11, + sWrathJntSphElementsInit1, +}; + +static ColliderCylinderInit sWrathCylInit = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 80, 200, 0, { 0, 0, 0 } }, +}; + +static ColliderJntSphElementInit sWrathJntSphElementsInit2[1] = { + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x04, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 36 }, 200 }, + }, +}; + +static ColliderJntSphInit sWrathJntSphInit2 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + sWrathJntSphElementsInit2, +}; + +static ColliderQuadInit sMaskQuadInit1 = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK2, + { 0xF7CFFFFF, 0x04, 0x00 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; + +static ColliderQuadInit sMaskQuadInit2 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK2, + { 0xF7CFFFFF, 0x04, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; + +static ColliderJntSphElementInit sIncarnationJntSphElementsInit[11] = { + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 25 }, 100 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 40 }, 100 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 0 }, 0 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 15 }, 150 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 15 }, 150 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 15 }, 150 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x10 }, + { 0xF7CEFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 15 }, 150 }, + }, +}; + +static ColliderJntSphInit sIncarnationJntSphInit1 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 11, + sIncarnationJntSphElementsInit, +}; + +static ColliderCylinderInit sShotCylInit = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xF7CFFFFF, 0x04, 0x10 }, + { 0x00300000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 15, 30, -15, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit sRemainsCylInit = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xF7CFFFFF, 0x04, 0x10 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 50, 100, -50, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit sTopCylInit = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xF7CFFFFF, 0x04, 0x10 }, + { 0xF7FFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 40, 20, 15, { 0, 0, 0 } }, +}; diff --git a/src/overlays/actors/ovl_Boss_07/z_boss_07_dmgtbl.c b/src/overlays/actors/ovl_Boss_07/z_boss_07_dmgtbl.c new file mode 100644 index 000000000..99df08a94 --- /dev/null +++ b/src/overlays/actors/ovl_Boss_07/z_boss_07_dmgtbl.c @@ -0,0 +1,176 @@ +#include "global.h" + +static DamageTable sMaskDmgTable = { + /* Deku Nut */ DMG_ENTRY(0, 0x0), + /* Deku Stick */ DMG_ENTRY(1, 0xF), + /* Horse trample */ DMG_ENTRY(0, 0x0), + /* Explosives */ DMG_ENTRY(2, 0xF), + /* Zora boomerang */ DMG_ENTRY(1, 0xF), + /* Normal arrow */ DMG_ENTRY(1, 0xF), + /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Goron punch */ DMG_ENTRY(1, 0xF), + /* Sword */ DMG_ENTRY(1, 0xF), + /* Goron pound */ DMG_ENTRY(1, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0x2), + /* Ice arrow */ DMG_ENTRY(2, 0x3), + /* Light arrow */ DMG_ENTRY(2, 0x4), + /* Goron spikes */ DMG_ENTRY(1, 0xF), + /* Deku spin */ DMG_ENTRY(1, 0xF), + /* Deku bubble */ DMG_ENTRY(1, 0xF), + /* Deku launch */ DMG_ENTRY(1, 0xF), + /* 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(1, 0xF), + /* Zora punch */ DMG_ENTRY(1, 0xF), + /* Spin attack */ DMG_ENTRY(2, 0xF), + /* Sword beam */ DMG_ENTRY(2, 0x9), + /* 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(2, 0xF), +}; + +static DamageTable sIncarnationDmgTable = { + /* Deku Nut */ DMG_ENTRY(0, 0x0), + /* Deku Stick */ DMG_ENTRY(1, 0xF), + /* Horse trample */ DMG_ENTRY(0, 0x0), + /* Explosives */ DMG_ENTRY(1, 0xC), + /* Zora boomerang */ DMG_ENTRY(1, 0xF), + /* Normal arrow */ DMG_ENTRY(1, 0xF), + /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Goron punch */ DMG_ENTRY(1, 0xE), + /* Sword */ DMG_ENTRY(1, 0xE), + /* Goron pound */ DMG_ENTRY(1, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0x2), + /* Ice arrow */ DMG_ENTRY(2, 0x3), + /* Light arrow */ DMG_ENTRY(2, 0x4), + /* Goron spikes */ DMG_ENTRY(1, 0xF), + /* Deku spin */ DMG_ENTRY(1, 0xF), + /* Deku bubble */ DMG_ENTRY(1, 0xF), + /* Deku launch */ DMG_ENTRY(1, 0xF), + /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0), + /* Zora barrier */ DMG_ENTRY(0, 0xA), + /* Normal shield */ DMG_ENTRY(0, 0x0), + /* Light ray */ DMG_ENTRY(0, 0x0), + /* Thrown object */ DMG_ENTRY(1, 0xF), + /* Zora punch */ DMG_ENTRY(1, 0xF), + /* Spin attack */ DMG_ENTRY(1, 0xD), + /* Sword beam */ DMG_ENTRY(2, 0x9), + /* 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(4, 0xC), +}; + +static DamageTable sWrathDmgTable = { + /* Deku Nut */ DMG_ENTRY(0, 0x0), + /* Deku Stick */ DMG_ENTRY(1, 0xE), + /* Horse trample */ DMG_ENTRY(0, 0x0), + /* Explosives */ DMG_ENTRY(1, 0xC), + /* Zora boomerang */ DMG_ENTRY(1, 0xF), + /* Normal arrow */ DMG_ENTRY(1, 0xF), + /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Goron punch */ DMG_ENTRY(1, 0xE), + /* Sword */ DMG_ENTRY(1, 0xE), + /* Goron pound */ DMG_ENTRY(1, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0x2), + /* Ice arrow */ DMG_ENTRY(2, 0x3), + /* Light arrow */ DMG_ENTRY(2, 0x4), + /* Goron spikes */ DMG_ENTRY(1, 0xE), + /* Deku spin */ DMG_ENTRY(1, 0xE), + /* Deku bubble */ DMG_ENTRY(1, 0xF), + /* Deku launch */ DMG_ENTRY(1, 0xE), + /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0), + /* Zora barrier */ DMG_ENTRY(0, 0xA), + /* Normal shield */ DMG_ENTRY(0, 0x0), + /* Light ray */ DMG_ENTRY(0, 0x0), + /* Thrown object */ DMG_ENTRY(1, 0xF), + /* Zora punch */ DMG_ENTRY(1, 0xE), + /* Spin attack */ DMG_ENTRY(1, 0xD), + /* Sword beam */ DMG_ENTRY(2, 0x9), + /* 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(2, 0xC), +}; + +static DamageTable sRemainsDmgTable = { + /* Deku Nut */ DMG_ENTRY(0, 0x0), + /* Deku Stick */ DMG_ENTRY(1, 0xF), + /* Horse trample */ DMG_ENTRY(0, 0x0), + /* Explosives */ DMG_ENTRY(2, 0xE), + /* Zora boomerang */ DMG_ENTRY(1, 0xF), + /* Normal arrow */ DMG_ENTRY(1, 0xF), + /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Goron punch */ DMG_ENTRY(1, 0xE), + /* Sword */ DMG_ENTRY(1, 0xE), + /* Goron pound */ DMG_ENTRY(1, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0x2), + /* Ice arrow */ DMG_ENTRY(2, 0x3), + /* Light arrow */ DMG_ENTRY(2, 0x4), + /* Goron spikes */ DMG_ENTRY(1, 0xF), + /* Deku spin */ DMG_ENTRY(1, 0xF), + /* Deku bubble */ DMG_ENTRY(1, 0xF), + /* Deku launch */ DMG_ENTRY(1, 0xF), + /* 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(1, 0xF), + /* Zora punch */ DMG_ENTRY(1, 0xF), + /* Spin attack */ DMG_ENTRY(1, 0xD), + /* Sword beam */ DMG_ENTRY(2, 0x9), + /* 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(2, 0xE), +}; + +static DamageTable sTopDmgTable = { + /* Deku Nut */ DMG_ENTRY(0, 0x0), + /* Deku Stick */ DMG_ENTRY(1, 0xD), + /* Horse trample */ DMG_ENTRY(1, 0xE), + /* Explosives */ DMG_ENTRY(1, 0xB), + /* Zora boomerang */ DMG_ENTRY(1, 0xF), + /* Normal arrow */ DMG_ENTRY(1, 0xF), + /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(1, 0xE), + /* Goron punch */ DMG_ENTRY(1, 0xE), + /* Sword */ DMG_ENTRY(1, 0xD), + /* Goron pound */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(1, 0xE), + /* Ice arrow */ DMG_ENTRY(1, 0xE), + /* Light arrow */ DMG_ENTRY(1, 0xE), + /* Goron spikes */ DMG_ENTRY(1, 0xC), + /* Deku spin */ DMG_ENTRY(1, 0xF), + /* Deku bubble */ DMG_ENTRY(1, 0xF), + /* Deku launch */ DMG_ENTRY(1, 0xF), + /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0), + /* Zora barrier */ DMG_ENTRY(0, 0x0), + /* Normal shield */ DMG_ENTRY(1, 0xD), + /* Light ray */ DMG_ENTRY(1, 0xD), + /* Thrown object */ DMG_ENTRY(1, 0xE), + /* Zora punch */ DMG_ENTRY(1, 0xE), + /* Spin attack */ DMG_ENTRY(1, 0xA), + /* Sword beam */ DMG_ENTRY(1, 0xA), + /* 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(2, 0xB), +}; diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 43190862e..6189a2309 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -9502,9 +9502,9 @@ 0x809FC8B0:("func_809FC8B0",), 0x809FC960:("func_809FC960",), 0x809FCBC8:("func_809FCBC8",), - 0x809FCC70:("func_809FCC70",), - 0x809FCCCC:("func_809FCCCC",), - 0x809FD5F8:("func_809FD5F8",), + 0x809FCC70:("Boss07_Incarnation_SetupIntro",), + 0x809FCCCC:("Boss07_Incarnation_Intro",), + 0x809FD5F8:("Boss07_Incarnation_SetupTaunt",), 0x809FD710:("func_809FD710",), 0x809FD818:("func_809FD818",), 0x809FD89C:("func_809FD89C",), @@ -9530,7 +9530,7 @@ 0x809FF6B0:("func_809FF6B0",), 0x809FF810:("func_809FF810",), 0x809FF900:("Boss07_Incarnation_Draw",), - 0x809FFA04:("Boss07_SetupIdle",), + 0x809FFA04:("Boss07_Mask_SetupIdle",), 0x809FFA80:("func_809FFA80",), 0x809FFE64:("func_809FFE64",), 0x809FFEAC:("func_809FFEAC",), @@ -9555,15 +9555,15 @@ 0x80A0434C:("Boss07_Projectile_Update",), 0x80A045A8:("Boss07_Projectile_Draw",), 0x80A04768:("func_80A04768",), - 0x80A04878:("func_80A04878",), + 0x80A04878:("Boss07_Remains_SetupIntro",), 0x80A04890:("func_80A04890",), - 0x80A04DE0:("func_80A04DE0",), + 0x80A04DE0:("Boss07_Remains_SetupFly",), 0x80A04E5C:("func_80A04E5C",), 0x80A055E0:("func_80A055E0",), 0x80A05608:("func_80A05608",), 0x80A05694:("Boss07_Remains_Update",), 0x80A057A0:("Boss07_Remains_Draw",), - 0x80A05AF8:("func_80A05AF8",), + 0x80A05AF8:("Boss07_Top_SetupThrown",), 0x80A05B50:("func_80A05B50",), 0x80A05C88:("func_80A05C88",), 0x80A05DDC:("func_80A05DDC",),